package Ġcom . template . flows čĊč Ċ import Ġco . parallel universe . fib ers . Suspend able č Ċ import Ġcom . r 3 . cord a . lib . accounts . workflows . account Service č Ċ import Ġcom . r 3 . cord a . lib . accounts . workflows . flows . Request Key For Account č Ċ import Ġcom . r 3 . cord a . lib . tokens . contracts . states . F ung ible Token č Ċ import Ġcom . r 3 . cord a . lib . tokens . contracts . utilities . iss ued By č Ċ import Ġcom . r 3 . cord a . lib . tokens . contracts . utilities . with Not ary č Ċ import Ġcom . r 3 . cord a . lib . tokens . workflows . flows . issue . add Issue Tokens č Ċ import Ġcom . r 3 . cord a . lib . tokens . workflows . flows . rpc . Create E vol vable Tokens č Ċ import Ġcom . r 3 . cord a . lib . tokens . workflows . flows . rpc . Issue Tokens č Ċ import Ġcom . r 3 . cord a . lib . tokens . workflows . utilities . get Preferred Not ary č Ċ import Ġcom . template . contracts . Iss u ance Record Contract č Ċ import Ġcom . template . states . Coin State č Ċ import Ġcom . template . states . Iss u ance Record č Ċ import Ġnet . cord a . core . contracts . Amount č Ċ import Ġnet . cord a . core . contracts . Command č Ċ import Ġnet . cord a . core . contracts . Unique Identifier č Ċ import Ġnet . cord a . core . flows . Final ity Flow č Ċ import Ġnet . cord a . core . flows . Flow Logic č Ċ import Ġnet . cord a . core . flows . Start able By RPC č Ċ import Ġnet . cord a . core . transactions . Transaction Builder č Ċ import Ġnet . cord a . core . utilities . Progress Tracker č Ċ import Ġjava . util .* čĊčĊč Ċ @ Start able By RPC č Ċ class ĠCreate And Issue Local Coin Flow ( val Ġtoken Name : ĠString , čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġvolume : ĠInt , čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġholder _ account : ĠString , čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġval uation : ĠAmount < Currency >) Ġ: ĠFlow Logic < String >() Ġ{ čĊĠĠĠ Ġoverride Ġval Ġprogress Tracker Ġ= ĠProgress Tracker () čĊčĊĠĠĠ Ġ@ Suspend able čĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠString Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġholder Account Info Ġ= Ġaccount Service . account Info ( holder _ account )[ 0 ]. state . data čĊĠĠĠĠĠĠĠ Ġval Ġholder Anonymous Party Ġ= Ġsub Flow ( Request Key For Account ( holder Account Info )) čĊĠĠĠĠĠĠĠ Ġ// Ġ 1 . Ġget Ġthe Ġnot ary čĊĠĠĠĠĠĠĠ Ġval Ġnot ary Ġ= Ġget Preferred Not ary ( service Hub ) čĊčĊĠĠĠĠĠĠĠ Ġ// Ġ 2 . Ġcreate Ġthe Ġtransaction Ġcomponents čĊĠĠĠĠĠĠĠ Ġval Ġcoin State Ġ= ĠCoin State ( our Identity , Ġtoken Name , Ġval uation , Ġ 0 , ĠUnique Identifier (), ĠlistOf ( our Identity ), ĠlistOf ( our Identity )) čĊčĊĠĠĠĠĠĠĠ Ġ/* Ġ 3 . ĠThe Ġsub Flow Ġprovides Ġthe ĠTransaction Builder Ġwith Ġthe Ġrelative ĠCommands Ġand ĠSignature s Ġ*/ čĊĠĠĠĠĠĠĠ Ġsub Flow ( Create E vol vable Tokens ( coin State Ġwith Not ary Ġnot ary )) čĊčĊĠĠĠĠĠĠĠ Ġ// Ġ 4 . ĠCreate Ġthe ĠTokenType Ġfrom Ġthe ĠE vol vable TokenType Ġusing Ġthe ĠToken Pointer . čĊĠĠĠĠĠĠĠ Ġ// ĠSee Ġthe ĠToken Ġtypes Ġschema Ġon Ġgithub : Ġshort url . at / FO WY 5 čĊĠĠĠĠĠĠĠ Ġval Ġissued Token Ġ= Ġcoin State . to Pointer ( coin State . java Class ) Ġissued By Ġour Identity čĊčĊĠĠĠĠĠĠĠ Ġ// Ġ 5 . ĠCreate Ġthe ĠF ung ible Token Ġand Ġissue Ġto Ġthe Ġholder čĊĠĠĠĠĠĠĠ Ġval Ġtoken Coin Ġ= ĠF ung ible Token ( Amount ( volume . to Long (), Ġissued Token ), Ġholder Anonymous Party ) čĊčĊĠĠĠĠĠĠĠ Ġval Ġiss u ance Record Ġ= ĠIss u ance Record ( holder Anonymous Party , Ġtoken Coin . amount ) čĊčĊĠĠĠĠĠĠĠ Ġval Ġtransaction Builder Ġ= ĠTransaction Builder ( not ary ). apply Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Output State ( iss u ance Record , ĠIss u ance Record Contract . ID ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Command ( Command ( Iss u ance Record Contract . Commands . Issue (), Ġour Identity . own ing Key )) čĊĠĠĠĠĠĠĠ Ġ} čĊčĊĠĠĠĠĠĠĠ Ġ// Ġ 6 . ĠIssue Ġthe Ġtoken Ġcreated čĊĠĠĠĠĠĠĠ Ġ// val Ġst x Ġ= Ġsub Flow ( Issue Tokens ( listOf ( token Coin ))) čĊĠĠĠĠĠĠĠ Ġadd Issue Tokens ( transaction Builder , Ġtoken Coin ) čĊčĊĠĠĠĠĠĠĠ Ġval Ġsigning Keys Ġ= ĠlistOf ( our Identity . own ing Key , Ġtoken Coin . holder . own ing Key ) čĊčĊĠĠĠĠĠĠĠ Ġtransaction Builder . verify ( service Hub ) čĊĠĠĠĠĠĠĠ Ġval Ġst x Ġ= Ġservice Hub . sign Initial Transaction ( transaction Builder , Ġsigning Pub Keys Ġ= Ġsigning Keys ) čĊčĊĠĠĠĠĠĠĠ Ġsub Flow ( Final ity Flow ( st x , Ġempty List ())) čĊčĊĠĠĠĠĠĠĠ Ġ// return Ġ(" Created Ġ" Ġ+ Ġvolume Ġ+ Ġ" Ġ" Ġ+ Ġtoken Name Ġ+ Ġ" Ġtokens Ġfor Ġ" Ġ+ Ġval uation . quantity Ġ+ Ġ" Ġ" Ġ+ Ġval uation . token . currency Code Ġ+ čĊĠĠĠĠĠĠĠĠĠ Ġ// ĠĠĠĠĠ Ġ" Ġto Ġ" Ġ+ Ġholder _ account Ġ+ Ġ"\ n Transaction ĠID : Ġ" Ġ+ Ġst x . id ) čĊĠĠĠĠĠĠĠ Ġreturn Ġ"" čĊĠĠĠ Ġ} č Ċ }