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/index.d.ts
CHANGED
|
@@ -1477,7 +1477,7 @@ declare abstract class ProviderInterface {
|
|
|
1477
1477
|
abstract deployAccountContract(payload: DeployAccountContractPayload, details: InvocationsDetailsWithNonce): Promise<DeployContractResponse>;
|
|
1478
1478
|
/**
|
|
1479
1479
|
* Invokes a function on starknet
|
|
1480
|
-
* @deprecated This method wont be supported as soon as fees are mandatory
|
|
1480
|
+
* @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class
|
|
1481
1481
|
*
|
|
1482
1482
|
* @param invocation the invocation object containing:
|
|
1483
1483
|
* - contractAddress - the address of the contract
|
|
@@ -1506,7 +1506,7 @@ declare abstract class ProviderInterface {
|
|
|
1506
1506
|
abstract declareContract(transaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<DeclareContractResponse>;
|
|
1507
1507
|
/**
|
|
1508
1508
|
* Estimates the fee for a given INVOKE transaction
|
|
1509
|
-
* @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead
|
|
1509
|
+
* @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class
|
|
1510
1510
|
*
|
|
1511
1511
|
* @param invocation the invocation object containing:
|
|
1512
1512
|
* - contractAddress - the address of the contract
|
|
@@ -1737,13 +1737,13 @@ declare class Provider implements ProviderInterface {
|
|
|
1737
1737
|
get chainId(): StarknetChainId;
|
|
1738
1738
|
getChainId(): Promise<StarknetChainId>;
|
|
1739
1739
|
getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse>;
|
|
1740
|
-
getClassAt(contractAddress: string, blockIdentifier
|
|
1740
|
+
getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<ContractClass>;
|
|
1741
1741
|
getClassHashAt(contractAddress: string, blockIdentifier: BlockIdentifier): Promise<string>;
|
|
1742
1742
|
getClassByHash(classHash: string): Promise<ContractClass>;
|
|
1743
1743
|
getEstimateFee(invocationWithTxType: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier: BlockIdentifier): Promise<EstimateFeeResponse>;
|
|
1744
1744
|
getInvokeEstimateFee(invocationWithTxType: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<EstimateFeeResponse>;
|
|
1745
1745
|
getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<BigNumberish>;
|
|
1746
|
-
getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier
|
|
1746
|
+
getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<BigNumberish>;
|
|
1747
1747
|
getTransaction(txHash: BigNumberish): Promise<GetTransactionResponse>;
|
|
1748
1748
|
getTransactionReceipt(txHash: BigNumberish): Promise<GetTransactionReceiptResponse>;
|
|
1749
1749
|
callContract(request: Call, blockIdentifier?: BlockIdentifier): Promise<CallContractResponse>;
|
|
@@ -2322,6 +2322,7 @@ declare class Contract implements ContractInterface {
|
|
|
2322
2322
|
[name: string]: ContractFunction;
|
|
2323
2323
|
};
|
|
2324
2324
|
readonly [key: string]: AsyncContractFunction | any;
|
|
2325
|
+
private checkCalldata;
|
|
2325
2326
|
/**
|
|
2326
2327
|
* Contract class to handle contract methods
|
|
2327
2328
|
*
|
|
@@ -2337,29 +2338,6 @@ declare class Contract implements ContractInterface {
|
|
|
2337
2338
|
invoke(method: string, args?: Array<any>, options?: Overrides): Promise<InvokeFunctionResponse>;
|
|
2338
2339
|
estimate(method: string, args?: Array<any>): Promise<EstimateFeeResponse>;
|
|
2339
2340
|
populate(method: string, args?: Array<any>): Call;
|
|
2340
|
-
/**
|
|
2341
|
-
* Deep parse of the object that has been passed to the method
|
|
2342
|
-
*
|
|
2343
|
-
* @param struct - struct that needs to be calculated
|
|
2344
|
-
* @return {number} - number of members for the given struct
|
|
2345
|
-
*/
|
|
2346
|
-
private calculateStructMembers;
|
|
2347
|
-
/**
|
|
2348
|
-
* Validates if all arguments that are passed to the method are corresponding to the ones in the abi
|
|
2349
|
-
*
|
|
2350
|
-
* @param type - type of the method
|
|
2351
|
-
* @param method - name of the method
|
|
2352
|
-
* @param args - arguments that are passed to the method
|
|
2353
|
-
*/
|
|
2354
|
-
protected validateMethodAndArgs(type: 'INVOKE' | 'CALL', method: string, args?: Array<any>): void;
|
|
2355
|
-
/**
|
|
2356
|
-
* Deep parse of the object that has been passed to the method
|
|
2357
|
-
*
|
|
2358
|
-
* @param element - element that needs to be parsed
|
|
2359
|
-
* @param type - name of the method
|
|
2360
|
-
* @return {string | string[]} - parsed arguments in format that contract is expecting
|
|
2361
|
-
*/
|
|
2362
|
-
protected parseCalldataValue(element: ParsedStruct | BigNumberish | BigNumberish[], type: string): string | string[];
|
|
2363
2341
|
/**
|
|
2364
2342
|
* Parse of the response elements that are converted to Object (Struct) by using the abi
|
|
2365
2343
|
*
|
|
@@ -2368,22 +2346,6 @@ declare class Contract implements ContractInterface {
|
|
|
2368
2346
|
* @return {BigNumberish | ParsedStruct} - parsed arguments in format that contract is expecting
|
|
2369
2347
|
*/
|
|
2370
2348
|
protected parseResponseStruct(responseIterator: Iterator<string>, type: string): BigNumberish | ParsedStruct;
|
|
2371
|
-
/**
|
|
2372
|
-
* Parse one field of the calldata by using input field from the abi for that method
|
|
2373
|
-
*
|
|
2374
|
-
* @param args - value of the field
|
|
2375
|
-
* @param input - input(field) information from the abi that will be used to parse the data
|
|
2376
|
-
* @return {string | string[]} - parsed arguments in format that contract is expecting
|
|
2377
|
-
*/
|
|
2378
|
-
protected parseCalldataField(argsIterator: Iterator<any>, input: AbiEntry): string | string[];
|
|
2379
|
-
/**
|
|
2380
|
-
* Parse the calldata by using input fields from the abi for that method
|
|
2381
|
-
*
|
|
2382
|
-
* @param args - arguments passed the the method
|
|
2383
|
-
* @param inputs - list of inputs(fields) that are in the abi
|
|
2384
|
-
* @return {Calldata} - parsed arguments in format that contract is expecting
|
|
2385
|
-
*/
|
|
2386
|
-
protected compileCalldata(args: Array<any>, inputs: AbiEntry[]): Calldata;
|
|
2387
2349
|
/**
|
|
2388
2350
|
* Parse elements of the response and structuring them into one field by using output property from the abi for that method
|
|
2389
2351
|
*
|
|
@@ -2407,15 +2369,16 @@ declare class ContractFactory {
|
|
|
2407
2369
|
compiledContract: CompiledContract;
|
|
2408
2370
|
classHash: string;
|
|
2409
2371
|
account: AccountInterface;
|
|
2372
|
+
private checkCalldata;
|
|
2410
2373
|
constructor(compiledContract: CompiledContract, classHash: string, account: AccountInterface, abi?: Abi);
|
|
2411
2374
|
/**
|
|
2412
2375
|
* Deploys contract and returns new instance of the Contract
|
|
2413
2376
|
*
|
|
2414
|
-
* @param
|
|
2377
|
+
* @param args - Array of the constructor arguments for deployment
|
|
2415
2378
|
* @param addressSalt (optional) - Address Salt for deployment
|
|
2416
2379
|
* @returns deployed Contract
|
|
2417
2380
|
*/
|
|
2418
|
-
deploy(
|
|
2381
|
+
deploy(args?: Array<any>, addressSalt?: string | undefined): Promise<Contract>;
|
|
2419
2382
|
/**
|
|
2420
2383
|
* Attaches to new Provider or Account
|
|
2421
2384
|
*
|