starknet 4.16.0 → 4.17.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/__tests__/account.test.ts +2 -0
- package/__tests__/contract.test.ts +14 -2
- package/__tests__/defaultProvider.test.ts +4 -2
- package/__tests__/fixtures.ts +1 -1
- package/__tests__/rpcProvider.test.ts +2 -6
- package/dist/index.d.ts +8 -45
- package/dist/index.global.js +4128 -4106
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +199 -177
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +199 -177
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +8 -45
- package/index.global.js +4128 -4106
- package/index.global.js.map +1 -1
- package/index.js +199 -177
- package/index.js.map +1 -1
- package/index.mjs +199 -177
- package/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/contract/contractFactory.ts +13 -6
- package/src/contract/default.ts +11 -226
- package/src/provider/default.ts +2 -2
- package/src/provider/interface.ts +2 -2
- package/src/utils/calldata.ts +250 -0
- package/www/docs/API/account.md +50 -24
- package/www/docs/API/contract.md +20 -6
- package/www/docs/API/contractFactory.md +7 -3
- package/www/docs/API/provider.md +126 -44
- package/www/docs/API/signer.md +14 -4
- package/www/docs/API/utils.md +23 -5
package/www/docs/API/signer.md
CHANGED
|
@@ -12,11 +12,15 @@ The **Signer** API allows you to sign transactions and messages, and also allows
|
|
|
12
12
|
|
|
13
13
|
## Methods
|
|
14
14
|
|
|
15
|
+
### getPubKey()
|
|
16
|
+
|
|
15
17
|
signer.**getPubKey**() => _Promise < string >_
|
|
16
18
|
|
|
17
19
|
Returns the public key of the signer.
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### signTransaction()
|
|
20
24
|
|
|
21
25
|
signer.**signTransaction**(transactions, transactionsDetail [ , abi ]) => _Promise < Signature >_
|
|
22
26
|
|
|
@@ -36,7 +40,9 @@ _abi_ - (optional) the abi of the contract for better displaying
|
|
|
36
40
|
string[]
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### signMessage()
|
|
40
46
|
|
|
41
47
|
signer.**signMessage**(typedData, accountAddress) => _Promise < Signature >_
|
|
42
48
|
|
|
@@ -51,7 +57,9 @@ _accountAddress_ - calldata to be passed in deploy constructor
|
|
|
51
57
|
string[]
|
|
52
58
|
```
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### signDeployAccountTransaction()
|
|
55
63
|
|
|
56
64
|
signer.**signDeployAccountTransaction**(transaction) => _Promise < Signature >_
|
|
57
65
|
|
|
@@ -73,7 +81,9 @@ The _transactions_ object for write methods may include any of:
|
|
|
73
81
|
string[]
|
|
74
82
|
```
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### signDeclareTransaction()
|
|
77
87
|
|
|
78
88
|
signer.**signDeclareTransaction**(transaction, transactionsDetail [ , abi ]) => _Promise < Signature >_
|
|
79
89
|
|
package/www/docs/API/utils.md
CHANGED
|
@@ -41,7 +41,7 @@ This function validates the checksum address.
|
|
|
41
41
|
|
|
42
42
|
Returns true if the address is valid, false otherwise.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
---
|
|
45
45
|
|
|
46
46
|
## **stark**
|
|
47
47
|
|
|
@@ -102,7 +102,7 @@ Function that calculates and returns maximum fee based on the previously estimat
|
|
|
102
102
|
|
|
103
103
|
Returns a BN.
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
---
|
|
106
106
|
|
|
107
107
|
## **number**
|
|
108
108
|
|
|
@@ -190,7 +190,7 @@ const signature = await this.signer.signTransaction(transactions, signerDetails)
|
|
|
190
190
|
|
|
191
191
|
Convert BigNumberish array to hexadecimal string array. Used for signature conversion.
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
---
|
|
194
194
|
|
|
195
195
|
## **uint256**
|
|
196
196
|
|
|
@@ -222,7 +222,7 @@ Function to check if `BN` is smaller or equal to `2**256-1`.
|
|
|
222
222
|
|
|
223
223
|
Function to convert `BN` to `Uint256`.
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
---
|
|
226
226
|
|
|
227
227
|
## **hash**
|
|
228
228
|
|
|
@@ -301,7 +301,7 @@ Function that calculates contract address from hash.
|
|
|
301
301
|
|
|
302
302
|
Returns a string.
|
|
303
303
|
|
|
304
|
-
|
|
304
|
+
---
|
|
305
305
|
|
|
306
306
|
## **ellipticCurve**
|
|
307
307
|
|
|
@@ -354,3 +354,21 @@ keyPair should be an KeyPair with a valid public key.
|
|
|
354
354
|
sig should be an Signature.
|
|
355
355
|
|
|
356
356
|
Returns true if the verification succeeds.
|
|
357
|
+
|
|
358
|
+
<hr />
|
|
359
|
+
|
|
360
|
+
## **calldata**
|
|
361
|
+
|
|
362
|
+
Functions to compile and validate arguments passed in invoke, call and deploy functions.
|
|
363
|
+
|
|
364
|
+
### compile
|
|
365
|
+
|
|
366
|
+
`compileCalldata(args: Array<any>, inputs: AbiEntry[]): Calldata`
|
|
367
|
+
|
|
368
|
+
Parse the calldata by using input fields from the abi for that method.
|
|
369
|
+
|
|
370
|
+
### validate
|
|
371
|
+
|
|
372
|
+
`validateMethodAndArgs(type: 'INVOKE' | 'CALL' | 'DEPLOY', method: string, args: Array<any> = [])`
|
|
373
|
+
|
|
374
|
+
Validates if all arguments that are passed to the method are corresponding to the ones in the abi.
|