@shapeshiftoss/swapper 5.5.0 → 5.6.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/dist/swappers/thorchain/utils/ethereum/routerAbi.d.ts +2 -0
- package/dist/swappers/thorchain/utils/ethereum/routerAbi.js +153 -0
- package/dist/swappers/thorchain/utils/ethereum/routerCalldata.d.ts +1 -0
- package/dist/swappers/thorchain/utils/ethereum/routerCalldata.js +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.routerAbi = void 0;
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
exports.routerAbi = [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [{ "internalType": "address", "name": "rune", "type": "address" }],
|
|
8
|
+
"stateMutability": "nonpayable",
|
|
9
|
+
"type": "constructor"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"anonymous": false,
|
|
13
|
+
"inputs": [
|
|
14
|
+
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" },
|
|
15
|
+
{ "indexed": true, "internalType": "address", "name": "asset", "type": "address" },
|
|
16
|
+
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
17
|
+
{ "indexed": false, "internalType": "string", "name": "memo", "type": "string" }
|
|
18
|
+
],
|
|
19
|
+
"name": "Deposit",
|
|
20
|
+
"type": "event"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"anonymous": false,
|
|
24
|
+
"inputs": [
|
|
25
|
+
{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" },
|
|
26
|
+
{ "indexed": true, "internalType": "address", "name": "newVault", "type": "address" },
|
|
27
|
+
{ "indexed": false, "internalType": "address", "name": "asset", "type": "address" },
|
|
28
|
+
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
29
|
+
{ "indexed": false, "internalType": "string", "name": "memo", "type": "string" }
|
|
30
|
+
],
|
|
31
|
+
"name": "TransferAllowance",
|
|
32
|
+
"type": "event"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"anonymous": false,
|
|
36
|
+
"inputs": [
|
|
37
|
+
{ "indexed": true, "internalType": "address", "name": "vault", "type": "address" },
|
|
38
|
+
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" },
|
|
39
|
+
{ "indexed": false, "internalType": "address", "name": "asset", "type": "address" },
|
|
40
|
+
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
41
|
+
{ "indexed": false, "internalType": "string", "name": "memo", "type": "string" }
|
|
42
|
+
],
|
|
43
|
+
"name": "TransferOut",
|
|
44
|
+
"type": "event"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"anonymous": false,
|
|
48
|
+
"inputs": [
|
|
49
|
+
{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" },
|
|
50
|
+
{ "indexed": true, "internalType": "address", "name": "newVault", "type": "address" },
|
|
51
|
+
{
|
|
52
|
+
"components": [
|
|
53
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
54
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
|
55
|
+
],
|
|
56
|
+
"indexed": false,
|
|
57
|
+
"internalType": "struct THORChain_Router.Coin[]",
|
|
58
|
+
"name": "coins",
|
|
59
|
+
"type": "tuple[]"
|
|
60
|
+
},
|
|
61
|
+
{ "indexed": false, "internalType": "string", "name": "memo", "type": "string" }
|
|
62
|
+
],
|
|
63
|
+
"name": "VaultTransfer",
|
|
64
|
+
"type": "event"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"inputs": [],
|
|
68
|
+
"name": "RUNE",
|
|
69
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
70
|
+
"stateMutability": "view",
|
|
71
|
+
"type": "function"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [
|
|
75
|
+
{ "internalType": "address payable", "name": "vault", "type": "address" },
|
|
76
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
77
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
78
|
+
{ "internalType": "string", "name": "memo", "type": "string" }
|
|
79
|
+
],
|
|
80
|
+
"name": "deposit",
|
|
81
|
+
"outputs": [],
|
|
82
|
+
"stateMutability": "payable",
|
|
83
|
+
"type": "function"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"inputs": [
|
|
87
|
+
{ "internalType": "address payable", "name": "vault", "type": "address" },
|
|
88
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
89
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
90
|
+
{ "internalType": "string", "name": "memo", "type": "string" },
|
|
91
|
+
{ "internalType": "uint256", "name": "expiration", "type": "uint256" }
|
|
92
|
+
],
|
|
93
|
+
"name": "depositWithExpiry",
|
|
94
|
+
"outputs": [],
|
|
95
|
+
"stateMutability": "payable",
|
|
96
|
+
"type": "function"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"inputs": [
|
|
100
|
+
{ "internalType": "address", "name": "router", "type": "address" },
|
|
101
|
+
{ "internalType": "address payable", "name": "asgard", "type": "address" },
|
|
102
|
+
{
|
|
103
|
+
"components": [
|
|
104
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
105
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
|
106
|
+
],
|
|
107
|
+
"internalType": "struct THORChain_Router.Coin[]",
|
|
108
|
+
"name": "coins",
|
|
109
|
+
"type": "tuple[]"
|
|
110
|
+
},
|
|
111
|
+
{ "internalType": "string", "name": "memo", "type": "string" }
|
|
112
|
+
],
|
|
113
|
+
"name": "returnVaultAssets",
|
|
114
|
+
"outputs": [],
|
|
115
|
+
"stateMutability": "payable",
|
|
116
|
+
"type": "function"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"inputs": [
|
|
120
|
+
{ "internalType": "address", "name": "router", "type": "address" },
|
|
121
|
+
{ "internalType": "address", "name": "newVault", "type": "address" },
|
|
122
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
123
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
124
|
+
{ "internalType": "string", "name": "memo", "type": "string" }
|
|
125
|
+
],
|
|
126
|
+
"name": "transferAllowance",
|
|
127
|
+
"outputs": [],
|
|
128
|
+
"stateMutability": "nonpayable",
|
|
129
|
+
"type": "function"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"inputs": [
|
|
133
|
+
{ "internalType": "address payable", "name": "to", "type": "address" },
|
|
134
|
+
{ "internalType": "address", "name": "asset", "type": "address" },
|
|
135
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
|
136
|
+
{ "internalType": "string", "name": "memo", "type": "string" }
|
|
137
|
+
],
|
|
138
|
+
"name": "transferOut",
|
|
139
|
+
"outputs": [],
|
|
140
|
+
"stateMutability": "payable",
|
|
141
|
+
"type": "function"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"inputs": [
|
|
145
|
+
{ "internalType": "address", "name": "vault", "type": "address" },
|
|
146
|
+
{ "internalType": "address", "name": "token", "type": "address" }
|
|
147
|
+
],
|
|
148
|
+
"name": "vaultAllowance",
|
|
149
|
+
"outputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
|
150
|
+
"stateMutability": "view",
|
|
151
|
+
"type": "function"
|
|
152
|
+
}
|
|
153
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deposit: (contractAddress: string, vault: string, asset: string, amount: string, memo: string) => Promise<any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.deposit = void 0;
|
|
7
|
+
const web3_1 = __importDefault(require("web3"));
|
|
8
|
+
const routerAbi_1 = require("./routerAbi");
|
|
9
|
+
const deposit = async (contractAddress, vault, asset, amount, memo) => {
|
|
10
|
+
const web3 = new web3_1.default();
|
|
11
|
+
const routerContract = new web3.eth.Contract(routerAbi_1.routerAbi, contractAddress);
|
|
12
|
+
const data = routerContract.methods.deposit(vault, asset, amount, memo).encodeABI();
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
exports.deposit = deposit;
|