@swapkit/helpers 1.0.0-rc.11 → 1.0.0-rc.111
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/dist/index.js +2900 -0
- package/dist/index.js.map +31 -0
- package/package.json +26 -37
- package/src/helpers/__tests__/asset.test.ts +186 -103
- package/src/helpers/__tests__/memo.test.ts +53 -41
- package/src/helpers/__tests__/others.test.ts +44 -37
- package/src/helpers/__tests__/validators.test.ts +24 -0
- package/src/helpers/asset.ts +184 -95
- package/src/helpers/derivationPath.ts +53 -0
- package/src/helpers/liquidity.ts +50 -43
- package/src/helpers/memo.ts +34 -31
- package/src/helpers/others.ts +46 -12
- package/src/helpers/validators.ts +15 -6
- package/src/helpers/web3wallets.ts +200 -0
- package/src/index.ts +14 -9
- package/src/modules/__tests__/assetValue.test.ts +486 -129
- package/src/modules/__tests__/bigIntArithmetics.test.ts +30 -0
- package/src/modules/__tests__/swapKitNumber.test.ts +306 -183
- package/src/modules/assetValue.ts +220 -162
- package/src/modules/bigIntArithmetics.ts +214 -165
- package/src/modules/requestClient.ts +38 -0
- package/src/modules/swapKitError.ts +41 -5
- package/src/modules/swapKitNumber.ts +1 -1
- package/src/types/abis/erc20.ts +99 -0
- package/src/types/abis/mayaEvmVaults.ts +331 -0
- package/src/types/abis/tcEthVault.ts +496 -0
- package/src/types/chains.ts +226 -0
- package/src/types/commonTypes.ts +123 -0
- package/src/types/derivationPath.ts +58 -0
- package/src/types/errors/apiV1.ts +0 -0
- package/src/types/index.ts +12 -0
- package/src/types/network.ts +45 -0
- package/src/types/quotes.ts +391 -0
- package/src/types/radix.ts +14 -0
- package/src/types/sdk.ts +126 -0
- package/src/types/tokens.ts +30 -0
- package/src/types/wallet.ts +72 -0
- package/LICENSE +0 -201
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -356
- package/dist/index.es.js +0 -1071
- package/src/helpers/request.ts +0 -16
|
@@ -7,7 +7,11 @@ const errorMessages = {
|
|
|
7
7
|
core_extend_error: 10003,
|
|
8
8
|
core_inbound_data_not_found: 10004,
|
|
9
9
|
core_approve_asset_address_or_from_not_found: 10005,
|
|
10
|
+
core_plugin_not_found: 10006,
|
|
11
|
+
core_plugin_swap_not_found: 10007,
|
|
12
|
+
core_approve_asset_target_invalid: 10008,
|
|
10
13
|
core_chain_halted: 10099,
|
|
14
|
+
|
|
11
15
|
/**
|
|
12
16
|
* Core - Wallet Connection
|
|
13
17
|
*/
|
|
@@ -19,6 +23,7 @@ const errorMessages = {
|
|
|
19
23
|
core_wallet_trezor_not_installed: 10106,
|
|
20
24
|
core_wallet_keplr_not_installed: 10107,
|
|
21
25
|
core_wallet_okx_not_installed: 10108,
|
|
26
|
+
core_wallet_keepkey_not_installed: 10109,
|
|
22
27
|
/**
|
|
23
28
|
* Core - Swap
|
|
24
29
|
*/
|
|
@@ -45,12 +50,36 @@ const errorMessages = {
|
|
|
45
50
|
core_transaction_deposit_to_pool_error: 10310,
|
|
46
51
|
core_transaction_deposit_insufficient_funds_error: 10311,
|
|
47
52
|
core_transaction_deposit_gas_error: 10312,
|
|
48
|
-
|
|
53
|
+
core_transaction_invalid_sender_address: 10313,
|
|
54
|
+
core_transaction_deposit_server_error: 10314,
|
|
55
|
+
core_transaction_user_rejected: 10315,
|
|
56
|
+
core_transaction_create_liquidity_cacao_error: 10316,
|
|
57
|
+
core_transaction_add_liquidity_no_cacao_address: 10306,
|
|
58
|
+
core_transaction_add_liquidity_cacao_error: 10307,
|
|
49
59
|
|
|
50
60
|
/**
|
|
51
61
|
* Wallets
|
|
52
62
|
*/
|
|
53
63
|
wallet_ledger_connection_error: 20001,
|
|
64
|
+
wallet_ledger_connection_claimed: 20002,
|
|
65
|
+
wallet_ledger_get_address_error: 20003,
|
|
66
|
+
wallet_ledger_device_not_found: 20004,
|
|
67
|
+
wallet_ledger_device_locked: 20005,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Chainflip
|
|
71
|
+
*/
|
|
72
|
+
chainflip_channel_error: 30001,
|
|
73
|
+
chainflip_broker_recipient_error: 30002,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* THORChain
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* SwapKit API
|
|
81
|
+
*/
|
|
82
|
+
api_v2_invalid_response: 40001,
|
|
54
83
|
|
|
55
84
|
/**
|
|
56
85
|
* Helpers
|
|
@@ -58,13 +87,20 @@ const errorMessages = {
|
|
|
58
87
|
helpers_number_different_decimals: 99101,
|
|
59
88
|
} as const;
|
|
60
89
|
|
|
61
|
-
export type
|
|
90
|
+
export type ErrorKeys = keyof typeof errorMessages;
|
|
62
91
|
|
|
63
92
|
export class SwapKitError extends Error {
|
|
64
|
-
constructor(errorKey:
|
|
65
|
-
|
|
93
|
+
constructor(errorKey: ErrorKeys, sourceError?: NotWorth) {
|
|
94
|
+
if (sourceError) {
|
|
95
|
+
console.error(sourceError, {
|
|
96
|
+
stack: sourceError?.stack,
|
|
97
|
+
message: sourceError?.message,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
66
100
|
|
|
67
|
-
super(errorKey, {
|
|
101
|
+
super(errorKey, {
|
|
102
|
+
cause: { code: errorMessages[errorKey], message: errorKey },
|
|
103
|
+
});
|
|
68
104
|
Object.setPrototypeOf(this, SwapKitError.prototype);
|
|
69
105
|
}
|
|
70
106
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export const erc20ABI = [
|
|
2
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
3
|
+
{
|
|
4
|
+
anonymous: false,
|
|
5
|
+
inputs: [
|
|
6
|
+
{ indexed: true, internalType: "address", name: "owner", type: "address" },
|
|
7
|
+
{ indexed: true, internalType: "address", name: "spender", type: "address" },
|
|
8
|
+
{ indexed: false, internalType: "uint256", name: "value", type: "uint256" },
|
|
9
|
+
],
|
|
10
|
+
name: "Approval",
|
|
11
|
+
type: "event",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
anonymous: false,
|
|
15
|
+
inputs: [
|
|
16
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
17
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
18
|
+
{ indexed: false, internalType: "uint256", name: "value", type: "uint256" },
|
|
19
|
+
],
|
|
20
|
+
name: "Transfer",
|
|
21
|
+
type: "event",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
inputs: [
|
|
25
|
+
{ internalType: "address", name: "", type: "address" },
|
|
26
|
+
{ internalType: "address", name: "", type: "address" },
|
|
27
|
+
],
|
|
28
|
+
name: "allowance",
|
|
29
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
30
|
+
stateMutability: "view",
|
|
31
|
+
type: "function",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
36
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
37
|
+
],
|
|
38
|
+
name: "approve",
|
|
39
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
|
40
|
+
stateMutability: "nonpayable",
|
|
41
|
+
type: "function",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
45
|
+
name: "balanceOf",
|
|
46
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
47
|
+
stateMutability: "view",
|
|
48
|
+
type: "function",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
inputs: [],
|
|
52
|
+
name: "decimals",
|
|
53
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
54
|
+
stateMutability: "view",
|
|
55
|
+
type: "function",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
inputs: [],
|
|
59
|
+
name: "name",
|
|
60
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
61
|
+
stateMutability: "view",
|
|
62
|
+
type: "function",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
inputs: [],
|
|
66
|
+
name: "symbol",
|
|
67
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
68
|
+
stateMutability: "view",
|
|
69
|
+
type: "function",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
inputs: [],
|
|
73
|
+
name: "totalSupply",
|
|
74
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
75
|
+
stateMutability: "view",
|
|
76
|
+
type: "function",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
inputs: [
|
|
80
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
81
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
82
|
+
],
|
|
83
|
+
name: "transfer",
|
|
84
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
|
85
|
+
stateMutability: "nonpayable",
|
|
86
|
+
type: "function",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
inputs: [
|
|
90
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
91
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
92
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
93
|
+
],
|
|
94
|
+
name: "transferFrom",
|
|
95
|
+
outputs: [{ internalType: "bool", name: "success", type: "bool" }],
|
|
96
|
+
stateMutability: "nonpayable",
|
|
97
|
+
type: "function",
|
|
98
|
+
},
|
|
99
|
+
];
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
export const MayaEthereumVaultAbi = [
|
|
2
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
3
|
+
{
|
|
4
|
+
anonymous: false,
|
|
5
|
+
inputs: [
|
|
6
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
7
|
+
{ indexed: true, internalType: "address", name: "asset", type: "address" },
|
|
8
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
9
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
10
|
+
],
|
|
11
|
+
name: "Deposit",
|
|
12
|
+
type: "event",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
anonymous: false,
|
|
16
|
+
inputs: [
|
|
17
|
+
{ indexed: true, internalType: "address", name: "oldVault", type: "address" },
|
|
18
|
+
{ indexed: true, internalType: "address", name: "newVault", type: "address" },
|
|
19
|
+
{ indexed: false, internalType: "address", name: "asset", type: "address" },
|
|
20
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
21
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
22
|
+
],
|
|
23
|
+
name: "TransferAllowance",
|
|
24
|
+
type: "event",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
anonymous: false,
|
|
28
|
+
inputs: [
|
|
29
|
+
{ indexed: true, internalType: "address", name: "vault", type: "address" },
|
|
30
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
31
|
+
{ indexed: false, internalType: "address", name: "asset", type: "address" },
|
|
32
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
33
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
34
|
+
],
|
|
35
|
+
name: "TransferOut",
|
|
36
|
+
type: "event",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
anonymous: false,
|
|
40
|
+
inputs: [
|
|
41
|
+
{ indexed: true, internalType: "address", name: "vault", type: "address" },
|
|
42
|
+
{ indexed: false, internalType: "address", name: "target", type: "address" },
|
|
43
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
44
|
+
{ indexed: false, internalType: "address", name: "finalAsset", type: "address" },
|
|
45
|
+
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
46
|
+
{ indexed: false, internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
47
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
48
|
+
],
|
|
49
|
+
name: "TransferOutAndCall",
|
|
50
|
+
type: "event",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
anonymous: false,
|
|
54
|
+
inputs: [
|
|
55
|
+
{ indexed: true, internalType: "address", name: "oldVault", type: "address" },
|
|
56
|
+
{ indexed: true, internalType: "address", name: "newVault", type: "address" },
|
|
57
|
+
{
|
|
58
|
+
components: [
|
|
59
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
60
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
61
|
+
],
|
|
62
|
+
indexed: false,
|
|
63
|
+
internalType: "struct MAYAChain_Router.Coin[]",
|
|
64
|
+
name: "coins",
|
|
65
|
+
type: "tuple[]",
|
|
66
|
+
},
|
|
67
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
68
|
+
],
|
|
69
|
+
name: "VaultTransfer",
|
|
70
|
+
type: "event",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
inputs: [
|
|
74
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
|
75
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
76
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
77
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
78
|
+
],
|
|
79
|
+
name: "deposit",
|
|
80
|
+
outputs: [],
|
|
81
|
+
stateMutability: "payable",
|
|
82
|
+
type: "function",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
inputs: [
|
|
86
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
|
87
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
88
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
89
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
90
|
+
{ internalType: "uint256", name: "expiration", type: "uint256" },
|
|
91
|
+
],
|
|
92
|
+
name: "depositWithExpiry",
|
|
93
|
+
outputs: [],
|
|
94
|
+
stateMutability: "payable",
|
|
95
|
+
type: "function",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
inputs: [
|
|
99
|
+
{ internalType: "address", name: "router", type: "address" },
|
|
100
|
+
{ internalType: "address payable", name: "asgard", type: "address" },
|
|
101
|
+
{
|
|
102
|
+
components: [
|
|
103
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
104
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
105
|
+
],
|
|
106
|
+
internalType: "struct MAYAChain_Router.Coin[]",
|
|
107
|
+
name: "coins",
|
|
108
|
+
type: "tuple[]",
|
|
109
|
+
},
|
|
110
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
111
|
+
],
|
|
112
|
+
name: "returnVaultAssets",
|
|
113
|
+
outputs: [],
|
|
114
|
+
stateMutability: "payable",
|
|
115
|
+
type: "function",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
inputs: [
|
|
119
|
+
{ internalType: "address", name: "router", type: "address" },
|
|
120
|
+
{ internalType: "address", name: "newVault", type: "address" },
|
|
121
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
122
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
123
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
124
|
+
],
|
|
125
|
+
name: "transferAllowance",
|
|
126
|
+
outputs: [],
|
|
127
|
+
stateMutability: "nonpayable",
|
|
128
|
+
type: "function",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
inputs: [
|
|
132
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
|
133
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
134
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
135
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
136
|
+
],
|
|
137
|
+
name: "transferOut",
|
|
138
|
+
outputs: [],
|
|
139
|
+
stateMutability: "payable",
|
|
140
|
+
type: "function",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
inputs: [
|
|
144
|
+
{ internalType: "address payable", name: "target", type: "address" },
|
|
145
|
+
{ internalType: "address", name: "finalToken", type: "address" },
|
|
146
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
147
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
148
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
149
|
+
],
|
|
150
|
+
name: "transferOutAndCall",
|
|
151
|
+
outputs: [],
|
|
152
|
+
stateMutability: "payable",
|
|
153
|
+
type: "function",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
inputs: [
|
|
157
|
+
{ internalType: "address", name: "vault", type: "address" },
|
|
158
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
159
|
+
],
|
|
160
|
+
name: "vaultAllowance",
|
|
161
|
+
outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
|
162
|
+
stateMutability: "view",
|
|
163
|
+
type: "function",
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
|
|
167
|
+
export const MayaArbitrumVaultAbi = [
|
|
168
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
169
|
+
{
|
|
170
|
+
anonymous: false,
|
|
171
|
+
inputs: [
|
|
172
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
173
|
+
{ indexed: true, internalType: "address", name: "asset", type: "address" },
|
|
174
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
175
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
176
|
+
],
|
|
177
|
+
name: "Deposit",
|
|
178
|
+
type: "event",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
anonymous: false,
|
|
182
|
+
inputs: [
|
|
183
|
+
{ indexed: true, internalType: "address", name: "oldVault", type: "address" },
|
|
184
|
+
{ indexed: true, internalType: "address", name: "newVault", type: "address" },
|
|
185
|
+
{ indexed: false, internalType: "address", name: "asset", type: "address" },
|
|
186
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
187
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
188
|
+
],
|
|
189
|
+
name: "TransferAllowance",
|
|
190
|
+
type: "event",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
anonymous: false,
|
|
194
|
+
inputs: [
|
|
195
|
+
{ indexed: true, internalType: "address", name: "vault", type: "address" },
|
|
196
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
197
|
+
{ indexed: false, internalType: "address", name: "asset", type: "address" },
|
|
198
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
199
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
200
|
+
],
|
|
201
|
+
name: "TransferOut",
|
|
202
|
+
type: "event",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
anonymous: false,
|
|
206
|
+
inputs: [
|
|
207
|
+
{ indexed: true, internalType: "address", name: "vault", type: "address" },
|
|
208
|
+
{ indexed: false, internalType: "address", name: "target", type: "address" },
|
|
209
|
+
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
210
|
+
{ indexed: false, internalType: "address", name: "finalAsset", type: "address" },
|
|
211
|
+
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
212
|
+
{ indexed: false, internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
213
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
214
|
+
],
|
|
215
|
+
name: "TransferOutAndCall",
|
|
216
|
+
type: "event",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
anonymous: false,
|
|
220
|
+
inputs: [
|
|
221
|
+
{ indexed: true, internalType: "address", name: "oldVault", type: "address" },
|
|
222
|
+
{ indexed: true, internalType: "address", name: "newVault", type: "address" },
|
|
223
|
+
{
|
|
224
|
+
components: [
|
|
225
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
226
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
227
|
+
],
|
|
228
|
+
indexed: false,
|
|
229
|
+
internalType: "struct ArbRouter.Coin[]",
|
|
230
|
+
name: "coins",
|
|
231
|
+
type: "tuple[]",
|
|
232
|
+
},
|
|
233
|
+
{ indexed: false, internalType: "string", name: "memo", type: "string" },
|
|
234
|
+
],
|
|
235
|
+
name: "VaultTransfer",
|
|
236
|
+
type: "event",
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
inputs: [
|
|
240
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
|
241
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
242
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
243
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
244
|
+
],
|
|
245
|
+
name: "deposit",
|
|
246
|
+
outputs: [],
|
|
247
|
+
stateMutability: "payable",
|
|
248
|
+
type: "function",
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
inputs: [
|
|
252
|
+
{ internalType: "address payable", name: "vault", type: "address" },
|
|
253
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
254
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
255
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
256
|
+
{ internalType: "uint256", name: "expiration", type: "uint256" },
|
|
257
|
+
],
|
|
258
|
+
name: "depositWithExpiry",
|
|
259
|
+
outputs: [],
|
|
260
|
+
stateMutability: "payable",
|
|
261
|
+
type: "function",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
inputs: [
|
|
265
|
+
{ internalType: "address", name: "router", type: "address" },
|
|
266
|
+
{ internalType: "address payable", name: "asgard", type: "address" },
|
|
267
|
+
{
|
|
268
|
+
components: [
|
|
269
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
270
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
271
|
+
],
|
|
272
|
+
internalType: "struct ArbRouter.Coin[]",
|
|
273
|
+
name: "coins",
|
|
274
|
+
type: "tuple[]",
|
|
275
|
+
},
|
|
276
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
277
|
+
],
|
|
278
|
+
name: "returnVaultAssets",
|
|
279
|
+
outputs: [],
|
|
280
|
+
stateMutability: "payable",
|
|
281
|
+
type: "function",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
inputs: [
|
|
285
|
+
{ internalType: "address", name: "router", type: "address" },
|
|
286
|
+
{ internalType: "address", name: "newVault", type: "address" },
|
|
287
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
288
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
289
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
290
|
+
],
|
|
291
|
+
name: "transferAllowance",
|
|
292
|
+
outputs: [],
|
|
293
|
+
stateMutability: "nonpayable",
|
|
294
|
+
type: "function",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
inputs: [
|
|
298
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
|
299
|
+
{ internalType: "address", name: "asset", type: "address" },
|
|
300
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
301
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
302
|
+
],
|
|
303
|
+
name: "transferOut",
|
|
304
|
+
outputs: [],
|
|
305
|
+
stateMutability: "payable",
|
|
306
|
+
type: "function",
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
inputs: [
|
|
310
|
+
{ internalType: "address payable", name: "target", type: "address" },
|
|
311
|
+
{ internalType: "address", name: "finalToken", type: "address" },
|
|
312
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
313
|
+
{ internalType: "uint256", name: "amountOutMin", type: "uint256" },
|
|
314
|
+
{ internalType: "string", name: "memo", type: "string" },
|
|
315
|
+
],
|
|
316
|
+
name: "transferOutAndCall",
|
|
317
|
+
outputs: [],
|
|
318
|
+
stateMutability: "payable",
|
|
319
|
+
type: "function",
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
inputs: [
|
|
323
|
+
{ internalType: "address", name: "vault", type: "address" },
|
|
324
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
325
|
+
],
|
|
326
|
+
name: "vaultAllowance",
|
|
327
|
+
outputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
|
328
|
+
stateMutability: "view",
|
|
329
|
+
type: "function",
|
|
330
|
+
},
|
|
331
|
+
];
|