@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
|
@@ -3,11 +3,12 @@ import { CHAIN_IDs, TOKEN_SYMBOLS_MAP } from "@across-protocol/constants";
|
|
|
3
3
|
import { getDeployedAddress } from "@across-protocol/contracts";
|
|
4
4
|
import { asL2Provider } from "@eth-optimism/sdk";
|
|
5
5
|
import { CUSTOM_GAS_TOKENS } from "../../constants";
|
|
6
|
-
import { chainIsEvm, chainIsOPStack, isDefined, chainIsSvm, SvmAddress } from "../../utils";
|
|
6
|
+
import { chainIsEvm, chainIsOPStack, isDefined, chainIsSvm, chainIsTvm, SvmAddress } from "../../utils";
|
|
7
7
|
import { QueryBase } from "./baseQuery";
|
|
8
8
|
import { DEFAULT_LOGGER, getDefaultRelayer } from "../relayFeeCalculator";
|
|
9
9
|
import { CustomGasTokenQueries } from "./customGasToken";
|
|
10
10
|
import { SvmQuery } from "./svmQuery";
|
|
11
|
+
import { TvmQuery } from "./tvmQuery";
|
|
11
12
|
/**
|
|
12
13
|
* Some chains have a fixed gas price that is applied to the gas estimates. We should override
|
|
13
14
|
* the gas markup for these chains.
|
|
@@ -21,7 +22,12 @@ export class QueryBase__factory {
|
|
|
21
22
|
const customGasTokenSymbol = CUSTOM_GAS_TOKENS[chainId];
|
|
22
23
|
if (chainIsEvm(chainId) && isDefined(customGasTokenSymbol)) {
|
|
23
24
|
assert(relayerAddress.isEVM());
|
|
24
|
-
|
|
25
|
+
// TVM chains route through TvmQuery so that bandwidth — a Tron-native cost the
|
|
26
|
+
// EVM compatibility layer's `eth_estimateGas` does not surface — is included in
|
|
27
|
+
// `auxiliaryNativeTokenCost`. Otherwise fall back to the EVM-flavoured custom gas
|
|
28
|
+
// token query.
|
|
29
|
+
const QueryCtor = chainIsTvm(chainId) ? TvmQuery : CustomGasTokenQueries;
|
|
30
|
+
return new QueryCtor({
|
|
25
31
|
queryBaseArgs: [
|
|
26
32
|
provider,
|
|
27
33
|
symbolMapping,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/factory.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,M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AAC,QAA8B,CAAC;YAC9C,CAAC,CAAE,QAA+B,CAAC;QAErC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/B,OAAO,IAAI,SAAS,CAClB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,aAAa,CAAC,OAAO,CAAC,EACtB,qBAAqB,CACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RelayData } from "../../interfaces";
|
|
2
|
+
import { BigNumber } from "../../utils";
|
|
3
|
+
import { CustomGasTokenQueries } from "./customGasToken";
|
|
4
|
+
/**
|
|
5
|
+
* TVM (TRON) query implementation. Extends `CustomGasTokenQueries` to add bandwidth
|
|
6
|
+
* accounting via `getAuxiliaryNativeTokenCost`, which the base EVM path returns 0 for.
|
|
7
|
+
*
|
|
8
|
+
* Energy (Tron's analogue of gas) is already estimated by `voidSigner.estimateGas`
|
|
9
|
+
* against the EVM-compat RPC and surfaces in `tokenGasCost`. Bandwidth is a separate
|
|
10
|
+
* Tron-native resource that the EVM compatibility layer does not surface, so we
|
|
11
|
+
* estimate it here from the deposit's `message` length and a fixed `fillRelay`
|
|
12
|
+
* calldata footprint.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TvmQuery extends CustomGasTokenQueries {
|
|
15
|
+
getAuxiliaryNativeTokenCost(deposit: RelayData): BigNumber;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { arch } from "../..";
|
|
2
|
+
import { CustomGasTokenQueries } from "./customGasToken";
|
|
3
|
+
/**
|
|
4
|
+
* TVM (TRON) query implementation. Extends `CustomGasTokenQueries` to add bandwidth
|
|
5
|
+
* accounting via `getAuxiliaryNativeTokenCost`, which the base EVM path returns 0 for.
|
|
6
|
+
*
|
|
7
|
+
* Energy (Tron's analogue of gas) is already estimated by `voidSigner.estimateGas`
|
|
8
|
+
* against the EVM-compat RPC and surfaces in `tokenGasCost`. Bandwidth is a separate
|
|
9
|
+
* Tron-native resource that the EVM compatibility layer does not surface, so we
|
|
10
|
+
* estimate it here from the deposit's `message` length and a fixed `fillRelay`
|
|
11
|
+
* calldata footprint.
|
|
12
|
+
*/
|
|
13
|
+
export class TvmQuery extends CustomGasTokenQueries {
|
|
14
|
+
getAuxiliaryNativeTokenCost(deposit) {
|
|
15
|
+
return arch.tvm.getAuxiliaryNativeTokenCost(deposit);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=tvmQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tvmQuery.js","sourceRoot":"","sources":["../../../../../src/relayFeeCalculator/chain-queries/tvmQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,OAAO,QAAS,SAAQ,qBAAqB;IACxC,2BAA2B,CAAC,OAAkB;QACrD,OAAO,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -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
|
+
}
|