starknet 8.4.0 → 8.5.1
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 +12 -0
- package/dist/index.d.ts +79 -2
- package/dist/index.global.js +190 -54
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +194 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.5.1](https://github.com/starknet-io/starknet.js/compare/v8.5.0...v8.5.1) (2025-08-27)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- preserve leading zeros for pending word within byte array ([5d7ab04](https://github.com/starknet-io/starknet.js/commit/5d7ab042ce1a81e4f31a5ec4488db758308e872a))
|
|
6
|
+
|
|
7
|
+
# [8.5.0](https://github.com/starknet-io/starknet.js/compare/v8.4.0...v8.5.0) (2025-08-18)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **provider:** Add Brother ID domain resolution support ([#1313](https://github.com/starknet-io/starknet.js/issues/1313)) ([0bea966](https://github.com/starknet-io/starknet.js/commit/0bea966d29b51b026c6ed5d9916d9039d5fd6a17))
|
|
12
|
+
|
|
1
13
|
# [8.4.0](https://github.com/starknet-io/starknet.js/compare/v8.3.1...v8.4.0) (2025-08-15)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -4812,7 +4812,78 @@ declare class StarknetId {
|
|
|
4812
4812
|
static getStarkProfile(provider: ProviderInterface, address: BigNumberish, StarknetIdContract?: string, StarknetIdIdentityContract?: string, StarknetIdVerifierContract?: string, StarknetIdPfpContract?: string, StarknetIdPopContract?: string, StarknetIdMulticallContract?: string): Promise<StarkProfile>;
|
|
4813
4813
|
}
|
|
4814
4814
|
|
|
4815
|
-
|
|
4815
|
+
/**
|
|
4816
|
+
* Interface representing a Brother domain profile
|
|
4817
|
+
* @property name - The domain name without .brother suffix
|
|
4818
|
+
* @property resolver - The address that resolves to this domain
|
|
4819
|
+
* @property tokenId - The unique identifier of the domain NFT
|
|
4820
|
+
* @property expiryDate - Unix timestamp when the domain expires
|
|
4821
|
+
* @property lastTransferTime - Unix timestamp of the last transfer
|
|
4822
|
+
*/
|
|
4823
|
+
interface BrotherProfile {
|
|
4824
|
+
name: string;
|
|
4825
|
+
resolver: string;
|
|
4826
|
+
tokenId: string;
|
|
4827
|
+
expiryDate: number;
|
|
4828
|
+
lastTransferTime: number;
|
|
4829
|
+
}
|
|
4830
|
+
/**
|
|
4831
|
+
* Class providing methods to interact with Brother Identity contracts.
|
|
4832
|
+
*
|
|
4833
|
+
* This implementation uses the same domain encoding and decoding logic as StarknetId,
|
|
4834
|
+
* allowing for consistent handling of domain names between the two systems.
|
|
4835
|
+
* The encoding/decoding functions (encodeBrotherDomain/decodeBrotherDomain) are direct
|
|
4836
|
+
* adaptations of StarknetId's useEncoded/useDecoded functions to work with .brother domains.
|
|
4837
|
+
*/
|
|
4838
|
+
declare class BrotherId {
|
|
4839
|
+
/**
|
|
4840
|
+
* Gets the primary Brother domain name for an address
|
|
4841
|
+
* @param address - The address to get the domain for
|
|
4842
|
+
* @param BrotherIdContract - Optional contract address
|
|
4843
|
+
* @returns The domain name with .brother suffix
|
|
4844
|
+
*/
|
|
4845
|
+
getBrotherName(address: BigNumberish, BrotherIdContract?: string): Promise<string>;
|
|
4846
|
+
/**
|
|
4847
|
+
* Gets the address associated with a Brother domain name
|
|
4848
|
+
* @param name - The domain name (with or without .brother suffix)
|
|
4849
|
+
* @param BrotherIdContract - Optional contract address
|
|
4850
|
+
* @returns The resolver address for the domain
|
|
4851
|
+
*/
|
|
4852
|
+
getAddressFromBrotherName(name: string, BrotherIdContract?: string): Promise<string>;
|
|
4853
|
+
/**
|
|
4854
|
+
* Gets the complete profile information for a Brother domain
|
|
4855
|
+
* @param address - The address to get the profile for
|
|
4856
|
+
* @param BrotherIdContract - Optional contract address
|
|
4857
|
+
* @returns The complete Brother profile information
|
|
4858
|
+
*/
|
|
4859
|
+
getBrotherProfile(address: BigNumberish, BrotherIdContract?: string): Promise<BrotherProfile>;
|
|
4860
|
+
/**
|
|
4861
|
+
* Static implementation of getBrotherName
|
|
4862
|
+
* @param provider - The provider interface
|
|
4863
|
+
* @param address - The address to get the domain for
|
|
4864
|
+
* @param BrotherIdContract - Optional contract address
|
|
4865
|
+
* @returns The domain name with .brother suffix
|
|
4866
|
+
*/
|
|
4867
|
+
static getBrotherName(provider: ProviderInterface, address: BigNumberish, BrotherIdContract?: string): Promise<string>;
|
|
4868
|
+
/**
|
|
4869
|
+
* Static implementation of getAddressFromBrotherName
|
|
4870
|
+
* @param provider - The provider interface
|
|
4871
|
+
* @param name - The domain name
|
|
4872
|
+
* @param BrotherIdContract - Optional contract address
|
|
4873
|
+
* @returns The resolver address
|
|
4874
|
+
*/
|
|
4875
|
+
static getAddressFromBrotherName(provider: ProviderInterface, name: string, BrotherIdContract?: string): Promise<string>;
|
|
4876
|
+
/**
|
|
4877
|
+
* Static implementation of getBrotherProfile
|
|
4878
|
+
* @param provider - The provider interface
|
|
4879
|
+
* @param address - The address to get the profile for
|
|
4880
|
+
* @param BrotherIdContract - Optional contract address
|
|
4881
|
+
* @returns The complete Brother profile
|
|
4882
|
+
*/
|
|
4883
|
+
static getBrotherProfile(provider: ProviderInterface, address: BigNumberish, BrotherIdContract?: string): Promise<BrotherProfile>;
|
|
4884
|
+
}
|
|
4885
|
+
|
|
4886
|
+
declare const RpcProvider_base: ts_mixer_dist_types_types.Class<any[], RpcProvider$1 & StarknetId & BrotherId, typeof RpcProvider$1 & typeof StarknetId & typeof BrotherId>;
|
|
4816
4887
|
declare class RpcProvider extends RpcProvider_base {
|
|
4817
4888
|
}
|
|
4818
4889
|
|
|
@@ -8452,6 +8523,12 @@ declare class CairoBytes31 {
|
|
|
8452
8523
|
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoBytes31;
|
|
8453
8524
|
}
|
|
8454
8525
|
|
|
8526
|
+
/**
|
|
8527
|
+
* @deprecated use the CairoFelt252 class instead, this one is limited to ASCII strings
|
|
8528
|
+
* Create felt Cairo type (cairo type helper)
|
|
8529
|
+
* @returns format: felt-string
|
|
8530
|
+
*/
|
|
8531
|
+
declare function CairoFelt(it: BigNumberish): string;
|
|
8455
8532
|
/**
|
|
8456
8533
|
* felt252 is the basic field element used in Cairo.
|
|
8457
8534
|
* It corresponds to an integer in the range 0 ≤ x < P where P is a very large prime number currently equal to 2^251 + 17⋅2^192 + 1.
|
|
@@ -9295,4 +9372,4 @@ declare class Logger {
|
|
|
9295
9372
|
*/
|
|
9296
9373
|
declare const logger: Logger;
|
|
9297
9374
|
|
|
9298
|
-
export { type Abi, type AbiEntry, type AbiEntryType, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, AbiParser1, AbiParser2, AbiParserInterface, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, CairoByteArray, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint512, CairoUint64, CairoUint8, CairoUint96, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type ErrorReceiptResponseHelper, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, Int, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type ParsingStrategy, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type ReconnectOptions, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, type RevertedTransactionReceiptResponseHelper, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, type SubscribeEventsParams, type SubscribeNewHeadsParams, type SubscribeNewTransactionReceiptsParams, type SubscribeNewTransactionsParams, type SubscribeTransactionStatusParams, Subscription, type SubscriptionBlockIdentifier, type SubscriptionNewHeadsEvent, type SubscriptionNewTransactionEvent, type SubscriptionNewTransactionReceiptsEvent, type SubscriptionOptions, type SubscriptionStarknetEventsEvent, type SubscriptionTransactionStatusEvent, type SuccessfulTransactionReceiptResponse, type SuccessfulTransactionReceiptResponseHelper, type TXN_EXECUTION_STATUS, type TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, type fastExecuteResponse, fastParsingStrategy, type fastWaitForTransactionOptions, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
|
|
9375
|
+
export { type Abi, type AbiEntry, type AbiEntryType, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, AbiParser1, AbiParser2, AbiParserInterface, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, CairoByteArray, CairoBytes31, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFelt, CairoFelt252, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint32, CairoUint512, CairoUint64, CairoUint8, CairoUint96, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type ErrorReceiptResponseHelper, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, Int, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type ParsingStrategy, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type ReconnectOptions, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, type RevertedTransactionReceiptResponseHelper, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, type SubscribeEventsParams, type SubscribeNewHeadsParams, type SubscribeNewTransactionReceiptsParams, type SubscribeNewTransactionsParams, type SubscribeTransactionStatusParams, Subscription, type SubscriptionBlockIdentifier, type SubscriptionNewHeadsEvent, type SubscriptionNewTransactionEvent, type SubscriptionNewTransactionReceiptsEvent, type SubscriptionOptions, type SubscriptionStarknetEventsEvent, type SubscriptionTransactionStatusEvent, type SuccessfulTransactionReceiptResponse, type SuccessfulTransactionReceiptResponseHelper, type TXN_EXECUTION_STATUS, type TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, type fastExecuteResponse, fastParsingStrategy, type fastWaitForTransactionOptions, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
|
package/dist/index.global.js
CHANGED
|
@@ -30,7 +30,10 @@ var starknet = (() => {
|
|
|
30
30
|
BlockStatus: () => BlockStatus,
|
|
31
31
|
BlockTag: () => BlockTag,
|
|
32
32
|
CairoByteArray: () => CairoByteArray,
|
|
33
|
+
CairoBytes31: () => CairoBytes31,
|
|
33
34
|
CairoCustomEnum: () => CairoCustomEnum,
|
|
35
|
+
CairoFelt: () => CairoFelt,
|
|
36
|
+
CairoFelt252: () => CairoFelt252,
|
|
34
37
|
CairoFixedArray: () => CairoFixedArray,
|
|
35
38
|
CairoInt128: () => CairoInt128,
|
|
36
39
|
CairoInt16: () => CairoInt16,
|
|
@@ -44,6 +47,7 @@ var starknet = (() => {
|
|
|
44
47
|
CairoUint128: () => CairoUint128,
|
|
45
48
|
CairoUint16: () => CairoUint16,
|
|
46
49
|
CairoUint256: () => CairoUint256,
|
|
50
|
+
CairoUint32: () => CairoUint32,
|
|
47
51
|
CairoUint512: () => CairoUint512,
|
|
48
52
|
CairoUint64: () => CairoUint64,
|
|
49
53
|
CairoUint8: () => CairoUint8,
|
|
@@ -257,7 +261,6 @@ var starknet = (() => {
|
|
|
257
261
|
STATUS_PRE_CONFIRMED: () => STATUS_PRE_CONFIRMED,
|
|
258
262
|
STATUS_PRE_CONFIRMED_LOWERCASE: () => STATUS_PRE_CONFIRMED_LOWERCASE,
|
|
259
263
|
STATUS_RECEIVED: () => STATUS_RECEIVED2,
|
|
260
|
-
STATUS_REJECTED: () => STATUS_REJECTED2,
|
|
261
264
|
STATUS_REVERTED: () => STATUS_REVERTED2,
|
|
262
265
|
STATUS_SUCCEEDED: () => STATUS_SUCCEEDED2,
|
|
263
266
|
STRUCT_ABI_TYPE: () => STRUCT_ABI_TYPE2,
|
|
@@ -530,7 +533,6 @@ var starknet = (() => {
|
|
|
530
533
|
STATUS_PRE_CONFIRMED: () => STATUS_PRE_CONFIRMED,
|
|
531
534
|
STATUS_PRE_CONFIRMED_LOWERCASE: () => STATUS_PRE_CONFIRMED_LOWERCASE,
|
|
532
535
|
STATUS_RECEIVED: () => STATUS_RECEIVED2,
|
|
533
|
-
STATUS_REJECTED: () => STATUS_REJECTED2,
|
|
534
536
|
STATUS_REVERTED: () => STATUS_REVERTED2,
|
|
535
537
|
STATUS_SUCCEEDED: () => STATUS_SUCCEEDED2,
|
|
536
538
|
STRUCT_ABI_TYPE: () => STRUCT_ABI_TYPE2,
|
|
@@ -576,7 +578,6 @@ var starknet = (() => {
|
|
|
576
578
|
STATUS_PRE_CONFIRMED: () => STATUS_PRE_CONFIRMED,
|
|
577
579
|
STATUS_PRE_CONFIRMED_LOWERCASE: () => STATUS_PRE_CONFIRMED_LOWERCASE,
|
|
578
580
|
STATUS_RECEIVED: () => STATUS_RECEIVED2,
|
|
579
|
-
STATUS_REJECTED: () => STATUS_REJECTED2,
|
|
580
581
|
STATUS_REVERTED: () => STATUS_REVERTED2,
|
|
581
582
|
STATUS_SUCCEEDED: () => STATUS_SUCCEEDED2,
|
|
582
583
|
STRUCT_ABI_TYPE: () => STRUCT_ABI_TYPE2,
|
|
@@ -595,7 +596,6 @@ var starknet = (() => {
|
|
|
595
596
|
var STATUS_ACCEPTED_ON_L12 = "ACCEPTED_ON_L1";
|
|
596
597
|
var STATUS_SUCCEEDED2 = "SUCCEEDED";
|
|
597
598
|
var STATUS_REVERTED2 = "REVERTED";
|
|
598
|
-
var STATUS_REJECTED2 = "REJECTED";
|
|
599
599
|
var STATUS_RECEIVED2 = "RECEIVED";
|
|
600
600
|
var STATUS_CANDIDATE = "CANDIDATE";
|
|
601
601
|
var STATUS_PRE_CONFIRMED = "PRE_CONFIRMED";
|
|
@@ -6247,8 +6247,7 @@ ${indent}}` : "}";
|
|
|
6247
6247
|
}
|
|
6248
6248
|
decodeUtf8() {
|
|
6249
6249
|
const allBytes = this.reconstructBytes();
|
|
6250
|
-
|
|
6251
|
-
return new TextDecoder().decode(fullBytes);
|
|
6250
|
+
return new TextDecoder().decode(allBytes);
|
|
6252
6251
|
}
|
|
6253
6252
|
toBigInt() {
|
|
6254
6253
|
const allBytes = this.reconstructBytes();
|
|
@@ -6262,32 +6261,13 @@ ${indent}}` : "}";
|
|
|
6262
6261
|
return result;
|
|
6263
6262
|
}
|
|
6264
6263
|
toHexString() {
|
|
6265
|
-
|
|
6264
|
+
const allBytes = this.reconstructBytes();
|
|
6265
|
+
const hexValue = allBytes.length === 0 ? "0" : buf2hex(allBytes);
|
|
6266
|
+
return addHexPrefix(hexValue);
|
|
6266
6267
|
}
|
|
6267
6268
|
toBuffer() {
|
|
6268
6269
|
this.assertInitialized();
|
|
6269
|
-
const allBytes =
|
|
6270
|
-
this.data.forEach((chunk) => {
|
|
6271
|
-
const chunkBytes = chunk.data;
|
|
6272
|
-
for (let i = 0; i < chunkBytes.length; i += 1) {
|
|
6273
|
-
allBytes.push(chunkBytes[i]);
|
|
6274
|
-
}
|
|
6275
|
-
});
|
|
6276
|
-
const pendingLen = Number(this.pending_word_len.toBigInt());
|
|
6277
|
-
if (pendingLen > 0) {
|
|
6278
|
-
const hex = this.pending_word.toHexString();
|
|
6279
|
-
const hexWithoutPrefix = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
6280
|
-
const paddedHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;
|
|
6281
|
-
for (let i = 0; i < pendingLen; i += 1) {
|
|
6282
|
-
const byteHex = paddedHex.slice(i * 2, i * 2 + 2);
|
|
6283
|
-
if (byteHex.length >= 2) {
|
|
6284
|
-
const byteValue = parseInt(byteHex, 16);
|
|
6285
|
-
if (!Number.isNaN(byteValue)) {
|
|
6286
|
-
allBytes.push(byteValue);
|
|
6287
|
-
}
|
|
6288
|
-
}
|
|
6289
|
-
}
|
|
6290
|
-
}
|
|
6270
|
+
const allBytes = this.reconstructBytes();
|
|
6291
6271
|
return buffer_default.from(allBytes);
|
|
6292
6272
|
}
|
|
6293
6273
|
static validate(data) {
|
|
@@ -6351,32 +6331,15 @@ ${indent}}` : "}";
|
|
|
6351
6331
|
*/
|
|
6352
6332
|
reconstructBytes() {
|
|
6353
6333
|
this.assertInitialized();
|
|
6354
|
-
const
|
|
6355
|
-
this.data.forEach((chunk) => {
|
|
6356
|
-
const chunkBytes = chunk.data;
|
|
6357
|
-
for (let i = 0; i < chunkBytes.length; i += 1) {
|
|
6358
|
-
allBytes.push(chunkBytes[i]);
|
|
6359
|
-
}
|
|
6360
|
-
});
|
|
6334
|
+
const allChunks = this.data.flatMap((chunk) => chunk.data);
|
|
6361
6335
|
const pendingLen = Number(this.pending_word_len.toBigInt());
|
|
6362
|
-
if (pendingLen
|
|
6363
|
-
const
|
|
6364
|
-
const
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
const byteHex = paddedHex.slice(i * 2, i * 2 + 2);
|
|
6368
|
-
if (byteHex.length < 2) {
|
|
6369
|
-
allBytes.push(0);
|
|
6370
|
-
} else {
|
|
6371
|
-
const byteValue = parseInt(byteHex, 16);
|
|
6372
|
-
if (Number.isNaN(byteValue)) {
|
|
6373
|
-
throw new Error(`Invalid hex byte: ${byteHex}`);
|
|
6374
|
-
}
|
|
6375
|
-
allBytes.push(byteValue);
|
|
6376
|
-
}
|
|
6377
|
-
}
|
|
6336
|
+
if (pendingLen) {
|
|
6337
|
+
const pending = new Uint8Array(pendingLen);
|
|
6338
|
+
const paddingDifference = pendingLen - this.pending_word.data.length;
|
|
6339
|
+
pending.set(this.pending_word.data, paddingDifference);
|
|
6340
|
+
allChunks.push(pending);
|
|
6378
6341
|
}
|
|
6379
|
-
return
|
|
6342
|
+
return concatenateArrayBuffer(allChunks);
|
|
6380
6343
|
}
|
|
6381
6344
|
static factoryFromApiResponse(responseIterator) {
|
|
6382
6345
|
const data = Array.from(
|
|
@@ -17729,8 +17692,181 @@ ${indent}}` : "}";
|
|
|
17729
17692
|
}
|
|
17730
17693
|
};
|
|
17731
17694
|
|
|
17695
|
+
// src/provider/extensions/brotherId.ts
|
|
17696
|
+
function isBrotherDomain(domain) {
|
|
17697
|
+
return domain.endsWith(".brother");
|
|
17698
|
+
}
|
|
17699
|
+
function encodeBrotherDomain(domain) {
|
|
17700
|
+
const brotherName = domain.endsWith(".brother") ? domain.replace(".brother", "") : domain;
|
|
17701
|
+
return useEncoded(brotherName);
|
|
17702
|
+
}
|
|
17703
|
+
function decodeBrotherDomain(encoded) {
|
|
17704
|
+
const decoded = useDecoded([encoded]);
|
|
17705
|
+
if (decoded.endsWith(".stark")) {
|
|
17706
|
+
return decoded.replace(".stark", ".brother");
|
|
17707
|
+
}
|
|
17708
|
+
return decoded ? `${decoded}.brother` : decoded;
|
|
17709
|
+
}
|
|
17710
|
+
function getBrotherIdContract(chainId) {
|
|
17711
|
+
switch (chainId) {
|
|
17712
|
+
case _StarknetChainId.SN_MAIN:
|
|
17713
|
+
return "0x0212f1c57700f5a3913dd11efba540196aad4cf67772f7090c62709dd804fa74";
|
|
17714
|
+
default:
|
|
17715
|
+
return "0x0212f1c57700f5a3913dd11efba540196aad4cf67772f7090c62709dd804fa74";
|
|
17716
|
+
}
|
|
17717
|
+
}
|
|
17718
|
+
var BrotherId = class _BrotherId {
|
|
17719
|
+
/**
|
|
17720
|
+
* Gets the primary Brother domain name for an address
|
|
17721
|
+
* @param address - The address to get the domain for
|
|
17722
|
+
* @param BrotherIdContract - Optional contract address
|
|
17723
|
+
* @returns The domain name with .brother suffix
|
|
17724
|
+
*/
|
|
17725
|
+
async getBrotherName(address, BrotherIdContract) {
|
|
17726
|
+
return _BrotherId.getBrotherName(
|
|
17727
|
+
// After Mixin, this is ProviderInterface
|
|
17728
|
+
this,
|
|
17729
|
+
address,
|
|
17730
|
+
BrotherIdContract
|
|
17731
|
+
);
|
|
17732
|
+
}
|
|
17733
|
+
/**
|
|
17734
|
+
* Gets the address associated with a Brother domain name
|
|
17735
|
+
* @param name - The domain name (with or without .brother suffix)
|
|
17736
|
+
* @param BrotherIdContract - Optional contract address
|
|
17737
|
+
* @returns The resolver address for the domain
|
|
17738
|
+
*/
|
|
17739
|
+
async getAddressFromBrotherName(name, BrotherIdContract) {
|
|
17740
|
+
return _BrotherId.getAddressFromBrotherName(
|
|
17741
|
+
// After Mixin, this is ProviderInterface
|
|
17742
|
+
this,
|
|
17743
|
+
name,
|
|
17744
|
+
BrotherIdContract
|
|
17745
|
+
);
|
|
17746
|
+
}
|
|
17747
|
+
/**
|
|
17748
|
+
* Gets the complete profile information for a Brother domain
|
|
17749
|
+
* @param address - The address to get the profile for
|
|
17750
|
+
* @param BrotherIdContract - Optional contract address
|
|
17751
|
+
* @returns The complete Brother profile information
|
|
17752
|
+
*/
|
|
17753
|
+
async getBrotherProfile(address, BrotherIdContract) {
|
|
17754
|
+
return _BrotherId.getBrotherProfile(
|
|
17755
|
+
// After Mixin, this is ProviderInterface
|
|
17756
|
+
this,
|
|
17757
|
+
address,
|
|
17758
|
+
BrotherIdContract
|
|
17759
|
+
);
|
|
17760
|
+
}
|
|
17761
|
+
/**
|
|
17762
|
+
* Static implementation of getBrotherName
|
|
17763
|
+
* @param provider - The provider interface
|
|
17764
|
+
* @param address - The address to get the domain for
|
|
17765
|
+
* @param BrotherIdContract - Optional contract address
|
|
17766
|
+
* @returns The domain name with .brother suffix
|
|
17767
|
+
*/
|
|
17768
|
+
static async getBrotherName(provider, address, BrotherIdContract) {
|
|
17769
|
+
const chainId = await provider.getChainId();
|
|
17770
|
+
const contract = BrotherIdContract ?? getBrotherIdContract(chainId);
|
|
17771
|
+
try {
|
|
17772
|
+
const primaryDomain = await provider.callContract({
|
|
17773
|
+
contractAddress: contract,
|
|
17774
|
+
entrypoint: "getPrimary",
|
|
17775
|
+
calldata: CallData.compile({
|
|
17776
|
+
user: address
|
|
17777
|
+
})
|
|
17778
|
+
});
|
|
17779
|
+
if (!primaryDomain[0] || primaryDomain[0] === "0x0") {
|
|
17780
|
+
throw Error("Brother name not found");
|
|
17781
|
+
}
|
|
17782
|
+
const encodedDomain = BigInt(primaryDomain[0]);
|
|
17783
|
+
return decodeBrotherDomain(encodedDomain);
|
|
17784
|
+
} catch (e) {
|
|
17785
|
+
if (e instanceof Error && e.message === "Brother name not found") {
|
|
17786
|
+
throw e;
|
|
17787
|
+
}
|
|
17788
|
+
throw Error("Could not get brother name");
|
|
17789
|
+
}
|
|
17790
|
+
}
|
|
17791
|
+
/**
|
|
17792
|
+
* Static implementation of getAddressFromBrotherName
|
|
17793
|
+
* @param provider - The provider interface
|
|
17794
|
+
* @param name - The domain name
|
|
17795
|
+
* @param BrotherIdContract - Optional contract address
|
|
17796
|
+
* @returns The resolver address
|
|
17797
|
+
*/
|
|
17798
|
+
static async getAddressFromBrotherName(provider, name, BrotherIdContract) {
|
|
17799
|
+
const brotherName = name.endsWith(".brother") ? name : `${name}.brother`;
|
|
17800
|
+
if (!isBrotherDomain(brotherName)) {
|
|
17801
|
+
throw new Error("Invalid domain, must be a valid .brother domain");
|
|
17802
|
+
}
|
|
17803
|
+
const chainId = await provider.getChainId();
|
|
17804
|
+
const contract = BrotherIdContract ?? getBrotherIdContract(chainId);
|
|
17805
|
+
try {
|
|
17806
|
+
const domainDetails = await provider.callContract({
|
|
17807
|
+
contractAddress: contract,
|
|
17808
|
+
entrypoint: "get_details_by_domain",
|
|
17809
|
+
calldata: CallData.compile({
|
|
17810
|
+
domain: encodeBrotherDomain(brotherName)
|
|
17811
|
+
})
|
|
17812
|
+
});
|
|
17813
|
+
if (!domainDetails[0] || domainDetails[1] === "0x0") {
|
|
17814
|
+
throw Error("Could not get address from brother name");
|
|
17815
|
+
}
|
|
17816
|
+
return domainDetails[1];
|
|
17817
|
+
} catch {
|
|
17818
|
+
throw Error("Could not get address from brother name");
|
|
17819
|
+
}
|
|
17820
|
+
}
|
|
17821
|
+
/**
|
|
17822
|
+
* Static implementation of getBrotherProfile
|
|
17823
|
+
* @param provider - The provider interface
|
|
17824
|
+
* @param address - The address to get the profile for
|
|
17825
|
+
* @param BrotherIdContract - Optional contract address
|
|
17826
|
+
* @returns The complete Brother profile
|
|
17827
|
+
*/
|
|
17828
|
+
static async getBrotherProfile(provider, address, BrotherIdContract) {
|
|
17829
|
+
const chainId = await provider.getChainId();
|
|
17830
|
+
const contract = BrotherIdContract ?? getBrotherIdContract(chainId);
|
|
17831
|
+
try {
|
|
17832
|
+
const primaryDomain = await provider.callContract({
|
|
17833
|
+
contractAddress: contract,
|
|
17834
|
+
entrypoint: "getPrimary",
|
|
17835
|
+
calldata: CallData.compile({
|
|
17836
|
+
user: address
|
|
17837
|
+
})
|
|
17838
|
+
});
|
|
17839
|
+
if (!primaryDomain[0] || primaryDomain[0] === "0x0") {
|
|
17840
|
+
throw Error("Brother profile not found");
|
|
17841
|
+
}
|
|
17842
|
+
const encodedDomain = BigInt(primaryDomain[0]);
|
|
17843
|
+
const decodedDomain = decodeBrotherDomain(encodedDomain);
|
|
17844
|
+
const domain = decodedDomain.replace(".brother", "");
|
|
17845
|
+
const domainDetails = await provider.callContract({
|
|
17846
|
+
contractAddress: contract,
|
|
17847
|
+
entrypoint: "get_details_by_domain",
|
|
17848
|
+
calldata: CallData.compile({
|
|
17849
|
+
domain: encodeBrotherDomain(domain)
|
|
17850
|
+
})
|
|
17851
|
+
});
|
|
17852
|
+
return {
|
|
17853
|
+
name: domain,
|
|
17854
|
+
resolver: domainDetails[1],
|
|
17855
|
+
tokenId: domainDetails[2],
|
|
17856
|
+
expiryDate: parseInt(domainDetails[3], 16),
|
|
17857
|
+
lastTransferTime: parseInt(domainDetails[4], 16)
|
|
17858
|
+
};
|
|
17859
|
+
} catch (e) {
|
|
17860
|
+
if (e instanceof Error && e.message === "Brother profile not found") {
|
|
17861
|
+
throw e;
|
|
17862
|
+
}
|
|
17863
|
+
throw Error("Could not get brother profile");
|
|
17864
|
+
}
|
|
17865
|
+
}
|
|
17866
|
+
};
|
|
17867
|
+
|
|
17732
17868
|
// src/provider/extensions/default.ts
|
|
17733
|
-
var RpcProvider2 = class extends Mixin(RpcProvider, StarknetId) {
|
|
17869
|
+
var RpcProvider2 = class extends Mixin(RpcProvider, StarknetId, BrotherId) {
|
|
17734
17870
|
};
|
|
17735
17871
|
|
|
17736
17872
|
// src/provider/interface.ts
|