@avalabs/evm-module 0.0.13 → 0.0.15
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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +11 -6
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +17 -10
- package/src/contracts/openzeppelin/ERC1155.ts +440 -0
- package/src/contracts/openzeppelin/ERC20.ts +330 -0
- package/src/contracts/openzeppelin/ERC721.ts +420 -0
- package/src/contracts/openzeppelin/common.ts +131 -0
- package/src/contracts/openzeppelin/factories/ERC1155__factory.ts +388 -0
- package/src/contracts/openzeppelin/factories/ERC20__factory.ts +353 -0
- package/src/contracts/openzeppelin/factories/ERC721__factory.ts +413 -0
- package/src/contracts/openzeppelin/factories/index.ts +6 -0
- package/src/contracts/openzeppelin/index.ts +10 -0
- package/src/handlers/eth-send-transaction/eth-send-transaction.test.ts +2 -2
- package/src/handlers/eth-send-transaction/eth-send-transaction.ts +1 -1
- package/src/handlers/get-balances/evm-balance-service/get-erc20-balances.test.ts +78 -0
- package/src/handlers/get-balances/evm-balance-service/get-erc20-balances.ts +85 -0
- package/src/handlers/get-balances/evm-balance-service/get-native-token-balances.test.ts +102 -0
- package/src/handlers/get-balances/evm-balance-service/get-native-token-balances.ts +54 -0
- package/src/handlers/get-balances/get-balances.test.ts +252 -0
- package/src/handlers/get-balances/get-balances.ts +109 -0
- package/src/handlers/get-balances/glacier-balance-service/get-erc20-balances.test.ts +76 -0
- package/src/handlers/get-balances/glacier-balance-service/get-erc20-balances.ts +107 -0
- package/src/handlers/get-balances/glacier-balance-service/get-native-token-balances.test.ts +61 -0
- package/src/handlers/get-balances/glacier-balance-service/get-native-token-balances.ts +46 -0
- package/src/handlers/get-network-fee/get-network-fee.test.ts +0 -1
- package/src/handlers/get-network-fee/get-network-fee.ts +0 -1
- package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-transaction-from-glacier.test.ts +72 -59
- package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-transactions-from-glacier.ts +4 -11
- package/src/handlers/get-transaction-history/get-transaction-history.test.ts +7 -2
- package/src/handlers/get-transaction-history/get-transaction-history.ts +13 -3
- package/src/module.ts +17 -7
- package/src/services/glacier-service/glacier-service.ts +259 -0
- package/tsconfig.json +1 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumberish,
|
|
7
|
+
BytesLike,
|
|
8
|
+
FunctionFragment,
|
|
9
|
+
Result,
|
|
10
|
+
Interface,
|
|
11
|
+
EventFragment,
|
|
12
|
+
AddressLike,
|
|
13
|
+
ContractRunner,
|
|
14
|
+
ContractMethod,
|
|
15
|
+
Listener,
|
|
16
|
+
} from "ethers";
|
|
17
|
+
import type {
|
|
18
|
+
TypedContractEvent,
|
|
19
|
+
TypedDeferredTopicFilter,
|
|
20
|
+
TypedEventLog,
|
|
21
|
+
TypedLogDescription,
|
|
22
|
+
TypedListener,
|
|
23
|
+
TypedContractMethod,
|
|
24
|
+
} from "./common";
|
|
25
|
+
|
|
26
|
+
export interface ERC20Interface extends Interface {
|
|
27
|
+
getFunction(
|
|
28
|
+
nameOrSignature:
|
|
29
|
+
| "allowance"
|
|
30
|
+
| "approve"
|
|
31
|
+
| "balanceOf"
|
|
32
|
+
| "decimals"
|
|
33
|
+
| "decreaseAllowance"
|
|
34
|
+
| "increaseAllowance"
|
|
35
|
+
| "name"
|
|
36
|
+
| "symbol"
|
|
37
|
+
| "totalSupply"
|
|
38
|
+
| "transfer"
|
|
39
|
+
| "transferFrom"
|
|
40
|
+
): FunctionFragment;
|
|
41
|
+
|
|
42
|
+
getEvent(nameOrSignatureOrTopic: "Approval" | "Transfer"): EventFragment;
|
|
43
|
+
|
|
44
|
+
encodeFunctionData(
|
|
45
|
+
functionFragment: "allowance",
|
|
46
|
+
values: [AddressLike, AddressLike]
|
|
47
|
+
): string;
|
|
48
|
+
encodeFunctionData(
|
|
49
|
+
functionFragment: "approve",
|
|
50
|
+
values: [AddressLike, BigNumberish]
|
|
51
|
+
): string;
|
|
52
|
+
encodeFunctionData(
|
|
53
|
+
functionFragment: "balanceOf",
|
|
54
|
+
values: [AddressLike]
|
|
55
|
+
): string;
|
|
56
|
+
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
|
|
57
|
+
encodeFunctionData(
|
|
58
|
+
functionFragment: "decreaseAllowance",
|
|
59
|
+
values: [AddressLike, BigNumberish]
|
|
60
|
+
): string;
|
|
61
|
+
encodeFunctionData(
|
|
62
|
+
functionFragment: "increaseAllowance",
|
|
63
|
+
values: [AddressLike, BigNumberish]
|
|
64
|
+
): string;
|
|
65
|
+
encodeFunctionData(functionFragment: "name", values?: undefined): string;
|
|
66
|
+
encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
|
|
67
|
+
encodeFunctionData(
|
|
68
|
+
functionFragment: "totalSupply",
|
|
69
|
+
values?: undefined
|
|
70
|
+
): string;
|
|
71
|
+
encodeFunctionData(
|
|
72
|
+
functionFragment: "transfer",
|
|
73
|
+
values: [AddressLike, BigNumberish]
|
|
74
|
+
): string;
|
|
75
|
+
encodeFunctionData(
|
|
76
|
+
functionFragment: "transferFrom",
|
|
77
|
+
values: [AddressLike, AddressLike, BigNumberish]
|
|
78
|
+
): string;
|
|
79
|
+
|
|
80
|
+
decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
|
|
81
|
+
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
|
|
82
|
+
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
|
|
83
|
+
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
|
|
84
|
+
decodeFunctionResult(
|
|
85
|
+
functionFragment: "decreaseAllowance",
|
|
86
|
+
data: BytesLike
|
|
87
|
+
): Result;
|
|
88
|
+
decodeFunctionResult(
|
|
89
|
+
functionFragment: "increaseAllowance",
|
|
90
|
+
data: BytesLike
|
|
91
|
+
): Result;
|
|
92
|
+
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
|
|
93
|
+
decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
|
|
94
|
+
decodeFunctionResult(
|
|
95
|
+
functionFragment: "totalSupply",
|
|
96
|
+
data: BytesLike
|
|
97
|
+
): Result;
|
|
98
|
+
decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
|
|
99
|
+
decodeFunctionResult(
|
|
100
|
+
functionFragment: "transferFrom",
|
|
101
|
+
data: BytesLike
|
|
102
|
+
): Result;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export namespace ApprovalEvent {
|
|
106
|
+
export type InputTuple = [
|
|
107
|
+
owner: AddressLike,
|
|
108
|
+
spender: AddressLike,
|
|
109
|
+
value: BigNumberish
|
|
110
|
+
];
|
|
111
|
+
export type OutputTuple = [owner: string, spender: string, value: bigint];
|
|
112
|
+
export interface OutputObject {
|
|
113
|
+
owner: string;
|
|
114
|
+
spender: string;
|
|
115
|
+
value: bigint;
|
|
116
|
+
}
|
|
117
|
+
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
118
|
+
export type Filter = TypedDeferredTopicFilter<Event>;
|
|
119
|
+
export type Log = TypedEventLog<Event>;
|
|
120
|
+
export type LogDescription = TypedLogDescription<Event>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export namespace TransferEvent {
|
|
124
|
+
export type InputTuple = [
|
|
125
|
+
from: AddressLike,
|
|
126
|
+
to: AddressLike,
|
|
127
|
+
value: BigNumberish
|
|
128
|
+
];
|
|
129
|
+
export type OutputTuple = [from: string, to: string, value: bigint];
|
|
130
|
+
export interface OutputObject {
|
|
131
|
+
from: string;
|
|
132
|
+
to: string;
|
|
133
|
+
value: bigint;
|
|
134
|
+
}
|
|
135
|
+
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
136
|
+
export type Filter = TypedDeferredTopicFilter<Event>;
|
|
137
|
+
export type Log = TypedEventLog<Event>;
|
|
138
|
+
export type LogDescription = TypedLogDescription<Event>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface ERC20 extends BaseContract {
|
|
142
|
+
connect(runner?: ContractRunner | null): ERC20;
|
|
143
|
+
waitForDeployment(): Promise<this>;
|
|
144
|
+
|
|
145
|
+
interface: ERC20Interface;
|
|
146
|
+
|
|
147
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
148
|
+
event: TCEvent,
|
|
149
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
150
|
+
toBlock?: string | number | undefined
|
|
151
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
152
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
153
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
154
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
155
|
+
toBlock?: string | number | undefined
|
|
156
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
157
|
+
|
|
158
|
+
on<TCEvent extends TypedContractEvent>(
|
|
159
|
+
event: TCEvent,
|
|
160
|
+
listener: TypedListener<TCEvent>
|
|
161
|
+
): Promise<this>;
|
|
162
|
+
on<TCEvent extends TypedContractEvent>(
|
|
163
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
164
|
+
listener: TypedListener<TCEvent>
|
|
165
|
+
): Promise<this>;
|
|
166
|
+
|
|
167
|
+
once<TCEvent extends TypedContractEvent>(
|
|
168
|
+
event: TCEvent,
|
|
169
|
+
listener: TypedListener<TCEvent>
|
|
170
|
+
): Promise<this>;
|
|
171
|
+
once<TCEvent extends TypedContractEvent>(
|
|
172
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
173
|
+
listener: TypedListener<TCEvent>
|
|
174
|
+
): Promise<this>;
|
|
175
|
+
|
|
176
|
+
listeners<TCEvent extends TypedContractEvent>(
|
|
177
|
+
event: TCEvent
|
|
178
|
+
): Promise<Array<TypedListener<TCEvent>>>;
|
|
179
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
180
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(
|
|
181
|
+
event?: TCEvent
|
|
182
|
+
): Promise<this>;
|
|
183
|
+
|
|
184
|
+
allowance: TypedContractMethod<
|
|
185
|
+
[owner: AddressLike, spender: AddressLike],
|
|
186
|
+
[bigint],
|
|
187
|
+
"view"
|
|
188
|
+
>;
|
|
189
|
+
|
|
190
|
+
approve: TypedContractMethod<
|
|
191
|
+
[spender: AddressLike, amount: BigNumberish],
|
|
192
|
+
[boolean],
|
|
193
|
+
"nonpayable"
|
|
194
|
+
>;
|
|
195
|
+
|
|
196
|
+
balanceOf: TypedContractMethod<[account: AddressLike], [bigint], "view">;
|
|
197
|
+
|
|
198
|
+
decimals: TypedContractMethod<[], [bigint], "view">;
|
|
199
|
+
|
|
200
|
+
decreaseAllowance: TypedContractMethod<
|
|
201
|
+
[spender: AddressLike, subtractedValue: BigNumberish],
|
|
202
|
+
[boolean],
|
|
203
|
+
"nonpayable"
|
|
204
|
+
>;
|
|
205
|
+
|
|
206
|
+
increaseAllowance: TypedContractMethod<
|
|
207
|
+
[spender: AddressLike, addedValue: BigNumberish],
|
|
208
|
+
[boolean],
|
|
209
|
+
"nonpayable"
|
|
210
|
+
>;
|
|
211
|
+
|
|
212
|
+
name: TypedContractMethod<[], [string], "view">;
|
|
213
|
+
|
|
214
|
+
symbol: TypedContractMethod<[], [string], "view">;
|
|
215
|
+
|
|
216
|
+
totalSupply: TypedContractMethod<[], [bigint], "view">;
|
|
217
|
+
|
|
218
|
+
transfer: TypedContractMethod<
|
|
219
|
+
[to: AddressLike, amount: BigNumberish],
|
|
220
|
+
[boolean],
|
|
221
|
+
"nonpayable"
|
|
222
|
+
>;
|
|
223
|
+
|
|
224
|
+
transferFrom: TypedContractMethod<
|
|
225
|
+
[from: AddressLike, to: AddressLike, amount: BigNumberish],
|
|
226
|
+
[boolean],
|
|
227
|
+
"nonpayable"
|
|
228
|
+
>;
|
|
229
|
+
|
|
230
|
+
getFunction<T extends ContractMethod = ContractMethod>(
|
|
231
|
+
key: string | FunctionFragment
|
|
232
|
+
): T;
|
|
233
|
+
|
|
234
|
+
getFunction(
|
|
235
|
+
nameOrSignature: "allowance"
|
|
236
|
+
): TypedContractMethod<
|
|
237
|
+
[owner: AddressLike, spender: AddressLike],
|
|
238
|
+
[bigint],
|
|
239
|
+
"view"
|
|
240
|
+
>;
|
|
241
|
+
getFunction(
|
|
242
|
+
nameOrSignature: "approve"
|
|
243
|
+
): TypedContractMethod<
|
|
244
|
+
[spender: AddressLike, amount: BigNumberish],
|
|
245
|
+
[boolean],
|
|
246
|
+
"nonpayable"
|
|
247
|
+
>;
|
|
248
|
+
getFunction(
|
|
249
|
+
nameOrSignature: "balanceOf"
|
|
250
|
+
): TypedContractMethod<[account: AddressLike], [bigint], "view">;
|
|
251
|
+
getFunction(
|
|
252
|
+
nameOrSignature: "decimals"
|
|
253
|
+
): TypedContractMethod<[], [bigint], "view">;
|
|
254
|
+
getFunction(
|
|
255
|
+
nameOrSignature: "decreaseAllowance"
|
|
256
|
+
): TypedContractMethod<
|
|
257
|
+
[spender: AddressLike, subtractedValue: BigNumberish],
|
|
258
|
+
[boolean],
|
|
259
|
+
"nonpayable"
|
|
260
|
+
>;
|
|
261
|
+
getFunction(
|
|
262
|
+
nameOrSignature: "increaseAllowance"
|
|
263
|
+
): TypedContractMethod<
|
|
264
|
+
[spender: AddressLike, addedValue: BigNumberish],
|
|
265
|
+
[boolean],
|
|
266
|
+
"nonpayable"
|
|
267
|
+
>;
|
|
268
|
+
getFunction(
|
|
269
|
+
nameOrSignature: "name"
|
|
270
|
+
): TypedContractMethod<[], [string], "view">;
|
|
271
|
+
getFunction(
|
|
272
|
+
nameOrSignature: "symbol"
|
|
273
|
+
): TypedContractMethod<[], [string], "view">;
|
|
274
|
+
getFunction(
|
|
275
|
+
nameOrSignature: "totalSupply"
|
|
276
|
+
): TypedContractMethod<[], [bigint], "view">;
|
|
277
|
+
getFunction(
|
|
278
|
+
nameOrSignature: "transfer"
|
|
279
|
+
): TypedContractMethod<
|
|
280
|
+
[to: AddressLike, amount: BigNumberish],
|
|
281
|
+
[boolean],
|
|
282
|
+
"nonpayable"
|
|
283
|
+
>;
|
|
284
|
+
getFunction(
|
|
285
|
+
nameOrSignature: "transferFrom"
|
|
286
|
+
): TypedContractMethod<
|
|
287
|
+
[from: AddressLike, to: AddressLike, amount: BigNumberish],
|
|
288
|
+
[boolean],
|
|
289
|
+
"nonpayable"
|
|
290
|
+
>;
|
|
291
|
+
|
|
292
|
+
getEvent(
|
|
293
|
+
key: "Approval"
|
|
294
|
+
): TypedContractEvent<
|
|
295
|
+
ApprovalEvent.InputTuple,
|
|
296
|
+
ApprovalEvent.OutputTuple,
|
|
297
|
+
ApprovalEvent.OutputObject
|
|
298
|
+
>;
|
|
299
|
+
getEvent(
|
|
300
|
+
key: "Transfer"
|
|
301
|
+
): TypedContractEvent<
|
|
302
|
+
TransferEvent.InputTuple,
|
|
303
|
+
TransferEvent.OutputTuple,
|
|
304
|
+
TransferEvent.OutputObject
|
|
305
|
+
>;
|
|
306
|
+
|
|
307
|
+
filters: {
|
|
308
|
+
"Approval(address,address,uint256)": TypedContractEvent<
|
|
309
|
+
ApprovalEvent.InputTuple,
|
|
310
|
+
ApprovalEvent.OutputTuple,
|
|
311
|
+
ApprovalEvent.OutputObject
|
|
312
|
+
>;
|
|
313
|
+
Approval: TypedContractEvent<
|
|
314
|
+
ApprovalEvent.InputTuple,
|
|
315
|
+
ApprovalEvent.OutputTuple,
|
|
316
|
+
ApprovalEvent.OutputObject
|
|
317
|
+
>;
|
|
318
|
+
|
|
319
|
+
"Transfer(address,address,uint256)": TypedContractEvent<
|
|
320
|
+
TransferEvent.InputTuple,
|
|
321
|
+
TransferEvent.OutputTuple,
|
|
322
|
+
TransferEvent.OutputObject
|
|
323
|
+
>;
|
|
324
|
+
Transfer: TypedContractEvent<
|
|
325
|
+
TransferEvent.InputTuple,
|
|
326
|
+
TransferEvent.OutputTuple,
|
|
327
|
+
TransferEvent.OutputObject
|
|
328
|
+
>;
|
|
329
|
+
};
|
|
330
|
+
}
|