@obolnetwork/obol-sdk 2.10.2 → 2.11.2
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/package.json +1 -1
- package/dist/cjs/src/abi/BatchDeposit.js +120 -0
- package/dist/cjs/src/abi/Multicall3.js +253 -0
- package/dist/cjs/src/bytecodes.js +4 -4
- package/dist/cjs/src/constants.js +13 -7
- package/dist/cjs/src/eoa/eoa.js +49 -0
- package/dist/cjs/src/eoa/eoaHelpers.js +46 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/schema.js +93 -1
- package/dist/cjs/src/splits/splitHelpers.js +64 -19
- package/dist/cjs/src/splits/splits.js +54 -11
- package/dist/cjs/test/eoa/eoa.spec.js +78 -0
- package/dist/cjs/test/splits/splits.spec.js +84 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/abi/BatchDeposit.js +117 -0
- package/dist/esm/src/abi/Multicall3.js +250 -0
- package/dist/esm/src/bytecodes.js +3 -3
- package/dist/esm/src/constants.js +14 -8
- package/dist/esm/src/eoa/eoa.js +51 -2
- package/dist/esm/src/eoa/eoaHelpers.js +44 -0
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/schema.js +92 -0
- package/dist/esm/src/splits/splitHelpers.js +61 -17
- package/dist/esm/src/splits/splits.js +56 -13
- package/dist/esm/test/eoa/eoa.spec.js +79 -1
- package/dist/esm/test/splits/splits.spec.js +85 -1
- package/dist/types/src/abi/BatchDeposit.d.ts +49 -0
- package/dist/types/src/abi/Multicall3.d.ts +37 -0
- package/dist/types/src/bytecodes.d.ts +3 -3
- package/dist/types/src/eoa/eoa.d.ts +35 -1
- package/dist/types/src/eoa/eoaHelpers.d.ts +16 -0
- package/dist/types/src/schema.d.ts +80 -0
- package/dist/types/src/splits/splitHelpers.d.ts +22 -1
- package/dist/types/src/splits/splits.d.ts +33 -1
- package/dist/types/src/types.d.ts +42 -1
- package/package.json +1 -1
- package/src/abi/BatchDeposit.ts +117 -0
- package/src/abi/Multicall3.ts +250 -0
- package/src/bytecodes.ts +4 -4
- package/src/constants.ts +16 -10
- package/src/eoa/eoa.ts +61 -2
- package/src/eoa/eoaHelpers.ts +70 -0
- package/src/index.ts +4 -4
- package/src/schema.ts +94 -0
- package/src/splits/splitHelpers.ts +99 -19
- package/src/splits/splits.ts +65 -15
- package/src/types.ts +45 -1
- package/dist/cjs/src/abi/Multicall.js +0 -148
- package/dist/esm/src/abi/Multicall.js +0 -145
- package/dist/types/src/abi/Multicall.d.ts +0 -35
- package/src/abi/Multicall.ts +0 -145
|
@@ -14,3 +14,19 @@ export declare function submitEOAWithdrawalRequest({ pubkey, allocation, withdra
|
|
|
14
14
|
}): Promise<{
|
|
15
15
|
txHash: string | null;
|
|
16
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to submit batch deposit request for EOA
|
|
19
|
+
*/
|
|
20
|
+
export declare function submitEOABatchDeposit({ deposits, batchDepositContractAddress, signer, }: {
|
|
21
|
+
deposits: Array<{
|
|
22
|
+
pubkey: string;
|
|
23
|
+
withdrawal_credentials: string;
|
|
24
|
+
signature: string;
|
|
25
|
+
deposit_data_root: string;
|
|
26
|
+
amount: string;
|
|
27
|
+
}>;
|
|
28
|
+
batchDepositContractAddress: string;
|
|
29
|
+
signer: SignerType;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
txHashes: string[];
|
|
32
|
+
}>;
|
|
@@ -370,3 +370,83 @@ export declare const eoaWithdrawalPayloadSchema: {
|
|
|
370
370
|
};
|
|
371
371
|
required: string[];
|
|
372
372
|
};
|
|
373
|
+
export declare const ovmDepositPayloadSchema: {
|
|
374
|
+
type: string;
|
|
375
|
+
properties: {
|
|
376
|
+
ovmAddress: {
|
|
377
|
+
type: string;
|
|
378
|
+
pattern: string;
|
|
379
|
+
};
|
|
380
|
+
deposits: {
|
|
381
|
+
type: string;
|
|
382
|
+
minItems: number;
|
|
383
|
+
items: {
|
|
384
|
+
type: string;
|
|
385
|
+
properties: {
|
|
386
|
+
pubkey: {
|
|
387
|
+
type: string;
|
|
388
|
+
pattern: string;
|
|
389
|
+
};
|
|
390
|
+
withdrawal_credentials: {
|
|
391
|
+
type: string;
|
|
392
|
+
pattern: string;
|
|
393
|
+
description: string;
|
|
394
|
+
};
|
|
395
|
+
signature: {
|
|
396
|
+
type: string;
|
|
397
|
+
pattern: string;
|
|
398
|
+
description: string;
|
|
399
|
+
};
|
|
400
|
+
deposit_data_root: {
|
|
401
|
+
type: string;
|
|
402
|
+
pattern: string;
|
|
403
|
+
};
|
|
404
|
+
amount: {
|
|
405
|
+
type: string;
|
|
406
|
+
pattern: string;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
required: string[];
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
required: string[];
|
|
414
|
+
};
|
|
415
|
+
export declare const eoaDepositPayloadSchema: {
|
|
416
|
+
type: string;
|
|
417
|
+
properties: {
|
|
418
|
+
deposits: {
|
|
419
|
+
type: string;
|
|
420
|
+
minItems: number;
|
|
421
|
+
items: {
|
|
422
|
+
type: string;
|
|
423
|
+
properties: {
|
|
424
|
+
pubkey: {
|
|
425
|
+
type: string;
|
|
426
|
+
pattern: string;
|
|
427
|
+
};
|
|
428
|
+
withdrawal_credentials: {
|
|
429
|
+
type: string;
|
|
430
|
+
pattern: string;
|
|
431
|
+
description: string;
|
|
432
|
+
};
|
|
433
|
+
signature: {
|
|
434
|
+
type: string;
|
|
435
|
+
pattern: string;
|
|
436
|
+
description: string;
|
|
437
|
+
};
|
|
438
|
+
deposit_data_root: {
|
|
439
|
+
type: string;
|
|
440
|
+
pattern: string;
|
|
441
|
+
};
|
|
442
|
+
amount: {
|
|
443
|
+
type: string;
|
|
444
|
+
pattern: string;
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
required: string[];
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
required: string[];
|
|
452
|
+
};
|
|
@@ -61,7 +61,7 @@ export declare const getOWRTranches: ({ owrAddress, signer, }: {
|
|
|
61
61
|
owrAddress: ETH_ADDRESS;
|
|
62
62
|
signer: SignerType;
|
|
63
63
|
}) => Promise<OWRTranches>;
|
|
64
|
-
export declare const
|
|
64
|
+
export declare const multicall3: (calls: Call[], signer: SignerType, chainId: number) => Promise<any>;
|
|
65
65
|
export declare const formatRecipientsForSplitV2: (splitRecipients: SplitRecipient[] | SplitV2Recipient[]) => SplitV2Recipient[];
|
|
66
66
|
export declare const predictSplitV2Address: ({ splitOwnerAddress, recipients, distributorFeePercent, salt, signer, chainId, }: {
|
|
67
67
|
splitOwnerAddress: string;
|
|
@@ -116,4 +116,25 @@ export declare const requestWithdrawalFromOVM: ({ ovmAddress, pubKeys, amounts,
|
|
|
116
116
|
}) => Promise<{
|
|
117
117
|
txHash: string;
|
|
118
118
|
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Deposits to OVM contract using multicall3 for batch operations
|
|
121
|
+
* @param ovmAddress - The address of the OVM contract
|
|
122
|
+
* @param deposits - Array of deposit objects with all required parameters
|
|
123
|
+
* @param signer - The signer to use for the transaction
|
|
124
|
+
* @returns Promise that resolves to an array of transaction hashes
|
|
125
|
+
*/
|
|
126
|
+
export declare const depositWithMulticall3: ({ ovmAddress, deposits, signer, chainId, }: {
|
|
127
|
+
ovmAddress: string;
|
|
128
|
+
deposits: Array<{
|
|
129
|
+
pubkey: string;
|
|
130
|
+
withdrawal_credentials: string;
|
|
131
|
+
signature: string;
|
|
132
|
+
deposit_data_root: string;
|
|
133
|
+
amount: string;
|
|
134
|
+
}>;
|
|
135
|
+
signer: SignerType;
|
|
136
|
+
chainId: number;
|
|
137
|
+
}) => Promise<{
|
|
138
|
+
txHashes: string[];
|
|
139
|
+
}>;
|
|
119
140
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClusterValidator, type ProviderType, type SignerType, type OVMRewardsSplitPayload, type OVMTotalSplitPayload, type OVMRequestWithdrawalPayload } from '../types';
|
|
1
|
+
import { type ClusterValidator, type ProviderType, type SignerType, type OVMRewardsSplitPayload, type OVMTotalSplitPayload, type OVMRequestWithdrawalPayload, type OVMDepositPayload } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* ObolSplits can be used for creating and managing Obol splits.
|
|
4
4
|
* @class
|
|
@@ -75,4 +75,36 @@ export declare class ObolSplits {
|
|
|
75
75
|
requestWithdrawal(payload: OVMRequestWithdrawalPayload): Promise<{
|
|
76
76
|
txHash: string;
|
|
77
77
|
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Deposits to OVM contract using multicall3 for batch operations.
|
|
80
|
+
*
|
|
81
|
+
* This method allows depositing to an OVM contract using multicall3 for efficient batch processing.
|
|
82
|
+
* Each deposit includes validator public key, withdrawal credentials, signature, deposit data root, and amount.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* **⚠️ Important:** If you're storing the private key in an `.env` file, ensure it is securely managed
|
|
86
|
+
* and not pushed to version control.
|
|
87
|
+
*
|
|
88
|
+
* @param {OVMDepositPayload} payload - Data needed to deposit to OVM
|
|
89
|
+
* @returns {Promise<{txHashes: string[]}>} Array of transaction hashes for all batches
|
|
90
|
+
* @throws Will throw an error if the signer is not provided, OVM address is invalid, or the deposit fails
|
|
91
|
+
*
|
|
92
|
+
* An example of how to use deposit:
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const result = await client.splits.deposit({
|
|
95
|
+
* ovmAddress: '0x1234567890123456789012345678901234567890',
|
|
96
|
+
* deposits: [{
|
|
97
|
+
* pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
|
|
98
|
+
* withdrawal_credentials: '0x1234567890123456789012345678901234567890',
|
|
99
|
+
* signature: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
|
|
100
|
+
* deposit_data_root: '0x1234567890123456789012345678901234567890123456789012345678901234',
|
|
101
|
+
* amount: '32000000000000000000' // 32 ETH in wei
|
|
102
|
+
* }]
|
|
103
|
+
* });
|
|
104
|
+
* console.log('Deposits completed:', result.txHashes);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
deposit(payload: OVMDepositPayload): Promise<{
|
|
108
|
+
txHashes: string[];
|
|
109
|
+
}>;
|
|
78
110
|
}
|
|
@@ -447,7 +447,7 @@ export type ChainConfig = {
|
|
|
447
447
|
address: string;
|
|
448
448
|
bytecode: string;
|
|
449
449
|
};
|
|
450
|
-
|
|
450
|
+
MULTICALL3_CONTRACT: {
|
|
451
451
|
address: string;
|
|
452
452
|
bytecode: string;
|
|
453
453
|
};
|
|
@@ -474,6 +474,9 @@ export type ChainConfig = {
|
|
|
474
474
|
EOA_WITHDRAWAL_CONTRACT?: {
|
|
475
475
|
address: string;
|
|
476
476
|
};
|
|
477
|
+
BATCH_DEPOSIT_CONTRACT?: {
|
|
478
|
+
address: string;
|
|
479
|
+
};
|
|
477
480
|
};
|
|
478
481
|
/**
|
|
479
482
|
* Payload for requesting withdrawal from OVM contract
|
|
@@ -499,3 +502,41 @@ export type EOAWithdrawalPayload = {
|
|
|
499
502
|
/** Required fee in wei */
|
|
500
503
|
requiredFee: string;
|
|
501
504
|
};
|
|
505
|
+
/**
|
|
506
|
+
* Payload for depositing to OVM contract with multicall3
|
|
507
|
+
*/
|
|
508
|
+
export type OVMDepositPayload = {
|
|
509
|
+
/** OVM contract address */
|
|
510
|
+
ovmAddress: string;
|
|
511
|
+
/** Array of deposit objects */
|
|
512
|
+
deposits: Array<{
|
|
513
|
+
/** Validator public key in hex format (48 bytes) */
|
|
514
|
+
pubkey: string;
|
|
515
|
+
/** Withdrawal credentials in hex format */
|
|
516
|
+
withdrawal_credentials: string;
|
|
517
|
+
/** Deposit signature in hex format */
|
|
518
|
+
signature: string;
|
|
519
|
+
/** Deposit data root in hex format (32 bytes) */
|
|
520
|
+
deposit_data_root: string;
|
|
521
|
+
/** Deposit amount in wei as string */
|
|
522
|
+
amount: string;
|
|
523
|
+
}>;
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Payload for depositing to batch deposit contract
|
|
527
|
+
*/
|
|
528
|
+
export type EOADepositPayload = {
|
|
529
|
+
/** Array of deposit objects */
|
|
530
|
+
deposits: Array<{
|
|
531
|
+
/** Validator public key in hex format (48 bytes) */
|
|
532
|
+
pubkey: string;
|
|
533
|
+
/** Withdrawal credentials in hex format */
|
|
534
|
+
withdrawal_credentials: string;
|
|
535
|
+
/** Deposit signature in hex format */
|
|
536
|
+
signature: string;
|
|
537
|
+
/** Deposit data root in hex format (32 bytes) */
|
|
538
|
+
deposit_data_root: string;
|
|
539
|
+
/** Deposit amount in wei as string */
|
|
540
|
+
amount: string;
|
|
541
|
+
}>;
|
|
542
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export const BatchDepositContract = {
|
|
2
|
+
abi: [
|
|
3
|
+
{
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: 'DepositValueGreaterThan2048ETH',
|
|
6
|
+
type: 'error',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
inputs: [],
|
|
10
|
+
name: 'DepositValueLessThan1ETH',
|
|
11
|
+
type: 'error',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
inputs: [],
|
|
15
|
+
name: 'DepositValueMustBeMultipleOfGwei',
|
|
16
|
+
type: 'error',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
inputs: [],
|
|
20
|
+
name: 'InvalidPubKeyLength',
|
|
21
|
+
type: 'error',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
inputs: [],
|
|
25
|
+
name: 'InvalidSignatureLength',
|
|
26
|
+
type: 'error',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
inputs: [],
|
|
30
|
+
name: 'InvalidWithdrawalCredLength',
|
|
31
|
+
type: 'error',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [],
|
|
35
|
+
name: 'MsgValueNotEqualToTotalDepositAmount',
|
|
36
|
+
type: 'error',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
inputs: [],
|
|
40
|
+
name: 'NoDepositsProvided',
|
|
41
|
+
type: 'error',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
anonymous: false,
|
|
45
|
+
inputs: [
|
|
46
|
+
{
|
|
47
|
+
indexed: true,
|
|
48
|
+
internalType: 'bytes',
|
|
49
|
+
name: 'pubKey',
|
|
50
|
+
type: 'bytes',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
indexed: true,
|
|
54
|
+
internalType: 'bytes',
|
|
55
|
+
name: 'withdrawalCredentials',
|
|
56
|
+
type: 'bytes',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
indexed: false,
|
|
60
|
+
internalType: 'uint256',
|
|
61
|
+
name: 'amount',
|
|
62
|
+
type: 'uint256',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
name: 'ValidatorDeposit',
|
|
66
|
+
type: 'event',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
inputs: [
|
|
70
|
+
{
|
|
71
|
+
components: [
|
|
72
|
+
{
|
|
73
|
+
internalType: 'bytes',
|
|
74
|
+
name: 'pubKey',
|
|
75
|
+
type: 'bytes',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
internalType: 'bytes',
|
|
79
|
+
name: 'withdrawalCredentials',
|
|
80
|
+
type: 'bytes',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
internalType: 'bytes',
|
|
84
|
+
name: 'signature',
|
|
85
|
+
type: 'bytes',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
internalType: 'uint256',
|
|
89
|
+
name: 'amount',
|
|
90
|
+
type: 'uint256',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
internalType: 'struct IBatchDeposit.Deposit[]',
|
|
94
|
+
name: '_deposits',
|
|
95
|
+
type: 'tuple[]',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
name: 'batchDeposit',
|
|
99
|
+
outputs: [],
|
|
100
|
+
stateMutability: 'payable',
|
|
101
|
+
type: 'function',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
inputs: [],
|
|
105
|
+
name: 'depositContract',
|
|
106
|
+
outputs: [
|
|
107
|
+
{
|
|
108
|
+
internalType: 'contract IDepositContract',
|
|
109
|
+
name: '',
|
|
110
|
+
type: 'address',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
stateMutability: 'view',
|
|
114
|
+
type: 'function',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export const MultiCall3Contract = {
|
|
2
|
+
abi: [
|
|
3
|
+
{
|
|
4
|
+
inputs: [
|
|
5
|
+
{
|
|
6
|
+
components: [
|
|
7
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
8
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
9
|
+
],
|
|
10
|
+
internalType: 'struct Multicall3.Call[]',
|
|
11
|
+
name: 'calls',
|
|
12
|
+
type: 'tuple[]',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
name: 'aggregate',
|
|
16
|
+
outputs: [
|
|
17
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
18
|
+
{ internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' },
|
|
19
|
+
],
|
|
20
|
+
stateMutability: 'payable',
|
|
21
|
+
type: 'function',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
inputs: [
|
|
25
|
+
{
|
|
26
|
+
components: [
|
|
27
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
28
|
+
{ internalType: 'bool', name: 'allowFailure', type: 'bool' },
|
|
29
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
30
|
+
],
|
|
31
|
+
internalType: 'struct Multicall3.Call3[]',
|
|
32
|
+
name: 'calls',
|
|
33
|
+
type: 'tuple[]',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
name: 'aggregate3',
|
|
37
|
+
outputs: [
|
|
38
|
+
{
|
|
39
|
+
components: [
|
|
40
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
41
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
42
|
+
],
|
|
43
|
+
internalType: 'struct Multicall3.Result[]',
|
|
44
|
+
name: 'returnData',
|
|
45
|
+
type: 'tuple[]',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
stateMutability: 'payable',
|
|
49
|
+
type: 'function',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
inputs: [
|
|
53
|
+
{
|
|
54
|
+
components: [
|
|
55
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
56
|
+
{ internalType: 'bool', name: 'allowFailure', type: 'bool' },
|
|
57
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
58
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
59
|
+
],
|
|
60
|
+
internalType: 'struct Multicall3.Call3Value[]',
|
|
61
|
+
name: 'calls',
|
|
62
|
+
type: 'tuple[]',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
name: 'aggregate3Value',
|
|
66
|
+
outputs: [
|
|
67
|
+
{
|
|
68
|
+
components: [
|
|
69
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
70
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
71
|
+
],
|
|
72
|
+
internalType: 'struct Multicall3.Result[]',
|
|
73
|
+
name: 'returnData',
|
|
74
|
+
type: 'tuple[]',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
stateMutability: 'payable',
|
|
78
|
+
type: 'function',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
inputs: [
|
|
82
|
+
{
|
|
83
|
+
components: [
|
|
84
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
85
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
86
|
+
],
|
|
87
|
+
internalType: 'struct Multicall3.Call[]',
|
|
88
|
+
name: 'calls',
|
|
89
|
+
type: 'tuple[]',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
name: 'blockAndAggregate',
|
|
93
|
+
outputs: [
|
|
94
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
95
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
96
|
+
{
|
|
97
|
+
components: [
|
|
98
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
99
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
100
|
+
],
|
|
101
|
+
internalType: 'struct Multicall3.Result[]',
|
|
102
|
+
name: 'returnData',
|
|
103
|
+
type: 'tuple[]',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
stateMutability: 'payable',
|
|
107
|
+
type: 'function',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
inputs: [],
|
|
111
|
+
name: 'getBasefee',
|
|
112
|
+
outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }],
|
|
113
|
+
stateMutability: 'view',
|
|
114
|
+
type: 'function',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
inputs: [
|
|
118
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
119
|
+
],
|
|
120
|
+
name: 'getBlockHash',
|
|
121
|
+
outputs: [
|
|
122
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
123
|
+
],
|
|
124
|
+
stateMutability: 'view',
|
|
125
|
+
type: 'function',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
inputs: [],
|
|
129
|
+
name: 'getBlockNumber',
|
|
130
|
+
outputs: [
|
|
131
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
132
|
+
],
|
|
133
|
+
stateMutability: 'view',
|
|
134
|
+
type: 'function',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
inputs: [],
|
|
138
|
+
name: 'getChainId',
|
|
139
|
+
outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }],
|
|
140
|
+
stateMutability: 'view',
|
|
141
|
+
type: 'function',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
inputs: [],
|
|
145
|
+
name: 'getCurrentBlockCoinbase',
|
|
146
|
+
outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }],
|
|
147
|
+
stateMutability: 'view',
|
|
148
|
+
type: 'function',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
inputs: [],
|
|
152
|
+
name: 'getCurrentBlockDifficulty',
|
|
153
|
+
outputs: [
|
|
154
|
+
{ internalType: 'uint256', name: 'difficulty', type: 'uint256' },
|
|
155
|
+
],
|
|
156
|
+
stateMutability: 'view',
|
|
157
|
+
type: 'function',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
inputs: [],
|
|
161
|
+
name: 'getCurrentBlockGasLimit',
|
|
162
|
+
outputs: [{ internalType: 'uint256', name: 'gaslimit', type: 'uint256' }],
|
|
163
|
+
stateMutability: 'view',
|
|
164
|
+
type: 'function',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
inputs: [],
|
|
168
|
+
name: 'getCurrentBlockTimestamp',
|
|
169
|
+
outputs: [
|
|
170
|
+
{ internalType: 'uint256', name: 'timestamp', type: 'uint256' },
|
|
171
|
+
],
|
|
172
|
+
stateMutability: 'view',
|
|
173
|
+
type: 'function',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
inputs: [{ internalType: 'address', name: 'addr', type: 'address' }],
|
|
177
|
+
name: 'getEthBalance',
|
|
178
|
+
outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }],
|
|
179
|
+
stateMutability: 'view',
|
|
180
|
+
type: 'function',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
inputs: [],
|
|
184
|
+
name: 'getLastBlockHash',
|
|
185
|
+
outputs: [
|
|
186
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
187
|
+
],
|
|
188
|
+
stateMutability: 'view',
|
|
189
|
+
type: 'function',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
inputs: [
|
|
193
|
+
{ internalType: 'bool', name: 'requireSuccess', type: 'bool' },
|
|
194
|
+
{
|
|
195
|
+
components: [
|
|
196
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
197
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
198
|
+
],
|
|
199
|
+
internalType: 'struct Multicall3.Call[]',
|
|
200
|
+
name: 'calls',
|
|
201
|
+
type: 'tuple[]',
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
name: 'tryAggregate',
|
|
205
|
+
outputs: [
|
|
206
|
+
{
|
|
207
|
+
components: [
|
|
208
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
209
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
210
|
+
],
|
|
211
|
+
internalType: 'struct Multicall3.Result[]',
|
|
212
|
+
name: 'returnData',
|
|
213
|
+
type: 'tuple[]',
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
stateMutability: 'payable',
|
|
217
|
+
type: 'function',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
inputs: [
|
|
221
|
+
{ internalType: 'bool', name: 'requireSuccess', type: 'bool' },
|
|
222
|
+
{
|
|
223
|
+
components: [
|
|
224
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
225
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
226
|
+
],
|
|
227
|
+
internalType: 'struct Multicall3.Call[]',
|
|
228
|
+
name: 'calls',
|
|
229
|
+
type: 'tuple[]',
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
name: 'tryBlockAndAggregate',
|
|
233
|
+
outputs: [
|
|
234
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
235
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
236
|
+
{
|
|
237
|
+
components: [
|
|
238
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
239
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
240
|
+
],
|
|
241
|
+
internalType: 'struct Multicall3.Result[]',
|
|
242
|
+
name: 'returnData',
|
|
243
|
+
type: 'tuple[]',
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
stateMutability: 'payable',
|
|
247
|
+
type: 'function',
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
};
|