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.
Files changed (65) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -3
  3. package/__tests__/account.test.ts +1 -1
  4. package/__tests__/defaultProvider.test.ts +85 -210
  5. package/__tests__/fixtures.ts +1 -1
  6. package/__tests__/rpcProvider.test.ts +4 -3
  7. package/__tests__/udc.test.ts +41 -0
  8. package/account/default.d.ts +3 -1
  9. package/account/default.js +50 -0
  10. package/account/interface.d.ts +24 -7
  11. package/constants.d.ts +7 -1
  12. package/constants.js +7 -1
  13. package/contract/default.d.ts +11 -27
  14. package/contract/default.js +104 -120
  15. package/contract/interface.d.ts +5 -2
  16. package/dist/account/default.d.ts +3 -1
  17. package/dist/account/default.js +50 -0
  18. package/dist/account/interface.d.ts +24 -7
  19. package/dist/constants.d.ts +7 -1
  20. package/dist/constants.js +7 -1
  21. package/dist/contract/default.d.ts +11 -27
  22. package/dist/contract/default.js +104 -120
  23. package/dist/contract/interface.d.ts +5 -2
  24. package/dist/provider/rpc.d.ts +3 -1
  25. package/dist/provider/rpc.js +15 -2
  26. package/dist/provider/sequencer.d.ts +4 -2
  27. package/dist/provider/sequencer.js +18 -5
  28. package/dist/signer/default.d.ts +2 -2
  29. package/dist/signer/default.js +15 -15
  30. package/dist/signer/interface.d.ts +2 -0
  31. package/dist/types/api/index.d.ts +0 -6
  32. package/dist/types/index.d.ts +1 -1
  33. package/dist/types/lib.d.ts +13 -0
  34. package/dist/utils/number.d.ts +1 -0
  35. package/dist/utils/number.js +3 -1
  36. package/package.json +1 -1
  37. package/provider/rpc.d.ts +3 -1
  38. package/provider/rpc.js +15 -2
  39. package/provider/sequencer.d.ts +4 -2
  40. package/provider/sequencer.js +18 -5
  41. package/signer/default.d.ts +2 -2
  42. package/signer/default.js +15 -15
  43. package/signer/interface.d.ts +2 -0
  44. package/src/account/default.ts +43 -3
  45. package/src/account/interface.ts +34 -7
  46. package/src/constants.ts +7 -0
  47. package/src/contract/default.ts +123 -140
  48. package/src/contract/interface.ts +5 -2
  49. package/src/provider/rpc.ts +7 -3
  50. package/src/provider/sequencer.ts +13 -4
  51. package/src/signer/default.ts +18 -18
  52. package/src/signer/interface.ts +2 -0
  53. package/src/types/api/index.ts +0 -4
  54. package/src/types/index.ts +1 -1
  55. package/src/types/lib.ts +13 -0
  56. package/src/utils/number.ts +2 -0
  57. package/types/api/index.d.ts +0 -6
  58. package/types/index.d.ts +1 -1
  59. package/types/lib.d.ts +13 -0
  60. package/utils/number.d.ts +1 -0
  61. package/utils/number.js +3 -1
  62. package/www/docs/API/account.md +122 -22
  63. package/www/docs/API/contract.md +39 -3
  64. package/www/docs/API/provider.md +4 -0
  65. package/www/docs/API/signer.md +56 -2
@@ -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
- Returns the signature of the transaction.
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
- Returns the signature of the transaction.
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