starknet 4.13.0 → 4.13.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/CHANGELOG.md +13 -0
- package/__tests__/contract.test.ts +1 -1
- package/dist/index.d.ts +315 -348
- package/dist/index.global.js +0 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -4
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +315 -348
- package/index.global.js +0 -4
- package/index.global.js.map +1 -1
- package/index.js +0 -5
- package/index.js.map +1 -1
- package/index.mjs +0 -4
- package/index.mjs.map +1 -1
- package/package.json +12 -3
- package/src/account/default.ts +6 -7
- package/src/account/interface.ts +4 -6
- package/src/provider/default.ts +3 -5
- package/src/provider/interface.ts +4 -6
- package/src/provider/rpc.ts +4 -6
- package/src/provider/sequencer.ts +7 -8
- package/src/signer/default.ts +1 -1
- package/src/signer/interface.ts +8 -2
- package/src/types/api/index.ts +0 -3
- package/src/types/api/sequencer.ts +0 -4
- package/src/types/index.ts +2 -1
- package/src/utils/hash.ts +1 -1
- package/src/utils/responseParser/rpc.ts +1 -1
- package/src/utils/responseParser/sequencer.ts +1 -1
- package/tsup.config.ts +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starknet",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.2",
|
|
4
4
|
"description": "JavaScript library for StarkNet",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"browser": "dist/index.global.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
|
+
"browser": "./dist/index.global.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
9
17
|
"scripts": {
|
|
10
18
|
"prepare": "npm run build && husky install",
|
|
11
|
-
"build": "tsup && npm run build:esm && npm run build:iife",
|
|
19
|
+
"build": "tsup && npm run build:esm && npm run build:iife && npm run build:dts",
|
|
12
20
|
"build:esm": "tsup --clean false --format esm --platform node",
|
|
13
21
|
"build:iife": "tsup --clean false --format iife --platform browser",
|
|
22
|
+
"build:dts": "tsup --clean false --dts-only",
|
|
14
23
|
"pretest": "npm run lint",
|
|
15
24
|
"test": "jest",
|
|
16
25
|
"posttest": "npm run format",
|
|
@@ -64,7 +73,7 @@
|
|
|
64
73
|
"lint-staged": "^13.0.1",
|
|
65
74
|
"prettier": "^2.7.0",
|
|
66
75
|
"prettier-plugin-import-sort": "^0.0.7",
|
|
67
|
-
"tsup": "
|
|
76
|
+
"tsup": "~6.3.0",
|
|
68
77
|
"typedoc": "^0.22.17",
|
|
69
78
|
"typescript": "^4.7.3"
|
|
70
79
|
},
|
package/src/account/default.ts
CHANGED
|
@@ -5,23 +5,22 @@ import { BlockIdentifier } from '../provider/utils';
|
|
|
5
5
|
import { Signer, SignerInterface } from '../signer';
|
|
6
6
|
import {
|
|
7
7
|
Abi,
|
|
8
|
+
AllowArray,
|
|
8
9
|
Call,
|
|
10
|
+
DeclareContractPayload,
|
|
9
11
|
DeclareContractResponse,
|
|
12
|
+
DeployAccountContractPayload,
|
|
10
13
|
DeployContractResponse,
|
|
14
|
+
EstimateFee,
|
|
11
15
|
EstimateFeeAction,
|
|
16
|
+
EstimateFeeDetails,
|
|
12
17
|
InvocationsDetails,
|
|
13
18
|
InvocationsSignerDetails,
|
|
14
19
|
InvokeFunctionResponse,
|
|
15
20
|
KeyPair,
|
|
16
21
|
Signature,
|
|
17
|
-
} from '../types';
|
|
18
|
-
import { EstimateFee, EstimateFeeDetails } from '../types/account';
|
|
19
|
-
import {
|
|
20
|
-
AllowArray,
|
|
21
|
-
DeclareContractPayload,
|
|
22
|
-
DeployAccountContractPayload,
|
|
23
22
|
UniversalDeployerContractPayload,
|
|
24
|
-
} from '../types
|
|
23
|
+
} from '../types';
|
|
25
24
|
import {
|
|
26
25
|
calculateContractAddressFromHash,
|
|
27
26
|
feeTransactionVersion,
|
package/src/account/interface.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { BlockIdentifier } from '../provider/utils';
|
|
|
3
3
|
import { SignerInterface } from '../signer';
|
|
4
4
|
import {
|
|
5
5
|
Abi,
|
|
6
|
+
AllowArray,
|
|
6
7
|
Call,
|
|
8
|
+
DeclareContractPayload,
|
|
7
9
|
DeclareContractResponse,
|
|
10
|
+
DeployAccountContractPayload,
|
|
8
11
|
DeployContractResponse,
|
|
9
12
|
EstimateFeeAction,
|
|
10
13
|
EstimateFeeDetails,
|
|
@@ -12,13 +15,8 @@ import {
|
|
|
12
15
|
InvocationsDetails,
|
|
13
16
|
InvokeFunctionResponse,
|
|
14
17
|
Signature,
|
|
15
|
-
} from '../types';
|
|
16
|
-
import {
|
|
17
|
-
AllowArray,
|
|
18
|
-
DeclareContractPayload,
|
|
19
|
-
DeployAccountContractPayload,
|
|
20
18
|
UniversalDeployerContractPayload,
|
|
21
|
-
} from '../types
|
|
19
|
+
} from '../types';
|
|
22
20
|
import { BigNumberish } from '../utils/number';
|
|
23
21
|
import { TypedData } from '../utils/typedData/types';
|
|
24
22
|
|
package/src/provider/default.ts
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
CallContractResponse,
|
|
5
5
|
ContractClass,
|
|
6
6
|
DeclareContractResponse,
|
|
7
|
+
DeclareContractTransaction,
|
|
8
|
+
DeployAccountContractTransaction,
|
|
7
9
|
DeployContractPayload,
|
|
8
10
|
DeployContractResponse,
|
|
9
11
|
EstimateFeeResponse,
|
|
@@ -12,14 +14,10 @@ import {
|
|
|
12
14
|
GetTransactionReceiptResponse,
|
|
13
15
|
GetTransactionResponse,
|
|
14
16
|
Invocation,
|
|
17
|
+
InvocationsDetails,
|
|
15
18
|
InvocationsDetailsWithNonce,
|
|
16
19
|
InvokeFunctionResponse,
|
|
17
20
|
} from '../types';
|
|
18
|
-
import {
|
|
19
|
-
DeclareContractTransaction,
|
|
20
|
-
DeployAccountContractTransaction,
|
|
21
|
-
InvocationsDetails,
|
|
22
|
-
} from '../types/lib';
|
|
23
21
|
import { BigNumberish } from '../utils/number';
|
|
24
22
|
import { ProviderInterface } from './interface';
|
|
25
23
|
import { RpcProvider, RpcProviderOptions } from './rpc';
|
|
@@ -4,6 +4,9 @@ import type {
|
|
|
4
4
|
CallContractResponse,
|
|
5
5
|
ContractClass,
|
|
6
6
|
DeclareContractResponse,
|
|
7
|
+
DeclareContractTransaction,
|
|
8
|
+
DeployAccountContractPayload,
|
|
9
|
+
DeployAccountContractTransaction,
|
|
7
10
|
DeployContractPayload,
|
|
8
11
|
DeployContractResponse,
|
|
9
12
|
EstimateFeeResponse,
|
|
@@ -12,15 +15,10 @@ import type {
|
|
|
12
15
|
GetTransactionReceiptResponse,
|
|
13
16
|
GetTransactionResponse,
|
|
14
17
|
Invocation,
|
|
18
|
+
InvocationsDetails,
|
|
15
19
|
InvocationsDetailsWithNonce,
|
|
16
20
|
InvokeFunctionResponse,
|
|
17
21
|
} from '../types';
|
|
18
|
-
import {
|
|
19
|
-
DeclareContractTransaction,
|
|
20
|
-
DeployAccountContractPayload,
|
|
21
|
-
DeployAccountContractTransaction,
|
|
22
|
-
InvocationsDetails,
|
|
23
|
-
} from '../types/lib';
|
|
24
22
|
import type { BigNumberish } from '../utils/number';
|
|
25
23
|
import { BlockIdentifier } from './utils';
|
|
26
24
|
|
package/src/provider/rpc.ts
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
Call,
|
|
4
4
|
CallContractResponse,
|
|
5
5
|
DeclareContractResponse,
|
|
6
|
+
DeclareContractTransaction,
|
|
7
|
+
DeployAccountContractTransaction,
|
|
6
8
|
DeployContractPayload,
|
|
7
9
|
DeployContractResponse,
|
|
8
10
|
EstimateFeeResponse,
|
|
@@ -10,15 +12,11 @@ import {
|
|
|
10
12
|
GetCodeResponse,
|
|
11
13
|
GetTransactionResponse,
|
|
12
14
|
Invocation,
|
|
15
|
+
InvocationsDetails,
|
|
13
16
|
InvocationsDetailsWithNonce,
|
|
14
17
|
InvokeFunctionResponse,
|
|
18
|
+
RPC,
|
|
15
19
|
} from '../types';
|
|
16
|
-
import { RPC } from '../types/api';
|
|
17
|
-
import {
|
|
18
|
-
DeclareContractTransaction,
|
|
19
|
-
DeployAccountContractTransaction,
|
|
20
|
-
InvocationsDetails,
|
|
21
|
-
} from '../types/lib';
|
|
22
20
|
import fetch from '../utils/fetchPonyfill';
|
|
23
21
|
import { getSelectorFromName } from '../utils/hash';
|
|
24
22
|
import { stringify } from '../utils/json';
|
|
@@ -4,26 +4,25 @@ import { StarknetChainId } from '../constants';
|
|
|
4
4
|
import {
|
|
5
5
|
Call,
|
|
6
6
|
CallContractResponse,
|
|
7
|
+
CallL1Handler,
|
|
7
8
|
ContractClass,
|
|
8
9
|
DeclareContractResponse,
|
|
10
|
+
DeclareContractTransaction,
|
|
11
|
+
DeployAccountContractTransaction,
|
|
9
12
|
DeployContractPayload,
|
|
10
13
|
DeployContractResponse,
|
|
11
14
|
EstimateFeeResponse,
|
|
12
15
|
GetBlockResponse,
|
|
16
|
+
GetContractAddressesResponse,
|
|
13
17
|
GetTransactionReceiptResponse,
|
|
14
18
|
GetTransactionResponse,
|
|
19
|
+
GetTransactionStatusResponse,
|
|
20
|
+
GetTransactionTraceResponse,
|
|
15
21
|
Invocation,
|
|
16
22
|
InvocationsDetailsWithNonce,
|
|
17
23
|
InvokeFunctionResponse,
|
|
18
|
-
} from '../types';
|
|
19
|
-
import {
|
|
20
|
-
CallL1Handler,
|
|
21
|
-
GetContractAddressesResponse,
|
|
22
|
-
GetTransactionStatusResponse,
|
|
23
|
-
GetTransactionTraceResponse,
|
|
24
24
|
Sequencer,
|
|
25
|
-
} from '../types
|
|
26
|
-
import { DeclareContractTransaction, DeployAccountContractTransaction } from '../types/lib';
|
|
25
|
+
} from '../types';
|
|
27
26
|
import fetch from '../utils/fetchPonyfill';
|
|
28
27
|
import { getSelector, getSelectorFromName } from '../utils/hash';
|
|
29
28
|
import { parse, parseAlwaysAsBig, stringify } from '../utils/json';
|
package/src/signer/default.ts
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Abi,
|
|
3
3
|
Call,
|
|
4
4
|
DeclareSignerDetails,
|
|
5
|
+
DeployAccountSignerDetails,
|
|
5
6
|
InvocationsSignerDetails,
|
|
6
7
|
KeyPair,
|
|
7
8
|
Signature,
|
|
8
9
|
} from '../types';
|
|
9
|
-
import { DeployAccountSignerDetails } from '../types/signer';
|
|
10
10
|
import { genKeyPair, getStarkKey, sign } from '../utils/ellipticCurve';
|
|
11
11
|
import {
|
|
12
12
|
calculateDeclareTransactionHash,
|
package/src/signer/interface.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Abi,
|
|
3
|
+
Call,
|
|
4
|
+
DeclareSignerDetails,
|
|
5
|
+
DeployAccountSignerDetails,
|
|
6
|
+
InvocationsSignerDetails,
|
|
7
|
+
Signature,
|
|
8
|
+
} from '../types';
|
|
3
9
|
import { TypedData } from '../utils/typedData';
|
|
4
10
|
|
|
5
11
|
export abstract class SignerInterface {
|
package/src/types/api/index.ts
CHANGED
|
@@ -62,10 +62,6 @@ export type GetTransactionTraceResponse = {
|
|
|
62
62
|
signature: Signature;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
export type RawArgs = {
|
|
66
|
-
[inputName: string]: string | string[] | { type: 'struct'; [k: string]: BigNumberish };
|
|
67
|
-
};
|
|
68
|
-
|
|
69
65
|
export type CallL1Handler = {
|
|
70
66
|
from_address: string;
|
|
71
67
|
to_address: string;
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './lib';
|
|
2
|
-
export * as api from './api';
|
|
3
2
|
export { Calldata, Overrides } from './api';
|
|
4
3
|
export * from './signer';
|
|
5
4
|
export * from './contract';
|
|
6
5
|
export * from './account';
|
|
7
6
|
export * from './provider';
|
|
7
|
+
export * from './api/sequencer';
|
|
8
|
+
export * from './api/rpc';
|
package/src/utils/hash.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TransactionHashPrefix,
|
|
14
14
|
ZERO,
|
|
15
15
|
} from '../constants';
|
|
16
|
-
import { RawCalldata } from '../types
|
|
16
|
+
import { RawCalldata } from '../types';
|
|
17
17
|
import { ec } from './ellipticCurve';
|
|
18
18
|
import { addHexPrefix, buf2hex, removeHexPrefix, utf8ToArray } from './encode';
|
|
19
19
|
import {
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
GetTransactionReceiptResponse,
|
|
12
12
|
GetTransactionResponse,
|
|
13
13
|
InvokeFunctionResponse,
|
|
14
|
+
Sequencer,
|
|
14
15
|
} from '../../types';
|
|
15
|
-
import { Sequencer } from '../../types/api';
|
|
16
16
|
import { toBN } from '../number';
|
|
17
17
|
import { ResponseParser } from '.';
|
|
18
18
|
|