starknet 5.25.0 → 5.26.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 +6 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.global.js +3 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# [5.26.0](https://github.com/starknet-io/starknet.js/compare/v5.25.0...v5.26.0) (2024-01-15)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- abi-wan trigger ([c10150a](https://github.com/starknet-io/starknet.js/commit/c10150a328051054a7bba1260296c0c92fdd2051))
|
|
6
|
+
|
|
1
7
|
# [5.25.0](https://github.com/starknet-io/starknet.js/compare/v5.24.5...v5.25.0) (2023-12-18)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
2
2
|
import { Abi as Abi$1, TypedContract as TypedContract$1 } from 'abi-wan-kanabi';
|
|
3
|
+
import { Abi as Abi$2, TypedContract as TypedContract$2 } from 'abi-wan-kanabi-v2';
|
|
3
4
|
import * as poseidon from '@noble/curves/abstract/poseidon';
|
|
4
5
|
import * as json$1 from 'lossless-json';
|
|
5
6
|
import * as starknet from '@scure/starknet';
|
|
@@ -330,7 +331,7 @@ declare class CairoResult<T, U> {
|
|
|
330
331
|
type CairoEnum = CairoCustomEnum | CairoOption<any> | CairoResult<any, any>;
|
|
331
332
|
|
|
332
333
|
/** ABI */
|
|
333
|
-
type Abi =
|
|
334
|
+
type Abi = ReadonlyArray<FunctionAbi | EventAbi | StructAbi | any>;
|
|
334
335
|
type AbiEntry = {
|
|
335
336
|
name: string;
|
|
336
337
|
type: 'felt' | 'felt*' | string;
|
|
@@ -1120,7 +1121,7 @@ type SIERRA_ENTRY_POINT = {
|
|
|
1120
1121
|
selector: FELT;
|
|
1121
1122
|
function_idx: number;
|
|
1122
1123
|
};
|
|
1123
|
-
type CONTRACT_ABI = CONTRACT_ABI_ENTRY[];
|
|
1124
|
+
type CONTRACT_ABI = readonly CONTRACT_ABI_ENTRY[];
|
|
1124
1125
|
type CONTRACT_ABI_ENTRY = {
|
|
1125
1126
|
selector: FELT;
|
|
1126
1127
|
input: string;
|
|
@@ -4182,7 +4183,22 @@ declare class Account extends Provider implements AccountInterface {
|
|
|
4182
4183
|
StarknetIdContract?: string): Promise<string>;
|
|
4183
4184
|
}
|
|
4184
4185
|
|
|
4186
|
+
declare module 'abi-wan-kanabi-v2' {
|
|
4187
|
+
interface Config<OptionT = any, ResultT = any, ErrorT = any> {
|
|
4188
|
+
FeltType: BigNumberish;
|
|
4189
|
+
U256Type: number | bigint | Uint256;
|
|
4190
|
+
Option: CairoOption<OptionT>;
|
|
4191
|
+
Tuple: Record<number, BigNumberish | object | boolean>;
|
|
4192
|
+
Result: CairoResult<ResultT, ErrorT>;
|
|
4193
|
+
Enum: CairoCustomEnum;
|
|
4194
|
+
Calldata: RawArgs | Calldata;
|
|
4195
|
+
CallOptions: CallOptions;
|
|
4196
|
+
InvokeOptions: InvokeOptions;
|
|
4197
|
+
InvokeFunctionResponse: InvokeFunctionResponse;
|
|
4198
|
+
}
|
|
4199
|
+
}
|
|
4185
4200
|
type TypedContract<TAbi extends Abi$1> = TypedContract$1<TAbi> & ContractInterface;
|
|
4201
|
+
type TypedContractV2$1<TAbi extends Abi$2> = TypedContract$2<TAbi> & ContractInterface;
|
|
4186
4202
|
declare abstract class ContractInterface {
|
|
4187
4203
|
abstract abi: Abi;
|
|
4188
4204
|
abstract address: string;
|
|
@@ -4278,8 +4294,10 @@ declare abstract class ContractInterface {
|
|
|
4278
4294
|
*/
|
|
4279
4295
|
abstract getVersion(): Promise<ContractVersion>;
|
|
4280
4296
|
abstract typed<TAbi extends Abi$1>(tAbi: TAbi): TypedContract<TAbi>;
|
|
4297
|
+
abstract typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2$1<TAbi>;
|
|
4281
4298
|
}
|
|
4282
4299
|
|
|
4300
|
+
type TypedContractV2<TAbi extends Abi$2> = TypedContract$2<TAbi> & Contract;
|
|
4283
4301
|
declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => {
|
|
4284
4302
|
args: ArgsOrCalldata;
|
|
4285
4303
|
options: ContractOptions;
|
|
@@ -4330,6 +4348,7 @@ declare class Contract implements ContractInterface {
|
|
|
4330
4348
|
isCairo1(): boolean;
|
|
4331
4349
|
getVersion(): Promise<ContractVersion>;
|
|
4332
4350
|
typed<TAbi extends Abi$1>(tAbi: TAbi): TypedContract<TAbi>;
|
|
4351
|
+
typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2<TAbi>;
|
|
4333
4352
|
}
|
|
4334
4353
|
|
|
4335
4354
|
type ContractFactoryParams = {
|
|
@@ -5379,4 +5398,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
|
|
|
5379
5398
|
/** @deprecated prefer the 'num' naming */
|
|
5380
5399
|
declare const number: typeof num;
|
|
5381
5400
|
|
|
5382
|
-
export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, EventAbi, EventEntry, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus$1 as TransactionStatus, TransactionType, Tupled, TypedContract, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getDefaultNodeUrl, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$1 as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|
|
5401
|
+
export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, EventAbi, EventEntry, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus$1 as TransactionStatus, TransactionType, Tupled, TypedContract, TypedContractV2, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getDefaultNodeUrl, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$1 as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|
package/dist/index.global.js
CHANGED
|
@@ -13374,6 +13374,9 @@ ${res.tx_failure_reason.error_message}`;
|
|
|
13374
13374
|
typed(tAbi) {
|
|
13375
13375
|
return this;
|
|
13376
13376
|
}
|
|
13377
|
+
typedv2(tAbi) {
|
|
13378
|
+
return this;
|
|
13379
|
+
}
|
|
13377
13380
|
};
|
|
13378
13381
|
|
|
13379
13382
|
// src/contract/interface.ts
|