( network: string, safe: string, faceValues: number[], tokenAddress: string, customizationDID: string | undefined, mnemonic?: string )
| 26 | } |
| 27 | |
| 28 | export async function create( |
| 29 | network: string, |
| 30 | safe: string, |
| 31 | faceValues: number[], |
| 32 | tokenAddress: string, |
| 33 | customizationDID: string | undefined, |
| 34 | mnemonic?: string |
| 35 | ): Promise<void> { |
| 36 | let web3 = await getWeb3(network, mnemonic); |
| 37 | |
| 38 | let prepaidCard = await getSDK('PrepaidCard', web3); |
| 39 | let blockExplorer = await getConstant('blockExplorer', web3); |
| 40 | let assets = await getSDK('Assets', web3); |
| 41 | let { symbol } = await assets.getTokenInfo(tokenAddress); |
| 42 | |
| 43 | console.log( |
| 44 | `Creating prepaid card(s) with face value(s) §${faceValues.join( |
| 45 | ' SPEND, §' |
| 46 | )} SPEND and issuing token ${symbol} from depot ${safe}...` |
| 47 | ); |
| 48 | let result = await prepaidCard.create(safe, tokenAddress, faceValues, customizationDID, (prepaidCardAddresses) => |
| 49 | console.log(`Created new prepaid card(s): ${prepaidCardAddresses.join(', ')}`) |
| 50 | ); |
| 51 | console.log(`Transaction hash: ${blockExplorer}/tx/${result.gnosisTxn.ethereumTx.txHash}/token-transfers`); |
| 52 | } |
| 53 | |
| 54 | export async function split( |
| 55 | network: string, |
no test coverage detected