( network: string, prepaidCardAddress: string, infoDID: string | undefined, mnemonic?: string )
| 3 | import { getWeb3 } from './utils'; |
| 4 | |
| 5 | export async function registerMerchant( |
| 6 | network: string, |
| 7 | prepaidCardAddress: string, |
| 8 | infoDID: string | undefined, |
| 9 | mnemonic?: string |
| 10 | ): Promise<void> { |
| 11 | let web3 = await getWeb3(network, mnemonic); |
| 12 | let revenuePool = await getSDK('RevenuePool', web3); |
| 13 | let blockExplorer = await getConstant('blockExplorer', web3); |
| 14 | |
| 15 | console.log( |
| 16 | `Paying merchant registration fee in the amount of §${await revenuePool.merchantRegistrationFee()} SPEND from prepaid card address ${prepaidCardAddress}...` |
| 17 | ); |
| 18 | let { merchantSafe, gnosisTxn } = (await revenuePool.registerMerchant(prepaidCardAddress, infoDID)) ?? {}; |
| 19 | console.log(`Created merchant safe: ${merchantSafe}`); |
| 20 | console.log(`Transaction hash: ${blockExplorer}/tx/${gnosisTxn?.ethereumTx.txHash}/token-transfers`); |
| 21 | } |
| 22 | |
| 23 | export async function revenueBalances(network: string, merchantSafeAddress: string, mnemonic?: string): Promise<void> { |
| 24 | let web3 = await getWeb3(network, mnemonic); |
no test coverage detected