@across-protocol/sdk 4.3.165-beta.1 → 4.3.166-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/dist/cjs/src/arch/tvm/MessageUtils.d.ts +6 -0
- package/dist/cjs/src/arch/tvm/MessageUtils.js +27 -0
- package/dist/cjs/src/arch/tvm/MessageUtils.js.map +1 -0
- package/dist/cjs/src/arch/tvm/index.d.ts +1 -0
- package/dist/cjs/src/arch/tvm/index.js +1 -0
- package/dist/cjs/src/arch/tvm/index.js.map +1 -1
- package/dist/cjs/src/relayFeeCalculator/chain-queries/factory.js +3 -1
- package/dist/cjs/src/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/cjs/src/relayFeeCalculator/chain-queries/index.d.ts +1 -0
- package/dist/cjs/src/relayFeeCalculator/chain-queries/index.js +1 -0
- package/dist/cjs/src/relayFeeCalculator/chain-queries/index.js.map +1 -1
- package/dist/cjs/src/relayFeeCalculator/chain-queries/tvmQuery.d.ts +6 -0
- package/dist/cjs/src/relayFeeCalculator/chain-queries/tvmQuery.js +12 -0
- package/dist/cjs/src/relayFeeCalculator/chain-queries/tvmQuery.js.map +1 -0
- package/dist/cjs/src/utils/abi/typechain/TronMulticallHandler.d.ts +153 -0
- package/dist/cjs/src/utils/abi/typechain/TronMulticallHandler.js +3 -0
- package/dist/cjs/src/utils/abi/typechain/TronMulticallHandler.js.map +1 -0
- package/dist/cjs/src/utils/abi/typechain/factories/TronMulticallHandler__factory.d.ts +231 -0
- package/dist/cjs/src/utils/abi/typechain/factories/TronMulticallHandler__factory.js +306 -0
- package/dist/cjs/src/utils/abi/typechain/factories/TronMulticallHandler__factory.js.map +1 -0
- package/dist/cjs/src/utils/abi/typechain/factories/index.d.ts +1 -0
- package/dist/cjs/src/utils/abi/typechain/factories/index.js +4 -2
- package/dist/cjs/src/utils/abi/typechain/factories/index.js.map +1 -1
- package/dist/cjs/src/utils/abi/typechain/index.d.ts +2 -0
- package/dist/cjs/src/utils/abi/typechain/index.js +4 -2
- package/dist/cjs/src/utils/abi/typechain/index.js.map +1 -1
- package/dist/esm/src/arch/tvm/MessageUtils.d.ts +22 -0
- package/dist/esm/src/arch/tvm/MessageUtils.js +61 -0
- package/dist/esm/src/arch/tvm/MessageUtils.js.map +1 -0
- package/dist/esm/src/arch/tvm/index.d.ts +1 -0
- package/dist/esm/src/arch/tvm/index.js +1 -0
- package/dist/esm/src/arch/tvm/index.js.map +1 -1
- package/dist/esm/src/relayFeeCalculator/chain-queries/factory.js +8 -2
- package/dist/esm/src/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/esm/src/relayFeeCalculator/chain-queries/index.d.ts +1 -0
- package/dist/esm/src/relayFeeCalculator/chain-queries/index.js +1 -0
- package/dist/esm/src/relayFeeCalculator/chain-queries/index.js.map +1 -1
- package/dist/esm/src/relayFeeCalculator/chain-queries/tvmQuery.d.ts +16 -0
- package/dist/esm/src/relayFeeCalculator/chain-queries/tvmQuery.js +18 -0
- package/dist/esm/src/relayFeeCalculator/chain-queries/tvmQuery.js.map +1 -0
- package/dist/esm/src/utils/abi/typechain/TronMulticallHandler.d.ts +153 -0
- package/dist/esm/src/utils/abi/typechain/TronMulticallHandler.js +2 -0
- package/dist/esm/src/utils/abi/typechain/TronMulticallHandler.js.map +1 -0
- package/dist/esm/src/utils/abi/typechain/factories/TronMulticallHandler__factory.d.ts +231 -0
- package/dist/esm/src/utils/abi/typechain/factories/TronMulticallHandler__factory.js +305 -0
- package/dist/esm/src/utils/abi/typechain/factories/TronMulticallHandler__factory.js.map +1 -0
- package/dist/esm/src/utils/abi/typechain/factories/index.d.ts +1 -0
- package/dist/esm/src/utils/abi/typechain/factories/index.js +1 -0
- package/dist/esm/src/utils/abi/typechain/factories/index.js.map +1 -1
- package/dist/esm/src/utils/abi/typechain/index.d.ts +2 -0
- package/dist/esm/src/utils/abi/typechain/index.js +1 -0
- package/dist/esm/src/utils/abi/typechain/index.js.map +1 -1
- package/dist/types/src/arch/tvm/MessageUtils.d.ts +23 -0
- package/dist/types/src/arch/tvm/MessageUtils.d.ts.map +1 -0
- package/dist/types/src/arch/tvm/index.d.ts +1 -0
- package/dist/types/src/arch/tvm/index.d.ts.map +1 -1
- package/dist/types/src/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/src/relayFeeCalculator/chain-queries/index.d.ts +1 -0
- package/dist/types/src/relayFeeCalculator/chain-queries/index.d.ts.map +1 -1
- package/dist/types/src/relayFeeCalculator/chain-queries/tvmQuery.d.ts +17 -0
- package/dist/types/src/relayFeeCalculator/chain-queries/tvmQuery.d.ts.map +1 -0
- package/dist/types/src/utils/abi/typechain/TronMulticallHandler.d.ts +154 -0
- package/dist/types/src/utils/abi/typechain/TronMulticallHandler.d.ts.map +1 -0
- package/dist/types/src/utils/abi/typechain/factories/TronMulticallHandler__factory.d.ts +232 -0
- package/dist/types/src/utils/abi/typechain/factories/TronMulticallHandler__factory.d.ts.map +1 -0
- package/dist/types/src/utils/abi/typechain/factories/index.d.ts +1 -0
- package/dist/types/src/utils/abi/typechain/factories/index.d.ts.map +1 -1
- package/dist/types/src/utils/abi/typechain/index.d.ts +2 -0
- package/dist/types/src/utils/abi/typechain/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/arch/tvm/MessageUtils.ts +72 -0
- package/src/arch/tvm/index.ts +1 -0
- package/src/relayFeeCalculator/chain-queries/factory.ts +8 -2
- package/src/relayFeeCalculator/chain-queries/index.ts +1 -0
- package/src/relayFeeCalculator/chain-queries/tvmQuery.ts +20 -0
- package/src/utils/abi/contracts/TronMulticallHandler.json +291 -0
- package/src/utils/abi/typechain/TronMulticallHandler.ts +327 -0
- package/src/utils/abi/typechain/factories/TronMulticallHandler__factory.ts +319 -0
- package/src/utils/abi/typechain/factories/index.ts +1 -0
- package/src/utils/abi/typechain/index.ts +2 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RelayData, SpeedUpCommon } from "../../interfaces";
|
|
2
|
+
import { BigNumber } from "../../utils";
|
|
3
|
+
export declare function getAuxiliaryNativeTokenCost(deposit: RelayData & Partial<SpeedUpCommon> & {
|
|
4
|
+
speedUpSignature?: string;
|
|
5
|
+
}): BigNumber;
|
|
6
|
+
export declare const tvmBandwidthCostZero: BigNumber;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tvmBandwidthCostZero = void 0;
|
|
4
|
+
exports.getAuxiliaryNativeTokenCost = getAuxiliaryNativeTokenCost;
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const TVM_BANDWIDTH_SUN_PER_BYTE = 1000;
|
|
7
|
+
const TVM_RAW_DATA_OVERHEAD_BYTES = 290;
|
|
8
|
+
const TVM_FILL_RELAY_FIXED_CALLDATA_BYTES = 4 + 96 + 384 + 32;
|
|
9
|
+
const TVM_SPEED_UP_FIXED_CALLDATA_EXTRA_BYTES = 128 + 32 + 32 + 96;
|
|
10
|
+
function paddedMessageByteLength(message) {
|
|
11
|
+
if (!(0, utils_1.isDefined)(message) || (0, utils_1.isMessageEmpty)(message))
|
|
12
|
+
return 0;
|
|
13
|
+
const bytes = Math.max(0, Math.floor((message.length - 2) / 2));
|
|
14
|
+
return Math.ceil(bytes / 32) * 32;
|
|
15
|
+
}
|
|
16
|
+
function getAuxiliaryNativeTokenCost(deposit) {
|
|
17
|
+
const paddedMessageBytes = paddedMessageByteLength(deposit.message);
|
|
18
|
+
let speedUpExtraBytes = 0;
|
|
19
|
+
if ((0, utils_1.isDefined)(deposit.speedUpSignature) && deposit.speedUpSignature !== "0x") {
|
|
20
|
+
speedUpExtraBytes = TVM_SPEED_UP_FIXED_CALLDATA_EXTRA_BYTES + paddedMessageByteLength(deposit.updatedMessage);
|
|
21
|
+
}
|
|
22
|
+
const calldataBytes = TVM_FILL_RELAY_FIXED_CALLDATA_BYTES + paddedMessageBytes + speedUpExtraBytes;
|
|
23
|
+
const txBytes = TVM_RAW_DATA_OVERHEAD_BYTES + calldataBytes;
|
|
24
|
+
return (0, utils_1.toBN)(txBytes).mul(TVM_BANDWIDTH_SUN_PER_BYTE);
|
|
25
|
+
}
|
|
26
|
+
exports.tvmBandwidthCostZero = utils_1.bnZero;
|
|
27
|
+
//# sourceMappingURL=MessageUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageUtils.js","sourceRoot":"","sources":["../../../../../src/arch/tvm/MessageUtils.ts"],"names":[],"mappings":";;;AAsDA,kEAcC;AAnED,uCAAiF;AAKjF,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAKxC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAQxC,MAAM,mCAAmC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;AAW9D,MAAM,uCAAuC,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEnE,SAAS,uBAAuB,CAAC,OAA2B;IAC1D,IAAI,CAAC,IAAA,iBAAS,EAAC,OAAO,CAAC,IAAI,IAAA,sBAAc,EAAC,OAAO,CAAC;QAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;AACpC,CAAC;AAkBD,SAAgB,2BAA2B,CACzC,OAA2E;IAE3E,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpE,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,IAAI,IAAA,iBAAS,EAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAC7E,iBAAiB,GAAG,uCAAuC,GAAG,uBAAuB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAChH,CAAC;IAED,MAAM,aAAa,GAAG,mCAAmC,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;IACnG,MAAM,OAAO,GAAG,2BAA2B,GAAG,aAAa,CAAC;IAE5D,OAAO,IAAA,YAAI,EAAC,OAAO,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACvD,CAAC;AAGY,QAAA,oBAAoB,GAAG,cAAM,CAAC"}
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./SpokeUtils"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./TransactionUtils"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./MessageUtils"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/arch/tvm/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,6DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/arch/tvm/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,6DAAmC;AACnC,yDAA+B"}
|
|
@@ -12,6 +12,7 @@ const baseQuery_1 = require("./baseQuery");
|
|
|
12
12
|
const relayFeeCalculator_1 = require("../relayFeeCalculator");
|
|
13
13
|
const customGasToken_1 = require("./customGasToken");
|
|
14
14
|
const svmQuery_1 = require("./svmQuery");
|
|
15
|
+
const tvmQuery_1 = require("./tvmQuery");
|
|
15
16
|
const fixedGasPrice = {
|
|
16
17
|
[constants_1.CHAIN_IDs.BOBA]: 1e9,
|
|
17
18
|
};
|
|
@@ -21,7 +22,8 @@ class QueryBase__factory {
|
|
|
21
22
|
const customGasTokenSymbol = constants_2.CUSTOM_GAS_TOKENS[chainId];
|
|
22
23
|
if ((0, utils_1.chainIsEvm)(chainId) && (0, utils_1.isDefined)(customGasTokenSymbol)) {
|
|
23
24
|
(0, assert_1.default)(relayerAddress.isEVM());
|
|
24
|
-
|
|
25
|
+
const QueryCtor = (0, utils_1.chainIsTvm)(chainId) ? tvmQuery_1.TvmQuery : customGasToken_1.CustomGasTokenQueries;
|
|
26
|
+
return new QueryCtor({
|
|
25
27
|
queryBaseArgs: [
|
|
26
28
|
provider,
|
|
27
29
|
symbolMapping,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0DAA0E;AAC1E,0DAAgE;AAChE,2CAAiD;AAEjD,+CAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0DAA0E;AAC1E,0DAAgE;AAChE,2CAAiD;AAEjD,+CAAoD;AACpD,uCAAwG;AACxG,2CAAwC;AAExC,8DAAkF;AAClF,qDAAyD;AACzD,yCAAsC;AACtC,yCAAsC;AAMtC,MAAM,aAAa,GAAG;IACpB,CAAC,qBAAS,CAAC,IAAI,CAAC,EAAE,GAAG;CACtB,CAAC;AAEF,MAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CACX,OAAe,EACf,QAA0C,EAC1C,aAAa,GAAG,6BAAiB,EACjC,gBAAgB,GAAG,IAAA,8BAAkB,EAAC,WAAW,EAAE,OAAO,CAAC,EAC3D,cAAc,GAAG,IAAA,sCAAiB,EAAC,OAAO,CAAC,EAC3C,kBAA2B,EAC3B,SAAiB,mCAAc,EAC/B,qBAAqB,GAAG,KAAK;QAE7B,IAAA,gBAAM,EAAC,IAAA,iBAAS,EAAC,gBAAgB,CAAC,CAAC,CAAC;QAEpC,MAAM,oBAAoB,GAAG,6BAAiB,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,IAAA,kBAAU,EAAC,OAAO,CAAC,IAAI,IAAA,iBAAS,EAAC,oBAAoB,CAAC,EAAE,CAAC;YAC3D,IAAA,gBAAM,EAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC;YAK/B,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAQ,CAAC,CAAC,CAAC,sCAAqB,CAAC;YACzE,OAAO,IAAI,SAAS,CAAC;gBACnB,aAAa,EAAE;oBACb,QAA8B;oBAC9B,aAAa;oBACb,gBAAgB;oBAChB,cAAc;oBACd,MAAM;oBACN,kBAAkB;oBAClB,aAAa,CAAC,OAAO,CAAC;oBACtB,KAAK;iBACN;gBACD,oBAAoB;aACrB,CAAC,CAAC;QACL,CAAC;QACD,IAAI,IAAA,kBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACxB,IAAA,gBAAM,EAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC;YAC/B,OAAO,IAAI,mBAAQ,CACjB,QAAuB,EACvB,aAAa,EACb,kBAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACjC,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CACtB,CAAC;QACJ,CAAC;QAGD,QAAQ,GAAG,IAAA,sBAAc,EAAC,OAAO,CAAC;YAChC,CAAC,CAAC,IAAA,kBAAY,EAAC,QAA8B,CAAC;YAC9C,CAAC,CAAE,QAA+B,CAAC;QAErC,IAAA,gBAAM,EAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/B,OAAO,IAAI,qBAAS,CAClB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CACtB,CAAC;IACJ,CAAC;CACF;AAlED,gDAkEC"}
|
|
@@ -5,4 +5,5 @@ tslib_1.__exportStar(require("./baseQuery"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./factory"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./customGasToken"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./svmQuery"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./tvmQuery"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,qDAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,qDAA2B;AAC3B,qDAA2B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RelayData } from "../../interfaces";
|
|
2
|
+
import { BigNumber } from "../../utils";
|
|
3
|
+
import { CustomGasTokenQueries } from "./customGasToken";
|
|
4
|
+
export declare class TvmQuery extends CustomGasTokenQueries {
|
|
5
|
+
getAuxiliaryNativeTokenCost(deposit: RelayData): BigNumber;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TvmQuery = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
const customGasToken_1 = require("./customGasToken");
|
|
6
|
+
class TvmQuery extends customGasToken_1.CustomGasTokenQueries {
|
|
7
|
+
getAuxiliaryNativeTokenCost(deposit) {
|
|
8
|
+
return __1.arch.tvm.getAuxiliaryNativeTokenCost(deposit);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TvmQuery = TvmQuery;
|
|
12
|
+
//# sourceMappingURL=tvmQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tvmQuery.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/tvmQuery.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAG7B,qDAAyD;AAYzD,MAAa,QAAS,SAAQ,sCAAqB;IACxC,2BAA2B,CAAC,OAAkB;QACrD,OAAO,QAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AAJD,4BAIC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
|
+
import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common";
|
|
5
|
+
export declare namespace MulticallHandler {
|
|
6
|
+
type CallStruct = {
|
|
7
|
+
target: string;
|
|
8
|
+
callData: BytesLike;
|
|
9
|
+
value: BigNumberish;
|
|
10
|
+
};
|
|
11
|
+
type CallStructOutput = [string, string, BigNumber] & {
|
|
12
|
+
target: string;
|
|
13
|
+
callData: string;
|
|
14
|
+
value: BigNumber;
|
|
15
|
+
};
|
|
16
|
+
type ReplacementStruct = {
|
|
17
|
+
token: string;
|
|
18
|
+
offset: BigNumberish;
|
|
19
|
+
};
|
|
20
|
+
type ReplacementStructOutput = [string, BigNumber] & {
|
|
21
|
+
token: string;
|
|
22
|
+
offset: BigNumber;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface TronMulticallHandlerInterface extends utils.Interface {
|
|
26
|
+
functions: {
|
|
27
|
+
"attemptCalls((address,bytes,uint256)[])": FunctionFragment;
|
|
28
|
+
"drainLeftoverTokens(address,address)": FunctionFragment;
|
|
29
|
+
"handleV3AcrossMessage(address,uint256,address,bytes)": FunctionFragment;
|
|
30
|
+
"makeCallWithBalance(address,bytes,uint256,(address,uint256)[])": FunctionFragment;
|
|
31
|
+
};
|
|
32
|
+
getFunction(nameOrSignatureOrTopic: "attemptCalls" | "drainLeftoverTokens" | "handleV3AcrossMessage" | "makeCallWithBalance"): FunctionFragment;
|
|
33
|
+
encodeFunctionData(functionFragment: "attemptCalls", values: [MulticallHandler.CallStruct[]]): string;
|
|
34
|
+
encodeFunctionData(functionFragment: "drainLeftoverTokens", values: [string, string]): string;
|
|
35
|
+
encodeFunctionData(functionFragment: "handleV3AcrossMessage", values: [string, BigNumberish, string, BytesLike]): string;
|
|
36
|
+
encodeFunctionData(functionFragment: "makeCallWithBalance", values: [
|
|
37
|
+
string,
|
|
38
|
+
BytesLike,
|
|
39
|
+
BigNumberish,
|
|
40
|
+
MulticallHandler.ReplacementStruct[]
|
|
41
|
+
]): string;
|
|
42
|
+
decodeFunctionResult(functionFragment: "attemptCalls", data: BytesLike): Result;
|
|
43
|
+
decodeFunctionResult(functionFragment: "drainLeftoverTokens", data: BytesLike): Result;
|
|
44
|
+
decodeFunctionResult(functionFragment: "handleV3AcrossMessage", data: BytesLike): Result;
|
|
45
|
+
decodeFunctionResult(functionFragment: "makeCallWithBalance", data: BytesLike): Result;
|
|
46
|
+
events: {
|
|
47
|
+
"CallsFailed((address,bytes,uint256)[],address)": EventFragment;
|
|
48
|
+
"DrainedTokens(address,address,uint256)": EventFragment;
|
|
49
|
+
};
|
|
50
|
+
getEvent(nameOrSignatureOrTopic: "CallsFailed"): EventFragment;
|
|
51
|
+
getEvent(nameOrSignatureOrTopic: "DrainedTokens"): EventFragment;
|
|
52
|
+
}
|
|
53
|
+
export interface CallsFailedEventObject {
|
|
54
|
+
calls: MulticallHandler.CallStructOutput[];
|
|
55
|
+
fallbackRecipient: string;
|
|
56
|
+
}
|
|
57
|
+
export type CallsFailedEvent = TypedEvent<[
|
|
58
|
+
MulticallHandler.CallStructOutput[],
|
|
59
|
+
string
|
|
60
|
+
], CallsFailedEventObject>;
|
|
61
|
+
export type CallsFailedEventFilter = TypedEventFilter<CallsFailedEvent>;
|
|
62
|
+
export interface DrainedTokensEventObject {
|
|
63
|
+
recipient: string;
|
|
64
|
+
token: string;
|
|
65
|
+
amount: BigNumber;
|
|
66
|
+
}
|
|
67
|
+
export type DrainedTokensEvent = TypedEvent<[
|
|
68
|
+
string,
|
|
69
|
+
string,
|
|
70
|
+
BigNumber
|
|
71
|
+
], DrainedTokensEventObject>;
|
|
72
|
+
export type DrainedTokensEventFilter = TypedEventFilter<DrainedTokensEvent>;
|
|
73
|
+
export interface TronMulticallHandler extends BaseContract {
|
|
74
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
75
|
+
attach(addressOrName: string): this;
|
|
76
|
+
deployed(): Promise<this>;
|
|
77
|
+
interface: TronMulticallHandlerInterface;
|
|
78
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
79
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
80
|
+
listeners(eventName?: string): Array<Listener>;
|
|
81
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
82
|
+
removeAllListeners(eventName?: string): this;
|
|
83
|
+
off: OnEvent<this>;
|
|
84
|
+
on: OnEvent<this>;
|
|
85
|
+
once: OnEvent<this>;
|
|
86
|
+
removeListener: OnEvent<this>;
|
|
87
|
+
functions: {
|
|
88
|
+
attemptCalls(calls: MulticallHandler.CallStruct[], overrides?: Overrides & {
|
|
89
|
+
from?: string;
|
|
90
|
+
}): Promise<ContractTransaction>;
|
|
91
|
+
drainLeftoverTokens(token: string, destination: string, overrides?: Overrides & {
|
|
92
|
+
from?: string;
|
|
93
|
+
}): Promise<ContractTransaction>;
|
|
94
|
+
handleV3AcrossMessage(token: string, arg1: BigNumberish, arg2: string, message: BytesLike, overrides?: Overrides & {
|
|
95
|
+
from?: string;
|
|
96
|
+
}): Promise<ContractTransaction>;
|
|
97
|
+
makeCallWithBalance(target: string, callData: BytesLike, value: BigNumberish, replacement: MulticallHandler.ReplacementStruct[], overrides?: Overrides & {
|
|
98
|
+
from?: string;
|
|
99
|
+
}): Promise<ContractTransaction>;
|
|
100
|
+
};
|
|
101
|
+
attemptCalls(calls: MulticallHandler.CallStruct[], overrides?: Overrides & {
|
|
102
|
+
from?: string;
|
|
103
|
+
}): Promise<ContractTransaction>;
|
|
104
|
+
drainLeftoverTokens(token: string, destination: string, overrides?: Overrides & {
|
|
105
|
+
from?: string;
|
|
106
|
+
}): Promise<ContractTransaction>;
|
|
107
|
+
handleV3AcrossMessage(token: string, arg1: BigNumberish, arg2: string, message: BytesLike, overrides?: Overrides & {
|
|
108
|
+
from?: string;
|
|
109
|
+
}): Promise<ContractTransaction>;
|
|
110
|
+
makeCallWithBalance(target: string, callData: BytesLike, value: BigNumberish, replacement: MulticallHandler.ReplacementStruct[], overrides?: Overrides & {
|
|
111
|
+
from?: string;
|
|
112
|
+
}): Promise<ContractTransaction>;
|
|
113
|
+
callStatic: {
|
|
114
|
+
attemptCalls(calls: MulticallHandler.CallStruct[], overrides?: CallOverrides): Promise<void>;
|
|
115
|
+
drainLeftoverTokens(token: string, destination: string, overrides?: CallOverrides): Promise<void>;
|
|
116
|
+
handleV3AcrossMessage(token: string, arg1: BigNumberish, arg2: string, message: BytesLike, overrides?: CallOverrides): Promise<void>;
|
|
117
|
+
makeCallWithBalance(target: string, callData: BytesLike, value: BigNumberish, replacement: MulticallHandler.ReplacementStruct[], overrides?: CallOverrides): Promise<void>;
|
|
118
|
+
};
|
|
119
|
+
filters: {
|
|
120
|
+
"CallsFailed((address,bytes,uint256)[],address)"(calls?: null, fallbackRecipient?: string | null): CallsFailedEventFilter;
|
|
121
|
+
CallsFailed(calls?: null, fallbackRecipient?: string | null): CallsFailedEventFilter;
|
|
122
|
+
"DrainedTokens(address,address,uint256)"(recipient?: string | null, token?: string | null, amount?: BigNumberish | null): DrainedTokensEventFilter;
|
|
123
|
+
DrainedTokens(recipient?: string | null, token?: string | null, amount?: BigNumberish | null): DrainedTokensEventFilter;
|
|
124
|
+
};
|
|
125
|
+
estimateGas: {
|
|
126
|
+
attemptCalls(calls: MulticallHandler.CallStruct[], overrides?: Overrides & {
|
|
127
|
+
from?: string;
|
|
128
|
+
}): Promise<BigNumber>;
|
|
129
|
+
drainLeftoverTokens(token: string, destination: string, overrides?: Overrides & {
|
|
130
|
+
from?: string;
|
|
131
|
+
}): Promise<BigNumber>;
|
|
132
|
+
handleV3AcrossMessage(token: string, arg1: BigNumberish, arg2: string, message: BytesLike, overrides?: Overrides & {
|
|
133
|
+
from?: string;
|
|
134
|
+
}): Promise<BigNumber>;
|
|
135
|
+
makeCallWithBalance(target: string, callData: BytesLike, value: BigNumberish, replacement: MulticallHandler.ReplacementStruct[], overrides?: Overrides & {
|
|
136
|
+
from?: string;
|
|
137
|
+
}): Promise<BigNumber>;
|
|
138
|
+
};
|
|
139
|
+
populateTransaction: {
|
|
140
|
+
attemptCalls(calls: MulticallHandler.CallStruct[], overrides?: Overrides & {
|
|
141
|
+
from?: string;
|
|
142
|
+
}): Promise<PopulatedTransaction>;
|
|
143
|
+
drainLeftoverTokens(token: string, destination: string, overrides?: Overrides & {
|
|
144
|
+
from?: string;
|
|
145
|
+
}): Promise<PopulatedTransaction>;
|
|
146
|
+
handleV3AcrossMessage(token: string, arg1: BigNumberish, arg2: string, message: BytesLike, overrides?: Overrides & {
|
|
147
|
+
from?: string;
|
|
148
|
+
}): Promise<PopulatedTransaction>;
|
|
149
|
+
makeCallWithBalance(target: string, callData: BytesLike, value: BigNumberish, replacement: MulticallHandler.ReplacementStruct[], overrides?: Overrides & {
|
|
150
|
+
from?: string;
|
|
151
|
+
}): Promise<PopulatedTransaction>;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TronMulticallHandler.js","sourceRoot":"","sources":["../../../../../../src/utils/abi/typechain/TronMulticallHandler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import type { Provider } from "@ethersproject/providers";
|
|
3
|
+
import type { TronMulticallHandler, TronMulticallHandlerInterface } from "../TronMulticallHandler";
|
|
4
|
+
export declare class TronMulticallHandler__factory {
|
|
5
|
+
static readonly abi: readonly [{
|
|
6
|
+
readonly type: "receive";
|
|
7
|
+
readonly stateMutability: "payable";
|
|
8
|
+
}, {
|
|
9
|
+
readonly type: "function";
|
|
10
|
+
readonly name: "attemptCalls";
|
|
11
|
+
readonly inputs: readonly [{
|
|
12
|
+
readonly name: "calls";
|
|
13
|
+
readonly type: "tuple[]";
|
|
14
|
+
readonly internalType: "struct MulticallHandler.Call[]";
|
|
15
|
+
readonly components: readonly [{
|
|
16
|
+
readonly name: "target";
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
readonly internalType: "address";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "callData";
|
|
21
|
+
readonly type: "bytes";
|
|
22
|
+
readonly internalType: "bytes";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "value";
|
|
25
|
+
readonly type: "uint256";
|
|
26
|
+
readonly internalType: "uint256";
|
|
27
|
+
}];
|
|
28
|
+
}];
|
|
29
|
+
readonly outputs: readonly [];
|
|
30
|
+
readonly stateMutability: "nonpayable";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "function";
|
|
33
|
+
readonly name: "drainLeftoverTokens";
|
|
34
|
+
readonly inputs: readonly [{
|
|
35
|
+
readonly name: "token";
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
readonly internalType: "address";
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "destination";
|
|
40
|
+
readonly type: "address";
|
|
41
|
+
readonly internalType: "address payable";
|
|
42
|
+
}];
|
|
43
|
+
readonly outputs: readonly [];
|
|
44
|
+
readonly stateMutability: "nonpayable";
|
|
45
|
+
}, {
|
|
46
|
+
readonly type: "function";
|
|
47
|
+
readonly name: "handleV3AcrossMessage";
|
|
48
|
+
readonly inputs: readonly [{
|
|
49
|
+
readonly name: "token";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
readonly internalType: "address";
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "";
|
|
54
|
+
readonly type: "uint256";
|
|
55
|
+
readonly internalType: "uint256";
|
|
56
|
+
}, {
|
|
57
|
+
readonly name: "";
|
|
58
|
+
readonly type: "address";
|
|
59
|
+
readonly internalType: "address";
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "message";
|
|
62
|
+
readonly type: "bytes";
|
|
63
|
+
readonly internalType: "bytes";
|
|
64
|
+
}];
|
|
65
|
+
readonly outputs: readonly [];
|
|
66
|
+
readonly stateMutability: "nonpayable";
|
|
67
|
+
}, {
|
|
68
|
+
readonly type: "function";
|
|
69
|
+
readonly name: "makeCallWithBalance";
|
|
70
|
+
readonly inputs: readonly [{
|
|
71
|
+
readonly name: "target";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
readonly internalType: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "callData";
|
|
76
|
+
readonly type: "bytes";
|
|
77
|
+
readonly internalType: "bytes";
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "value";
|
|
80
|
+
readonly type: "uint256";
|
|
81
|
+
readonly internalType: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "replacement";
|
|
84
|
+
readonly type: "tuple[]";
|
|
85
|
+
readonly internalType: "struct MulticallHandler.Replacement[]";
|
|
86
|
+
readonly components: readonly [{
|
|
87
|
+
readonly name: "token";
|
|
88
|
+
readonly type: "address";
|
|
89
|
+
readonly internalType: "address";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "offset";
|
|
92
|
+
readonly type: "uint256";
|
|
93
|
+
readonly internalType: "uint256";
|
|
94
|
+
}];
|
|
95
|
+
}];
|
|
96
|
+
readonly outputs: readonly [];
|
|
97
|
+
readonly stateMutability: "nonpayable";
|
|
98
|
+
}, {
|
|
99
|
+
readonly type: "event";
|
|
100
|
+
readonly name: "CallsFailed";
|
|
101
|
+
readonly inputs: readonly [{
|
|
102
|
+
readonly name: "calls";
|
|
103
|
+
readonly type: "tuple[]";
|
|
104
|
+
readonly indexed: false;
|
|
105
|
+
readonly internalType: "struct MulticallHandler.Call[]";
|
|
106
|
+
readonly components: readonly [{
|
|
107
|
+
readonly name: "target";
|
|
108
|
+
readonly type: "address";
|
|
109
|
+
readonly internalType: "address";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "callData";
|
|
112
|
+
readonly type: "bytes";
|
|
113
|
+
readonly internalType: "bytes";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "value";
|
|
116
|
+
readonly type: "uint256";
|
|
117
|
+
readonly internalType: "uint256";
|
|
118
|
+
}];
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "fallbackRecipient";
|
|
121
|
+
readonly type: "address";
|
|
122
|
+
readonly indexed: true;
|
|
123
|
+
readonly internalType: "address";
|
|
124
|
+
}];
|
|
125
|
+
readonly anonymous: false;
|
|
126
|
+
}, {
|
|
127
|
+
readonly type: "event";
|
|
128
|
+
readonly name: "DrainedTokens";
|
|
129
|
+
readonly inputs: readonly [{
|
|
130
|
+
readonly name: "recipient";
|
|
131
|
+
readonly type: "address";
|
|
132
|
+
readonly indexed: true;
|
|
133
|
+
readonly internalType: "address";
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "token";
|
|
136
|
+
readonly type: "address";
|
|
137
|
+
readonly indexed: true;
|
|
138
|
+
readonly internalType: "address";
|
|
139
|
+
}, {
|
|
140
|
+
readonly name: "amount";
|
|
141
|
+
readonly type: "uint256";
|
|
142
|
+
readonly indexed: true;
|
|
143
|
+
readonly internalType: "uint256";
|
|
144
|
+
}];
|
|
145
|
+
readonly anonymous: false;
|
|
146
|
+
}, {
|
|
147
|
+
readonly type: "error";
|
|
148
|
+
readonly name: "CallReverted";
|
|
149
|
+
readonly inputs: readonly [{
|
|
150
|
+
readonly name: "index";
|
|
151
|
+
readonly type: "uint256";
|
|
152
|
+
readonly internalType: "uint256";
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "calls";
|
|
155
|
+
readonly type: "tuple[]";
|
|
156
|
+
readonly internalType: "struct MulticallHandler.Call[]";
|
|
157
|
+
readonly components: readonly [{
|
|
158
|
+
readonly name: "target";
|
|
159
|
+
readonly type: "address";
|
|
160
|
+
readonly internalType: "address";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "callData";
|
|
163
|
+
readonly type: "bytes";
|
|
164
|
+
readonly internalType: "bytes";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "value";
|
|
167
|
+
readonly type: "uint256";
|
|
168
|
+
readonly internalType: "uint256";
|
|
169
|
+
}];
|
|
170
|
+
}];
|
|
171
|
+
}, {
|
|
172
|
+
readonly type: "error";
|
|
173
|
+
readonly name: "CalldataTooShort";
|
|
174
|
+
readonly inputs: readonly [{
|
|
175
|
+
readonly name: "callDataLength";
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
readonly internalType: "uint256";
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "offset";
|
|
180
|
+
readonly type: "uint256";
|
|
181
|
+
readonly internalType: "uint256";
|
|
182
|
+
}];
|
|
183
|
+
}, {
|
|
184
|
+
readonly type: "error";
|
|
185
|
+
readonly name: "InvalidCall";
|
|
186
|
+
readonly inputs: readonly [{
|
|
187
|
+
readonly name: "index";
|
|
188
|
+
readonly type: "uint256";
|
|
189
|
+
readonly internalType: "uint256";
|
|
190
|
+
}, {
|
|
191
|
+
readonly name: "calls";
|
|
192
|
+
readonly type: "tuple[]";
|
|
193
|
+
readonly internalType: "struct MulticallHandler.Call[]";
|
|
194
|
+
readonly components: readonly [{
|
|
195
|
+
readonly name: "target";
|
|
196
|
+
readonly type: "address";
|
|
197
|
+
readonly internalType: "address";
|
|
198
|
+
}, {
|
|
199
|
+
readonly name: "callData";
|
|
200
|
+
readonly type: "bytes";
|
|
201
|
+
readonly internalType: "bytes";
|
|
202
|
+
}, {
|
|
203
|
+
readonly name: "value";
|
|
204
|
+
readonly type: "uint256";
|
|
205
|
+
readonly internalType: "uint256";
|
|
206
|
+
}];
|
|
207
|
+
}];
|
|
208
|
+
}, {
|
|
209
|
+
readonly type: "error";
|
|
210
|
+
readonly name: "NotSelf";
|
|
211
|
+
readonly inputs: readonly [];
|
|
212
|
+
}, {
|
|
213
|
+
readonly type: "error";
|
|
214
|
+
readonly name: "ReplacementCallFailed";
|
|
215
|
+
readonly inputs: readonly [{
|
|
216
|
+
readonly name: "callData";
|
|
217
|
+
readonly type: "bytes";
|
|
218
|
+
readonly internalType: "bytes";
|
|
219
|
+
}];
|
|
220
|
+
}, {
|
|
221
|
+
readonly type: "error";
|
|
222
|
+
readonly name: "TronTransferBalanceMismatch";
|
|
223
|
+
readonly inputs: readonly [];
|
|
224
|
+
}, {
|
|
225
|
+
readonly type: "error";
|
|
226
|
+
readonly name: "TronTransferCallReverted";
|
|
227
|
+
readonly inputs: readonly [];
|
|
228
|
+
}];
|
|
229
|
+
static createInterface(): TronMulticallHandlerInterface;
|
|
230
|
+
static connect(address: string, signerOrProvider: Signer | Provider): TronMulticallHandler;
|
|
231
|
+
}
|