@0xknwn/starknet-modular-account / Exports
@0xknwn/starknet-modular-account
Table of contents
Classes
Interfaces
Type Aliases
Variables
Functions
Type Aliases
Authorization
Ƭ Authorization: Object
Type declaration
Name | Type |
---|---|
accountAddress | string |
authKey | string |
chainId | string |
expires | string |
grantorClass? | string |
hash? | string |
root | string |
selector | string |
signature | string [] |
validatorClass | string |
Defined in
sdks/account/src/smartr_account.ts:27
Variables
POLICY_TYPE_HASH
• Const
POLICY_TYPE_HASH: string
Defined in
SESSION_TYPE_HASH
• Const
SESSION_TYPE_HASH: string
Defined in
STARKNET_DOMAIN_TYPE_HASH
• Const
STARKNET_DOMAIN_TYPE_HASH: string
Defined in
SmartrAccountABI
• Const
SmartrAccountABI: readonly [{ interface_name
: "smartr::component::version::IVersion"
= "smartr::component::version::IVersion"; name
: "VersionImpl"
= "VersionImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [] = []; name
: "get_version"
= "get_version"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [] = []; name
: "get_name"
= "get_name"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::version::IVersion"
= "smartr::component::version::IVersion"; type
: "interface"
= "interface" }, { interface_name
: "openzeppelin::upgrades::interface::IUpgradeable"
= "openzeppelin::upgrades::interface::IUpgradeable"; name
: "UpgradeableImpl"
= "UpgradeableImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "new_class_hash"
= "new_class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; name
: "upgrade"
= "upgrade"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }] ; name
: "openzeppelin::upgrades::interface::IUpgradeable"
= "openzeppelin::upgrades::interface::IUpgradeable"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::account::ISRC6"
= "smartr::component::account::ISRC6"; name
: "SRC6Impl"
= "SRC6Impl"; type
: "impl"
= "impl" }, { members
: readonly [{ name
: "snapshot"
= "snapshot"; type
: "@core::array::Array::<core::felt252>"
= "@core::array::Array::<core::felt252>" }] ; name
: "core::array::Span::<core::felt252>"
= "core::array::Span::<core::felt252>"; type
: "struct"
= "struct" }, { members
: readonly [{ name
: "to"
= "to"; type
: "core::starknet::contract_address::ContractAddress"
= "core::starknet::contract_address::ContractAddress" }, { name
: "selector"
= "selector"; type
: "core::felt252"
= "core::felt252" }, { name
: "calldata"
= "calldata"; type
: "core::array::Span::<core::felt252>"
= "core::array::Span::<core::felt252>" }] ; name
: "core::starknet::account::Call"
= "core::starknet::account::Call"; type
: "struct"
= "struct" }, { items
: readonly [{ inputs
: readonly [{ name
: "calls"
= "calls"; type
: "core::array::Array::<core::starknet::account::Call>"
= "core::array::Array::<core::starknet::account::Call>" }] ; name
: "__execute__"
= "__execute__"; outputs
: readonly [{ type
: "core::array::Array::<core::array::Span::<core::felt252>>"
= "core::array::Array::<core::array::Span::<core::felt252>>" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "calls"
= "calls"; type
: "core::array::Array::<core::starknet::account::Call>"
= "core::array::Array::<core::starknet::account::Call>" }] ; name
: "__validate__"
= "__validate__"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "hash"
= "hash"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }, { name
: "signature"
= "signature"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "is_valid_signature"
= "is_valid_signature"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::account::ISRC6"
= "smartr::component::account::ISRC6"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::account::IDeclarer"
= "smartr::component::account::IDeclarer"; name
: "DeclarerImpl"
= "DeclarerImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::felt252"
= "core::felt252" }] ; name
: "__validate_declare__"
= "__validate_declare__"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::account::IDeclarer"
= "smartr::component::account::IDeclarer"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::account::IDeployable"
= "smartr::component::account::IDeployable"; name
: "DeployableImpl"
= "DeployableImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::felt252"
= "core::felt252" }, { name
: "contract_address_salt"
= "contract_address_salt"; type
: "core::felt252"
= "core::felt252" }, { name
: "core_validator"
= "core_validator"; type
: "core::felt252"
= "core::felt252" }, { name
: "public_key"
= "public_key"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "__validate_deploy__"
= "__validate_deploy__"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::account::IDeployable"
= "smartr::component::account::IDeployable"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::account::IModule"
= "smartr::component::account::IModule"; name
: "ModuleImpl"
= "ModuleImpl"; type
: "impl"
= "impl" }, { name
: "core::bool"
= "core::bool"; type
: "enum"
= "enum"; variants
: readonly [{ name
: "False"
= "False"; type
: "()"
= "()" }, { name
: "True"
= "True"; type
: "()"
= "()" }] }, { items
: readonly [{ inputs
: readonly [{ name
: "calldata"
= "calldata"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "__module_validate__"
= "__module_validate__"; outputs
: readonly [] = []; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; name
: "add_module"
= "add_module"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; name
: "remove_module"
= "remove_module"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }, { name
: "forward_validate_module"
= "forward_validate_module"; type
: "core::bool"
= "core::bool" }] ; name
: "update_core_module"
= "update_core_module"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }, { inputs
: readonly [] = []; name
: "get_core_module"
= "get_core_module"; outputs
: readonly [{ type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [] = []; name
: "is_validate_module_forwarded"
= "is_validate_module_forwarded"; outputs
: readonly [{ type
: "core::bool"
= "core::bool" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; name
: "is_module"
= "is_module"; outputs
: readonly [{ type
: "core::bool"
= "core::bool" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }, { name
: "call"
= "call"; type
: "core::starknet::account::Call"
= "core::starknet::account::Call" }] ; name
: "call_on_module"
= "call_on_module"; outputs
: readonly [{ type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }, { name
: "call"
= "call"; type
: "core::starknet::account::Call"
= "core::starknet::account::Call" }] ; name
: "execute_on_module"
= "execute_on_module"; outputs
: readonly [{ type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; state_mutability
: "external"
= "external"; type
: "function"
= "function" }] ; name
: "smartr::component::account::IModule"
= "smartr::component::account::IModule"; type
: "interface"
= "interface" }, { interface_name
: "openzeppelin::introspection::interface::ISRC5"
= "openzeppelin::introspection::interface::ISRC5"; name
: "SRC5Impl"
= "SRC5Impl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "interface_id"
= "interface_id"; type
: "core::felt252"
= "core::felt252" }] ; name
: "supports_interface"
= "supports_interface"; outputs
: readonly [{ type
: "core::bool"
= "core::bool" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "openzeppelin::introspection::interface::ISRC5"
= "openzeppelin::introspection::interface::ISRC5"; type
: "interface"
= "interface" }, { inputs
: readonly [{ name
: "core_validator"
= "core_validator"; type
: "core::felt252"
= "core::felt252" }, { name
: "args"
= "args"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "constructor"
= "constructor"; type
: "constructor"
= "constructor" }, { kind
: "struct"
= "struct"; members
: readonly [{ kind
: "key"
= "key"; name
: "new_owner_guid"
= "new_owner_guid"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "smartr::component::account::AccountComponent::OwnerAdded"
= "smartr::component::account::AccountComponent::OwnerAdded"; type
: "event"
= "event" }, { kind
: "struct"
= "struct"; members
: readonly [{ kind
: "key"
= "key"; name
: "removed_owner_guid"
= "removed_owner_guid"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "smartr::component::account::AccountComponent::OwnerRemoved"
= "smartr::component::account::AccountComponent::OwnerRemoved"; type
: "event"
= "event" }, { kind
: "enum"
= "enum"; name
: "smartr::component::account::AccountComponent::Event"
= "smartr::component::account::AccountComponent::Event"; type
: "event"
= "event"; variants
: readonly [{ kind
: "nested"
= "nested"; name
: "OwnerAdded"
= "OwnerAdded"; type
: "smartr::component::account::AccountComponent::OwnerAdded"
= "smartr::component::account::AccountComponent::OwnerAdded" }, { kind
: "nested"
= "nested"; name
: "OwnerRemoved"
= "OwnerRemoved"; type
: "smartr::component::account::AccountComponent::OwnerRemoved"
= "smartr::component::account::AccountComponent::OwnerRemoved" }] }, { kind
: "enum"
= "enum"; name
: "openzeppelin::introspection::src5::SRC5Component::Event"
= "openzeppelin::introspection::src5::SRC5Component::Event"; type
: "event"
= "event"; variants
: readonly [] = [] }, { kind
: "struct"
= "struct"; members
: readonly [{ kind
: "data"
= "data"; name
: "class_hash"
= "class_hash"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }] ; name
: "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded"
= "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded"; type
: "event"
= "event" }, { kind
: "enum"
= "enum"; name
: "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event"
= "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event"; type
: "event"
= "event"; variants
: readonly [{ kind
: "nested"
= "nested"; name
: "Upgraded"
= "Upgraded"; type
: "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded"
= "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded" }] }, { kind
: "enum"
= "enum"; name
: "smartr::account::smartraccount::SmartrAccount::Event"
= "smartr::account::smartraccount::SmartrAccount::Event"; type
: "event"
= "event"; variants
: readonly [{ kind
: "flat"
= "flat"; name
: "AccountEvent"
= "AccountEvent"; type
: "smartr::component::account::AccountComponent::Event"
= "smartr::component::account::AccountComponent::Event" }, { kind
: "flat"
= "flat"; name
: "SRC5Event"
= "SRC5Event"; type
: "openzeppelin::introspection::src5::SRC5Component::Event"
= "openzeppelin::introspection::src5::SRC5Component::Event" }, { kind
: "flat"
= "flat"; name
: "UpgradeableEvent"
= "UpgradeableEvent"; type
: "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event"
= "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event" }] }]
Defined in
sdks/account/src/abi/SmartrAccount.ts:1
StarkValidatorABI
• Const
StarkValidatorABI: readonly [{ interface_name
: "smartr::component::validator::IValidator"
= "smartr::component::validator::IValidator"; name
: "ValidatorImpl"
= "ValidatorImpl"; type
: "impl"
= "impl" }, { members
: readonly [{ name
: "snapshot"
= "snapshot"; type
: "@core::array::Array::<core::felt252>"
= "@core::array::Array::<core::felt252>" }] ; name
: "core::array::Span::<core::felt252>"
= "core::array::Span::<core::felt252>"; type
: "struct"
= "struct" }, { members
: readonly [{ name
: "to"
= "to"; type
: "core::starknet::contract_address::ContractAddress"
= "core::starknet::contract_address::ContractAddress" }, { name
: "selector"
= "selector"; type
: "core::felt252"
= "core::felt252" }, { name
: "calldata"
= "calldata"; type
: "core::array::Span::<core::felt252>"
= "core::array::Span::<core::felt252>" }] ; name
: "core::starknet::account::Call"
= "core::starknet::account::Call"; type
: "struct"
= "struct" }, { items
: readonly [{ inputs
: readonly [{ name
: "grantor_class"
= "grantor_class"; type
: "core::starknet::class_hash::ClassHash"
= "core::starknet::class_hash::ClassHash" }, { name
: "calls"
= "calls"; type
: "core::array::Array::<core::starknet::account::Call>"
= "core::array::Array::<core::starknet::account::Call>" }] ; name
: "validate"
= "validate"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::validator::IValidator"
= "smartr::component::validator::IValidator"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::version::IVersion"
= "smartr::component::version::IVersion"; name
: "VersionImpl"
= "VersionImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [] = []; name
: "get_version"
= "get_version"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [] = []; name
: "get_name"
= "get_name"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::component::version::IVersion"
= "smartr::component::version::IVersion"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::validator::ICoreValidator"
= "smartr::component::validator::ICoreValidator"; name
: "CoreValidator"
= "CoreValidator"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "hash"
= "hash"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }, { name
: "signature"
= "signature"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "is_valid_signature"
= "is_valid_signature"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "args"
= "args"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "initialize"
= "initialize"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }] ; name
: "smartr::component::validator::ICoreValidator"
= "smartr::component::validator::ICoreValidator"; type
: "interface"
= "interface" }, { interface_name
: "smartr::component::validator::IConfigure"
= "smartr::component::validator::IConfigure"; name
: "ConfigureImpl"
= "ConfigureImpl"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "call"
= "call"; type
: "core::starknet::account::Call"
= "core::starknet::account::Call" }] ; name
: "call"
= "call"; outputs
: readonly [{ type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }, { inputs
: readonly [{ name
: "call"
= "call"; type
: "core::starknet::account::Call"
= "core::starknet::account::Call" }] ; name
: "execute"
= "execute"; outputs
: readonly [{ type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; state_mutability
: "external"
= "external"; type
: "function"
= "function" }] ; name
: "smartr::component::validator::IConfigure"
= "smartr::component::validator::IConfigure"; type
: "interface"
= "interface" }, { interface_name
: "smartr::modules::starkvalidator::starkvalidator::IPublicKey"
= "smartr::modules::starkvalidator::starkvalidator::IPublicKey"; name
: "PublicKey"
= "PublicKey"; type
: "impl"
= "impl" }, { items
: readonly [{ inputs
: readonly [{ name
: "new_public_key"
= "new_public_key"; type
: "core::felt252"
= "core::felt252" }] ; name
: "set_public_key"
= "set_public_key"; outputs
: readonly [] = []; state_mutability
: "external"
= "external"; type
: "function"
= "function" }, { inputs
: readonly [] = []; name
: "get_public_key"
= "get_public_key"; outputs
: readonly [{ type
: "core::felt252"
= "core::felt252" }] ; state_mutability
: "view"
= "view"; type
: "function"
= "function" }] ; name
: "smartr::modules::starkvalidator::starkvalidator::IPublicKey"
= "smartr::modules::starkvalidator::starkvalidator::IPublicKey"; type
: "interface"
= "interface" }, { inputs
: readonly [] = []; name
: "constructor"
= "constructor"; type
: "constructor"
= "constructor" }, { kind
: "enum"
= "enum"; name
: "smartr::component::validator::ValidatorComponent::Event"
= "smartr::component::validator::ValidatorComponent::Event"; type
: "event"
= "event"; variants
: readonly [] = [] }, { kind
: "enum"
= "enum"; name
: "openzeppelin::introspection::src5::SRC5Component::Event"
= "openzeppelin::introspection::src5::SRC5Component::Event"; type
: "event"
= "event"; variants
: readonly [] = [] }, { kind
: "struct"
= "struct"; members
: readonly [{ kind
: "key"
= "key"; name
: "new_owner_guid"
= "new_owner_guid"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "smartr::component::account::AccountComponent::OwnerAdded"
= "smartr::component::account::AccountComponent::OwnerAdded"; type
: "event"
= "event" }, { kind
: "struct"
= "struct"; members
: readonly [{ kind
: "key"
= "key"; name
: "removed_owner_guid"
= "removed_owner_guid"; type
: "core::array::Array::<core::felt252>"
= "core::array::Array::<core::felt252>" }] ; name
: "smartr::component::account::AccountComponent::OwnerRemoved"
= "smartr::component::account::AccountComponent::OwnerRemoved"; type
: "event"
= "event" }, { kind
: "enum"
= "enum"; name
: "smartr::component::account::AccountComponent::Event"
= "smartr::component::account::AccountComponent::Event"; type
: "event"
= "event"; variants
: readonly [{ kind
: "nested"
= "nested"; name
: "OwnerAdded"
= "OwnerAdded"; type
: "smartr::component::account::AccountComponent::OwnerAdded"
= "smartr::component::account::AccountComponent::OwnerAdded" }, { kind
: "nested"
= "nested"; name
: "OwnerRemoved"
= "OwnerRemoved"; type
: "smartr::component::account::AccountComponent::OwnerRemoved"
= "smartr::component::account::AccountComponent::OwnerRemoved" }] }, { kind
: "enum"
= "enum"; name
: "smartr::modules::starkvalidator::starkvalidator::StarkValidator::Event"
= "smartr::modules::starkvalidator::starkvalidator::StarkValidator::Event"; type
: "event"
= "event"; variants
: readonly [{ kind
: "flat"
= "flat"; name
: "ValidatorEvent"
= "ValidatorEvent"; type
: "smartr::component::validator::ValidatorComponent::Event"
= "smartr::component::validator::ValidatorComponent::Event" }, { kind
: "flat"
= "flat"; name
: "SRC5Event"
= "SRC5Event"; type
: "openzeppelin::introspection::src5::SRC5Component::Event"
= "openzeppelin::introspection::src5::SRC5Component::Event" }, { kind
: "flat"
= "flat"; name
: "AccountEvent"
= "AccountEvent"; type
: "smartr::component::account::AccountComponent::Event"
= "smartr::component::account::AccountComponent::Event" }] }]
Defined in
sdks/account/src/abi/StarkValidator.ts:1
Functions
accountAddress
▸ accountAddress(accountName
, salt
, constructorCallData
): string
Calculates the account address for a given account name, public key, and constructor call data.
Parameters
Name | Type | Description |
---|---|---|
accountName | "SmartrAccount" | - |
salt | string | - |
constructorCallData | string [] | The constructor call data for the account. |
Returns
string
The calculated account address.
Remarks
This function requires the cairo account to be compiled with the
scarb build
command at the root of the project.
Defined in
sdks/account/src/contract.ts:14
classHash
▸ classHash(className?
): string
Computes the hash of the requested class that is part of the 0xknwn/starknet-modular-account project.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
className | "StarkValidator" | "SmartrAccount" | "SimpleValidator" | "SmartrAccount" | The name of the contract class. |
Returns
string
The hash of the contract class.
Remarks
This function requires the cairo contract to be compiled with the
scarb build
command at the root of the project.
Defined in
declareClass
▸ declareClass(account
, className?
): Promise
<{ classHash
: string
= HelperClassHash } | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; block_hash
: string
; block_number
: number
; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "INVOKE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "INVOKE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; block_hash
: string
; block_number
: number
; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "DECLARE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "DECLARE"
; value
: TransactionReceiptValue
} | { actual_fee
: string
; block_hash?
: string
; block_number?
: BlockNumber
; classHash
: string
= declare.class_hash; events
: any
[] ; execution_status
: any
; finality_status
: any
; messages_sent
: MessageToL1
[] ; revert_reason?
: string
; status?
: TransactionStatus
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; transaction_index?
: number
; type?
: any
; value
: TransactionReceiptValue
} | { classHash
: string
= declare.class_hash; status
: "REJECTED"
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_failure_reason
: { code
: string
; error_message
: string
} ; value
: TransactionReceiptValue
}>
If not already declared, declare the requested class from the 0xknwn/starknet-modular-account project to the Starknet network used by the provided account.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
account | Account | undefined | The starknet.js account used to declare the class. |
className | "StarkValidator" | "SmartrAccount" | "SimpleValidator" | "SmartrAccount" | The name of the class to declare. Defaults to "SmartrAccount". |
Returns
Promise
<{ classHash
: string
= HelperClassHash } | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; block_hash
: string
; block_number
: number
; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "INVOKE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "INVOKE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; block_hash
: string
; block_number
: number
; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "DECLARE"
; value
: TransactionReceiptValue
} | { actual_fee
: { amount
: string
; unit
: "WEI"
| "FRI"
} ; classHash
: string
= declare.class_hash; events
: { data
: string
[] ; from_address
: string
; keys
: string
[] }[] ; execution_resources
: { bitwise_builtin_applications
: undefined
| number
; data_availability
: undefined
| { l1_data_gas
: number
; l1_gas
: number
} ; ec_op_builtin_applications
: undefined
| number
; ecdsa_builtin_applications
: undefined
| number
; keccak_builtin_applications
: undefined
| number
; memory_holes
: undefined
| number
; pedersen_builtin_applications
: undefined
| number
; poseidon_builtin_applications
: undefined
| number
; range_check_builtin_applications
: undefined
| number
; segment_arena_builtin
: undefined
| number
; steps
: number
} ; execution_status
: "SUCCEEDED"
| "REVERTED"
; finality_status
: "ACCEPTED_ON_L2"
| "ACCEPTED_ON_L1"
; messages_sent
: { from_address
: string
; payload
: string
[] ; to_address
: string
}[] ; revert_reason
: undefined
| string
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; type
: "DECLARE"
; value
: TransactionReceiptValue
} | { actual_fee
: string
; block_hash?
: string
; block_number?
: BlockNumber
; classHash
: string
= declare.class_hash; events
: any
[] ; execution_status
: any
; finality_status
: any
; messages_sent
: MessageToL1
[] ; revert_reason?
: string
; status?
: TransactionStatus
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_hash
: string
; transaction_index?
: number
; type?
: any
; value
: TransactionReceiptValue
} | { classHash
: string
= declare.class_hash; status
: "REJECTED"
; statusReceipt
: keyof TransactionStatusReceiptSets
; transaction_failure_reason
: { code
: string
; error_message
: string
} ; value
: TransactionReceiptValue
}>
An object containing the declared class hash and the transaction receipt if the class was not already declared.
Throws
An error if the class deployment fails.
Remarks
This function requires the cairo contract to be compiled with the
scarb build
command at the root of the project. It also requires the
account to have enough funds to declare the class to the Starknet network.
Defined in
deployAccount
▸ deployAccount(deployerAccount
, accountName
, salt
, constructorCalldata
): Promise
<string
>
Deploys an account on the StarkNet network.
Parameters
Name | Type | Description |
---|---|---|
deployerAccount | Account | The account used to deploy the new account. |
accountName | "SmartrAccount" | The name of the account to be deployed. |
salt | string | - |
constructorCalldata | any [] | The constructor calldata required for deploying the account. |
Returns
Promise
<string
>
The address of the deployed account.
Throws
Error if the deployment fails.
Defined in
sdks/account/src/contract.ts:38
hash_auth_message
▸ hash_auth_message(account_address
, validator_class
, grantor_class
, auth_key
, expires
, root
, chain_id
): string
Parameters
Name | Type |
---|---|
account_address | string |
validator_class | string |
grantor_class | string |
auth_key | string |
expires | string |
root | string |
chain_id | string |
Returns
string
Defined in
signatureToHexArray
▸ signatureToHexArray(signature
): ArraySignatureType
Generates a signature represented as an array of hexadecimal.
Parameters
Name | Type | Description |
---|---|---|
signature | Signature | The signature to handle. |
Returns
ArraySignatureType
The signature as an array.