@cowprotocol/sdk-ethers-v6-adapter 0.2.0-beta.0 → 0.2.1-beta.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/index.d.mts +17 -22
- package/dist/index.d.ts +17 -22
- package/dist/index.js +0 -3
- package/dist/index.mjs +0 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InterfaceAbi, Interface, BytesLike, TypedDataDomain, TypedDataField, BigNumberish, SignatureLike, JsonRpcProvider,
|
|
2
|
-
import { GenericContractInterface, Log, AdapterUtils, AbstractSigner, TransactionParams, TransactionResponse, AdapterTypes, PrivateKey, AbstractProviderAdapter, TransactionReceipt, Block, GenericContract } from '@cowprotocol/sdk-common';
|
|
1
|
+
import { InterfaceAbi, Interface, BytesLike, TypedDataDomain, TypedDataField, BigNumberish, SignatureLike, JsonRpcProvider, Provider, Signer } from 'ethers';
|
|
2
|
+
import { GenericContractInterface, ContractValue, Log, AdapterUtils, ParamType, AbstractSigner, TransactionParams, TransactionResponse, AdapterTypes, PrivateKey, AbstractProviderAdapter, TransactionReceipt, Block, GenericContract } from '@cowprotocol/sdk-common';
|
|
3
3
|
|
|
4
4
|
declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
5
5
|
private ethersInterface;
|
|
@@ -18,20 +18,20 @@ declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
|
18
18
|
/**
|
|
19
19
|
* Encode function data
|
|
20
20
|
*/
|
|
21
|
-
encodeFunctionData(name: string, args:
|
|
21
|
+
encodeFunctionData(name: string, args: ContractValue[]): string;
|
|
22
22
|
/**
|
|
23
23
|
* Decode function data
|
|
24
24
|
* Fixed to return data in the same format as ethers v5 for compatibility
|
|
25
25
|
*/
|
|
26
|
-
decodeFunctionData(functionName: string, data: string):
|
|
26
|
+
decodeFunctionData(functionName: string, data: string): ContractValue[];
|
|
27
27
|
parseLog(event: Log): {
|
|
28
|
-
args: unknown
|
|
28
|
+
args: Record<string, unknown>;
|
|
29
29
|
} | null;
|
|
30
30
|
getEventTopic(name: string): string | null;
|
|
31
31
|
/**
|
|
32
32
|
* Get all fragments
|
|
33
33
|
*/
|
|
34
|
-
get fragments():
|
|
34
|
+
get fragments(): Record<string, unknown>[];
|
|
35
35
|
/**
|
|
36
36
|
* Get functions object (ethers v5 compatibility)
|
|
37
37
|
*/
|
|
@@ -39,13 +39,13 @@ declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
|
39
39
|
/**
|
|
40
40
|
* Get ABI
|
|
41
41
|
*/
|
|
42
|
-
get abi():
|
|
42
|
+
get abi(): Record<string, unknown>[];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
type Abi$1 = ConstructorParameters<typeof Interface>[0];
|
|
46
46
|
declare class EthersV6Utils implements AdapterUtils {
|
|
47
47
|
toUtf8Bytes(text: string): Uint8Array;
|
|
48
|
-
encodeDeploy(encodeDeployArgs:
|
|
48
|
+
encodeDeploy(encodeDeployArgs: ContractValue[], abi: Abi$1): string;
|
|
49
49
|
getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string;
|
|
50
50
|
hexConcat(items: ReadonlyArray<BytesLike>): string;
|
|
51
51
|
formatBytes32String(text: string): string;
|
|
@@ -54,14 +54,13 @@ declare class EthersV6Utils implements AdapterUtils {
|
|
|
54
54
|
hexZeroPad(value: BytesLike, length: number): string;
|
|
55
55
|
arrayify(hexString: string): Uint8Array;
|
|
56
56
|
hexlify(value: Uint8Array): string;
|
|
57
|
-
solidityPack(types: string[], values:
|
|
57
|
+
solidityPack(types: string[], values: ContractValue[]): string;
|
|
58
58
|
hashTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, data: Record<string, unknown>): string;
|
|
59
59
|
getChecksumAddress(address: string): string;
|
|
60
|
-
encodeAbi(types: string[], values:
|
|
61
|
-
decodeAbi(types: string[], data: BytesLike):
|
|
60
|
+
encodeAbi(types: string[], values: ContractValue[]): BytesLike;
|
|
61
|
+
decodeAbi(types: string[], data: BytesLike): ContractValue[];
|
|
62
62
|
id(text: string): BytesLike;
|
|
63
63
|
toBigIntish(value: string | number | BigNumberish): BigNumberish;
|
|
64
|
-
newBigintish(value: number | string): BigNumberish;
|
|
65
64
|
hexDataSlice(data: BytesLike, offset: number, endOffset?: number): BytesLike;
|
|
66
65
|
joinSignature(signature: {
|
|
67
66
|
r: string;
|
|
@@ -83,19 +82,19 @@ declare class EthersV6Utils implements AdapterUtils {
|
|
|
83
82
|
inputs: Array<{
|
|
84
83
|
type: string;
|
|
85
84
|
}>;
|
|
86
|
-
}>, functionName: string, args:
|
|
85
|
+
}>, functionName: string, args: ContractValue[]): string;
|
|
87
86
|
decodeFunctionData(abi: Array<{
|
|
88
87
|
name: string;
|
|
89
88
|
inputs: Array<{
|
|
90
89
|
type: string;
|
|
91
90
|
}>;
|
|
92
|
-
}>, functionName: string, data: string):
|
|
91
|
+
}>, functionName: string, data: string): ContractValue[];
|
|
93
92
|
toNumber(value: BigNumberish): number;
|
|
94
|
-
solidityKeccak256(types: string[], values:
|
|
93
|
+
solidityKeccak256(types: string[], values: ContractValue[]): string;
|
|
95
94
|
createInterface(abi: InterfaceAbi): EthersV6InterfaceWrapper;
|
|
96
95
|
hashDomain(domain: TypedDataDomain): string;
|
|
97
|
-
grantRequiredRoles(authorizerAddress: string, authorizerAbi: Abi$1, vaultAddress: string, vaultRelayerAddress: string, contractCall: (address: string, abi: Abi$1, functionName: string, args:
|
|
98
|
-
readStorage(baseAddress: string, baseAbi: any[], readerAddress: string, readerAbi: any[], provider: JsonRpcProvider, method: string, parameters:
|
|
96
|
+
grantRequiredRoles(authorizerAddress: string, authorizerAbi: Abi$1, vaultAddress: string, vaultRelayerAddress: string, contractCall: (address: string, abi: Abi$1, functionName: string, args: ContractValue[]) => Promise<void>): Promise<void>;
|
|
97
|
+
readStorage(baseAddress: string, baseAbi: any[], readerAddress: string, readerAbi: any[], provider: JsonRpcProvider, method: string, parameters: ContractValue[]): Promise<any>;
|
|
99
98
|
randomBytes(length: number): string;
|
|
100
99
|
isAddress(address: string): boolean;
|
|
101
100
|
isHexString(value: string): boolean;
|
|
@@ -148,14 +147,10 @@ declare class IntChainIdTypedDataV4Signer extends EthersV6SignerAdapter {
|
|
|
148
147
|
type Abi = ConstructorParameters<typeof Interface>[0];
|
|
149
148
|
interface EthersV6Types extends AdapterTypes {
|
|
150
149
|
Abi: Abi;
|
|
151
|
-
Address: string;
|
|
152
150
|
Bytes: BytesLike;
|
|
153
|
-
BigIntish: BigNumberish;
|
|
154
151
|
ContractInterface: Interface;
|
|
155
152
|
Provider: Provider;
|
|
156
153
|
Signer: Signer;
|
|
157
|
-
TypedDataDomain: TypedDataDomain;
|
|
158
|
-
TypedDataTypes: Record<string, TypedDataField[]>;
|
|
159
154
|
}
|
|
160
155
|
interface EthersV6AdapterOptions {
|
|
161
156
|
provider: Provider | string;
|
|
@@ -183,7 +178,7 @@ declare class EthersV6Adapter extends AbstractProviderAdapter<EthersV6Types> {
|
|
|
183
178
|
address: string;
|
|
184
179
|
abi: Abi;
|
|
185
180
|
functionName: string;
|
|
186
|
-
args?:
|
|
181
|
+
args?: ContractValue[];
|
|
187
182
|
}, provider?: Provider): Promise<unknown>;
|
|
188
183
|
getBlock(blockTag: string, provider?: Provider): Promise<Block>;
|
|
189
184
|
getContract(address: string, abi: Abi): GenericContract;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InterfaceAbi, Interface, BytesLike, TypedDataDomain, TypedDataField, BigNumberish, SignatureLike, JsonRpcProvider,
|
|
2
|
-
import { GenericContractInterface, Log, AdapterUtils, AbstractSigner, TransactionParams, TransactionResponse, AdapterTypes, PrivateKey, AbstractProviderAdapter, TransactionReceipt, Block, GenericContract } from '@cowprotocol/sdk-common';
|
|
1
|
+
import { InterfaceAbi, Interface, BytesLike, TypedDataDomain, TypedDataField, BigNumberish, SignatureLike, JsonRpcProvider, Provider, Signer } from 'ethers';
|
|
2
|
+
import { GenericContractInterface, ContractValue, Log, AdapterUtils, ParamType, AbstractSigner, TransactionParams, TransactionResponse, AdapterTypes, PrivateKey, AbstractProviderAdapter, TransactionReceipt, Block, GenericContract } from '@cowprotocol/sdk-common';
|
|
3
3
|
|
|
4
4
|
declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
5
5
|
private ethersInterface;
|
|
@@ -18,20 +18,20 @@ declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
|
18
18
|
/**
|
|
19
19
|
* Encode function data
|
|
20
20
|
*/
|
|
21
|
-
encodeFunctionData(name: string, args:
|
|
21
|
+
encodeFunctionData(name: string, args: ContractValue[]): string;
|
|
22
22
|
/**
|
|
23
23
|
* Decode function data
|
|
24
24
|
* Fixed to return data in the same format as ethers v5 for compatibility
|
|
25
25
|
*/
|
|
26
|
-
decodeFunctionData(functionName: string, data: string):
|
|
26
|
+
decodeFunctionData(functionName: string, data: string): ContractValue[];
|
|
27
27
|
parseLog(event: Log): {
|
|
28
|
-
args: unknown
|
|
28
|
+
args: Record<string, unknown>;
|
|
29
29
|
} | null;
|
|
30
30
|
getEventTopic(name: string): string | null;
|
|
31
31
|
/**
|
|
32
32
|
* Get all fragments
|
|
33
33
|
*/
|
|
34
|
-
get fragments():
|
|
34
|
+
get fragments(): Record<string, unknown>[];
|
|
35
35
|
/**
|
|
36
36
|
* Get functions object (ethers v5 compatibility)
|
|
37
37
|
*/
|
|
@@ -39,13 +39,13 @@ declare class EthersV6InterfaceWrapper implements GenericContractInterface {
|
|
|
39
39
|
/**
|
|
40
40
|
* Get ABI
|
|
41
41
|
*/
|
|
42
|
-
get abi():
|
|
42
|
+
get abi(): Record<string, unknown>[];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
type Abi$1 = ConstructorParameters<typeof Interface>[0];
|
|
46
46
|
declare class EthersV6Utils implements AdapterUtils {
|
|
47
47
|
toUtf8Bytes(text: string): Uint8Array;
|
|
48
|
-
encodeDeploy(encodeDeployArgs:
|
|
48
|
+
encodeDeploy(encodeDeployArgs: ContractValue[], abi: Abi$1): string;
|
|
49
49
|
getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string;
|
|
50
50
|
hexConcat(items: ReadonlyArray<BytesLike>): string;
|
|
51
51
|
formatBytes32String(text: string): string;
|
|
@@ -54,14 +54,13 @@ declare class EthersV6Utils implements AdapterUtils {
|
|
|
54
54
|
hexZeroPad(value: BytesLike, length: number): string;
|
|
55
55
|
arrayify(hexString: string): Uint8Array;
|
|
56
56
|
hexlify(value: Uint8Array): string;
|
|
57
|
-
solidityPack(types: string[], values:
|
|
57
|
+
solidityPack(types: string[], values: ContractValue[]): string;
|
|
58
58
|
hashTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, data: Record<string, unknown>): string;
|
|
59
59
|
getChecksumAddress(address: string): string;
|
|
60
|
-
encodeAbi(types: string[], values:
|
|
61
|
-
decodeAbi(types: string[], data: BytesLike):
|
|
60
|
+
encodeAbi(types: string[], values: ContractValue[]): BytesLike;
|
|
61
|
+
decodeAbi(types: string[], data: BytesLike): ContractValue[];
|
|
62
62
|
id(text: string): BytesLike;
|
|
63
63
|
toBigIntish(value: string | number | BigNumberish): BigNumberish;
|
|
64
|
-
newBigintish(value: number | string): BigNumberish;
|
|
65
64
|
hexDataSlice(data: BytesLike, offset: number, endOffset?: number): BytesLike;
|
|
66
65
|
joinSignature(signature: {
|
|
67
66
|
r: string;
|
|
@@ -83,19 +82,19 @@ declare class EthersV6Utils implements AdapterUtils {
|
|
|
83
82
|
inputs: Array<{
|
|
84
83
|
type: string;
|
|
85
84
|
}>;
|
|
86
|
-
}>, functionName: string, args:
|
|
85
|
+
}>, functionName: string, args: ContractValue[]): string;
|
|
87
86
|
decodeFunctionData(abi: Array<{
|
|
88
87
|
name: string;
|
|
89
88
|
inputs: Array<{
|
|
90
89
|
type: string;
|
|
91
90
|
}>;
|
|
92
|
-
}>, functionName: string, data: string):
|
|
91
|
+
}>, functionName: string, data: string): ContractValue[];
|
|
93
92
|
toNumber(value: BigNumberish): number;
|
|
94
|
-
solidityKeccak256(types: string[], values:
|
|
93
|
+
solidityKeccak256(types: string[], values: ContractValue[]): string;
|
|
95
94
|
createInterface(abi: InterfaceAbi): EthersV6InterfaceWrapper;
|
|
96
95
|
hashDomain(domain: TypedDataDomain): string;
|
|
97
|
-
grantRequiredRoles(authorizerAddress: string, authorizerAbi: Abi$1, vaultAddress: string, vaultRelayerAddress: string, contractCall: (address: string, abi: Abi$1, functionName: string, args:
|
|
98
|
-
readStorage(baseAddress: string, baseAbi: any[], readerAddress: string, readerAbi: any[], provider: JsonRpcProvider, method: string, parameters:
|
|
96
|
+
grantRequiredRoles(authorizerAddress: string, authorizerAbi: Abi$1, vaultAddress: string, vaultRelayerAddress: string, contractCall: (address: string, abi: Abi$1, functionName: string, args: ContractValue[]) => Promise<void>): Promise<void>;
|
|
97
|
+
readStorage(baseAddress: string, baseAbi: any[], readerAddress: string, readerAbi: any[], provider: JsonRpcProvider, method: string, parameters: ContractValue[]): Promise<any>;
|
|
99
98
|
randomBytes(length: number): string;
|
|
100
99
|
isAddress(address: string): boolean;
|
|
101
100
|
isHexString(value: string): boolean;
|
|
@@ -148,14 +147,10 @@ declare class IntChainIdTypedDataV4Signer extends EthersV6SignerAdapter {
|
|
|
148
147
|
type Abi = ConstructorParameters<typeof Interface>[0];
|
|
149
148
|
interface EthersV6Types extends AdapterTypes {
|
|
150
149
|
Abi: Abi;
|
|
151
|
-
Address: string;
|
|
152
150
|
Bytes: BytesLike;
|
|
153
|
-
BigIntish: BigNumberish;
|
|
154
151
|
ContractInterface: Interface;
|
|
155
152
|
Provider: Provider;
|
|
156
153
|
Signer: Signer;
|
|
157
|
-
TypedDataDomain: TypedDataDomain;
|
|
158
|
-
TypedDataTypes: Record<string, TypedDataField[]>;
|
|
159
154
|
}
|
|
160
155
|
interface EthersV6AdapterOptions {
|
|
161
156
|
provider: Provider | string;
|
|
@@ -183,7 +178,7 @@ declare class EthersV6Adapter extends AbstractProviderAdapter<EthersV6Types> {
|
|
|
183
178
|
address: string;
|
|
184
179
|
abi: Abi;
|
|
185
180
|
functionName: string;
|
|
186
|
-
args?:
|
|
181
|
+
args?: ContractValue[];
|
|
187
182
|
}, provider?: Provider): Promise<unknown>;
|
|
188
183
|
getBlock(blockTag: string, provider?: Provider): Promise<Block>;
|
|
189
184
|
getContract(address: string, abi: Abi): GenericContract;
|
package/dist/index.js
CHANGED
|
@@ -278,9 +278,6 @@ var EthersV6Utils = class {
|
|
|
278
278
|
toBigIntish(value) {
|
|
279
279
|
return (0, import_ethers2.toBigInt)(value);
|
|
280
280
|
}
|
|
281
|
-
newBigintish(value) {
|
|
282
|
-
return (0, import_ethers2.toBigInt)(value);
|
|
283
|
-
}
|
|
284
281
|
hexDataSlice(data, offset, endOffset) {
|
|
285
282
|
return (0, import_ethers2.dataSlice)(data, offset, endOffset);
|
|
286
283
|
}
|
package/dist/index.mjs
CHANGED