starknet 4.9.0 → 4.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 +22 -0
- package/README.md +1 -3
- package/__tests__/account.test.ts +1 -1
- package/__tests__/defaultProvider.test.ts +85 -210
- package/__tests__/fixtures.ts +1 -1
- package/__tests__/rpcProvider.test.ts +4 -3
- package/__tests__/udc.test.ts +41 -0
- package/account/default.d.ts +3 -1
- package/account/default.js +50 -0
- package/account/interface.d.ts +24 -7
- package/constants.d.ts +7 -1
- package/constants.js +7 -1
- package/contract/default.d.ts +11 -27
- package/contract/default.js +104 -120
- package/contract/interface.d.ts +5 -2
- package/dist/account/default.d.ts +3 -1
- package/dist/account/default.js +50 -0
- package/dist/account/interface.d.ts +24 -7
- package/dist/constants.d.ts +7 -1
- package/dist/constants.js +7 -1
- package/dist/contract/default.d.ts +11 -27
- package/dist/contract/default.js +104 -120
- package/dist/contract/interface.d.ts +5 -2
- package/dist/provider/rpc.d.ts +3 -1
- package/dist/provider/rpc.js +15 -2
- package/dist/provider/sequencer.d.ts +4 -2
- package/dist/provider/sequencer.js +18 -5
- package/dist/signer/default.d.ts +2 -2
- package/dist/signer/default.js +15 -15
- package/dist/signer/interface.d.ts +2 -0
- package/dist/types/api/index.d.ts +0 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib.d.ts +13 -0
- package/dist/utils/number.d.ts +1 -0
- package/dist/utils/number.js +3 -1
- package/package.json +1 -1
- package/provider/rpc.d.ts +3 -1
- package/provider/rpc.js +15 -2
- package/provider/sequencer.d.ts +4 -2
- package/provider/sequencer.js +18 -5
- package/signer/default.d.ts +2 -2
- package/signer/default.js +15 -15
- package/signer/interface.d.ts +2 -0
- package/src/account/default.ts +43 -3
- package/src/account/interface.ts +34 -7
- package/src/constants.ts +7 -0
- package/src/contract/default.ts +123 -140
- package/src/contract/interface.ts +5 -2
- package/src/provider/rpc.ts +7 -3
- package/src/provider/sequencer.ts +13 -4
- package/src/signer/default.ts +18 -18
- package/src/signer/interface.ts +2 -0
- package/src/types/api/index.ts +0 -4
- package/src/types/index.ts +1 -1
- package/src/types/lib.ts +13 -0
- package/src/utils/number.ts +2 -0
- package/types/api/index.d.ts +0 -6
- package/types/index.d.ts +1 -1
- package/types/lib.d.ts +13 -0
- package/utils/number.d.ts +1 -0
- package/utils/number.js +3 -1
- package/www/docs/API/account.md +122 -22
- package/www/docs/API/contract.md +39 -3
- package/www/docs/API/provider.md +4 -0
- package/www/docs/API/signer.md +56 -2
package/www/docs/API/signer.md
CHANGED
|
@@ -20,7 +20,15 @@ Returns the public key of the signer.
|
|
|
20
20
|
|
|
21
21
|
signer.**signTransaction**(transactions, transactionsDetail [ , abi ]) => _Promise < Signature >_
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Signs a transaction with the starknet private key and returns the signature.
|
|
24
|
+
|
|
25
|
+
The _transactions_ object for write methods may include any of:
|
|
26
|
+
|
|
27
|
+
- transactions.**contractAddress** - the address of the contract
|
|
28
|
+
- transactions.**entrypoint** - the entrypoint of the contract
|
|
29
|
+
- transactions.**calldata** - (defaults to []) the calldata
|
|
30
|
+
|
|
31
|
+
_abi_ - (optional) the abi of the contract for better displaying
|
|
24
32
|
|
|
25
33
|
###### _Signature_
|
|
26
34
|
|
|
@@ -32,7 +40,53 @@ string[]
|
|
|
32
40
|
|
|
33
41
|
signer.**signMessage**(typedData, accountAddress) => _Promise < Signature >_
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
Sign an JSON object for off-chain usage with the starknet private key and return the signature. This adds a message prefix so it cant be interchanged with transactions.
|
|
44
|
+
|
|
45
|
+
_typedData_ - JSON object to be signed
|
|
46
|
+
_accountAddress_ - calldata to be passed in deploy constructor
|
|
47
|
+
|
|
48
|
+
###### _Signature_
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
string[]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<hr />
|
|
55
|
+
|
|
56
|
+
signer.**signDeployAccountTransaction**(transaction) => _Promise < Signature >_
|
|
57
|
+
|
|
58
|
+
Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature.
|
|
59
|
+
|
|
60
|
+
The _transactions_ object for write methods may include any of:
|
|
61
|
+
|
|
62
|
+
- transactions.**contractAddress** - the address of the contract
|
|
63
|
+
- transactions.**constructorCalldata** - calldata to be passed in deploy constructor
|
|
64
|
+
- transactions.**addressSalt** - contract address salt
|
|
65
|
+
- transactions.**chainId** - the chainId to declare contract on
|
|
66
|
+
- transactions.**maxFee** - maxFee for the declare transaction
|
|
67
|
+
- transactions.**version** - transaction version
|
|
68
|
+
- transactions.**nonce** - Nonce of the declare transaction
|
|
69
|
+
|
|
70
|
+
###### _Signature_
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
string[]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
<hr />
|
|
77
|
+
|
|
78
|
+
signer.**signDeclareTransaction**(transaction, transactionsDetail [ , abi ]) => _Promise < Signature >_
|
|
79
|
+
|
|
80
|
+
Signs a DECLARE transaction with the starknet private key and returns the signature.
|
|
81
|
+
|
|
82
|
+
The _transaction_ object for write methods may include any of:
|
|
83
|
+
|
|
84
|
+
- transactions.**classHash** - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract
|
|
85
|
+
- transactions.**senderAddress** - the address of the sender
|
|
86
|
+
- transactions.**chainId** - the chainId to declare contract on
|
|
87
|
+
- transactions.**maxFee** - maxFee for the declare transaction
|
|
88
|
+
- transactions.**version** - transaction version
|
|
89
|
+
- transactions.**nonce** - Nonce of the declare transaction
|
|
36
90
|
|
|
37
91
|
###### _Signature_
|
|
38
92
|
|