@paraswap/dex-lib 4.8.30 → 4.8.31
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/build/dex/cables/constants.d.ts +1 -1
- package/build/dex/cables/constants.js +1 -1
- package/build/dex/dexalot/constants.d.ts +1 -1
- package/build/dex/dexalot/constants.js +1 -1
- package/build/dex/generic-rfq/rate-fetcher.js +1 -1
- package/build/dex/swaap-v2/constants.d.ts +1 -1
- package/build/dex/swaap-v2/constants.js +1 -1
- package/build/dex/uniswap-v3/contract-math/native-bridge.js +1 -1
- package/build/dex/uniswap-v3/contract-math/native-bridge.js.map +1 -1
- package/build/dex/uniswap-v4/api-go/compare-pricing.d.ts +1 -0
- package/build/dex/uniswap-v4/api-go/compare-pricing.js +187 -0
- package/build/dex/uniswap-v4/api-go/compare-pricing.js.map +1 -0
- package/build/dex/uniswap-v4/api-go/compare-states.d.ts +1 -0
- package/build/dex/uniswap-v4/api-go/compare-states.js +149 -0
- package/build/dex/uniswap-v4/api-go/compare-states.js.map +1 -0
- package/build/dex/uniswap-v4/api-go/fetch-pool-key.d.ts +0 -0
- package/build/dex/uniswap-v4/api-go/fetch-pool-key.js +140 -0
- package/build/dex/uniswap-v4/api-go/fetch-pool-key.js.map +1 -0
- package/build/tenderly-simulation.d.ts +221 -0
- package/build/tenderly-simulation.js +517 -0
- package/build/tenderly-simulation.js.map +1 -0
- package/package.json +1 -1
- package/build/abi/BProtocol.json +0 -1155
- package/build/abi/Jarvis.json +0 -1172
- package/build/abi/MStableAsset.json +0 -1545
- package/build/abi/OneInchLp.json +0 -1304
- package/build/abi/Onebit.json +0 -736
- package/build/abi/Shell.json +0 -1294
- package/build/abi/TraderJoeV2Router.json +0 -50
- package/build/abi/idle-dao/idle-cdo-factory.json +0 -38
- package/build/abi/idle-dao/idle-cdo.json +0 -1245
- package/build/abi/infusion/InfusionFactory.json +0 -147
- package/build/abi/infusion/InfusionPair.json +0 -658
- package/build/abi/infusion/InfusionRouter.json +0 -442
- package/build/abi/maker-psm/pot.json +0 -322
- package/build/abi/maker-psm/psm.json +0 -243
- package/build/abi/maker-psm/vat.json +0 -363
- package/build/abi/nomiswap-v2/nomiswap-v2-pool.json +0 -773
- package/build/abi/quick-perps/fast-price-events.json +0 -70
- package/build/abi/quick-perps/fast-price-feed.json +0 -741
- package/build/abi/quick-perps/reader.json +0 -313
- package/build/abi/quick-perps/vault-price-feed.json +0 -323
- package/build/abi/quick-perps/vault.json +0 -1953
- package/build/abi/uniswap-v2/excalibur-pool.json +0 -881
- package/build/abi/uniswap-v2/mdex-factory.json +0 -759
- package/build/abi/wUSDM.json +0 -757
- package/build/abi/zrx.v2.json +0 -1967
- package/build/abi/zrx.v3.json +0 -3454
- package/build/abi/zrx.v4.json +0 -2193
- package/build/dex/OneInchLp.d.ts +0 -24
- package/build/dex/OneInchLp.js +0 -43
- package/build/dex/OneInchLp.js.map +0 -1
- package/build/dex/bProtocol/bProtocol.d.ts +0 -15
- package/build/dex/bProtocol/bProtocol.js +0 -56
- package/build/dex/bProtocol/bProtocol.js.map +0 -1
- package/build/dex/bProtocol/types.d.ts +0 -11
- package/build/dex/bProtocol/types.js +0 -8
- package/build/dex/bProtocol/types.js.map +0 -1
- package/build/dex/ekubo/pools/base-pool.d.ts +0 -47
- package/build/dex/ekubo/pools/base-pool.js +0 -184
- package/build/dex/ekubo/pools/base-pool.js.map +0 -1
- package/build/dex/ekubo/pools/iface.d.ts +0 -46
- package/build/dex/ekubo/pools/iface.js +0 -75
- package/build/dex/ekubo/pools/iface.js.map +0 -1
- package/build/dex/ekubo/pools/math/price.d.ts +0 -7
- package/build/dex/ekubo/pools/math/price.js +0 -112
- package/build/dex/ekubo/pools/math/price.js.map +0 -1
- package/build/dex/ekubo/pools/oracle-pool.d.ts +0 -10
- package/build/dex/ekubo/pools/oracle-pool.js +0 -19
- package/build/dex/ekubo/pools/oracle-pool.js.map +0 -1
- package/build/dex/ekubo/pools/pool-utils.d.ts +0 -44
- package/build/dex/ekubo/pools/pool-utils.js +0 -240
- package/build/dex/ekubo/pools/pool-utils.js.map +0 -1
- package/build/dex/idle-dao/config.d.ts +0 -5
- package/build/dex/idle-dao/config.js +0 -24
- package/build/dex/idle-dao/config.js.map +0 -1
- package/build/dex/idle-dao/idle-dao.d.ts +0 -42
- package/build/dex/idle-dao/idle-dao.js +0 -279
- package/build/dex/idle-dao/idle-dao.js.map +0 -1
- package/build/dex/idle-dao/token_list.d.ts +0 -4
- package/build/dex/idle-dao/token_list.js +0 -289
- package/build/dex/idle-dao/token_list.js.map +0 -1
- package/build/dex/idle-dao/tokens.d.ts +0 -9
- package/build/dex/idle-dao/tokens.js +0 -68
- package/build/dex/idle-dao/tokens.js.map +0 -1
- package/build/dex/idle-dao/types.d.ts +0 -35
- package/build/dex/idle-dao/types.js +0 -11
- package/build/dex/idle-dao/types.js.map +0 -1
- package/build/dex/idle-dao/utils.d.ts +0 -8
- package/build/dex/idle-dao/utils.js +0 -149
- package/build/dex/idle-dao/utils.js.map +0 -1
- package/build/dex/infusion/config.d.ts +0 -3
- package/build/dex/infusion/config.js +0 -20
- package/build/dex/infusion/config.js.map +0 -1
- package/build/dex/infusion/infusion-stable-pool.d.ts +0 -4
- package/build/dex/infusion/infusion-stable-pool.js +0 -74
- package/build/dex/infusion/infusion-stable-pool.js.map +0 -1
- package/build/dex/infusion/infusion.d.ts +0 -51
- package/build/dex/infusion/infusion.js +0 -500
- package/build/dex/infusion/infusion.js.map +0 -1
- package/build/dex/infusion/types.d.ts +0 -45
- package/build/dex/infusion/types.js +0 -3
- package/build/dex/infusion/types.js.map +0 -1
- package/build/dex/infusion/utils/isStablePair.d.ts +0 -2
- package/build/dex/infusion/utils/isStablePair.js +0 -18
- package/build/dex/infusion/utils/isStablePair.js.map +0 -1
- package/build/dex/jarvis.d.ts +0 -56
- package/build/dex/jarvis.js +0 -163
- package/build/dex/jarvis.js.map +0 -1
- package/build/dex/mStable.d.ts +0 -44
- package/build/dex/mStable.js +0 -75
- package/build/dex/mStable.js.map +0 -1
- package/build/dex/maker-psm/config.d.ts +0 -11
- package/build/dex/maker-psm/config.js +0 -53
- package/build/dex/maker-psm/config.js.map +0 -1
- package/build/dex/maker-psm/maker-psm.d.ts +0 -103
- package/build/dex/maker-psm/maker-psm.js +0 -493
- package/build/dex/maker-psm/maker-psm.js.map +0 -1
- package/build/dex/maker-psm/types.d.ts +0 -39
- package/build/dex/maker-psm/types.js +0 -3
- package/build/dex/maker-psm/types.js.map +0 -1
- package/build/dex/onebit/onebit.d.ts +0 -16
- package/build/dex/onebit/onebit.js +0 -61
- package/build/dex/onebit/onebit.js.map +0 -1
- package/build/dex/onebit/types.d.ts +0 -14
- package/build/dex/onebit/types.js +0 -8
- package/build/dex/onebit/types.js.map +0 -1
- package/build/dex/quick-perps/config.d.ts +0 -11
- package/build/dex/quick-perps/config.js +0 -27
- package/build/dex/quick-perps/config.js.map +0 -1
- package/build/dex/quick-perps/fast-price-feed.d.ts +0 -26
- package/build/dex/quick-perps/fast-price-feed.js +0 -184
- package/build/dex/quick-perps/fast-price-feed.js.map +0 -1
- package/build/dex/quick-perps/pool.d.ts +0 -21
- package/build/dex/quick-perps/pool.js +0 -229
- package/build/dex/quick-perps/pool.js.map +0 -1
- package/build/dex/quick-perps/quick-perps.d.ts +0 -53
- package/build/dex/quick-perps/quick-perps.js +0 -247
- package/build/dex/quick-perps/quick-perps.js.map +0 -1
- package/build/dex/quick-perps/types.d.ts +0 -98
- package/build/dex/quick-perps/types.js +0 -3
- package/build/dex/quick-perps/types.js.map +0 -1
- package/build/dex/quick-perps/usdq.d.ts +0 -15
- package/build/dex/quick-perps/usdq.js +0 -62
- package/build/dex/quick-perps/usdq.js.map +0 -1
- package/build/dex/quick-perps/vault-price-feed.d.ts +0 -43
- package/build/dex/quick-perps/vault-price-feed.js +0 -203
- package/build/dex/quick-perps/vault-price-feed.js.map +0 -1
- package/build/dex/quick-perps/vault-utils.d.ts +0 -8
- package/build/dex/quick-perps/vault-utils.js +0 -42
- package/build/dex/quick-perps/vault-utils.js.map +0 -1
- package/build/dex/quick-perps/vault.d.ts +0 -46
- package/build/dex/quick-perps/vault.js +0 -182
- package/build/dex/quick-perps/vault.js.map +0 -1
- package/build/dex/se-vlr/config.d.ts +0 -3
- package/build/dex/se-vlr/config.js +0 -24
- package/build/dex/se-vlr/config.js.map +0 -1
- package/build/dex/se-vlr/se-vlr-pool.d.ts +0 -39
- package/build/dex/se-vlr/se-vlr-pool.js +0 -70
- package/build/dex/se-vlr/se-vlr-pool.js.map +0 -1
- package/build/dex/se-vlr/se-vlr.d.ts +0 -35
- package/build/dex/se-vlr/se-vlr.js +0 -131
- package/build/dex/se-vlr/se-vlr.js.map +0 -1
- package/build/dex/se-vlr/types.d.ts +0 -6
- package/build/dex/se-vlr/types.js +0 -3
- package/build/dex/se-vlr/types.js.map +0 -1
- package/build/dex/shell.d.ts +0 -25
- package/build/dex/shell.js +0 -41
- package/build/dex/shell.js.map +0 -1
- package/build/dex/solidly/forks-override/aerodrome.d.ts +0 -14
- package/build/dex/solidly/forks-override/aerodrome.js +0 -46
- package/build/dex/solidly/forks-override/aerodrome.js.map +0 -1
- package/build/dex/solidly/forks-override/chronos.d.ts +0 -23
- package/build/dex/solidly/forks-override/chronos.js +0 -141
- package/build/dex/solidly/forks-override/chronos.js.map +0 -1
- package/build/dex/solidly/forks-override/usdfi.d.ts +0 -8
- package/build/dex/solidly/forks-override/usdfi.js +0 -15
- package/build/dex/solidly/forks-override/usdfi.js.map +0 -1
- package/build/dex/solidly/forks-override/velocimeter.d.ts +0 -23
- package/build/dex/solidly/forks-override/velocimeter.js +0 -77
- package/build/dex/solidly/forks-override/velocimeter.js.map +0 -1
- package/build/dex/trader-joe-v2.d.ts +0 -40
- package/build/dex/trader-joe-v2.js +0 -74
- package/build/dex/trader-joe-v2.js.map +0 -1
- package/build/dex/uniswap-v2/dfyn.d.ts +0 -19
- package/build/dex/uniswap-v2/dfyn.js +0 -61
- package/build/dex/uniswap-v2/dfyn.js.map +0 -1
- package/build/dex/uniswap-v2/excalibur.d.ts +0 -24
- package/build/dex/uniswap-v2/excalibur.js +0 -47
- package/build/dex/uniswap-v2/excalibur.js.map +0 -1
- package/build/dex/uniswap-v2/mdex.d.ts +0 -24
- package/build/dex/uniswap-v2/mdex.js +0 -50
- package/build/dex/uniswap-v2/mdex.js.map +0 -1
- package/build/dex/uniswap-v2/nomiswap-v2.d.ts +0 -24
- package/build/dex/uniswap-v2/nomiswap-v2.js +0 -57
- package/build/dex/uniswap-v2/nomiswap-v2.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
- package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +0 -3
- package/build/dex/uniswap-v4/contract-math/Position.js +0 -10
- package/build/dex/uniswap-v4/contract-math/Position.js.map +0 -1
- package/build/dex/usual-bond/config.d.ts +0 -3
- package/build/dex/usual-bond/config.js +0 -13
- package/build/dex/usual-bond/config.js.map +0 -1
- package/build/dex/usual-bond/types.d.ts +0 -7
- package/build/dex/usual-bond/types.js +0 -3
- package/build/dex/usual-bond/types.js.map +0 -1
- package/build/dex/usual-bond/usual-bond.d.ts +0 -35
- package/build/dex/usual-bond/usual-bond.js +0 -176
- package/build/dex/usual-bond/usual-bond.js.map +0 -1
- package/build/dex/wusdm/config.d.ts +0 -3
- package/build/dex/wusdm/config.js +0 -43
- package/build/dex/wusdm/config.js.map +0 -1
- package/build/dex/wusdm/constants.d.ts +0 -2
- package/build/dex/wusdm/constants.js +0 -6
- package/build/dex/wusdm/constants.js.map +0 -1
- package/build/dex/wusdm/types.d.ts +0 -18
- package/build/dex/wusdm/types.js +0 -11
- package/build/dex/wusdm/types.js.map +0 -1
- package/build/dex/wusdm/wusdm-pool.d.ts +0 -21
- package/build/dex/wusdm/wusdm-pool.js +0 -74
- package/build/dex/wusdm/wusdm-pool.js.map +0 -1
- package/build/dex/wusdm/wusdm.d.ts +0 -46
- package/build/dex/wusdm/wusdm.js +0 -243
- package/build/dex/wusdm/wusdm.js.map +0 -1
- package/build/dex/zerox/config.d.ts +0 -2
- package/build/dex/zerox/config.js +0 -33
- package/build/dex/zerox/config.js.map +0 -1
- package/build/dex/zerox/index.d.ts +0 -22
- package/build/dex/zerox/index.js +0 -225
- package/build/dex/zerox/index.js.map +0 -1
- package/build/dex/zerox/order.d.ts +0 -88
- package/build/dex/zerox/order.js +0 -53
- package/build/dex/zerox/order.js.map +0 -1
- package/build/dex/zerox/types.d.ts +0 -73
- package/build/dex/zerox/types.js +0 -21
- package/build/dex/zerox/types.js.map +0 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
import { ICache } from './dex-helper/icache';
|
|
3
|
+
interface StateObject {
|
|
4
|
+
storage?: Record<string, string>;
|
|
5
|
+
balance?: string;
|
|
6
|
+
nonce?: number;
|
|
7
|
+
code?: string;
|
|
8
|
+
}
|
|
9
|
+
export type StateOverride = Record<string, StateObject>;
|
|
10
|
+
interface TokenStorageSlots {
|
|
11
|
+
balanceSlot: string;
|
|
12
|
+
allowanceSlot: string;
|
|
13
|
+
isVyper?: boolean;
|
|
14
|
+
stateProxy?: string;
|
|
15
|
+
additionalOverrides?: StateOverride;
|
|
16
|
+
}
|
|
17
|
+
interface SimulateTransactionRequest {
|
|
18
|
+
from: string | null;
|
|
19
|
+
to: string | null;
|
|
20
|
+
value?: string;
|
|
21
|
+
data: string;
|
|
22
|
+
chainId: number;
|
|
23
|
+
timestamp?: number;
|
|
24
|
+
blockNumber?: number;
|
|
25
|
+
stateOverride?: StateOverride;
|
|
26
|
+
}
|
|
27
|
+
interface SimulatedTransactionCall {
|
|
28
|
+
hash: string;
|
|
29
|
+
contract_name: string;
|
|
30
|
+
function_name: string;
|
|
31
|
+
function_pc: number;
|
|
32
|
+
function_op: string;
|
|
33
|
+
function_file_index: number;
|
|
34
|
+
function_code_start: number;
|
|
35
|
+
function_line_number: number;
|
|
36
|
+
function_code_length: number;
|
|
37
|
+
absolute_position: number;
|
|
38
|
+
caller_pc: number;
|
|
39
|
+
caller_op: string;
|
|
40
|
+
call_type: string;
|
|
41
|
+
address: string;
|
|
42
|
+
from: string;
|
|
43
|
+
from_balance: string;
|
|
44
|
+
to: string;
|
|
45
|
+
to_balance: string;
|
|
46
|
+
value: string | null;
|
|
47
|
+
caller: {
|
|
48
|
+
address: string;
|
|
49
|
+
balance: string;
|
|
50
|
+
};
|
|
51
|
+
block_timestamp: string;
|
|
52
|
+
gas: number;
|
|
53
|
+
gas_used: number;
|
|
54
|
+
intrinsic_gas: number;
|
|
55
|
+
storage_address: string;
|
|
56
|
+
input: string;
|
|
57
|
+
output: string;
|
|
58
|
+
storage_slot: string[] | undefined;
|
|
59
|
+
calls: SimulatedTransactionCall[] | null;
|
|
60
|
+
}
|
|
61
|
+
type SimulatedTransactionCallWithParent = SimulatedTransactionCall & {
|
|
62
|
+
parentCall: SimulatedTransactionCall | null;
|
|
63
|
+
};
|
|
64
|
+
interface Simulation {
|
|
65
|
+
id: string;
|
|
66
|
+
project_id: string;
|
|
67
|
+
owner_id: string;
|
|
68
|
+
network_id: string;
|
|
69
|
+
block_number: number;
|
|
70
|
+
transaction_index: number;
|
|
71
|
+
from: string;
|
|
72
|
+
to: string;
|
|
73
|
+
input: string;
|
|
74
|
+
gas: number;
|
|
75
|
+
gas_price: string;
|
|
76
|
+
gas_used: number;
|
|
77
|
+
value: string;
|
|
78
|
+
method: string;
|
|
79
|
+
status: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface SimulatedTransactionDetails {
|
|
82
|
+
transaction: {
|
|
83
|
+
hash: string;
|
|
84
|
+
block_hash: string;
|
|
85
|
+
block_number: number;
|
|
86
|
+
from: string;
|
|
87
|
+
gas: number;
|
|
88
|
+
gas_price: number;
|
|
89
|
+
gas_fee_cap: number;
|
|
90
|
+
gas_tip_cap: number;
|
|
91
|
+
cumulative_gas_used: number;
|
|
92
|
+
gas_used: number;
|
|
93
|
+
effective_gas_price: number;
|
|
94
|
+
input: string;
|
|
95
|
+
nonce: number;
|
|
96
|
+
to: string;
|
|
97
|
+
index: number;
|
|
98
|
+
value: string;
|
|
99
|
+
access_list: null;
|
|
100
|
+
status: boolean;
|
|
101
|
+
transaction_info: {
|
|
102
|
+
call_trace: SimulatedTransactionCall;
|
|
103
|
+
};
|
|
104
|
+
call_trace: SimulatedTransactionCall[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export type SimulatedTransaction = Pick<SimulatedTransactionDetails['transaction'], 'transaction_info' | 'call_trace'>;
|
|
108
|
+
export type SimulationResult = {
|
|
109
|
+
transaction: SimulatedTransaction;
|
|
110
|
+
simulation: Simulation;
|
|
111
|
+
};
|
|
112
|
+
export declare class TenderlySimulator {
|
|
113
|
+
static readonly DEFAULT_OWNER = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
|
114
|
+
static readonly DEFAULT_SPENDER = "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
|
|
115
|
+
private static instance;
|
|
116
|
+
private constructor();
|
|
117
|
+
static getInstance(cache?: ICache, tenderlyToken?: string, tenderlyProject?: string, tenderlyAccountId?: string): TenderlySimulator;
|
|
118
|
+
simulateTransaction(request: SimulateTransactionRequest, forceSimulationAPI?: boolean): Promise<SimulationResult>;
|
|
119
|
+
private simulateWithTenderlySimulationAPI;
|
|
120
|
+
private simulateWithTenderlyVNet;
|
|
121
|
+
getSimulatedTransactionDetails(id: string): Promise<SimulatedTransactionDetails | null>;
|
|
122
|
+
getSLOADCalls: (callTrace: SimulatedTransactionCall, parentCall?: SimulatedTransactionCall | null) => SimulatedTransactionCallWithParent[];
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @param balanceOfSlot storage slot of `balanceOf` mapping
|
|
126
|
+
* @param owner account's address
|
|
127
|
+
* @param isVyper `true` if contract is written in Vyper
|
|
128
|
+
*/
|
|
129
|
+
calculateAddressBalanceSlot(balanceOfSlot: string, owner: string, isVyper?: boolean): string;
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param balanceOfSlot storage slot of `balanceOf` mapping
|
|
133
|
+
* @param owner account's address
|
|
134
|
+
*/
|
|
135
|
+
calculateSolidityAddressBalanceSlot(balanceOfSlot: string, owner: string): string;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param balanceOfSlot storage slot of `balanceOf` mapping
|
|
139
|
+
* @param owner account's address
|
|
140
|
+
*/
|
|
141
|
+
calculateVyperAddressBalanceSlot(balanceOfSlot: string, owner: string): string;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* @param allowanceSlot storage slot of `allowance` mapping
|
|
145
|
+
* @param owner account's address
|
|
146
|
+
* @param spender spender's address
|
|
147
|
+
* @param isVyper `true` if contract is written in Vyper
|
|
148
|
+
*/
|
|
149
|
+
calculateAddressAllowanceSlot(allowanceSlot: string, owner: string, spender: string, isVyper?: boolean): string;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param allowanceSlot storage slot of `allowance` mapping
|
|
153
|
+
* @param owner account's address
|
|
154
|
+
* @param spender spender's address
|
|
155
|
+
*/
|
|
156
|
+
calculateSolidityAddressAllowanceSlot(allowanceSlot: string, owner: string, spender: string): string;
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* @param allowanceSlot storage slot of `allowance` mapping
|
|
160
|
+
* @param owner account's address
|
|
161
|
+
* @param spender spender's address
|
|
162
|
+
*/
|
|
163
|
+
calculateVyperAddressAllowanceSlot(allowanceSlot: string, owner: string, spender: string): string;
|
|
164
|
+
buildBalanceOfSimulationRequest(chainId: number, token: string, owner: string): SimulateTransactionRequest;
|
|
165
|
+
buildAllowanceSimulationRequest(chainId: number, token: string, owner: string, spender: string): SimulateTransactionRequest;
|
|
166
|
+
/**
|
|
167
|
+
* Finds the slot of the `balanceOf` mapping in given token contract's storage.
|
|
168
|
+
* Supports `Solidity` and `Vyper` contracts
|
|
169
|
+
* @param chainId token chain id
|
|
170
|
+
* @param token token address
|
|
171
|
+
*/
|
|
172
|
+
findTokenBalanceOfSlot(chainId: number, token: string): Promise<{
|
|
173
|
+
slot: string;
|
|
174
|
+
isVyper?: boolean;
|
|
175
|
+
stateProxy?: string;
|
|
176
|
+
}>;
|
|
177
|
+
/**
|
|
178
|
+
* Finds the slot of the `allowance` mapping in given token contract's storage
|
|
179
|
+
* Supports `Solidity` and `Vyper` contracts
|
|
180
|
+
* @param chainId token chain id
|
|
181
|
+
* @param token token address
|
|
182
|
+
*/
|
|
183
|
+
findTokenAllowanceSlot(chainId: number, token: string): Promise<{
|
|
184
|
+
slot: string;
|
|
185
|
+
isVyper?: boolean;
|
|
186
|
+
stateProxy?: string;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* Returns storage slots for the given token contract.
|
|
190
|
+
* @param chainId Token chain ID
|
|
191
|
+
* @param token Token address. Doesn't have to be normalized
|
|
192
|
+
*/
|
|
193
|
+
getTokenStorageSlots(chainId: number, token: string): Promise<TokenStorageSlots>;
|
|
194
|
+
/**
|
|
195
|
+
* Adds native balance override to an existing `StateOverride` object
|
|
196
|
+
* @param stateOverride object to add the override to
|
|
197
|
+
* @param account address to be given the balance
|
|
198
|
+
* @param amount token amount in wei
|
|
199
|
+
*/
|
|
200
|
+
addBalanceOverride(stateOverride: StateOverride, account: string, amount: bigint): void;
|
|
201
|
+
/**
|
|
202
|
+
* Adds token balance override to an existing `StateOverride` object
|
|
203
|
+
* @param stateOverride object to add the override to
|
|
204
|
+
* @param chainId token chain ID
|
|
205
|
+
* @param token token address
|
|
206
|
+
* @param account address to be given the balance
|
|
207
|
+
* @param amount token amount in wei
|
|
208
|
+
*/
|
|
209
|
+
addTokenBalanceOverride(stateOverride: StateOverride, chainId: number, token: string, account: string, amount: bigint): Promise<void>;
|
|
210
|
+
/**
|
|
211
|
+
* Adds token allowance override to an existing `StateOverride` object
|
|
212
|
+
* @param stateOverride object to add the override to
|
|
213
|
+
* @param chainId token chain ID
|
|
214
|
+
* @param token token address
|
|
215
|
+
* @param account owner address
|
|
216
|
+
* @param spender spender address
|
|
217
|
+
* @param amount token amount in wei
|
|
218
|
+
*/
|
|
219
|
+
addAllowanceOverride(stateOverride: StateOverride, chainId: number, token: string, account: string, spender: string, amount: bigint): Promise<void>;
|
|
220
|
+
}
|
|
221
|
+
export {};
|