starknet 4.5.0 → 4.7.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 (88) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +3 -1
  3. package/__tests__/account.test.ts +2 -5
  4. package/__tests__/contract.test.ts +0 -1
  5. package/__tests__/defaultProvider.test.ts +16 -10
  6. package/__tests__/rpcProvider.test.ts +107 -12
  7. package/__tests__/sequencerProvider.test.ts +10 -8
  8. package/__tests__/utils/ellipticalCurve.test.ts +7 -8
  9. package/__tests__/utils/utils.test.ts +17 -0
  10. package/account/default.d.ts +3 -2
  11. package/account/default.js +22 -29
  12. package/account/interface.d.ts +2 -1
  13. package/contract/contractFactory.d.ts +1 -2
  14. package/contract/default.d.ts +2 -2
  15. package/contract/default.js +7 -3
  16. package/dist/account/default.d.ts +3 -2
  17. package/dist/account/default.js +22 -29
  18. package/dist/account/interface.d.ts +2 -1
  19. package/dist/contract/contractFactory.d.ts +1 -2
  20. package/dist/contract/default.d.ts +2 -2
  21. package/dist/contract/default.js +7 -3
  22. package/dist/provider/default.d.ts +4 -3
  23. package/dist/provider/default.js +9 -3
  24. package/dist/provider/interface.d.ts +10 -3
  25. package/dist/provider/rpc.d.ts +24 -12
  26. package/dist/provider/rpc.js +167 -105
  27. package/dist/provider/sequencer.d.ts +4 -3
  28. package/dist/provider/sequencer.js +16 -7
  29. package/dist/provider/utils.d.ts +11 -35
  30. package/dist/provider/utils.js +52 -63
  31. package/dist/signer/default.d.ts +2 -2
  32. package/dist/signer/default.js +2 -2
  33. package/dist/signer/interface.d.ts +2 -2
  34. package/dist/types/api/openrpc.d.ts +395 -45
  35. package/dist/types/api/openrpc.js +21 -3
  36. package/dist/types/api/rpc.d.ts +34 -191
  37. package/dist/types/api/sequencer.d.ts +15 -4
  38. package/dist/types/lib.d.ts +10 -4
  39. package/dist/types/provider.d.ts +3 -2
  40. package/dist/utils/hash.d.ts +2 -2
  41. package/dist/utils/hash.js +5 -5
  42. package/dist/utils/responseParser/rpc.d.ts +6 -6
  43. package/dist/utils/responseParser/rpc.js +3 -39
  44. package/package.json +1 -1
  45. package/provider/default.d.ts +4 -3
  46. package/provider/default.js +9 -3
  47. package/provider/interface.d.ts +10 -3
  48. package/provider/rpc.d.ts +24 -12
  49. package/provider/rpc.js +167 -105
  50. package/provider/sequencer.d.ts +4 -3
  51. package/provider/sequencer.js +16 -7
  52. package/provider/utils.d.ts +11 -35
  53. package/provider/utils.js +52 -63
  54. package/signer/default.d.ts +2 -2
  55. package/signer/default.js +2 -2
  56. package/signer/interface.d.ts +2 -2
  57. package/src/account/default.ts +21 -20
  58. package/src/account/interface.ts +2 -1
  59. package/src/contract/contractFactory.ts +1 -2
  60. package/src/contract/default.ts +16 -8
  61. package/src/provider/default.ts +12 -5
  62. package/src/provider/interface.ts +15 -4
  63. package/src/provider/rpc.ts +152 -102
  64. package/src/provider/sequencer.ts +19 -10
  65. package/src/provider/utils.ts +43 -56
  66. package/src/signer/default.ts +8 -8
  67. package/src/signer/interface.ts +2 -2
  68. package/src/types/api/openrpc.ts +378 -53
  69. package/src/types/api/rpc.ts +33 -211
  70. package/src/types/api/sequencer.ts +17 -4
  71. package/src/types/lib.ts +7 -5
  72. package/src/types/provider.ts +3 -2
  73. package/src/utils/hash.ts +7 -6
  74. package/src/utils/responseParser/rpc.ts +13 -27
  75. package/types/api/openrpc.d.ts +395 -45
  76. package/types/api/openrpc.js +21 -3
  77. package/types/api/rpc.d.ts +34 -191
  78. package/types/api/sequencer.d.ts +15 -4
  79. package/types/lib.d.ts +10 -4
  80. package/types/provider.d.ts +3 -2
  81. package/utils/hash.d.ts +2 -2
  82. package/utils/hash.js +5 -5
  83. package/utils/responseParser/rpc.d.ts +6 -6
  84. package/utils/responseParser/rpc.js +3 -39
  85. package/www/docs/API/account.md +3 -3
  86. package/www/docs/API/contract.md +2 -2
  87. package/www/docs/API/provider.md +6 -0
  88. package/www/docs/API/utils.md +2 -2
package/provider/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFormattedBlockIdentifier = exports.getBlockIdentifier = exports.BlockIdentifierClass = exports.txIdentifier = exports.formatHash = void 0;
3
+ exports.Block = exports.txIdentifier = exports.formatHash = void 0;
4
4
  var number_1 = require("../utils/number");
5
5
  /**
6
6
  *
@@ -29,67 +29,56 @@ function txIdentifier(txHash, txId) {
29
29
  return "transactionHash=".concat(hashString);
30
30
  }
31
31
  exports.txIdentifier = txIdentifier;
32
- var BlockIdentifierClass = /** @class */ (function () {
33
- function BlockIdentifierClass(blockIdentifier) {
34
- this.blockIdentifier = blockIdentifier;
32
+ var Block = /** @class */ (function () {
33
+ function Block(_identifier) {
34
+ var _this = this;
35
+ this.hash = null;
36
+ this.number = null;
37
+ this.tag = null;
38
+ this.valueOf = function () { return _this.number; };
39
+ this.toString = function () { return _this.hash; };
40
+ this.setIdentifier = function (__identifier) {
41
+ if (typeof __identifier === 'string' && (0, number_1.isHex)(__identifier)) {
42
+ this.hash = __identifier;
43
+ }
44
+ else if (typeof __identifier === 'number') {
45
+ this.number = __identifier;
46
+ }
47
+ else {
48
+ this.tag = __identifier;
49
+ }
50
+ };
51
+ this.setIdentifier(_identifier);
35
52
  }
36
- BlockIdentifierClass.prototype.getIdentifier = function () {
37
- if (typeof this.blockIdentifier === 'string' && (0, number_1.isHex)(this.blockIdentifier)) {
38
- return { block_hash: this.blockIdentifier };
39
- }
40
- if (typeof this.blockIdentifier === 'number') {
41
- return { block_number: this.blockIdentifier };
42
- }
43
- return this.blockIdentifier;
44
- };
45
- return BlockIdentifierClass;
53
+ Object.defineProperty(Block.prototype, "queryIdentifier", {
54
+ get: function () {
55
+ if (this.number !== null) {
56
+ return "blockNumber=".concat(this.number);
57
+ }
58
+ if (this.hash !== null) {
59
+ return "blockHash=".concat(this.hash);
60
+ }
61
+ return "blockNumber=".concat(this.tag);
62
+ },
63
+ enumerable: false,
64
+ configurable: true
65
+ });
66
+ Object.defineProperty(Block.prototype, "identifier", {
67
+ get: function () {
68
+ if (this.number !== null) {
69
+ return { block_number: this.number };
70
+ }
71
+ if (this.hash !== null) {
72
+ return { block_hash: this.hash };
73
+ }
74
+ return this.tag;
75
+ },
76
+ set: function (_identifier) {
77
+ this.setIdentifier(_identifier);
78
+ },
79
+ enumerable: false,
80
+ configurable: true
81
+ });
82
+ return Block;
46
83
  }());
47
- exports.BlockIdentifierClass = BlockIdentifierClass;
48
- /**
49
- * Identifies the block to be queried.
50
- *
51
- * @param blockIdentifier - block identifier
52
- * @returns block identifier object
53
- */
54
- function getBlockIdentifier(blockIdentifier) {
55
- if (blockIdentifier === null || blockIdentifier === 'latest') {
56
- return { type: 'BLOCK_NUMBER', data: 'latest' }; // default to latest block
57
- }
58
- if (blockIdentifier === 'pending') {
59
- return { type: 'BLOCK_NUMBER', data: 'pending' };
60
- }
61
- if (typeof blockIdentifier === 'number' || typeof blockIdentifier === 'bigint') {
62
- return { type: 'BLOCK_NUMBER', data: blockIdentifier };
63
- }
64
- if (typeof blockIdentifier === 'string' && blockIdentifier.startsWith('0x')) {
65
- return { type: 'BLOCK_HASH', data: blockIdentifier };
66
- }
67
- if (typeof blockIdentifier === 'string' && !Number.isNaN(parseInt(blockIdentifier, 10))) {
68
- return { type: 'BLOCK_NUMBER', data: parseInt(blockIdentifier, 10) };
69
- }
70
- if (typeof blockIdentifier === 'string') {
71
- throw new Error("Invalid block identifier: ".concat(blockIdentifier));
72
- }
73
- return { type: 'BLOCK_HASH', data: blockIdentifier };
74
- }
75
- exports.getBlockIdentifier = getBlockIdentifier;
76
- /**
77
- * Gets the block identifier for API request
78
- *
79
- * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L164-L173)
80
- *
81
- * @param blockIdentifier
82
- * @returns block identifier for API request
83
- */
84
- function getFormattedBlockIdentifier(blockIdentifier) {
85
- if (blockIdentifier === void 0) { blockIdentifier = null; }
86
- var blockIdentifierObject = getBlockIdentifier(blockIdentifier);
87
- if (blockIdentifierObject.type === 'BLOCK_NUMBER' && blockIdentifierObject.data === null) {
88
- return '';
89
- }
90
- if (blockIdentifierObject.type === 'BLOCK_NUMBER') {
91
- return "blockNumber=".concat(blockIdentifierObject.data);
92
- }
93
- return "blockHash=".concat((0, number_1.toHex)((0, number_1.toBN)(blockIdentifierObject.data)));
94
- }
95
- exports.getFormattedBlockIdentifier = getFormattedBlockIdentifier;
84
+ exports.Block = Block;
@@ -1,10 +1,10 @@
1
- import { Abi, Invocation, InvocationsSignerDetails, KeyPair, Signature } from '../types';
1
+ import { Abi, Call, InvocationsSignerDetails, KeyPair, Signature } from '../types';
2
2
  import { TypedData } from '../utils/typedData';
3
3
  import { SignerInterface } from './interface';
4
4
  export declare class Signer implements SignerInterface {
5
5
  protected keyPair: KeyPair;
6
6
  constructor(keyPair?: KeyPair);
7
7
  getPubKey(): Promise<string>;
8
- signTransaction(transactions: Invocation[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
8
+ signTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
9
9
  signMessage(typedData: TypedData, accountAddress: string): Promise<Signature>;
10
10
  }
package/signer/default.js CHANGED
@@ -60,8 +60,8 @@ var Signer = /** @class */ (function () {
60
60
  if (abis && abis.length !== transactions.length) {
61
61
  throw new Error('ABI must be provided for each transaction or no transaction');
62
62
  }
63
- calldata = (0, transaction_1.fromCallsToExecuteCalldataWithNonce)(transactions, transactionsDetail.nonce);
64
- msgHash = (0, hash_1.calculcateTransactionHash)(transactionsDetail.walletAddress, transactionsDetail.version, (0, hash_1.getSelectorFromName)('__execute__'), calldata, transactionsDetail.maxFee, transactionsDetail.chainId);
63
+ calldata = (0, transaction_1.fromCallsToExecuteCalldata)(transactions);
64
+ msgHash = (0, hash_1.calculateTransactionHash)(transactionsDetail.walletAddress, transactionsDetail.version, calldata, transactionsDetail.maxFee, transactionsDetail.chainId, transactionsDetail.nonce);
65
65
  return [2 /*return*/, (0, ellipticCurve_1.sign)(this.keyPair, msgHash)];
66
66
  });
67
67
  });
@@ -1,4 +1,4 @@
1
- import { Abi, Invocation, InvocationsSignerDetails, Signature } from '../types';
1
+ import { Abi, Call, InvocationsSignerDetails, Signature } from '../types';
2
2
  import { TypedData } from '../utils/typedData';
3
3
  export declare abstract class SignerInterface {
4
4
  /**
@@ -29,5 +29,5 @@ export declare abstract class SignerInterface {
29
29
  *
30
30
  * @returns signature
31
31
  */
32
- abstract signTransaction(transactions: Invocation[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
32
+ abstract signTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
33
33
  }
@@ -1,6 +1,7 @@
1
1
  import { ZERO } from '../constants';
2
2
  import { ProviderInterface, ProviderOptions } from '../provider';
3
3
  import { Provider } from '../provider/default';
4
+ import { BlockIdentifier } from '../provider/utils';
4
5
  import { Signer, SignerInterface } from '../signer';
5
6
  import {
6
7
  Abi,
@@ -12,32 +13,31 @@ import {
12
13
  Signature,
13
14
  } from '../types';
14
15
  import { EstimateFee, EstimateFeeDetails } from '../types/account';
15
- import { feeTransactionVersion, transactionVersion } from '../utils/hash';
16
- import { BigNumberish, toBN, toHex } from '../utils/number';
16
+ import { transactionVersion } from '../utils/hash';
17
+ import { BigNumberish, toBN } from '../utils/number';
17
18
  import { compileCalldata, estimatedFeeToMaxFee } from '../utils/stark';
18
- import { fromCallsToExecuteCalldataWithNonce } from '../utils/transaction';
19
+ import { fromCallsToExecuteCalldata } from '../utils/transaction';
19
20
  import { TypedData, getMessageHash } from '../utils/typedData';
20
21
  import { AccountInterface } from './interface';
21
22
 
22
23
  export class Account extends Provider implements AccountInterface {
23
24
  public signer: SignerInterface;
24
25
 
26
+ public address: string;
27
+
25
28
  constructor(
26
29
  providerOrOptions: ProviderOptions | ProviderInterface,
27
- public address: string,
30
+ address: string,
28
31
  keyPairOrSigner: KeyPair | SignerInterface
29
32
  ) {
30
33
  super(providerOrOptions);
34
+ this.address = address.toLowerCase();
31
35
  this.signer =
32
36
  'getPubKey' in keyPairOrSigner ? keyPairOrSigner : new Signer(keyPairOrSigner as KeyPair);
33
37
  }
34
38
 
35
- public async getNonce(): Promise<string> {
36
- const { result } = await this.callContract({
37
- contractAddress: this.address,
38
- entrypoint: 'get_nonce',
39
- });
40
- return toHex(toBN(result[0]));
39
+ public async getNonce(blockIdentifier?: BlockIdentifier): Promise<BigNumberish> {
40
+ return super.getNonce(this.address, blockIdentifier);
41
41
  }
42
42
 
43
43
  public async estimateFee(
@@ -45,13 +45,13 @@ export class Account extends Provider implements AccountInterface {
45
45
  { nonce: providedNonce, blockIdentifier }: EstimateFeeDetails = {}
46
46
  ): Promise<EstimateFee> {
47
47
  const transactions = Array.isArray(calls) ? calls : [calls];
48
- const nonce = providedNonce ?? (await this.getNonce());
49
- const version = toBN(feeTransactionVersion);
48
+ const nonce = toBN(providedNonce ?? (await this.getNonce()));
49
+ const version = toBN(transactionVersion);
50
50
  const chainId = await this.getChainId();
51
51
 
52
52
  const signerDetails: InvocationsSignerDetails = {
53
53
  walletAddress: this.address,
54
- nonce: toBN(nonce),
54
+ nonce,
55
55
  maxFee: ZERO,
56
56
  version,
57
57
  chainId,
@@ -59,11 +59,11 @@ export class Account extends Provider implements AccountInterface {
59
59
 
60
60
  const signature = await this.signer.signTransaction(transactions, signerDetails);
61
61
 
62
- const calldata = fromCallsToExecuteCalldataWithNonce(transactions, nonce);
62
+ const calldata = fromCallsToExecuteCalldata(transactions);
63
63
  const response = await super.getEstimateFee(
64
- { contractAddress: this.address, entrypoint: '__execute__', calldata, signature },
65
- blockIdentifier,
66
- { version }
64
+ { contractAddress: this.address, calldata, signature },
65
+ { version, nonce },
66
+ blockIdentifier
67
67
  );
68
68
 
69
69
  const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);
@@ -112,11 +112,12 @@ export class Account extends Provider implements AccountInterface {
112
112
 
113
113
  const signature = await this.signer.signTransaction(transactions, signerDetails, abis);
114
114
 
115
- const calldata = fromCallsToExecuteCalldataWithNonce(transactions, nonce);
115
+ const calldata = fromCallsToExecuteCalldata(transactions);
116
116
 
117
117
  return this.invokeFunction(
118
- { contractAddress: this.address, entrypoint: '__execute__', calldata, signature },
118
+ { contractAddress: this.address, calldata, signature },
119
119
  {
120
+ nonce,
120
121
  maxFee,
121
122
  version,
122
123
  }
@@ -158,7 +159,7 @@ export class Account extends Provider implements AccountInterface {
158
159
  try {
159
160
  await this.callContract({
160
161
  contractAddress: this.address,
161
- entrypoint: 'is_valid_signature',
162
+ entrypoint: 'isValidSignature',
162
163
  calldata: compileCalldata({
163
164
  hash: toBN(hash).toString(),
164
165
  signature: signature.map((x) => toBN(x).toString()),
@@ -1,4 +1,5 @@
1
1
  import { ProviderInterface } from '../provider';
2
+ import { BlockIdentifier } from '../provider/utils';
2
3
  import { SignerInterface } from '../signer';
3
4
  import {
4
5
  Abi,
@@ -92,5 +93,5 @@ export abstract class AccountInterface extends ProviderInterface {
92
93
  */
93
94
  public abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise<boolean>;
94
95
 
95
- public abstract getNonce(): Promise<string>;
96
+ public abstract getNonce(blockIdentifier?: BlockIdentifier): Promise<BigNumberish>;
96
97
  }
@@ -3,7 +3,6 @@ import assert from 'minimalistic-assert';
3
3
  import { AccountInterface } from '../account';
4
4
  import { ProviderInterface, defaultProvider } from '../provider';
5
5
  import { Abi, CompiledContract, RawCalldata } from '../types';
6
- import { BigNumberish } from '../utils/number';
7
6
  import { Contract } from './default';
8
7
 
9
8
  export class ContractFactory {
@@ -32,7 +31,7 @@ export class ContractFactory {
32
31
  */
33
32
  public async deploy(
34
33
  constructorCalldata?: RawCalldata,
35
- addressSalt?: BigNumberish
34
+ addressSalt?: string | undefined
36
35
  ): Promise<Contract> {
37
36
  const { contract_address, transaction_hash } = await this.providerOrAccount.deployContract({
38
37
  contract: this.compiledContract,
@@ -9,10 +9,10 @@ import {
9
9
  AbiEntry,
10
10
  Args,
11
11
  AsyncContractFunction,
12
+ Call,
12
13
  Calldata,
13
14
  ContractFunction,
14
15
  FunctionAbi,
15
- Invocation,
16
16
  InvokeFunctionResponse,
17
17
  Overrides,
18
18
  ParsedStruct,
@@ -125,7 +125,7 @@ export class Contract implements ContractInterface {
125
125
  address: string,
126
126
  providerOrAccount: ProviderInterface | AccountInterface = defaultProvider
127
127
  ) {
128
- this.address = address;
128
+ this.address = address.toLowerCase();
129
129
  this.providerOrAccount = providerOrAccount;
130
130
  this.abi = abi;
131
131
  this.structs = abi
@@ -578,13 +578,22 @@ export class Contract implements ContractInterface {
578
578
  });
579
579
  }
580
580
 
581
+ if (!options.nonce) {
582
+ throw new Error(`Nonce is required when invoking a function without an account`);
583
+ }
584
+
581
585
  // eslint-disable-next-line no-console
582
586
  console.warn(`Invoking ${method} without an account. This will not work on a public node.`);
583
587
 
584
- return this.providerOrAccount.invokeFunction({
585
- ...invocation,
586
- signature: options.signature || [],
587
- });
588
+ return this.providerOrAccount.invokeFunction(
589
+ {
590
+ ...invocation,
591
+ signature: options.signature || [],
592
+ },
593
+ {
594
+ nonce: options.nonce,
595
+ }
596
+ );
588
597
  }
589
598
 
590
599
  public async call(
@@ -630,13 +639,12 @@ export class Contract implements ContractInterface {
630
639
  throw Error('Contract must be connected to the account contract to estimate');
631
640
  }
632
641
 
633
- public populate(method: string, args: Array<any> = []): Invocation {
642
+ public populate(method: string, args: Array<any> = []): Call {
634
643
  const { inputs } = this.abi.find((abi) => abi.name === method) as FunctionAbi;
635
644
  return {
636
645
  contractAddress: this.address,
637
646
  entrypoint: method,
638
647
  calldata: this.compileCalldata(args, inputs),
639
- signature: [],
640
648
  };
641
649
  }
642
650
  }
@@ -13,7 +13,7 @@ import {
13
13
  GetTransactionReceiptResponse,
14
14
  GetTransactionResponse,
15
15
  Invocation,
16
- InvocationsDetails,
16
+ InvocationsDetailsWithNonce,
17
17
  InvokeFunctionResponse,
18
18
  } from '../types';
19
19
  import { BigNumberish } from '../utils/number';
@@ -63,10 +63,17 @@ export class Provider implements ProviderInterface {
63
63
 
64
64
  public async getEstimateFee(
65
65
  invocation: Invocation,
66
- blockIdentifier: BlockIdentifier = 'pending',
67
- invocationDetails: InvocationsDetails = {}
66
+ invocationDetails: InvocationsDetailsWithNonce,
67
+ blockIdentifier: BlockIdentifier = 'pending'
68
68
  ): Promise<EstimateFeeResponse> {
69
- return this.provider.getEstimateFee(invocation, blockIdentifier, invocationDetails);
69
+ return this.provider.getEstimateFee(invocation, invocationDetails, blockIdentifier);
70
+ }
71
+
72
+ public async getNonce(
73
+ contractAddress: string,
74
+ blockIdentifier?: BlockIdentifier
75
+ ): Promise<BigNumberish> {
76
+ return this.provider.getNonce(contractAddress, blockIdentifier);
70
77
  }
71
78
 
72
79
  public async getStorageAt(
@@ -94,7 +101,7 @@ export class Provider implements ProviderInterface {
94
101
 
95
102
  public async invokeFunction(
96
103
  functionInvocation: Invocation,
97
- details: InvocationsDetails
104
+ details: InvocationsDetailsWithNonce
98
105
  ): Promise<InvokeFunctionResponse> {
99
106
  return this.provider.invokeFunction(functionInvocation, details);
100
107
  }
@@ -13,7 +13,7 @@ import type {
13
13
  GetTransactionReceiptResponse,
14
14
  GetTransactionResponse,
15
15
  Invocation,
16
- InvocationsDetails,
16
+ InvocationsDetailsWithNonce,
17
17
  InvokeFunctionResponse,
18
18
  } from '../types';
19
19
  import type { BigNumberish } from '../utils/number';
@@ -69,6 +69,17 @@ export abstract class ProviderInterface {
69
69
  blockIdentifier?: BlockIdentifier
70
70
  ): Promise<ContractClass>;
71
71
 
72
+ /**
73
+ * Gets the nonce of a contract with respect to a specific block
74
+ *
75
+ * @param contractAddress - contract address
76
+ * @returns the hex nonce
77
+ */
78
+ public abstract getNonce(
79
+ contractAddress: string,
80
+ blockIdentifier?: BlockIdentifier
81
+ ): Promise<BigNumberish>;
82
+
72
83
  /**
73
84
  * Gets the contract's storage variable at a specific key.
74
85
  *
@@ -141,7 +152,7 @@ export abstract class ProviderInterface {
141
152
  */
142
153
  public abstract invokeFunction(
143
154
  invocation: Invocation,
144
- details?: InvocationsDetails
155
+ details: InvocationsDetailsWithNonce
145
156
  ): Promise<InvokeFunctionResponse>;
146
157
 
147
158
  /**
@@ -160,8 +171,8 @@ export abstract class ProviderInterface {
160
171
  */
161
172
  public abstract getEstimateFee(
162
173
  invocation: Invocation,
163
- blockIdentifier: BlockIdentifier,
164
- details?: InvocationsDetails
174
+ details: InvocationsDetailsWithNonce,
175
+ blockIdentifier: BlockIdentifier
165
176
  ): Promise<EstimateFeeResponse>;
166
177
 
167
178
  /**