starknet 5.6.1 → 5.8.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 +21 -0
- package/dist/index.d.ts +140 -100
- package/dist/index.global.js +1040 -1043
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1043 -1043
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1040 -1043
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [5.8.0](https://github.com/0xs34n/starknet.js/compare/v5.7.0...v5.8.0) (2023-04-26)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- contract types, interface, cleanup, extend tests ([02c6b72](https://github.com/0xs34n/starknet.js/commit/02c6b72ec41016fdd75537044889e7cffd624b27))
|
|
6
|
+
- contractfactory, contract, interface cleanup cleanup & ts ([b25047e](https://github.com/0xs34n/starknet.js/commit/b25047ece2eed313eaa776b2a132b9a04c3fbc2f))
|
|
7
|
+
- lapsus lingua, dangling, cleanup 🚀 ([a79d55c](https://github.com/0xs34n/starknet.js/commit/a79d55c2990e81bc6b0e58583142d3eb7bbddfa2))
|
|
8
|
+
- prevent missusage of cairoVersion on deploy ([d920dbe](https://github.com/0xs34n/starknet.js/commit/d920dbe6144006438c917727b153a043fec2531b))
|
|
9
|
+
- remove unused cairoVersion from Contract ([e4fcf24](https://github.com/0xs34n/starknet.js/commit/e4fcf244fa1dfd01301addfa7492bf90dac5a854))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- boolean to felt - cairo 1, compile() ([ef34e0a](https://github.com/0xs34n/starknet.js/commit/ef34e0a25a52be7a6ac76714bda43233a2f1a6f1))
|
|
14
|
+
- remove deprecated compileCalldata ([e5adca4](https://github.com/0xs34n/starknet.js/commit/e5adca449a9d1142339d5e63adb857698c5913d6))
|
|
15
|
+
|
|
16
|
+
# [5.7.0](https://github.com/0xs34n/starknet.js/compare/v5.6.1...v5.7.0) (2023-04-25)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- expose more starknetId addresses ([863736e](https://github.com/0xs34n/starknet.js/commit/863736e0d1daf30b9b6c1bab7c5213cda29f3d61))
|
|
21
|
+
|
|
1
22
|
## [5.6.1](https://github.com/0xs34n/starknet.js/compare/v5.6.0...v5.6.1) (2023-04-21)
|
|
2
23
|
|
|
3
24
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -206,6 +206,33 @@ declare namespace num {
|
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
interface Uint256 {
|
|
210
|
+
low: BigNumberish;
|
|
211
|
+
high: BigNumberish;
|
|
212
|
+
}
|
|
213
|
+
declare function uint256ToBN(uint256: Uint256): bigint;
|
|
214
|
+
declare const UINT_128_MAX: bigint;
|
|
215
|
+
declare const UINT_256_MAX: bigint;
|
|
216
|
+
declare function isUint256(bn: BigNumberish): boolean;
|
|
217
|
+
declare function bnToUint256(bignumber: BigNumberish): Uint256;
|
|
218
|
+
|
|
219
|
+
type uint256$1_Uint256 = Uint256;
|
|
220
|
+
declare const uint256$1_uint256ToBN: typeof uint256ToBN;
|
|
221
|
+
declare const uint256$1_UINT_128_MAX: typeof UINT_128_MAX;
|
|
222
|
+
declare const uint256$1_UINT_256_MAX: typeof UINT_256_MAX;
|
|
223
|
+
declare const uint256$1_isUint256: typeof isUint256;
|
|
224
|
+
declare const uint256$1_bnToUint256: typeof bnToUint256;
|
|
225
|
+
declare namespace uint256$1 {
|
|
226
|
+
export {
|
|
227
|
+
uint256$1_Uint256 as Uint256,
|
|
228
|
+
uint256$1_uint256ToBN as uint256ToBN,
|
|
229
|
+
uint256$1_UINT_128_MAX as UINT_128_MAX,
|
|
230
|
+
uint256$1_UINT_256_MAX as UINT_256_MAX,
|
|
231
|
+
uint256$1_isUint256 as isUint256,
|
|
232
|
+
uint256$1_bnToUint256 as bnToUint256,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
209
236
|
/** ABI */
|
|
210
237
|
declare type Abi = Array<FunctionAbi | EventAbi | StructAbi>;
|
|
211
238
|
declare type AbiEntry = {
|
|
@@ -316,12 +343,12 @@ declare type ArraySignatureType = string[];
|
|
|
316
343
|
declare type Signature = ArraySignatureType | WeierstrassSignatureType;
|
|
317
344
|
declare type RawCalldata = BigNumberish[];
|
|
318
345
|
declare type AllowArray<T> = T | T[];
|
|
319
|
-
declare type RawArgs =
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
346
|
+
declare type RawArgs = RawArgsObject | RawArgsArray;
|
|
347
|
+
declare type RawArgsObject = {
|
|
348
|
+
[inputName: string]: MultiType | MultiType[] | RawArgs;
|
|
349
|
+
};
|
|
350
|
+
declare type RawArgsArray = Array<MultiType | MultiType[] | RawArgs>;
|
|
351
|
+
declare type MultiType = BigNumberish | Uint256 | object | boolean;
|
|
325
352
|
declare type UniversalDeployerContractPayload = {
|
|
326
353
|
classHash: BigNumberish;
|
|
327
354
|
salt?: string;
|
|
@@ -457,14 +484,6 @@ interface CallStruct {
|
|
|
457
484
|
calldata: string[];
|
|
458
485
|
}
|
|
459
486
|
|
|
460
|
-
declare type Calldata = string[];
|
|
461
|
-
declare type Overrides = {
|
|
462
|
-
maxFee?: BigNumberish;
|
|
463
|
-
nonce?: BigNumberish;
|
|
464
|
-
signature?: Signature;
|
|
465
|
-
parseRequest?: Boolean;
|
|
466
|
-
};
|
|
467
|
-
|
|
468
487
|
interface InvocationsSignerDetails extends Required<InvocationsDetails> {
|
|
469
488
|
walletAddress: string;
|
|
470
489
|
chainId: StarknetChainId;
|
|
@@ -483,13 +502,32 @@ declare type DeployAccountSignerDetails = Required<DeployAccountContractPayload>
|
|
|
483
502
|
chainId: StarknetChainId;
|
|
484
503
|
};
|
|
485
504
|
|
|
486
|
-
declare type
|
|
487
|
-
|
|
505
|
+
declare type BlockIdentifier = BlockNumber | BigNumberish;
|
|
506
|
+
|
|
507
|
+
declare type AsyncContractFunction<T = any> = (...args: ArgsOrCalldataWithOptions) => Promise<T>;
|
|
508
|
+
declare type ContractFunction = (...args: ArgsOrCalldataWithOptions) => any;
|
|
488
509
|
declare type Result = {
|
|
489
510
|
[key: string]: any;
|
|
490
511
|
} | Result[] | bigint | string | boolean;
|
|
491
|
-
|
|
492
|
-
|
|
512
|
+
declare type Calldata = string[] & {
|
|
513
|
+
readonly __compiled__?: boolean;
|
|
514
|
+
};
|
|
515
|
+
declare type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata;
|
|
516
|
+
declare type ArgsOrCalldataWithOptions = ArgsOrCalldata & ContractOptions;
|
|
517
|
+
declare type ContractOptions = {
|
|
518
|
+
blockIdentifier?: BlockIdentifier;
|
|
519
|
+
parseRequest?: boolean;
|
|
520
|
+
parseResponse?: boolean;
|
|
521
|
+
formatResponse?: {
|
|
522
|
+
[key: string]: any;
|
|
523
|
+
};
|
|
524
|
+
maxFee?: BigNumberish;
|
|
525
|
+
nonce?: BigNumberish;
|
|
526
|
+
signature?: Signature;
|
|
527
|
+
addressSalt?: string;
|
|
528
|
+
};
|
|
529
|
+
declare type CallOptions = Pick<ContractOptions, 'blockIdentifier' | 'parseRequest' | 'parseResponse' | 'formatResponse'>;
|
|
530
|
+
declare type InvokeOptions = Pick<ContractOptions, 'maxFee' | 'nonce' | 'signature' | 'parseRequest'>;
|
|
493
531
|
|
|
494
532
|
/**
|
|
495
533
|
* Starknet RPC version 0.2.1
|
|
@@ -1609,6 +1647,7 @@ interface EstimateFeeResponse {
|
|
|
1609
1647
|
overall_fee: bigint;
|
|
1610
1648
|
gas_consumed?: bigint;
|
|
1611
1649
|
gas_price?: bigint;
|
|
1650
|
+
suggestedMaxFee?: bigint;
|
|
1612
1651
|
}
|
|
1613
1652
|
interface InvokeFunctionResponse {
|
|
1614
1653
|
transaction_hash: string;
|
|
@@ -2624,12 +2663,6 @@ declare class Account extends Provider implements AccountInterface {
|
|
|
2624
2663
|
StarknetIdContract?: string): Promise<string>;
|
|
2625
2664
|
}
|
|
2626
2665
|
|
|
2627
|
-
declare type CallOptions = {
|
|
2628
|
-
blockIdentifier?: BlockIdentifier;
|
|
2629
|
-
parseRequest: Boolean;
|
|
2630
|
-
parseResponse: Boolean;
|
|
2631
|
-
formatResponse?: object | null;
|
|
2632
|
-
};
|
|
2633
2666
|
declare abstract class ContractInterface {
|
|
2634
2667
|
abstract abi: Abi;
|
|
2635
2668
|
abstract address: string;
|
|
@@ -2675,36 +2708,47 @@ declare abstract class ContractInterface {
|
|
|
2675
2708
|
* @param options optional blockIdentifier
|
|
2676
2709
|
* @returns Result of the call as an array with key value pars
|
|
2677
2710
|
*/
|
|
2678
|
-
abstract call(method: string, args?:
|
|
2711
|
+
abstract call(method: string, args?: ArgsOrCalldata, options?: CallOptions): Promise<Result>;
|
|
2679
2712
|
/**
|
|
2680
2713
|
* Invokes a method on a contract
|
|
2681
2714
|
*
|
|
2682
2715
|
* @param method name of the method
|
|
2683
|
-
* @param args Array of the arguments for the invoke
|
|
2716
|
+
* @param args Array of the arguments for the invoke or Calldata
|
|
2684
2717
|
* @param options
|
|
2685
2718
|
* @returns Add Transaction Response
|
|
2686
2719
|
*/
|
|
2687
|
-
abstract invoke(method: string, args?:
|
|
2720
|
+
abstract invoke(method: string, args?: ArgsOrCalldata, options?: InvokeOptions): Promise<InvokeFunctionResponse>;
|
|
2688
2721
|
/**
|
|
2689
2722
|
* Estimates a method on a contract
|
|
2690
2723
|
*
|
|
2691
2724
|
* @param method name of the method
|
|
2692
|
-
* @param args Array of the arguments for the call
|
|
2725
|
+
* @param args Array of the arguments for the call or Calldata
|
|
2693
2726
|
* @param options optional blockIdentifier
|
|
2694
2727
|
*/
|
|
2695
|
-
abstract estimate(method: string, args?:
|
|
2728
|
+
abstract estimate(method: string, args?: ArgsOrCalldata, options?: {
|
|
2696
2729
|
blockIdentifier?: BlockIdentifier;
|
|
2697
|
-
}): Promise<
|
|
2730
|
+
}): Promise<EstimateFeeResponse>;
|
|
2698
2731
|
/**
|
|
2699
2732
|
* Calls a method on a contract
|
|
2700
2733
|
*
|
|
2701
2734
|
* @param method name of the method
|
|
2702
|
-
* @param args Array of the arguments for the call
|
|
2735
|
+
* @param args Array of the arguments for the call or Calldata
|
|
2703
2736
|
* @returns Invocation object
|
|
2704
2737
|
*/
|
|
2705
|
-
abstract populate(method: string, args?:
|
|
2738
|
+
abstract populate(method: string, args?: ArgsOrCalldata): Invocation;
|
|
2706
2739
|
}
|
|
2707
2740
|
|
|
2741
|
+
declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => {
|
|
2742
|
+
args: ArgsOrCalldata;
|
|
2743
|
+
options: ContractOptions;
|
|
2744
|
+
} | {
|
|
2745
|
+
args: ArgsOrCalldata;
|
|
2746
|
+
options?: undefined;
|
|
2747
|
+
};
|
|
2748
|
+
declare function getCalldata(args: ArgsOrCalldata, callback: Function): Calldata;
|
|
2749
|
+
/**
|
|
2750
|
+
* Not used at the moment
|
|
2751
|
+
*/
|
|
2708
2752
|
declare class Contract implements ContractInterface {
|
|
2709
2753
|
abi: Abi;
|
|
2710
2754
|
address: string;
|
|
@@ -2727,23 +2771,21 @@ declare class Contract implements ContractInterface {
|
|
|
2727
2771
|
};
|
|
2728
2772
|
readonly [key: string]: AsyncContractFunction | any;
|
|
2729
2773
|
private callData;
|
|
2730
|
-
private version;
|
|
2731
2774
|
/**
|
|
2732
2775
|
* Contract class to handle contract methods
|
|
2733
2776
|
*
|
|
2734
2777
|
* @param abi - Abi of the contract object
|
|
2735
2778
|
* @param address (optional) - address to connect to
|
|
2736
2779
|
* @param providerOrAccount (optional) - Provider or Account to attach to
|
|
2737
|
-
* @param cairoVersion (optional) - default '0', for Cairo 1 set '1'
|
|
2738
2780
|
*/
|
|
2739
|
-
constructor(abi: Abi, address: string, providerOrAccount?: ProviderInterface | AccountInterface
|
|
2781
|
+
constructor(abi: Abi, address: string, providerOrAccount?: ProviderInterface | AccountInterface);
|
|
2740
2782
|
attach(address: string): void;
|
|
2741
2783
|
connect(providerOrAccount: ProviderInterface | AccountInterface): void;
|
|
2742
2784
|
deployed(): Promise<Contract>;
|
|
2743
|
-
call(method: string, args?:
|
|
2744
|
-
invoke(method: string, args?:
|
|
2745
|
-
estimate(method: string, args?:
|
|
2746
|
-
populate(method: string, args?:
|
|
2785
|
+
call(method: string, args?: ArgsOrCalldata, { parseRequest, parseResponse, formatResponse, blockIdentifier, }?: CallOptions): Promise<Result>;
|
|
2786
|
+
invoke(method: string, args?: ArgsOrCalldata, { parseRequest, maxFee, nonce, signature }?: InvokeOptions): Promise<InvokeFunctionResponse>;
|
|
2787
|
+
estimate(method: string, args?: ArgsOrCalldata): Promise<EstimateFeeResponse>;
|
|
2788
|
+
populate(method: string, args?: ArgsOrCalldata): Call;
|
|
2747
2789
|
}
|
|
2748
2790
|
|
|
2749
2791
|
declare class ContractFactory {
|
|
@@ -2751,7 +2793,7 @@ declare class ContractFactory {
|
|
|
2751
2793
|
compiledContract: CompiledContract;
|
|
2752
2794
|
classHash: string;
|
|
2753
2795
|
account: AccountInterface;
|
|
2754
|
-
private
|
|
2796
|
+
private CallData;
|
|
2755
2797
|
constructor(compiledContract: CompiledContract, classHash: string, account: AccountInterface, abi?: Abi);
|
|
2756
2798
|
/**
|
|
2757
2799
|
* Deploys contract and returns new instance of the Contract
|
|
@@ -2760,16 +2802,16 @@ declare class ContractFactory {
|
|
|
2760
2802
|
* @param options (optional) Object - parseRequest, parseResponse, addressSalt
|
|
2761
2803
|
* @returns deployed Contract
|
|
2762
2804
|
*/
|
|
2763
|
-
deploy(...args:
|
|
2805
|
+
deploy(...args: ArgsOrCalldataWithOptions): Promise<Contract>;
|
|
2764
2806
|
/**
|
|
2765
|
-
* Attaches to new
|
|
2807
|
+
* Attaches to new Account
|
|
2766
2808
|
*
|
|
2767
2809
|
* @param account - new Provider or Account to attach to
|
|
2768
2810
|
* @returns ContractFactory
|
|
2769
2811
|
*/
|
|
2770
2812
|
connect(account: AccountInterface): ContractFactory;
|
|
2771
2813
|
/**
|
|
2772
|
-
* Attaches current abi and
|
|
2814
|
+
* Attaches current abi and account to the new address
|
|
2773
2815
|
*
|
|
2774
2816
|
* @param address - Contract address
|
|
2775
2817
|
* @returns Contract
|
|
@@ -2957,10 +2999,6 @@ declare function makeAddress(input: string): string;
|
|
|
2957
2999
|
declare function formatSignature(sig?: Signature): ArraySignatureType;
|
|
2958
3000
|
declare function signatureToDecimalArray(sig?: Signature): ArraySignatureType;
|
|
2959
3001
|
declare function signatureToHexArray(sig?: Signature): ArraySignatureType;
|
|
2960
|
-
/**
|
|
2961
|
-
* @deprecated this function is deprecated use callData instead from calldata.ts
|
|
2962
|
-
*/
|
|
2963
|
-
declare function compileCalldata(args: RawArgs): Calldata;
|
|
2964
3002
|
declare function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead?: number): bigint;
|
|
2965
3003
|
|
|
2966
3004
|
declare const stark_compressProgram: typeof compressProgram;
|
|
@@ -2969,7 +3007,6 @@ declare const stark_makeAddress: typeof makeAddress;
|
|
|
2969
3007
|
declare const stark_formatSignature: typeof formatSignature;
|
|
2970
3008
|
declare const stark_signatureToDecimalArray: typeof signatureToDecimalArray;
|
|
2971
3009
|
declare const stark_signatureToHexArray: typeof signatureToHexArray;
|
|
2972
|
-
declare const stark_compileCalldata: typeof compileCalldata;
|
|
2973
3010
|
declare const stark_estimatedFeeToMaxFee: typeof estimatedFeeToMaxFee;
|
|
2974
3011
|
declare namespace stark {
|
|
2975
3012
|
export {
|
|
@@ -2979,7 +3016,6 @@ declare namespace stark {
|
|
|
2979
3016
|
stark_formatSignature as formatSignature,
|
|
2980
3017
|
stark_signatureToDecimalArray as signatureToDecimalArray,
|
|
2981
3018
|
stark_signatureToHexArray as signatureToHexArray,
|
|
2982
|
-
stark_compileCalldata as compileCalldata,
|
|
2983
3019
|
stark_estimatedFeeToMaxFee as estimatedFeeToMaxFee,
|
|
2984
3020
|
};
|
|
2985
3021
|
}
|
|
@@ -3005,33 +3041,6 @@ declare namespace merkle {
|
|
|
3005
3041
|
};
|
|
3006
3042
|
}
|
|
3007
3043
|
|
|
3008
|
-
interface Uint256 {
|
|
3009
|
-
low: BigNumberish;
|
|
3010
|
-
high: BigNumberish;
|
|
3011
|
-
}
|
|
3012
|
-
declare function uint256ToBN(uint256: Uint256): bigint;
|
|
3013
|
-
declare const UINT_128_MAX: bigint;
|
|
3014
|
-
declare const UINT_256_MAX: bigint;
|
|
3015
|
-
declare function isUint256(bn: BigNumberish): boolean;
|
|
3016
|
-
declare function bnToUint256(bignumber: BigNumberish): Uint256;
|
|
3017
|
-
|
|
3018
|
-
type uint256$1_Uint256 = Uint256;
|
|
3019
|
-
declare const uint256$1_uint256ToBN: typeof uint256ToBN;
|
|
3020
|
-
declare const uint256$1_UINT_128_MAX: typeof UINT_128_MAX;
|
|
3021
|
-
declare const uint256$1_UINT_256_MAX: typeof UINT_256_MAX;
|
|
3022
|
-
declare const uint256$1_isUint256: typeof isUint256;
|
|
3023
|
-
declare const uint256$1_bnToUint256: typeof bnToUint256;
|
|
3024
|
-
declare namespace uint256$1 {
|
|
3025
|
-
export {
|
|
3026
|
-
uint256$1_Uint256 as Uint256,
|
|
3027
|
-
uint256$1_uint256ToBN as uint256ToBN,
|
|
3028
|
-
uint256$1_UINT_128_MAX as UINT_128_MAX,
|
|
3029
|
-
uint256$1_UINT_256_MAX as UINT_256_MAX,
|
|
3030
|
-
uint256$1_isUint256 as isUint256,
|
|
3031
|
-
uint256$1_bnToUint256 as bnToUint256,
|
|
3032
|
-
};
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
3044
|
declare function isASCII(str: string): boolean;
|
|
3036
3045
|
declare function isShortString(str: string): boolean;
|
|
3037
3046
|
declare function isDecimalString(decim: string): boolean;
|
|
@@ -3093,6 +3102,28 @@ declare namespace shortString {
|
|
|
3093
3102
|
};
|
|
3094
3103
|
}
|
|
3095
3104
|
|
|
3105
|
+
declare function useDecoded(encoded: bigint[]): string;
|
|
3106
|
+
declare function useEncoded(decoded: string): bigint;
|
|
3107
|
+
declare const enum StarknetIdContract {
|
|
3108
|
+
MAINNET = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",
|
|
3109
|
+
TESTNET = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce"
|
|
3110
|
+
}
|
|
3111
|
+
declare function getStarknetIdContract(chainId: StarknetChainId): string;
|
|
3112
|
+
|
|
3113
|
+
declare const starknetId_useDecoded: typeof useDecoded;
|
|
3114
|
+
declare const starknetId_useEncoded: typeof useEncoded;
|
|
3115
|
+
type starknetId_StarknetIdContract = StarknetIdContract;
|
|
3116
|
+
declare const starknetId_StarknetIdContract: typeof StarknetIdContract;
|
|
3117
|
+
declare const starknetId_getStarknetIdContract: typeof getStarknetIdContract;
|
|
3118
|
+
declare namespace starknetId {
|
|
3119
|
+
export {
|
|
3120
|
+
starknetId_useDecoded as useDecoded,
|
|
3121
|
+
starknetId_useEncoded as useEncoded,
|
|
3122
|
+
starknetId_StarknetIdContract as StarknetIdContract,
|
|
3123
|
+
starknetId_getStarknetIdContract as getStarknetIdContract,
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3096
3127
|
declare function addAddressPadding(address: BigNumberish): string;
|
|
3097
3128
|
declare function validateAndParseAddress(address: BigNumberish): string;
|
|
3098
3129
|
declare function getChecksumAddress(address: BigNumberish): string;
|
|
@@ -3241,44 +3272,53 @@ declare class CallData {
|
|
|
3241
3272
|
protected readonly structs: AbiStructs;
|
|
3242
3273
|
constructor(abi: Abi);
|
|
3243
3274
|
/**
|
|
3244
|
-
*
|
|
3245
|
-
*
|
|
3246
|
-
* @param
|
|
3247
|
-
* @param
|
|
3248
|
-
* @param args - arguments that are passed to the method
|
|
3275
|
+
* Validate arguments passed to the method as corresponding to the ones in the abi
|
|
3276
|
+
* @param type string - type of the method
|
|
3277
|
+
* @param method string - name of the method
|
|
3278
|
+
* @param args ArgsOrCalldata - arguments that are passed to the method
|
|
3249
3279
|
*/
|
|
3250
|
-
validate(type: 'INVOKE' | 'CALL' | 'DEPLOY', method: string, args?:
|
|
3280
|
+
validate(type: 'INVOKE' | 'CALL' | 'DEPLOY', method: string, args?: ArgsOrCalldata): void;
|
|
3251
3281
|
/**
|
|
3282
|
+
* Compile contract callData with abi
|
|
3252
3283
|
* Parse the calldata by using input fields from the abi for that method
|
|
3253
|
-
*
|
|
3254
|
-
* @param args - arguments passed
|
|
3255
|
-
* @
|
|
3256
|
-
* @return {Calldata} - parsed arguments in format that contract is expecting
|
|
3284
|
+
* @param method string - method name
|
|
3285
|
+
* @param args ArgsOrCalldata - arguments passed to the method
|
|
3286
|
+
* @return Calldata - parsed arguments in format that contract is expecting
|
|
3257
3287
|
*/
|
|
3258
|
-
compile(
|
|
3288
|
+
compile(method: string, args: ArgsOrCalldata): Calldata;
|
|
3259
3289
|
/**
|
|
3260
3290
|
* Compile contract callData without abi
|
|
3261
|
-
* @param
|
|
3262
|
-
* @returns
|
|
3291
|
+
* @param rawArgs RawArgs representing cairo method arguments or string array of compiled data
|
|
3292
|
+
* @returns Calldata
|
|
3263
3293
|
*/
|
|
3264
|
-
static compile(
|
|
3294
|
+
static compile(rawArgs: RawArgs): Calldata;
|
|
3265
3295
|
/**
|
|
3266
3296
|
* Parse elements of the response array and structuring them into response object
|
|
3267
|
-
* @param method - method name
|
|
3268
|
-
* @param response
|
|
3269
|
-
* @return - parsed response corresponding to the abi
|
|
3297
|
+
* @param method string - method name
|
|
3298
|
+
* @param response string[] - response from the method
|
|
3299
|
+
* @return Result - parsed response corresponding to the abi
|
|
3270
3300
|
*/
|
|
3271
3301
|
parse(method: string, response: string[]): Result;
|
|
3272
3302
|
/**
|
|
3273
3303
|
* Format cairo method response data to native js values based on provided format schema
|
|
3274
|
-
* @param method - cairo method name
|
|
3275
|
-
* @param response - cairo method response
|
|
3276
|
-
* @param format - formatter object schema
|
|
3277
|
-
* @returns parsed and formatted response object
|
|
3304
|
+
* @param method string - cairo method name
|
|
3305
|
+
* @param response string[] - cairo method response
|
|
3306
|
+
* @param format object - formatter object schema
|
|
3307
|
+
* @returns Result - parsed and formatted response object
|
|
3308
|
+
*/
|
|
3309
|
+
format(method: string, response: string[], format: object): Result;
|
|
3310
|
+
/**
|
|
3311
|
+
* Helper to calculate inputs from abi
|
|
3312
|
+
* @param inputs AbiEntry
|
|
3313
|
+
* @returns number
|
|
3278
3314
|
*/
|
|
3279
|
-
format(method: string, response: string[], format: object): object;
|
|
3280
3315
|
static abiInputsLength(inputs: AbiEntry[]): number;
|
|
3281
|
-
|
|
3316
|
+
/**
|
|
3317
|
+
* Helper to extract structs from abi
|
|
3318
|
+
* @param abi Abi
|
|
3319
|
+
* @returns AbiStructs - structs from abi
|
|
3320
|
+
*/
|
|
3321
|
+
static getAbiStruct(abi: Abi): AbiStructs;
|
|
3282
3322
|
}
|
|
3283
3323
|
|
|
3284
3324
|
/**
|
|
@@ -3288,4 +3328,4 @@ declare class CallData {
|
|
|
3288
3328
|
/** @deprecated prefer the 'num' naming */
|
|
3289
3329
|
declare const number: typeof num;
|
|
3290
3330
|
|
|
3291
|
-
export { Abi, AbiEntry, AbiStructs, Account, AccountInterface, AllowArray, Args, ArraySignatureType, AsyncContractFunction, BlockNumber, BlockTag, Builtins, ByteCode, CairoAssembly, CairoContract, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionReceiptResponse, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFunction, ContractInterface, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractPayload, DeployContractResponse, DeployContractUDCResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HttpError, Invocation, InvocationBulk, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LibraryError, MessageToL1, MessageToL2, MultiDeployContractResponse,
|
|
3331
|
+
export { Abi, AbiEntry, AbiStructs, Account, AccountInterface, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BlockNumber, BlockTag, Builtins, ByteCode, CairoAssembly, CairoContract, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionReceiptResponse, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFunction, ContractInterface, ContractOptions, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractPayload, DeployContractResponse, DeployContractUDCResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HttpError, Invocation, InvocationBulk, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LibraryError, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, Result, RpcProvider, RpcProviderOptions, Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, StateUpdateResponse, Status, Storage, Struct, StructAbi, TransactionBulk, TransactionSimulation, TransactionSimulationResponse, TransactionStatus, TransactionTraceResponse, TransactionType, Tupled, UniversalDeployerContractPayload, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, defaultProvider, ec, encode, fixProto, fixStack, getCalldata, getChecksumAddress, hash, isUrl, json, merkle, num, number, shortString, splitArgsAndOptions, stark, starknetId, transaction, index as typedData, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|