-
Notifications
You must be signed in to change notification settings - Fork 302
Expand file tree
/
Copy pathtip20Abi.ts
More file actions
60 lines (58 loc) · 1.43 KB
/
tip20Abi.ts
File metadata and controls
60 lines (58 loc) · 1.43 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* TIP-20 Token Standard ABI
*
* TIP-20 is Tempo's token standard, similar to ERC-20 but with:
* - 6 decimal places (instead of 18)
* - transferWithMemo function for attaching metadata
*/
/**
* TIP-20 transferWithMemo ABI
* Standard function for TIP-20 token transfers with memo field
*/
export const TIP20_TRANSFER_WITH_MEMO_ABI = [
{
type: 'function',
name: 'transferWithMemo',
inputs: [
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint256' },
{ name: 'memo', type: 'bytes32' },
],
outputs: [{ name: '', type: 'bool' }],
stateMutability: 'nonpayable',
},
] as const;
/**
* Standard TIP-20 token ABI (similar to ERC-20)
*/
export const TIP20_ABI = [
{
type: 'function',
name: 'balanceOf',
inputs: [{ name: 'account', type: 'address' }],
outputs: [{ name: '', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
name: 'transfer',
inputs: [
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint256' },
],
outputs: [{ name: '', type: 'bool' }],
stateMutability: 'nonpayable',
},
{
type: 'function',
name: 'transferFrom',
inputs: [
{ name: 'from', type: 'address' },
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint256' },
],
outputs: [{ name: '', type: 'bool' }],
stateMutability: 'nonpayable',
},
...TIP20_TRANSFER_WITH_MEMO_ABI,
] as const;