@tomo-inc/transaction-builder-sdk 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +162 -0
- package/__tests__/business.test.ts +316 -0
- package/package.json +35 -0
- package/src/api/index.ts +115 -0
- package/src/api/types.ts +196 -0
- package/src/chains/const.ts +776 -0
- package/src/chains/getBridgeSupportChains.ts +5 -0
- package/src/chains/getChains.ts +6 -0
- package/src/chains/getSwapSupportChains.ts +5 -0
- package/src/constant/abi.ts +191 -0
- package/src/constant/abis/permit2.json +901 -0
- package/src/constant/address.ts +3 -0
- package/src/constant/index.ts +3 -0
- package/src/constant/stage.json +10 -0
- package/src/index.ts +368 -0
- package/src/swap/bridgeBuilder.ts +46 -0
- package/src/swap/getApproveBuilder.ts +25 -0
- package/src/swap/getBridgeQuotes.ts +12 -0
- package/src/swap/getSwapQuotes.ts +11 -0
- package/src/swap/methods/builder.ts +19 -0
- package/src/swap/methods/chains/const.ts +13 -0
- package/src/swap/methods/chains/evm.ts +124 -0
- package/src/swap/methods/chains/sol.ts +19 -0
- package/src/swap/methods/chains/tron.ts +123 -0
- package/src/swap/methods/permit.ts +1 -0
- package/src/swap/methods/quote.ts +60 -0
- package/src/swap/methods/unsign.ts +26 -0
- package/src/swap/methods/utils.ts +70 -0
- package/src/swap/permitSign.ts +0 -0
- package/src/swap/swapBuilder.ts +46 -0
- package/src/types/chain.ts +86 -0
- package/src/types/index.ts +15 -0
- package/src/types/swap.ts +140 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import Permit2 from "./abis/permit2.json" assert { type: "json" };
|
|
2
|
+
export const abi = [
|
|
3
|
+
{
|
|
4
|
+
type: "event",
|
|
5
|
+
name: "Approval",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
indexed: true,
|
|
9
|
+
name: "owner",
|
|
10
|
+
type: "address",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
indexed: true,
|
|
14
|
+
name: "spender",
|
|
15
|
+
type: "address",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
indexed: false,
|
|
19
|
+
name: "value",
|
|
20
|
+
type: "uint256",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "event",
|
|
26
|
+
name: "Transfer",
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
indexed: true,
|
|
30
|
+
name: "from",
|
|
31
|
+
type: "address",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
indexed: true,
|
|
35
|
+
name: "to",
|
|
36
|
+
type: "address",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
indexed: false,
|
|
40
|
+
name: "value",
|
|
41
|
+
type: "uint256",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "function",
|
|
47
|
+
name: "allowance",
|
|
48
|
+
stateMutability: "view",
|
|
49
|
+
inputs: [
|
|
50
|
+
{
|
|
51
|
+
name: "owner",
|
|
52
|
+
type: "address",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "spender",
|
|
56
|
+
type: "address",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
outputs: [
|
|
60
|
+
{
|
|
61
|
+
type: "uint256",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "function",
|
|
67
|
+
name: "approve",
|
|
68
|
+
stateMutability: "nonpayable",
|
|
69
|
+
inputs: [
|
|
70
|
+
{
|
|
71
|
+
name: "spender",
|
|
72
|
+
type: "address",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "amount",
|
|
76
|
+
type: "uint256",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
outputs: [
|
|
80
|
+
{
|
|
81
|
+
type: "bool",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: "function",
|
|
87
|
+
name: "balanceOf",
|
|
88
|
+
stateMutability: "view",
|
|
89
|
+
inputs: [
|
|
90
|
+
{
|
|
91
|
+
name: "account",
|
|
92
|
+
type: "address",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
outputs: [
|
|
96
|
+
{
|
|
97
|
+
type: "uint256",
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "function",
|
|
103
|
+
name: "decimals",
|
|
104
|
+
stateMutability: "view",
|
|
105
|
+
inputs: [],
|
|
106
|
+
outputs: [
|
|
107
|
+
{
|
|
108
|
+
type: "uint8",
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "function",
|
|
114
|
+
name: "name",
|
|
115
|
+
stateMutability: "view",
|
|
116
|
+
inputs: [],
|
|
117
|
+
outputs: [
|
|
118
|
+
{
|
|
119
|
+
type: "string",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: "function",
|
|
125
|
+
name: "symbol",
|
|
126
|
+
stateMutability: "view",
|
|
127
|
+
inputs: [],
|
|
128
|
+
outputs: [
|
|
129
|
+
{
|
|
130
|
+
type: "string",
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "function",
|
|
136
|
+
name: "totalSupply",
|
|
137
|
+
stateMutability: "view",
|
|
138
|
+
inputs: [],
|
|
139
|
+
outputs: [
|
|
140
|
+
{
|
|
141
|
+
type: "uint256",
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: "function",
|
|
147
|
+
name: "transfer",
|
|
148
|
+
stateMutability: "nonpayable",
|
|
149
|
+
inputs: [
|
|
150
|
+
{
|
|
151
|
+
name: "recipient",
|
|
152
|
+
type: "address",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "amount",
|
|
156
|
+
type: "uint256",
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
outputs: [
|
|
160
|
+
{
|
|
161
|
+
type: "bool",
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "function",
|
|
167
|
+
name: "transferFrom",
|
|
168
|
+
stateMutability: "nonpayable",
|
|
169
|
+
inputs: [
|
|
170
|
+
{
|
|
171
|
+
name: "sender",
|
|
172
|
+
type: "address",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "recipient",
|
|
176
|
+
type: "address",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "amount",
|
|
180
|
+
type: "uint256",
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
outputs: [
|
|
184
|
+
{
|
|
185
|
+
type: "bool",
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
export const Permit2Abi = Permit2;
|