@avail-project/ca-common 2.3.0 → 3.0.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/cjs/index.js +10593 -20
- package/dist/esm/index.mjs +10603 -0
- package/dist/types/index.d.ts +2608 -13
- package/package.json +41 -37
- package/dist/cjs/_polyfill.js +0 -147
- package/dist/cjs/balances/ub-api.js +0 -25
- package/dist/cjs/cosmos/index.js +0 -31
- package/dist/cjs/data/chaindata.js +0 -788
- package/dist/cjs/data/chainid.js +0 -93
- package/dist/cjs/data/currency.js +0 -78
- package/dist/cjs/data/index.js +0 -7
- package/dist/cjs/data/utils.js +0 -44
- package/dist/cjs/evmabi/erc20.abi.js +0 -349
- package/dist/cjs/evmabi/fibrousrouter.abi.js +0 -41
- package/dist/cjs/evmabi/index.js +0 -7
- package/dist/cjs/evmabi/vault.abi.js +0 -1021
- package/dist/cjs/evmabi/yakaggregator.abi.js +0 -275
- package/dist/cjs/permitutils/index.js +0 -186
- package/dist/cjs/proto/client.js +0 -48
- package/dist/cjs/proto/definition.js +0 -4131
- package/dist/cjs/proto/grpc.js +0 -298
- package/dist/cjs/rff/rff.js +0 -42
- package/dist/cjs/types/binarytypes.js +0 -2
- package/dist/cjs/types/index.js +0 -5
- package/dist/cjs/types/msgpack-axios.js +0 -22
- package/dist/cjs/vaultcontracts/index.js +0 -4
- package/dist/cjs/vaultcontracts/vaultcontracts.js +0 -222
- package/dist/cjs/xcs/autochoice.js +0 -575
- package/dist/cjs/xcs/bebop-agg.js +0 -156
- package/dist/cjs/xcs/fibrous-agg.js +0 -155
- package/dist/cjs/xcs/iface.js +0 -13
- package/dist/cjs/xcs/index.js +0 -9
- package/dist/cjs/xcs/lifi-agg.js +0 -177
- package/dist/cjs/xcs/selectsources.js +0 -255
- package/dist/esm/_polyfill.js +0 -143
- package/dist/esm/balances/ub-api.js +0 -21
- package/dist/esm/cosmos/index.js +0 -26
- package/dist/esm/data/chaindata.js +0 -785
- package/dist/esm/data/chainid.js +0 -87
- package/dist/esm/data/currency.js +0 -73
- package/dist/esm/data/index.js +0 -4
- package/dist/esm/data/utils.js +0 -34
- package/dist/esm/evmabi/erc20.abi.js +0 -346
- package/dist/esm/evmabi/fibrousrouter.abi.js +0 -38
- package/dist/esm/evmabi/index.js +0 -4
- package/dist/esm/evmabi/vault.abi.js +0 -1018
- package/dist/esm/evmabi/yakaggregator.abi.js +0 -272
- package/dist/esm/index.js +0 -13
- package/dist/esm/permitutils/index.js +0 -181
- package/dist/esm/proto/client.js +0 -11
- package/dist/esm/proto/definition.js +0 -4122
- package/dist/esm/proto/grpc.js +0 -292
- package/dist/esm/rff/rff.js +0 -38
- package/dist/esm/types/binarytypes.js +0 -1
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/types/msgpack-axios.js +0 -18
- package/dist/esm/vaultcontracts/index.js +0 -1
- package/dist/esm/vaultcontracts/vaultcontracts.js +0 -218
- package/dist/esm/xcs/autochoice.js +0 -559
- package/dist/esm/xcs/bebop-agg.js +0 -151
- package/dist/esm/xcs/fibrous-agg.js +0 -150
- package/dist/esm/xcs/iface.js +0 -10
- package/dist/esm/xcs/index.js +0 -6
- package/dist/esm/xcs/lifi-agg.js +0 -172
- package/dist/esm/xcs/selectsources.js +0 -251
- package/dist/types/_polyfill.d.ts +0 -1
- package/dist/types/balances/ub-api.d.ts +0 -14
- package/dist/types/cosmos/index.d.ts +0 -6
- package/dist/types/data/chaindata.d.ts +0 -20
- package/dist/types/data/chainid.d.ts +0 -31
- package/dist/types/data/currency.d.ts +0 -30
- package/dist/types/data/index.d.ts +0 -4
- package/dist/types/data/utils.d.ts +0 -10
- package/dist/types/evmabi/erc20.abi.d.ts +0 -264
- package/dist/types/evmabi/fibrousrouter.abi.d.ts +0 -77
- package/dist/types/evmabi/index.d.ts +0 -4
- package/dist/types/evmabi/vault.abi.d.ts +0 -785
- package/dist/types/evmabi/yakaggregator.abi.d.ts +0 -298
- package/dist/types/permitutils/index.d.ts +0 -13
- package/dist/types/proto/client.d.ts +0 -2
- package/dist/types/proto/definition.d.ts +0 -382
- package/dist/types/proto/grpc.d.ts +0 -75
- package/dist/types/rff/rff.d.ts +0 -9
- package/dist/types/types/binarytypes.d.ts +0 -1
- package/dist/types/types/index.d.ts +0 -2
- package/dist/types/types/msgpack-axios.d.ts +0 -1
- package/dist/types/vaultcontracts/index.d.ts +0 -22
- package/dist/types/vaultcontracts/vaultcontracts.d.ts +0 -8
- package/dist/types/xcs/autochoice.d.ts +0 -104
- package/dist/types/xcs/bebop-agg.d.ts +0 -104
- package/dist/types/xcs/fibrous-agg.d.ts +0 -56
- package/dist/types/xcs/iface.d.ts +0 -69
- package/dist/types/xcs/index.d.ts +0 -6
- package/dist/types/xcs/lifi-agg.d.ts +0 -42
- package/dist/types/xcs/selectsources.d.ts +0 -27
package/dist/cjs/data/chainid.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChainIDKeyedMap = exports.OmniversalChainID = void 0;
|
|
4
|
-
exports.encodeChainID36 = encodeChainID36;
|
|
5
|
-
const _polyfill_1 = require("../_polyfill");
|
|
6
|
-
const viem_1 = require("viem");
|
|
7
|
-
const definition_1 = require("../proto/definition");
|
|
8
|
-
const utils_1 = require("./utils");
|
|
9
|
-
(0, _polyfill_1.ensureBufferPolyfill)();
|
|
10
|
-
function encodeChainID36(universe, chainID) {
|
|
11
|
-
let chainIDB;
|
|
12
|
-
if (Buffer.isBuffer(chainID) || chainID instanceof Uint8Array) {
|
|
13
|
-
chainIDB = chainID;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
chainIDB = (0, viem_1.toBytes)(chainID);
|
|
17
|
-
}
|
|
18
|
-
const buf = Buffer.alloc(36);
|
|
19
|
-
buf.writeUInt32BE(universe);
|
|
20
|
-
buf.set(chainIDB, 4 + (32 - chainIDB.length));
|
|
21
|
-
return buf;
|
|
22
|
-
}
|
|
23
|
-
class OmniversalChainID {
|
|
24
|
-
universe;
|
|
25
|
-
chainID;
|
|
26
|
-
binaryForm;
|
|
27
|
-
constructor(universe, chainID) {
|
|
28
|
-
this.universe = universe;
|
|
29
|
-
if (typeof chainID === "bigint") {
|
|
30
|
-
this.chainID = chainID;
|
|
31
|
-
}
|
|
32
|
-
else if (typeof chainID === "number" || typeof chainID === "string") {
|
|
33
|
-
this.chainID = BigInt(chainID);
|
|
34
|
-
}
|
|
35
|
-
else if (chainID instanceof Uint8Array) {
|
|
36
|
-
this.chainID = (0, viem_1.bytesToBigInt)(chainID);
|
|
37
|
-
}
|
|
38
|
-
this.binaryForm = encodeChainID36(this.universe, this.chainID);
|
|
39
|
-
}
|
|
40
|
-
toString() {
|
|
41
|
-
return (0, definition_1.universeToJSON)(this.universe) + "_" + this.chainID.toString(10);
|
|
42
|
-
}
|
|
43
|
-
toJSON() {
|
|
44
|
-
return {
|
|
45
|
-
universe: (0, definition_1.universeToJSON)(this.universe),
|
|
46
|
-
chainID: (0, viem_1.toHex)(this.chainID),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
static fromJSON(input) {
|
|
50
|
-
return new OmniversalChainID((0, definition_1.universeFromJSON)(input.universe), (0, viem_1.hexToBigInt)(input.chainID));
|
|
51
|
-
}
|
|
52
|
-
static fromChainID36(_input) {
|
|
53
|
-
const input = (0, utils_1.convertToBufferIfNecessary)(_input);
|
|
54
|
-
const univID = input.readUInt32BE(0);
|
|
55
|
-
const rest = input.subarray(4);
|
|
56
|
-
return new OmniversalChainID(univID, rest);
|
|
57
|
-
}
|
|
58
|
-
// Do not modify the returned buffer. Make a copy if necessary.
|
|
59
|
-
toBytes() {
|
|
60
|
-
return this.binaryForm;
|
|
61
|
-
}
|
|
62
|
-
equals(rhs) {
|
|
63
|
-
return this.universe === rhs.universe && this.chainID === rhs.chainID;
|
|
64
|
-
}
|
|
65
|
-
static equals(lhs, rhs) {
|
|
66
|
-
return lhs.equals(rhs);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.OmniversalChainID = OmniversalChainID;
|
|
70
|
-
class ChainIDKeyedMap {
|
|
71
|
-
map;
|
|
72
|
-
constructor(entries = null) {
|
|
73
|
-
this.map = new Map(entries != null
|
|
74
|
-
? entries.map((e) => [(0, viem_1.bytesToHex)(e[0].toBytes()), e[1]])
|
|
75
|
-
: null);
|
|
76
|
-
}
|
|
77
|
-
get(key) {
|
|
78
|
-
return this.map.get((0, viem_1.bytesToHex)(key.toBytes()));
|
|
79
|
-
}
|
|
80
|
-
set(key, value) {
|
|
81
|
-
this.map.set((0, viem_1.bytesToHex)(key.toBytes()), value);
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
getFromChainID36(key) {
|
|
85
|
-
return this.map.get((0, viem_1.bytesToHex)(key));
|
|
86
|
-
}
|
|
87
|
-
*entries() {
|
|
88
|
-
for (const [key, value] of this.map.entries()) {
|
|
89
|
-
yield [OmniversalChainID.fromChainID36((0, viem_1.hexToBytes)(key)), value];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.ChainIDKeyedMap = ChainIDKeyedMap;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Currency = exports.CurrencyID = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const viem_1 = require("viem");
|
|
6
|
-
const decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
|
|
7
|
-
const utils_1 = require("./utils");
|
|
8
|
-
var CurrencyID;
|
|
9
|
-
(function (CurrencyID) {
|
|
10
|
-
CurrencyID[CurrencyID["USDC"] = 1] = "USDC";
|
|
11
|
-
CurrencyID[CurrencyID["USDT"] = 2] = "USDT";
|
|
12
|
-
CurrencyID[CurrencyID["ETH"] = 3] = "ETH";
|
|
13
|
-
CurrencyID[CurrencyID["POL"] = 4] = "POL";
|
|
14
|
-
CurrencyID[CurrencyID["AVAX"] = 5] = "AVAX";
|
|
15
|
-
CurrencyID[CurrencyID["BNB"] = 6] = "BNB";
|
|
16
|
-
CurrencyID[CurrencyID["HYPE"] = 16] = "HYPE";
|
|
17
|
-
CurrencyID[CurrencyID["KAIA"] = 17] = "KAIA";
|
|
18
|
-
CurrencyID[CurrencyID["SOPH"] = 18] = "SOPH";
|
|
19
|
-
CurrencyID[CurrencyID["TRX"] = 19] = "TRX";
|
|
20
|
-
CurrencyID[CurrencyID["MON"] = 20] = "MON";
|
|
21
|
-
CurrencyID[CurrencyID["CBTC"] = 21] = "CBTC";
|
|
22
|
-
})(CurrencyID || (exports.CurrencyID = CurrencyID = {}));
|
|
23
|
-
class Currency {
|
|
24
|
-
currencyID;
|
|
25
|
-
decimals;
|
|
26
|
-
permitVariant;
|
|
27
|
-
permitContractVersion;
|
|
28
|
-
isGasToken;
|
|
29
|
-
// this is always 32 byte long
|
|
30
|
-
tokenAddress;
|
|
31
|
-
/* This is the ratio between one unit to the smallest unit used.
|
|
32
|
-
|
|
33
|
-
For example, USDC, which has a ‘decimals’ value of 6, is designed so that 1 USDC = 10⁶ μUSDC, which is the smallest indivisible amount representable.
|
|
34
|
-
*/
|
|
35
|
-
oneUnitToAtomicUnitRatio;
|
|
36
|
-
constructor(currencyID, tokenAddress, decimals, permitVariant, permitContractVersion = 0, isGasToken) {
|
|
37
|
-
this.currencyID = currencyID;
|
|
38
|
-
this.decimals = decimals;
|
|
39
|
-
this.permitVariant = permitVariant;
|
|
40
|
-
this.permitContractVersion = permitContractVersion;
|
|
41
|
-
this.isGasToken = isGasToken;
|
|
42
|
-
if (typeof tokenAddress === "string") {
|
|
43
|
-
this.tokenAddress = (0, utils_1.zeroExtendBufToGivenSize)((0, viem_1.toBytes)(tokenAddress), 32);
|
|
44
|
-
}
|
|
45
|
-
else if (tokenAddress instanceof Uint8Array) {
|
|
46
|
-
this.tokenAddress = (0, utils_1.zeroExtendBufToGivenSize)(tokenAddress, 32);
|
|
47
|
-
}
|
|
48
|
-
else if (Array.isArray(tokenAddress) &&
|
|
49
|
-
tokenAddress.length >= 1 &&
|
|
50
|
-
typeof tokenAddress[0] === "number") {
|
|
51
|
-
this.tokenAddress = (0, utils_1.zeroExtendBufToGivenSize)(Buffer.from(tokenAddress), 32);
|
|
52
|
-
}
|
|
53
|
-
this.oneUnitToAtomicUnitRatio = decimal_js_1.default.pow(10, decimals);
|
|
54
|
-
}
|
|
55
|
-
convertUnitsToAmountDecimal(input) {
|
|
56
|
-
let rawunits;
|
|
57
|
-
if (typeof input === "bigint") {
|
|
58
|
-
rawunits = input.toString(10);
|
|
59
|
-
}
|
|
60
|
-
else if (typeof input === "number") {
|
|
61
|
-
rawunits = input.toString();
|
|
62
|
-
}
|
|
63
|
-
else if (input instanceof Uint8Array) {
|
|
64
|
-
rawunits = (0, viem_1.bytesToBigInt)(input).toString(10);
|
|
65
|
-
}
|
|
66
|
-
else if (typeof input === "string") {
|
|
67
|
-
rawunits = input;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
throw new Error("Invalid input");
|
|
71
|
-
}
|
|
72
|
-
return decimal_js_1.default.div(rawunits, this.oneUnitToAtomicUnitRatio);
|
|
73
|
-
}
|
|
74
|
-
convertAmountToUnitsInBinary(input) {
|
|
75
|
-
return Buffer.from((0, viem_1.toBytes)(input.mul(this.oneUnitToAtomicUnitRatio).ceil().toHex()));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.Currency = Currency;
|
package/dist/cjs/data/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./chaindata"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./chainid"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./currency"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./utils"), exports);
|
package/dist/cjs/data/utils.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToBufferIfNecessary = convertToBufferIfNecessary;
|
|
4
|
-
exports.zeroExtendBufToGivenSize = zeroExtendBufToGivenSize;
|
|
5
|
-
exports.ezPadTo32Hex = ezPadTo32Hex;
|
|
6
|
-
exports.convertDecimalToBigInt = convertDecimalToBigInt;
|
|
7
|
-
exports.convertBigIntToDecimal = convertBigIntToDecimal;
|
|
8
|
-
exports.maxByBigInt = maxByBigInt;
|
|
9
|
-
exports.minByBigInt = minByBigInt;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
|
-
const viem_1 = require("viem");
|
|
12
|
-
const decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
|
|
13
|
-
function convertToBufferIfNecessary(buf) {
|
|
14
|
-
return Buffer.isBuffer(buf) ? buf : Buffer.from(buf);
|
|
15
|
-
}
|
|
16
|
-
function zeroExtendBufToGivenSize(buf, size = 32) {
|
|
17
|
-
if (buf.length === size) {
|
|
18
|
-
return convertToBufferIfNecessary(buf);
|
|
19
|
-
}
|
|
20
|
-
if (buf.length > size) {
|
|
21
|
-
return convertToBufferIfNecessary(buf.subarray(0, size));
|
|
22
|
-
}
|
|
23
|
-
const out = Buffer.alloc(size);
|
|
24
|
-
out.set(buf, size - buf.length);
|
|
25
|
-
return out;
|
|
26
|
-
}
|
|
27
|
-
function ezPadTo32Hex(input) {
|
|
28
|
-
return (0, viem_1.pad)(typeof input !== "string" ? (0, viem_1.toHex)(input) : input, {
|
|
29
|
-
dir: "left",
|
|
30
|
-
size: 32,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function convertDecimalToBigInt(dec) {
|
|
34
|
-
return BigInt(dec.ceil().toFixed());
|
|
35
|
-
}
|
|
36
|
-
function convertBigIntToDecimal(big) {
|
|
37
|
-
return new decimal_js_1.default(big.toString(10));
|
|
38
|
-
}
|
|
39
|
-
function maxByBigInt(items, getValue) {
|
|
40
|
-
return items.reduce((m, e) => getValue(e) > getValue(m) ? e : m);
|
|
41
|
-
}
|
|
42
|
-
function minByBigInt(items, getValue) {
|
|
43
|
-
return items.reduce((m, e) => getValue(e) < getValue(m) ? e : m);
|
|
44
|
-
}
|
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERC20ABI = void 0;
|
|
4
|
-
exports.ERC20ABI = [
|
|
5
|
-
{
|
|
6
|
-
constant: true,
|
|
7
|
-
inputs: [],
|
|
8
|
-
name: "name",
|
|
9
|
-
outputs: [
|
|
10
|
-
{
|
|
11
|
-
name: "",
|
|
12
|
-
type: "string",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
payable: false,
|
|
16
|
-
stateMutability: "view",
|
|
17
|
-
type: "function",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
constant: false,
|
|
21
|
-
inputs: [
|
|
22
|
-
{
|
|
23
|
-
name: "_spender",
|
|
24
|
-
type: "address",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "_value",
|
|
28
|
-
type: "uint256",
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
name: "approve",
|
|
32
|
-
outputs: [
|
|
33
|
-
{
|
|
34
|
-
name: "",
|
|
35
|
-
type: "bool",
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
payable: false,
|
|
39
|
-
stateMutability: "nonpayable",
|
|
40
|
-
type: "function",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
constant: true,
|
|
44
|
-
inputs: [],
|
|
45
|
-
name: "totalSupply",
|
|
46
|
-
outputs: [
|
|
47
|
-
{
|
|
48
|
-
name: "",
|
|
49
|
-
type: "uint256",
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
payable: false,
|
|
53
|
-
stateMutability: "view",
|
|
54
|
-
type: "function",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
constant: false,
|
|
58
|
-
inputs: [
|
|
59
|
-
{
|
|
60
|
-
name: "_from",
|
|
61
|
-
type: "address",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "_to",
|
|
65
|
-
type: "address",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "_value",
|
|
69
|
-
type: "uint256",
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
name: "transferFrom",
|
|
73
|
-
outputs: [
|
|
74
|
-
{
|
|
75
|
-
name: "",
|
|
76
|
-
type: "bool",
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
payable: false,
|
|
80
|
-
stateMutability: "nonpayable",
|
|
81
|
-
type: "function",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
constant: true,
|
|
85
|
-
inputs: [],
|
|
86
|
-
name: "decimals",
|
|
87
|
-
outputs: [
|
|
88
|
-
{
|
|
89
|
-
name: "",
|
|
90
|
-
type: "uint8",
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
payable: false,
|
|
94
|
-
stateMutability: "view",
|
|
95
|
-
type: "function",
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
constant: true,
|
|
99
|
-
inputs: [
|
|
100
|
-
{
|
|
101
|
-
name: "_owner",
|
|
102
|
-
type: "address",
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
name: "balanceOf",
|
|
106
|
-
outputs: [
|
|
107
|
-
{
|
|
108
|
-
name: "balance",
|
|
109
|
-
type: "uint256",
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
payable: false,
|
|
113
|
-
stateMutability: "view",
|
|
114
|
-
type: "function",
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
constant: true,
|
|
118
|
-
inputs: [],
|
|
119
|
-
name: "symbol",
|
|
120
|
-
outputs: [
|
|
121
|
-
{
|
|
122
|
-
name: "",
|
|
123
|
-
type: "string",
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
payable: false,
|
|
127
|
-
stateMutability: "view",
|
|
128
|
-
type: "function",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
constant: false,
|
|
132
|
-
inputs: [
|
|
133
|
-
{
|
|
134
|
-
name: "_to",
|
|
135
|
-
type: "address",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "_value",
|
|
139
|
-
type: "uint256",
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
name: "transfer",
|
|
143
|
-
outputs: [
|
|
144
|
-
{
|
|
145
|
-
name: "",
|
|
146
|
-
type: "bool",
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
payable: false,
|
|
150
|
-
stateMutability: "nonpayable",
|
|
151
|
-
type: "function",
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
constant: true,
|
|
155
|
-
inputs: [
|
|
156
|
-
{
|
|
157
|
-
name: "_owner",
|
|
158
|
-
type: "address",
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "_spender",
|
|
162
|
-
type: "address",
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
name: "allowance",
|
|
166
|
-
outputs: [
|
|
167
|
-
{
|
|
168
|
-
name: "",
|
|
169
|
-
type: "uint256",
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
payable: false,
|
|
173
|
-
stateMutability: "view",
|
|
174
|
-
type: "function",
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
payable: true,
|
|
178
|
-
stateMutability: "payable",
|
|
179
|
-
type: "fallback",
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
anonymous: false,
|
|
183
|
-
inputs: [
|
|
184
|
-
{
|
|
185
|
-
indexed: true,
|
|
186
|
-
name: "owner",
|
|
187
|
-
type: "address",
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
indexed: true,
|
|
191
|
-
name: "spender",
|
|
192
|
-
type: "address",
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
indexed: false,
|
|
196
|
-
name: "value",
|
|
197
|
-
type: "uint256",
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
name: "Approval",
|
|
201
|
-
type: "event",
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
anonymous: false,
|
|
205
|
-
inputs: [
|
|
206
|
-
{
|
|
207
|
-
indexed: true,
|
|
208
|
-
name: "from",
|
|
209
|
-
type: "address",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
indexed: true,
|
|
213
|
-
name: "to",
|
|
214
|
-
type: "address",
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
indexed: false,
|
|
218
|
-
name: "value",
|
|
219
|
-
type: "uint256",
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
name: "Transfer",
|
|
223
|
-
type: "event",
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
comment: "From the EIP-2612 spec.",
|
|
227
|
-
inputs: [
|
|
228
|
-
{
|
|
229
|
-
internalType: "address",
|
|
230
|
-
name: "owner",
|
|
231
|
-
type: "address",
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
name: "nonces",
|
|
235
|
-
outputs: [
|
|
236
|
-
{
|
|
237
|
-
internalType: "uint256",
|
|
238
|
-
name: "",
|
|
239
|
-
type: "uint256",
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
stateMutability: "view",
|
|
243
|
-
type: "function",
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
comment: "From the EIP-2612 spec.",
|
|
247
|
-
inputs: [
|
|
248
|
-
{
|
|
249
|
-
internalType: "address",
|
|
250
|
-
name: "owner",
|
|
251
|
-
type: "address",
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
internalType: "address",
|
|
255
|
-
name: "spender",
|
|
256
|
-
type: "address",
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
internalType: "uint256",
|
|
260
|
-
name: "value",
|
|
261
|
-
type: "uint256",
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
internalType: "uint256",
|
|
265
|
-
name: "deadline",
|
|
266
|
-
type: "uint256",
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
internalType: "uint8",
|
|
270
|
-
name: "v",
|
|
271
|
-
type: "uint8",
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
internalType: "bytes32",
|
|
275
|
-
name: "r",
|
|
276
|
-
type: "bytes32",
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
internalType: "bytes32",
|
|
280
|
-
name: "s",
|
|
281
|
-
type: "bytes32",
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
name: "permit",
|
|
285
|
-
outputs: [],
|
|
286
|
-
stateMutability: "nonpayable",
|
|
287
|
-
type: "function",
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
comment: "Available on bridged tokens on Polygon.",
|
|
291
|
-
inputs: [
|
|
292
|
-
{
|
|
293
|
-
internalType: "address",
|
|
294
|
-
name: "userAddress",
|
|
295
|
-
type: "address",
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
internalType: "bytes",
|
|
299
|
-
name: "functionSignature",
|
|
300
|
-
type: "bytes",
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
internalType: "bytes32",
|
|
304
|
-
name: "sigR",
|
|
305
|
-
type: "bytes32",
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
internalType: "bytes32",
|
|
309
|
-
name: "sigS",
|
|
310
|
-
type: "bytes32",
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
internalType: "uint8",
|
|
314
|
-
name: "sigV",
|
|
315
|
-
type: "uint8",
|
|
316
|
-
},
|
|
317
|
-
],
|
|
318
|
-
name: "executeMetaTransaction",
|
|
319
|
-
outputs: [
|
|
320
|
-
{
|
|
321
|
-
internalType: "bytes",
|
|
322
|
-
name: "",
|
|
323
|
-
type: "bytes",
|
|
324
|
-
},
|
|
325
|
-
],
|
|
326
|
-
stateMutability: "payable",
|
|
327
|
-
type: "function",
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
comment: "Available on bridged tokens on Polygon.",
|
|
331
|
-
inputs: [
|
|
332
|
-
{
|
|
333
|
-
internalType: "address",
|
|
334
|
-
name: "user",
|
|
335
|
-
type: "address",
|
|
336
|
-
},
|
|
337
|
-
],
|
|
338
|
-
name: "getNonce",
|
|
339
|
-
outputs: [
|
|
340
|
-
{
|
|
341
|
-
internalType: "uint256",
|
|
342
|
-
name: "nonce",
|
|
343
|
-
type: "uint256",
|
|
344
|
-
},
|
|
345
|
-
],
|
|
346
|
-
stateMutability: "view",
|
|
347
|
-
type: "function",
|
|
348
|
-
},
|
|
349
|
-
];
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FibrousRouterABI = void 0;
|
|
4
|
-
exports.FibrousRouterABI = [
|
|
5
|
-
{
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
components: [
|
|
9
|
-
{ internalType: "address", name: "token_in", type: "address" },
|
|
10
|
-
{ internalType: "address", name: "token_out", type: "address" },
|
|
11
|
-
{ internalType: "uint256", name: "amount_in", type: "uint256" },
|
|
12
|
-
{ internalType: "uint256", name: "amount_out", type: "uint256" },
|
|
13
|
-
{ internalType: "uint256", name: "min_received", type: "uint256" },
|
|
14
|
-
{ internalType: "address", name: "destination", type: "address" },
|
|
15
|
-
{ internalType: "uint8", name: "swap_type", type: "uint8" },
|
|
16
|
-
],
|
|
17
|
-
internalType: "struct IFibrousRouter.RouteParam",
|
|
18
|
-
name: "route",
|
|
19
|
-
type: "tuple",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
components: [
|
|
23
|
-
{ internalType: "address", name: "token_in", type: "address" },
|
|
24
|
-
{ internalType: "address", name: "token_out", type: "address" },
|
|
25
|
-
{ internalType: "uint32", name: "rate", type: "uint32" },
|
|
26
|
-
{ internalType: "int24", name: "protocol_id", type: "int24" },
|
|
27
|
-
{ internalType: "address", name: "pool_address", type: "address" },
|
|
28
|
-
{ internalType: "uint8", name: "swap_type", type: "uint8" },
|
|
29
|
-
{ internalType: "bytes", name: "extra_data", type: "bytes" },
|
|
30
|
-
],
|
|
31
|
-
internalType: "struct IFibrousRouter.SwapParams[]",
|
|
32
|
-
name: "swap_parameters",
|
|
33
|
-
type: "tuple[]",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
name: "swap",
|
|
37
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
38
|
-
stateMutability: "payable",
|
|
39
|
-
type: "function",
|
|
40
|
-
},
|
|
41
|
-
];
|
package/dist/cjs/evmabi/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./erc20.abi"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./vault.abi"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./yakaggregator.abi"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./fibrousrouter.abi"), exports);
|