starknet 3.9.0 → 3.10.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/CHANGELOG.md +11 -0
- package/__mocks__/ArgentAccount.json +32022 -38726
- package/__tests__/accountContract.test.ts +42 -32
- package/__tests__/contract.test.ts +20 -6
- package/__tests__/utils/__snapshots__/utils.browser.test.ts.snap +2 -2
- package/__tests__/utils/__snapshots__/utils.test.ts.snap +2 -2
- package/__tests__/utils/ellipticalCurve.test.ts +26 -8
- package/__tests__/utils/transactionHash.test.ts +17 -0
- package/account/default.js +10 -21
- package/constants.d.ts +9 -0
- package/constants.js +13 -0
- package/dist/account/default.js +9 -5
- package/dist/constants.d.ts +9 -0
- package/dist/constants.js +12 -1
- package/dist/provider/default.d.ts +3 -0
- package/dist/provider/default.js +18 -0
- package/dist/provider/interface.d.ts +2 -0
- package/dist/signer/default.js +4 -2
- package/dist/signer/ledger.js +4 -2
- package/dist/types/signer.d.ts +2 -0
- package/dist/utils/hash.d.ts +4 -3
- package/dist/utils/hash.js +24 -24
- package/dist/utils/transaction.d.ts +2 -0
- package/dist/utils/transaction.js +5 -1
- package/dist/utils/typedData/index.d.ts +2 -2
- package/dist/utils/typedData/types.d.ts +3 -3
- package/dist/utils/typedData/utils.d.ts +1 -1
- package/package.json +1 -1
- package/provider/default.d.ts +3 -0
- package/provider/default.js +19 -0
- package/provider/interface.d.ts +2 -0
- package/signer/default.js +12 -6
- package/signer/ledger.js +12 -5
- package/src/account/default.ts +16 -9
- package/src/constants.ts +10 -0
- package/src/provider/default.ts +19 -0
- package/src/provider/interface.ts +3 -0
- package/src/signer/default.ts +10 -6
- package/src/signer/ledger.ts +10 -5
- package/src/types/signer.ts +2 -0
- package/src/utils/hash.ts +68 -26
- package/src/utils/transaction.ts +7 -0
- package/types/signer.d.ts +2 -0
- package/utils/hash.d.ts +24 -8
- package/utils/hash.js +55 -28
- package/utils/transaction.d.ts +5 -0
- package/utils/transaction.js +12 -1
- package/utils/typedData/index.d.ts +2 -2
- package/utils/typedData/types.d.ts +3 -3
- package/utils/typedData/utils.d.ts +1 -1
- package/__tests__/constancts.ts +0 -2
package/utils/transaction.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Call, ParsedStruct } from '../types';
|
|
2
|
+
import { BigNumberish } from './number';
|
|
2
3
|
/**
|
|
3
4
|
* Transforms a list of Calls, each with their own calldata, into
|
|
4
5
|
* two arrays: one with the entrypoints, and one with the concatenated calldata.
|
|
@@ -16,3 +17,7 @@ export declare const transformCallsToMulticallArrays: (calls: Call[]) => {
|
|
|
16
17
|
* @returns
|
|
17
18
|
*/
|
|
18
19
|
export declare const fromCallsToExecuteCalldata: (calls: Call[]) => string[];
|
|
20
|
+
export declare const fromCallsToExecuteCalldataWithNonce: (
|
|
21
|
+
calls: Call[],
|
|
22
|
+
nonce: BigNumberish
|
|
23
|
+
) => string[];
|
package/utils/transaction.js
CHANGED
|
@@ -34,7 +34,10 @@ var __spreadArray =
|
|
|
34
34
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
37
|
-
exports.
|
|
37
|
+
exports.fromCallsToExecuteCalldataWithNonce =
|
|
38
|
+
exports.fromCallsToExecuteCalldata =
|
|
39
|
+
exports.transformCallsToMulticallArrays =
|
|
40
|
+
void 0;
|
|
38
41
|
var hash_1 = require('./hash');
|
|
39
42
|
var number_1 = require('./number');
|
|
40
43
|
/**
|
|
@@ -97,3 +100,11 @@ var fromCallsToExecuteCalldata = function (calls) {
|
|
|
97
100
|
);
|
|
98
101
|
};
|
|
99
102
|
exports.fromCallsToExecuteCalldata = fromCallsToExecuteCalldata;
|
|
103
|
+
var fromCallsToExecuteCalldataWithNonce = function (calls, nonce) {
|
|
104
|
+
return __spreadArray(
|
|
105
|
+
__spreadArray([], __read((0, exports.fromCallsToExecuteCalldata)(calls)), false),
|
|
106
|
+
[(0, number_1.toBN)(nonce).toString()],
|
|
107
|
+
false
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
exports.fromCallsToExecuteCalldataWithNonce = fromCallsToExecuteCalldataWithNonce;
|
|
@@ -56,8 +56,8 @@ export declare const encodeData: <
|
|
|
56
56
|
primaryType: string;
|
|
57
57
|
domain: {
|
|
58
58
|
version?: string | undefined;
|
|
59
|
-
name?: string | undefined;
|
|
60
59
|
chainId?: string | number | undefined;
|
|
60
|
+
name?: string | undefined;
|
|
61
61
|
};
|
|
62
62
|
message: Record<string, unknown>;
|
|
63
63
|
}
|
|
@@ -92,8 +92,8 @@ export declare const getStructHash: <
|
|
|
92
92
|
primaryType: string;
|
|
93
93
|
domain: {
|
|
94
94
|
version?: string | undefined;
|
|
95
|
-
name?: string | undefined;
|
|
96
95
|
chainId?: string | number | undefined;
|
|
96
|
+
name?: string | undefined;
|
|
97
97
|
};
|
|
98
98
|
message: Record<string, unknown>;
|
|
99
99
|
}
|
|
@@ -30,8 +30,8 @@ export declare type StarkNetType = Infer<typeof STARKNET_TYPE>;
|
|
|
30
30
|
export declare const STARKNET_DOMAIN_TYPE: import('superstruct').Struct<
|
|
31
31
|
{
|
|
32
32
|
version?: string | undefined;
|
|
33
|
-
name?: string | undefined;
|
|
34
33
|
chainId?: string | number | undefined;
|
|
34
|
+
name?: string | undefined;
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: import('superstruct').Struct<string | undefined, null>;
|
|
@@ -60,8 +60,8 @@ export declare const STARKNET_TYPED_DATA_TYPE: import('superstruct').Struct<
|
|
|
60
60
|
primaryType: string;
|
|
61
61
|
domain: {
|
|
62
62
|
version?: string | undefined;
|
|
63
|
-
name?: string | undefined;
|
|
64
63
|
chainId?: string | number | undefined;
|
|
64
|
+
name?: string | undefined;
|
|
65
65
|
};
|
|
66
66
|
message: Record<string, unknown>;
|
|
67
67
|
},
|
|
@@ -85,8 +85,8 @@ export declare const STARKNET_TYPED_DATA_TYPE: import('superstruct').Struct<
|
|
|
85
85
|
domain: import('superstruct').Struct<
|
|
86
86
|
{
|
|
87
87
|
version?: string | undefined;
|
|
88
|
-
name?: string | undefined;
|
|
89
88
|
chainId?: string | number | undefined;
|
|
89
|
+
name?: string | undefined;
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
name: import('superstruct').Struct<string | undefined, null>;
|
|
@@ -20,8 +20,8 @@ export declare const validateTypedData: (data: unknown) => data is {
|
|
|
20
20
|
primaryType: string;
|
|
21
21
|
domain: {
|
|
22
22
|
version?: string | undefined;
|
|
23
|
-
name?: string | undefined;
|
|
24
23
|
chainId?: string | number | undefined;
|
|
24
|
+
name?: string | undefined;
|
|
25
25
|
};
|
|
26
26
|
message: Record<string, unknown>;
|
|
27
27
|
};
|
package/__tests__/constancts.ts
DELETED