All files / evm-wallet-experiment/src/lib method-catalog.ts

66.66% Statements 2/3
50% Branches 1/2
0% Functions 0/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 303x   3x                                                      
const harden = globalThis.harden ?? (<T>(value: T): T => value);
 
export const METHOD_CATALOG = harden({
  transferNative: {
    description: 'Transfer native ETH to a recipient.',
    args: {
      to: { type: 'string', description: 'Recipient address.' },
      amount: {
        type: 'string',
        description: 'Amount in wei (bigint as string).',
      },
    },
    returns: { type: 'string', description: 'Transaction hash.' },
  },
  transferFungible: {
    description: 'Transfer ERC-20 tokens to a recipient.',
    args: {
      token: { type: 'string', description: 'Token contract address.' },
      to: { type: 'string', description: 'Recipient address.' },
      amount: {
        type: 'string',
        description: 'Amount in token units (bigint as string).',
      },
    },
    returns: { type: 'string', description: 'Transaction hash.' },
  },
});
 
export type CatalogMethodName = keyof typeof METHOD_CATALOG;