From a704595b7adeb7ce944a2d84ef5e477d379841a1 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Fri, 9 Aug 2024 12:35:32 -0400 Subject: [PATCH] Update starknet-rs --- Cargo.toml | 6 +- packages/account_sdk/src/abigen/controller.rs | 2008 ++++++++--------- packages/account_sdk/src/abigen/erc_20.rs | 694 +++--- 3 files changed, 1354 insertions(+), 1354 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1e6835016..b72c43c5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ account-wasm = { path = "packages/account-wasm" } anyhow = "1" async-trait = "0.1" base64 = "0.22" -cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "f4beb4a", features = [ +cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "deec8d4", features = [ "abigen-rs", ] } cairo-lang-starknet = "2.4.0" @@ -42,8 +42,8 @@ serde_with = { version = "3.9.0", default-features = false, features = [ "macros", ] } sha2 = "0.10" -starknet = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "af107dd" } -starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "af107dd" } +starknet = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "2ddc694" } +starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "2ddc694" } starknet-types-core = { version = "0.1.3", default-features = false, features = [ "curve", "hash", diff --git a/packages/account_sdk/src/abigen/controller.rs b/packages/account_sdk/src/abigen/controller.rs index 6d848c10d..f5bfde1b6 100644 --- a/packages/account_sdk/src/abigen/controller.rs +++ b/packages/account_sdk/src/abigen/controller.rs @@ -53,28 +53,23 @@ impl ControllerReader

{ } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct StarknetSigner { - pub pubkey: cainome::cairo_serde::NonZero, +pub struct ExternalOwnerRegistered { + pub address: cainome::cairo_serde::ContractAddress, } -impl cainome::cairo_serde::CairoSerde for StarknetSigner { +impl cainome::cairo_serde::CairoSerde for ExternalOwnerRegistered { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &__rust.pubkey, - ); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend( - cainome::cairo_serde::NonZero::::cairo_serialize( - &__rust.pubkey, - ), - ); + __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + &__rust.address, + )); __out } fn cairo_deserialize( @@ -82,47 +77,28 @@ impl cainome::cairo_serde::CairoSerde for StarknetSigner { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let pubkey = - cainome::cairo_serde::NonZero::::cairo_deserialize( - __felts, __offset, - )?; - __offset += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &pubkey, - ); - Ok(StarknetSigner { pubkey }) + let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); + Ok(ExternalOwnerRegistered { address }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Session { - pub expires_at: u64, - pub allowed_methods_root: starknet::core::types::Felt, - pub metadata_hash: starknet::core::types::Felt, - pub session_key_guid: starknet::core::types::Felt, +pub struct SessionRegistered { + pub session_hash: starknet::core::types::Felt, } -impl cainome::cairo_serde::CairoSerde for Session { +impl cainome::cairo_serde::CairoSerde for SessionRegistered { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += u64::cairo_serialized_size(&__rust.expires_at); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.allowed_methods_root); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.metadata_hash); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.session_key_guid); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.session_hash); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(u64::cairo_serialize(&__rust.expires_at)); - __out.extend(starknet::core::types::Felt::cairo_serialize( - &__rust.allowed_methods_root, - )); - __out.extend(starknet::core::types::Felt::cairo_serialize( - &__rust.metadata_hash, - )); __out.extend(starknet::core::types::Felt::cairo_serialize( - &__rust.session_key_guid, + &__rust.session_hash, )); __out } @@ -131,43 +107,28 @@ impl cainome::cairo_serde::CairoSerde for Session { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let expires_at = u64::cairo_deserialize(__felts, __offset)?; - __offset += u64::cairo_serialized_size(&expires_at); - let allowed_methods_root = - starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&allowed_methods_root); - let metadata_hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&metadata_hash); - let session_key_guid = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&session_key_guid); - Ok(Session { - expires_at, - allowed_methods_root, - metadata_hash, - session_key_guid, - }) + let session_hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&session_hash); + Ok(SessionRegistered { session_hash }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct TransactionExecuted { - pub hash: starknet::core::types::Felt, - pub response: Vec>, +pub struct DelegateAccountChanged { + pub address: cainome::cairo_serde::ContractAddress, } -impl cainome::cairo_serde::CairoSerde for TransactionExecuted { +impl cainome::cairo_serde::CairoSerde for DelegateAccountChanged { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.hash); - __size += Vec::>::cairo_serialized_size(&__rust.response); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.hash)); - __out.extend(Vec::>::cairo_serialize( - &__rust.response, + __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + &__rust.address, )); __out } @@ -176,44 +137,29 @@ impl cainome::cairo_serde::CairoSerde for TransactionExecuted { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&hash); - let response = - Vec::>::cairo_deserialize(__felts, __offset)?; - __offset += Vec::>::cairo_serialized_size(&response); - Ok(TransactionExecuted { hash, response }) + let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); + Ok(DelegateAccountChanged { address }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct OutsideExecution { - pub caller: cainome::cairo_serde::ContractAddress, - pub nonce: starknet::core::types::Felt, - pub execute_after: u64, - pub execute_before: u64, - pub calls: Vec, +pub struct Upgraded { + pub class_hash: cainome::cairo_serde::ClassHash, } -impl cainome::cairo_serde::CairoSerde for OutsideExecution { +impl cainome::cairo_serde::CairoSerde for Upgraded { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.caller); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.nonce); - __size += u64::cairo_serialized_size(&__rust.execute_after); - __size += u64::cairo_serialized_size(&__rust.execute_before); - __size += Vec::::cairo_serialized_size(&__rust.calls); + __size += cainome::cairo_serde::ClassHash::cairo_serialized_size(&__rust.class_hash); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.caller, + __out.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + &__rust.class_hash, )); - __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.nonce)); - __out.extend(u64::cairo_serialize(&__rust.execute_after)); - __out.extend(u64::cairo_serialize(&__rust.execute_before)); - __out.extend(Vec::::cairo_serialize(&__rust.calls)); __out } fn cairo_deserialize( @@ -221,47 +167,29 @@ impl cainome::cairo_serde::CairoSerde for OutsideExecution { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let caller = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&caller); - let nonce = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&nonce); - let execute_after = u64::cairo_deserialize(__felts, __offset)?; - __offset += u64::cairo_serialized_size(&execute_after); - let execute_before = u64::cairo_deserialize(__felts, __offset)?; - __offset += u64::cairo_serialized_size(&execute_before); - let calls = Vec::::cairo_deserialize(__felts, __offset)?; - __offset += Vec::::cairo_serialized_size(&calls); - Ok(OutsideExecution { - caller, - nonce, - execute_after, - execute_before, - calls, - }) + let class_hash = cainome::cairo_serde::ClassHash::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); + Ok(Upgraded { class_hash }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Signature { - pub r: cainome::cairo_serde::U256, - pub s: cainome::cairo_serde::U256, - pub y_parity: bool, +pub struct Eip191Signer { + pub eth_address: cainome::cairo_serde::EthAddress, } -impl cainome::cairo_serde::CairoSerde for Signature { +impl cainome::cairo_serde::CairoSerde for Eip191Signer { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.r); - __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.s); - __size += bool::cairo_serialized_size(&__rust.y_parity); + __size += cainome::cairo_serde::EthAddress::cairo_serialized_size(&__rust.eth_address); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.r)); - __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.s)); - __out.extend(bool::cairo_serialize(&__rust.y_parity)); + __out.extend(cainome::cairo_serde::EthAddress::cairo_serialize( + &__rust.eth_address, + )); __out } fn cairo_deserialize( @@ -269,51 +197,44 @@ impl cainome::cairo_serde::CairoSerde for Signature { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let r = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::U256::cairo_serialized_size(&r); - let s = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::U256::cairo_serialized_size(&s); - let y_parity = bool::cairo_deserialize(__felts, __offset)?; - __offset += bool::cairo_serialized_size(&y_parity); - Ok(Signature { r, s, y_parity }) + let eth_address = cainome::cairo_serde::EthAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::EthAddress::cairo_serialized_size(ð_address); + Ok(Eip191Signer { eth_address }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct WebauthnSigner { - pub origin: Vec, - pub rp_id_hash: cainome::cairo_serde::NonZero, - pub pubkey: cainome::cairo_serde::NonZero, +pub struct WebauthnSignature { + pub cross_origin: bool, + pub client_data_json_outro: Vec, + pub flags: u8, + pub sign_count: u32, + pub ec_signature: Signature, + pub sha256_implementation: Sha256Implementation, } -impl cainome::cairo_serde::CairoSerde for WebauthnSigner { +impl cainome::cairo_serde::CairoSerde for WebauthnSignature { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += Vec::::cairo_serialized_size(&__rust.origin); - __size += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &__rust.rp_id_hash, - ); - __size += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &__rust.pubkey, - ); + __size += bool::cairo_serialized_size(&__rust.cross_origin); + __size += Vec::::cairo_serialized_size(&__rust.client_data_json_outro); + __size += u8::cairo_serialized_size(&__rust.flags); + __size += u32::cairo_serialized_size(&__rust.sign_count); + __size += Signature::cairo_serialized_size(&__rust.ec_signature); + __size += Sha256Implementation::cairo_serialized_size(&__rust.sha256_implementation); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(Vec::::cairo_serialize(&__rust.origin)); - __out.extend( - cainome::cairo_serde::NonZero::::cairo_serialize( - &__rust.rp_id_hash, - ), - ); - __out.extend( - cainome::cairo_serde::NonZero::::cairo_serialize( - &__rust.pubkey, - ), - ); + __out.extend(bool::cairo_serialize(&__rust.cross_origin)); + __out.extend(Vec::::cairo_serialize(&__rust.client_data_json_outro)); + __out.extend(u8::cairo_serialize(&__rust.flags)); + __out.extend(u32::cairo_serialize(&__rust.sign_count)); + __out.extend(Signature::cairo_serialize(&__rust.ec_signature)); + __out.extend(Sha256Implementation::cairo_serialize( + &__rust.sha256_implementation, + )); __out } fn cairo_deserialize( @@ -321,54 +242,56 @@ impl cainome::cairo_serde::CairoSerde for WebauthnSigner { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let origin = Vec::::cairo_deserialize(__felts, __offset)?; - __offset += Vec::::cairo_serialized_size(&origin); - let rp_id_hash = - cainome::cairo_serde::NonZero::::cairo_deserialize( - __felts, __offset, - )?; - __offset += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &rp_id_hash, - ); - let pubkey = - cainome::cairo_serde::NonZero::::cairo_deserialize( - __felts, __offset, - )?; - __offset += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &pubkey, - ); - Ok(WebauthnSigner { - origin, - rp_id_hash, - pubkey, + let cross_origin = bool::cairo_deserialize(__felts, __offset)?; + __offset += bool::cairo_serialized_size(&cross_origin); + let client_data_json_outro = Vec::::cairo_deserialize(__felts, __offset)?; + __offset += Vec::::cairo_serialized_size(&client_data_json_outro); + let flags = u8::cairo_deserialize(__felts, __offset)?; + __offset += u8::cairo_serialized_size(&flags); + let sign_count = u32::cairo_deserialize(__felts, __offset)?; + __offset += u32::cairo_serialized_size(&sign_count); + let ec_signature = Signature::cairo_deserialize(__felts, __offset)?; + __offset += Signature::cairo_serialized_size(&ec_signature); + let sha256_implementation = Sha256Implementation::cairo_deserialize(__felts, __offset)?; + __offset += Sha256Implementation::cairo_serialized_size(&sha256_implementation); + Ok(WebauthnSignature { + cross_origin, + client_data_json_outro, + flags, + sign_count, + ec_signature, + sha256_implementation, }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Secp256r1Signer { - pub pubkey: cainome::cairo_serde::NonZero, +pub struct Call { + pub to: cainome::cairo_serde::ContractAddress, + pub selector: starknet::core::types::Felt, + pub calldata: Vec, } -impl cainome::cairo_serde::CairoSerde for Secp256r1Signer { +impl cainome::cairo_serde::CairoSerde for Call { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &__rust.pubkey, - ); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.to); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.selector); + __size += Vec::::cairo_serialized_size(&__rust.calldata); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend( - cainome::cairo_serde::NonZero::::cairo_serialize( - &__rust.pubkey, - ), - ); + __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + &__rust.to, + )); + __out.extend(starknet::core::types::Felt::cairo_serialize( + &__rust.selector, + )); + __out.extend(Vec::::cairo_serialize( + &__rust.calldata, + )); __out } fn cairo_deserialize( @@ -376,35 +299,49 @@ impl cainome::cairo_serde::CairoSerde for Secp256r1Signer { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let pubkey = - cainome::cairo_serde::NonZero::::cairo_deserialize( - __felts, __offset, - )?; - __offset += - cainome::cairo_serde::NonZero::::cairo_serialized_size( - &pubkey, - ); - Ok(Secp256r1Signer { pubkey }) + let to = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&to); + let selector = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&selector); + let calldata = Vec::::cairo_deserialize(__felts, __offset)?; + __offset += Vec::::cairo_serialized_size(&calldata); + Ok(Call { + to, + selector, + calldata, + }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct ExternalOwnerRemoved { - pub address: cainome::cairo_serde::ContractAddress, +pub struct OutsideExecution { + pub caller: cainome::cairo_serde::ContractAddress, + pub nonce: starknet::core::types::Felt, + pub execute_after: u64, + pub execute_before: u64, + pub calls: Vec, } -impl cainome::cairo_serde::CairoSerde for ExternalOwnerRemoved { +impl cainome::cairo_serde::CairoSerde for OutsideExecution { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.caller); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.nonce); + __size += u64::cairo_serialized_size(&__rust.execute_after); + __size += u64::cairo_serialized_size(&__rust.execute_before); + __size += Vec::::cairo_serialized_size(&__rust.calls); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.address, + &__rust.caller, )); + __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.nonce)); + __out.extend(u64::cairo_serialize(&__rust.execute_after)); + __out.extend(u64::cairo_serialize(&__rust.execute_before)); + __out.extend(Vec::::cairo_serialize(&__rust.calls)); __out } fn cairo_deserialize( @@ -412,28 +349,45 @@ impl cainome::cairo_serde::CairoSerde for ExternalOwnerRemoved { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); - Ok(ExternalOwnerRemoved { address }) + let caller = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&caller); + let nonce = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&nonce); + let execute_after = u64::cairo_deserialize(__felts, __offset)?; + __offset += u64::cairo_serialized_size(&execute_after); + let execute_before = u64::cairo_deserialize(__felts, __offset)?; + __offset += u64::cairo_serialized_size(&execute_before); + let calls = Vec::::cairo_deserialize(__felts, __offset)?; + __offset += Vec::::cairo_serialized_size(&calls); + Ok(OutsideExecution { + caller, + nonce, + execute_after, + execute_before, + calls, + }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct ExternalOwnerRegistered { - pub address: cainome::cairo_serde::ContractAddress, +pub struct TransactionExecuted { + pub hash: starknet::core::types::Felt, + pub response: Vec>, } -impl cainome::cairo_serde::CairoSerde for ExternalOwnerRegistered { +impl cainome::cairo_serde::CairoSerde for TransactionExecuted { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.hash); + __size += Vec::>::cairo_serialized_size(&__rust.response); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.address, + __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.hash)); + __out.extend(Vec::>::cairo_serialize( + &__rust.response, )); __out } @@ -442,29 +396,33 @@ impl cainome::cairo_serde::CairoSerde for ExternalOwnerRegistered { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); - Ok(ExternalOwnerRegistered { address }) + let hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&hash); + let response = + Vec::>::cairo_deserialize(__felts, __offset)?; + __offset += Vec::>::cairo_serialized_size(&response); + Ok(TransactionExecuted { hash, response }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Secp256k1Signer { - pub pubkey_hash: cainome::cairo_serde::EthAddress, +pub struct StarknetSignature { + pub r: starknet::core::types::Felt, + pub s: starknet::core::types::Felt, } -impl cainome::cairo_serde::CairoSerde for Secp256k1Signer { +impl cainome::cairo_serde::CairoSerde for StarknetSignature { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::EthAddress::cairo_serialized_size(&__rust.pubkey_hash); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.r); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.s); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::EthAddress::cairo_serialize( - &__rust.pubkey_hash, - )); + __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.r)); + __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.s)); __out } fn cairo_deserialize( @@ -472,30 +430,29 @@ impl cainome::cairo_serde::CairoSerde for Secp256k1Signer { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let pubkey_hash = cainome::cairo_serde::EthAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::EthAddress::cairo_serialized_size(&pubkey_hash); - Ok(Secp256k1Signer { pubkey_hash }) + let r = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&r); + let s = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&s); + Ok(StarknetSignature { r, s }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct StarknetSignature { - pub r: starknet::core::types::Felt, - pub s: starknet::core::types::Felt, +pub struct OwnerRemoved { + pub owner: Signer, } -impl cainome::cairo_serde::CairoSerde for StarknetSignature { +impl cainome::cairo_serde::CairoSerde for OwnerRemoved { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.r); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.s); + __size += Signer::cairo_serialized_size(&__rust.owner); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.r)); - __out.extend(starknet::core::types::Felt::cairo_serialize(&__rust.s)); + __out.extend(Signer::cairo_serialize(&__rust.owner)); __out } fn cairo_deserialize( @@ -503,29 +460,88 @@ impl cainome::cairo_serde::CairoSerde for StarknetSignature { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let r = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&r); - let s = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&s); - Ok(StarknetSignature { r, s }) + let owner = Signer::cairo_deserialize(__felts, __offset)?; + __offset += Signer::cairo_serialized_size(&owner); + Ok(OwnerRemoved { owner }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct OwnerAdded { - pub owner: Signer, +pub struct Session { + pub expires_at: u64, + pub allowed_methods_root: starknet::core::types::Felt, + pub metadata_hash: starknet::core::types::Felt, + pub session_key_guid: starknet::core::types::Felt, +} +impl cainome::cairo_serde::CairoSerde for Session { + type RustType = Self; + const SERIALIZED_SIZE: std::option::Option = None; + #[inline] + fn cairo_serialized_size(__rust: &Self::RustType) -> usize { + let mut __size = 0; + __size += u64::cairo_serialized_size(&__rust.expires_at); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.allowed_methods_root); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.metadata_hash); + __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.session_key_guid); + __size + } + fn cairo_serialize(__rust: &Self::RustType) -> Vec { + let mut __out: Vec = vec![]; + __out.extend(u64::cairo_serialize(&__rust.expires_at)); + __out.extend(starknet::core::types::Felt::cairo_serialize( + &__rust.allowed_methods_root, + )); + __out.extend(starknet::core::types::Felt::cairo_serialize( + &__rust.metadata_hash, + )); + __out.extend(starknet::core::types::Felt::cairo_serialize( + &__rust.session_key_guid, + )); + __out + } + fn cairo_deserialize( + __felts: &[starknet::core::types::Felt], + __offset: usize, + ) -> cainome::cairo_serde::Result { + let mut __offset = __offset; + let expires_at = u64::cairo_deserialize(__felts, __offset)?; + __offset += u64::cairo_serialized_size(&expires_at); + let allowed_methods_root = + starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&allowed_methods_root); + let metadata_hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&metadata_hash); + let session_key_guid = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; + __offset += starknet::core::types::Felt::cairo_serialized_size(&session_key_guid); + Ok(Session { + expires_at, + allowed_methods_root, + metadata_hash, + session_key_guid, + }) + } +} +#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] +pub struct Signature { + pub r: cainome::cairo_serde::U256, + pub s: cainome::cairo_serde::U256, + pub y_parity: bool, } -impl cainome::cairo_serde::CairoSerde for OwnerAdded { +impl cainome::cairo_serde::CairoSerde for Signature { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += Signer::cairo_serialized_size(&__rust.owner); + __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.r); + __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.s); + __size += bool::cairo_serialized_size(&__rust.y_parity); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(Signer::cairo_serialize(&__rust.owner)); + __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.r)); + __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.s)); + __out.extend(bool::cairo_serialize(&__rust.y_parity)); __out } fn cairo_deserialize( @@ -533,29 +549,38 @@ impl cainome::cairo_serde::CairoSerde for OwnerAdded { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let owner = Signer::cairo_deserialize(__felts, __offset)?; - __offset += Signer::cairo_serialized_size(&owner); - Ok(OwnerAdded { owner }) + let r = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::U256::cairo_serialized_size(&r); + let s = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::U256::cairo_serialized_size(&s); + let y_parity = bool::cairo_deserialize(__felts, __offset)?; + __offset += bool::cairo_serialized_size(&y_parity); + Ok(Signature { r, s, y_parity }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct DelegateAccountChanged { - pub address: cainome::cairo_serde::ContractAddress, +pub struct Secp256r1Signer { + pub pubkey: cainome::cairo_serde::NonZero, } -impl cainome::cairo_serde::CairoSerde for DelegateAccountChanged { +impl cainome::cairo_serde::CairoSerde for Secp256r1Signer { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); + __size += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &__rust.pubkey, + ); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.address, - )); + __out.extend( + cainome::cairo_serde::NonZero::::cairo_serialize( + &__rust.pubkey, + ), + ); __out } fn cairo_deserialize( @@ -563,29 +588,53 @@ impl cainome::cairo_serde::CairoSerde for DelegateAccountChanged { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); - Ok(DelegateAccountChanged { address }) + let pubkey = + cainome::cairo_serde::NonZero::::cairo_deserialize( + __felts, __offset, + )?; + __offset += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &pubkey, + ); + Ok(Secp256r1Signer { pubkey }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Upgraded { - pub class_hash: cainome::cairo_serde::ClassHash, +pub struct WebauthnSigner { + pub origin: Vec, + pub rp_id_hash: cainome::cairo_serde::NonZero, + pub pubkey: cainome::cairo_serde::NonZero, } -impl cainome::cairo_serde::CairoSerde for Upgraded { +impl cainome::cairo_serde::CairoSerde for WebauthnSigner { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ClassHash::cairo_serialized_size(&__rust.class_hash); + __size += Vec::::cairo_serialized_size(&__rust.origin); + __size += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &__rust.rp_id_hash, + ); + __size += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &__rust.pubkey, + ); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - &__rust.class_hash, - )); + __out.extend(Vec::::cairo_serialize(&__rust.origin)); + __out.extend( + cainome::cairo_serde::NonZero::::cairo_serialize( + &__rust.rp_id_hash, + ), + ); + __out.extend( + cainome::cairo_serde::NonZero::::cairo_serialize( + &__rust.pubkey, + ), + ); __out } fn cairo_deserialize( @@ -593,44 +642,47 @@ impl cainome::cairo_serde::CairoSerde for Upgraded { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let class_hash = cainome::cairo_serde::ClassHash::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); - Ok(Upgraded { class_hash }) + let origin = Vec::::cairo_deserialize(__felts, __offset)?; + __offset += Vec::::cairo_serialized_size(&origin); + let rp_id_hash = + cainome::cairo_serde::NonZero::::cairo_deserialize( + __felts, __offset, + )?; + __offset += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &rp_id_hash, + ); + let pubkey = + cainome::cairo_serde::NonZero::::cairo_deserialize( + __felts, __offset, + )?; + __offset += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &pubkey, + ); + Ok(WebauthnSigner { + origin, + rp_id_hash, + pubkey, + }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct WebauthnSignature { - pub cross_origin: bool, - pub client_data_json_outro: Vec, - pub flags: u8, - pub sign_count: u32, - pub ec_signature: Signature, - pub sha256_implementation: Sha256Implementation, +pub struct OwnerAdded { + pub owner: Signer, } -impl cainome::cairo_serde::CairoSerde for WebauthnSignature { +impl cainome::cairo_serde::CairoSerde for OwnerAdded { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += bool::cairo_serialized_size(&__rust.cross_origin); - __size += Vec::::cairo_serialized_size(&__rust.client_data_json_outro); - __size += u8::cairo_serialized_size(&__rust.flags); - __size += u32::cairo_serialized_size(&__rust.sign_count); - __size += Signature::cairo_serialized_size(&__rust.ec_signature); - __size += Sha256Implementation::cairo_serialized_size(&__rust.sha256_implementation); + __size += Signer::cairo_serialized_size(&__rust.owner); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(bool::cairo_serialize(&__rust.cross_origin)); - __out.extend(Vec::::cairo_serialize(&__rust.client_data_json_outro)); - __out.extend(u8::cairo_serialize(&__rust.flags)); - __out.extend(u32::cairo_serialize(&__rust.sign_count)); - __out.extend(Signature::cairo_serialize(&__rust.ec_signature)); - __out.extend(Sha256Implementation::cairo_serialize( - &__rust.sha256_implementation, - )); + __out.extend(Signer::cairo_serialize(&__rust.owner)); __out } fn cairo_deserialize( @@ -638,46 +690,34 @@ impl cainome::cairo_serde::CairoSerde for WebauthnSignature { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let cross_origin = bool::cairo_deserialize(__felts, __offset)?; - __offset += bool::cairo_serialized_size(&cross_origin); - let client_data_json_outro = Vec::::cairo_deserialize(__felts, __offset)?; - __offset += Vec::::cairo_serialized_size(&client_data_json_outro); - let flags = u8::cairo_deserialize(__felts, __offset)?; - __offset += u8::cairo_serialized_size(&flags); - let sign_count = u32::cairo_deserialize(__felts, __offset)?; - __offset += u32::cairo_serialized_size(&sign_count); - let ec_signature = Signature::cairo_deserialize(__felts, __offset)?; - __offset += Signature::cairo_serialized_size(&ec_signature); - let sha256_implementation = Sha256Implementation::cairo_deserialize(__felts, __offset)?; - __offset += Sha256Implementation::cairo_serialized_size(&sha256_implementation); - Ok(WebauthnSignature { - cross_origin, - client_data_json_outro, - flags, - sign_count, - ec_signature, - sha256_implementation, - }) + let owner = Signer::cairo_deserialize(__felts, __offset)?; + __offset += Signer::cairo_serialized_size(&owner); + Ok(OwnerAdded { owner }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct SessionRevoked { - pub session_hash: starknet::core::types::Felt, +pub struct StarknetSigner { + pub pubkey: cainome::cairo_serde::NonZero, } -impl cainome::cairo_serde::CairoSerde for SessionRevoked { +impl cainome::cairo_serde::CairoSerde for StarknetSigner { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.session_hash); + __size += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &__rust.pubkey, + ); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(starknet::core::types::Felt::cairo_serialize( - &__rust.session_hash, - )); + __out.extend( + cainome::cairo_serde::NonZero::::cairo_serialize( + &__rust.pubkey, + ), + ); __out } fn cairo_deserialize( @@ -685,16 +725,22 @@ impl cainome::cairo_serde::CairoSerde for SessionRevoked { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let session_hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&session_hash); - Ok(SessionRevoked { session_hash }) + let pubkey = + cainome::cairo_serde::NonZero::::cairo_deserialize( + __felts, __offset, + )?; + __offset += + cainome::cairo_serde::NonZero::::cairo_serialized_size( + &pubkey, + ); + Ok(StarknetSigner { pubkey }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct SessionRegistered { +pub struct SessionRevoked { pub session_hash: starknet::core::types::Felt, } -impl cainome::cairo_serde::CairoSerde for SessionRegistered { +impl cainome::cairo_serde::CairoSerde for SessionRevoked { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] @@ -717,26 +763,26 @@ impl cainome::cairo_serde::CairoSerde for SessionRegistered { let mut __offset = __offset; let session_hash = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; __offset += starknet::core::types::Felt::cairo_serialized_size(&session_hash); - Ok(SessionRegistered { session_hash }) + Ok(SessionRevoked { session_hash }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Eip191Signer { - pub eth_address: cainome::cairo_serde::EthAddress, +pub struct Secp256k1Signer { + pub pubkey_hash: cainome::cairo_serde::EthAddress, } -impl cainome::cairo_serde::CairoSerde for Eip191Signer { +impl cainome::cairo_serde::CairoSerde for Secp256k1Signer { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::EthAddress::cairo_serialized_size(&__rust.eth_address); + __size += cainome::cairo_serde::EthAddress::cairo_serialized_size(&__rust.pubkey_hash); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; __out.extend(cainome::cairo_serde::EthAddress::cairo_serialize( - &__rust.eth_address, + &__rust.pubkey_hash, )); __out } @@ -745,66 +791,28 @@ impl cainome::cairo_serde::CairoSerde for Eip191Signer { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let eth_address = cainome::cairo_serde::EthAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::EthAddress::cairo_serialized_size(ð_address); - Ok(Eip191Signer { eth_address }) - } -} -#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct OwnerRemoved { - pub owner: Signer, -} -impl cainome::cairo_serde::CairoSerde for OwnerRemoved { - type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = None; - #[inline] - fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - let mut __size = 0; - __size += Signer::cairo_serialized_size(&__rust.owner); - __size - } - fn cairo_serialize(__rust: &Self::RustType) -> Vec { - let mut __out: Vec = vec![]; - __out.extend(Signer::cairo_serialize(&__rust.owner)); - __out - } - fn cairo_deserialize( - __felts: &[starknet::core::types::Felt], - __offset: usize, - ) -> cainome::cairo_serde::Result { - let mut __offset = __offset; - let owner = Signer::cairo_deserialize(__felts, __offset)?; - __offset += Signer::cairo_serialized_size(&owner); - Ok(OwnerRemoved { owner }) + let pubkey_hash = cainome::cairo_serde::EthAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::EthAddress::cairo_serialized_size(&pubkey_hash); + Ok(Secp256k1Signer { pubkey_hash }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Call { - pub to: cainome::cairo_serde::ContractAddress, - pub selector: starknet::core::types::Felt, - pub calldata: Vec, +pub struct ExternalOwnerRemoved { + pub address: cainome::cairo_serde::ContractAddress, } -impl cainome::cairo_serde::CairoSerde for Call { +impl cainome::cairo_serde::CairoSerde for ExternalOwnerRemoved { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.to); - __size += starknet::core::types::Felt::cairo_serialized_size(&__rust.selector); - __size += Vec::::cairo_serialized_size(&__rust.calldata); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.address); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.to, - )); - __out.extend(starknet::core::types::Felt::cairo_serialize( - &__rust.selector, - )); - __out.extend(Vec::::cairo_serialize( - &__rust.calldata, + &__rust.address, )); __out } @@ -813,47 +821,31 @@ impl cainome::cairo_serde::CairoSerde for Call { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let to = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&to); - let selector = starknet::core::types::Felt::cairo_deserialize(__felts, __offset)?; - __offset += starknet::core::types::Felt::cairo_serialized_size(&selector); - let calldata = Vec::::cairo_deserialize(__felts, __offset)?; - __offset += Vec::::cairo_serialized_size(&calldata); - Ok(Call { - to, - selector, - calldata, - }) + let address = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); + Ok(ExternalOwnerRemoved { address }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum MultipleOwnersEvent { - OwnerAdded(OwnerAdded), - OwnerRemoved(OwnerRemoved), +pub enum UpgradeEvent { + Upgraded(Upgraded), } -impl cainome::cairo_serde::CairoSerde for MultipleOwnersEvent { +impl cainome::cairo_serde::CairoSerde for UpgradeEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { - MultipleOwnersEvent::OwnerAdded(val) => OwnerAdded::cairo_serialized_size(val) + 1, - MultipleOwnersEvent::OwnerRemoved(val) => OwnerRemoved::cairo_serialized_size(val) + 1, + UpgradeEvent::Upgraded(val) => Upgraded::cairo_serialized_size(val) + 1, _ => 0, } } fn cairo_serialize(__rust: &Self::RustType) -> Vec { match __rust { - MultipleOwnersEvent::OwnerAdded(val) => { + UpgradeEvent::Upgraded(val) => { let mut temp = vec![]; temp.extend(usize::cairo_serialize(&0usize)); - temp.extend(OwnerAdded::cairo_serialize(val)); - temp - } - MultipleOwnersEvent::OwnerRemoved(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&1usize)); - temp.extend(OwnerRemoved::cairo_serialize(val)); + temp.extend(Upgraded::cairo_serialize(val)); temp } _ => vec![], @@ -866,22 +858,20 @@ impl cainome::cairo_serde::CairoSerde for MultipleOwnersEvent { let __f = __felts[__offset]; let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); match __index as usize { - 0usize => Ok(MultipleOwnersEvent::OwnerAdded( - OwnerAdded::cairo_deserialize(__felts, __offset + 1)?, - )), - 1usize => Ok(MultipleOwnersEvent::OwnerRemoved( - OwnerRemoved::cairo_deserialize(__felts, __offset + 1)?, - )), + 0usize => Ok(UpgradeEvent::Upgraded(Upgraded::cairo_deserialize( + __felts, + __offset + 1, + )?)), _ => { return Err(cainome::cairo_serde::Error::Deserialize(format!( "Index not handle for enum {}", - "MultipleOwnersEvent" + "UpgradeEvent" ))) } } } } -impl TryFrom for MultipleOwnersEvent { +impl TryFrom for UpgradeEvent { type Error = String; fn try_from(event: starknet::core::types::EmittedEvent) -> Result { use cainome::cairo_serde::CairoSerde; @@ -890,41 +880,25 @@ impl TryFrom for MultipleOwnersEvent { } let selector = event.keys[0]; if selector - == starknet::core::utils::get_selector_from_name("OwnerAdded") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnerAdded")) - { - let mut key_offset = 0 + 1; - let mut data_offset = 0; - let owner = match Signer::cairo_deserialize(&event.data, data_offset) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "owner", "OwnerAdded", e - )) - } - }; - data_offset += Signer::cairo_serialized_size(&owner); - return Ok(MultipleOwnersEvent::OwnerAdded(OwnerAdded { owner })); - }; - let selector = event.keys[0]; - if selector - == starknet::core::utils::get_selector_from_name("OwnerRemoved") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnerRemoved")) + == starknet::core::utils::get_selector_from_name("Upgraded") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "Upgraded")) { let mut key_offset = 0 + 1; let mut data_offset = 0; - let owner = match Signer::cairo_deserialize(&event.data, data_offset) { + let class_hash = match cainome::cairo_serde::ClassHash::cairo_deserialize( + &event.data, + data_offset, + ) { Ok(v) => v, Err(e) => { return Err(format!( "Could not deserialize field {} for {}: {:?}", - "owner", "OwnerRemoved", e + "class_hash", "Upgraded", e )) } }; - data_offset += Signer::cairo_serialized_size(&owner); - return Ok(MultipleOwnersEvent::OwnerRemoved(OwnerRemoved { owner })); + data_offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); + return Ok(UpgradeEvent::Upgraded(Upgraded { class_hash })); }; Err(format!( "Could not match any event from keys {:?}", @@ -1026,18 +1000,35 @@ impl cainome::cairo_serde::CairoSerde for Signer { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum OutsideExecutionEvent {} -impl cainome::cairo_serde::CairoSerde for OutsideExecutionEvent { +pub enum MultipleOwnersEvent { + OwnerAdded(OwnerAdded), + OwnerRemoved(OwnerRemoved), +} +impl cainome::cairo_serde::CairoSerde for MultipleOwnersEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { + MultipleOwnersEvent::OwnerAdded(val) => OwnerAdded::cairo_serialized_size(val) + 1, + MultipleOwnersEvent::OwnerRemoved(val) => OwnerRemoved::cairo_serialized_size(val) + 1, _ => 0, } } fn cairo_serialize(__rust: &Self::RustType) -> Vec { match __rust { + MultipleOwnersEvent::OwnerAdded(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&0usize)); + temp.extend(OwnerAdded::cairo_serialize(val)); + temp + } + MultipleOwnersEvent::OwnerRemoved(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&1usize)); + temp.extend(OwnerRemoved::cairo_serialize(val)); + temp + } _ => vec![], } } @@ -1048,22 +1039,66 @@ impl cainome::cairo_serde::CairoSerde for OutsideExecutionEvent { let __f = __felts[__offset]; let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); match __index as usize { + 0usize => Ok(MultipleOwnersEvent::OwnerAdded( + OwnerAdded::cairo_deserialize(__felts, __offset + 1)?, + )), + 1usize => Ok(MultipleOwnersEvent::OwnerRemoved( + OwnerRemoved::cairo_deserialize(__felts, __offset + 1)?, + )), _ => { return Err(cainome::cairo_serde::Error::Deserialize(format!( "Index not handle for enum {}", - "OutsideExecutionEvent" + "MultipleOwnersEvent" ))) } } } } -impl TryFrom for OutsideExecutionEvent { +impl TryFrom for MultipleOwnersEvent { type Error = String; fn try_from(event: starknet::core::types::EmittedEvent) -> Result { use cainome::cairo_serde::CairoSerde; if event.keys.is_empty() { return Err("Event has no key".to_string()); } + let selector = event.keys[0]; + if selector + == starknet::core::utils::get_selector_from_name("OwnerAdded") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnerAdded")) + { + let mut key_offset = 0 + 1; + let mut data_offset = 0; + let owner = match Signer::cairo_deserialize(&event.data, data_offset) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "owner", "OwnerAdded", e + )) + } + }; + data_offset += Signer::cairo_serialized_size(&owner); + return Ok(MultipleOwnersEvent::OwnerAdded(OwnerAdded { owner })); + }; + let selector = event.keys[0]; + if selector + == starknet::core::utils::get_selector_from_name("OwnerRemoved") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnerRemoved")) + { + let mut key_offset = 0 + 1; + let mut data_offset = 0; + let owner = match Signer::cairo_deserialize(&event.data, data_offset) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "owner", "OwnerRemoved", e + )) + } + }; + data_offset += Signer::cairo_serialized_size(&owner); + return Ok(MultipleOwnersEvent::OwnerRemoved(OwnerRemoved { owner })); + }; Err(format!( "Could not match any event from keys {:?}", event.keys @@ -1071,69 +1106,59 @@ impl TryFrom for OutsideExecutionEvent { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum SignerSignature { - Starknet((StarknetSigner, StarknetSignature)), - Secp256k1((Secp256k1Signer, Signature)), - Secp256r1((Secp256r1Signer, Signature)), - Eip191((Eip191Signer, Signature)), - Webauthn((WebauthnSigner, WebauthnSignature)), +pub enum Sha256Implementation { + Cairo0, + Cairo1, } -impl cainome::cairo_serde::CairoSerde for SignerSignature { +impl cainome::cairo_serde::CairoSerde for Sha256Implementation { + type RustType = Self; + const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; + #[inline] + fn cairo_serialized_size(__rust: &Self::RustType) -> usize { + match __rust { + Sha256Implementation::Cairo0 => 1, + Sha256Implementation::Cairo1 => 1, + _ => 0, + } + } + fn cairo_serialize(__rust: &Self::RustType) -> Vec { + match __rust { + Sha256Implementation::Cairo0 => usize::cairo_serialize(&0usize), + Sha256Implementation::Cairo1 => usize::cairo_serialize(&1usize), + _ => vec![], + } + } + fn cairo_deserialize( + __felts: &[starknet::core::types::Felt], + __offset: usize, + ) -> cainome::cairo_serde::Result { + let __f = __felts[__offset]; + let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); + match __index as usize { + 0usize => Ok(Sha256Implementation::Cairo0), + 1usize => Ok(Sha256Implementation::Cairo1), + _ => { + return Err(cainome::cairo_serde::Error::Deserialize(format!( + "Index not handle for enum {}", + "Sha256Implementation" + ))) + } + } + } +} +#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] +pub enum OutsideExecutionEvent {} +impl cainome::cairo_serde::CairoSerde for OutsideExecutionEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { - SignerSignature::Starknet(val) => { - <(StarknetSigner, StarknetSignature)>::cairo_serialized_size(val) + 1 - } - SignerSignature::Secp256k1(val) => { - <(Secp256k1Signer, Signature)>::cairo_serialized_size(val) + 1 - } - SignerSignature::Secp256r1(val) => { - <(Secp256r1Signer, Signature)>::cairo_serialized_size(val) + 1 - } - SignerSignature::Eip191(val) => { - <(Eip191Signer, Signature)>::cairo_serialized_size(val) + 1 - } - SignerSignature::Webauthn(val) => { - <(WebauthnSigner, WebauthnSignature)>::cairo_serialized_size(val) + 1 - } _ => 0, } } fn cairo_serialize(__rust: &Self::RustType) -> Vec { match __rust { - SignerSignature::Starknet(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&0usize)); - temp.extend(<(StarknetSigner, StarknetSignature)>::cairo_serialize(val)); - temp - } - SignerSignature::Secp256k1(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&1usize)); - temp.extend(<(Secp256k1Signer, Signature)>::cairo_serialize(val)); - temp - } - SignerSignature::Secp256r1(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&2usize)); - temp.extend(<(Secp256r1Signer, Signature)>::cairo_serialize(val)); - temp - } - SignerSignature::Eip191(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&3usize)); - temp.extend(<(Eip191Signer, Signature)>::cairo_serialize(val)); - temp - } - SignerSignature::Webauthn(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&4usize)); - temp.extend(<(WebauthnSigner, WebauthnSignature)>::cairo_serialize(val)); - temp - } _ => vec![], } } @@ -1144,56 +1169,52 @@ impl cainome::cairo_serde::CairoSerde for SignerSignature { let __f = __felts[__offset]; let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); match __index as usize { - 0usize => Ok(SignerSignature::Starknet(<( - StarknetSigner, - StarknetSignature, - )>::cairo_deserialize( - __felts, __offset + 1 - )?)), - 1usize => Ok(SignerSignature::Secp256k1( - <(Secp256k1Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, - )), - 2usize => Ok(SignerSignature::Secp256r1( - <(Secp256r1Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, - )), - 3usize => Ok(SignerSignature::Eip191( - <(Eip191Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, - )), - 4usize => Ok(SignerSignature::Webauthn(<( - WebauthnSigner, - WebauthnSignature, - )>::cairo_deserialize( - __felts, __offset + 1 - )?)), _ => { return Err(cainome::cairo_serde::Error::Deserialize(format!( "Index not handle for enum {}", - "SignerSignature" + "OutsideExecutionEvent" ))) } } } } +impl TryFrom for OutsideExecutionEvent { + type Error = String; + fn try_from(event: starknet::core::types::EmittedEvent) -> Result { + use cainome::cairo_serde::CairoSerde; + if event.keys.is_empty() { + return Err("Event has no key".to_string()); + } + Err(format!( + "Could not match any event from keys {:?}", + event.keys + )) + } +} #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum Sha256Implementation { - Cairo0, - Cairo1, +pub enum DelegateAccountEvent { + DelegateAccountChanged(DelegateAccountChanged), } -impl cainome::cairo_serde::CairoSerde for Sha256Implementation { +impl cainome::cairo_serde::CairoSerde for DelegateAccountEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { - Sha256Implementation::Cairo0 => 1, - Sha256Implementation::Cairo1 => 1, + DelegateAccountEvent::DelegateAccountChanged(val) => { + DelegateAccountChanged::cairo_serialized_size(val) + 1 + } _ => 0, } } fn cairo_serialize(__rust: &Self::RustType) -> Vec { match __rust { - Sha256Implementation::Cairo0 => usize::cairo_serialize(&0usize), - Sha256Implementation::Cairo1 => usize::cairo_serialize(&1usize), + DelegateAccountEvent::DelegateAccountChanged(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&0usize)); + temp.extend(DelegateAccountChanged::cairo_serialize(val)); + temp + } _ => vec![], } } @@ -1204,17 +1225,55 @@ impl cainome::cairo_serde::CairoSerde for Sha256Implementation { let __f = __felts[__offset]; let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); match __index as usize { - 0usize => Ok(Sha256Implementation::Cairo0), - 1usize => Ok(Sha256Implementation::Cairo1), + 0usize => Ok(DelegateAccountEvent::DelegateAccountChanged( + DelegateAccountChanged::cairo_deserialize(__felts, __offset + 1)?, + )), _ => { return Err(cainome::cairo_serde::Error::Deserialize(format!( "Index not handle for enum {}", - "Sha256Implementation" + "DelegateAccountEvent" ))) } } } } +impl TryFrom for DelegateAccountEvent { + type Error = String; + fn try_from(event: starknet::core::types::EmittedEvent) -> Result { + use cainome::cairo_serde::CairoSerde; + if event.keys.is_empty() { + return Err("Event has no key".to_string()); + } + let selector = event.keys[0]; + if selector + == starknet::core::utils::get_selector_from_name("DelegateAccountChanged") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "DelegateAccountChanged")) + { + let mut key_offset = 0 + 1; + let mut data_offset = 0; + let address = match cainome::cairo_serde::ContractAddress::cairo_deserialize( + &event.data, + data_offset, + ) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "address", "DelegateAccountChanged", e + )) + } + }; + data_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); + return Ok(DelegateAccountEvent::DelegateAccountChanged( + DelegateAccountChanged { address }, + )); + }; + Err(format!( + "Could not match any event from keys {:?}", + event.keys + )) + } +} #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] pub enum ExternalOwnersEvent { ExternalOwnerRegistered(ExternalOwnerRegistered), @@ -1336,51 +1395,6 @@ impl TryFrom for ExternalOwnersEvent { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum Src5ComponentEvent {} -impl cainome::cairo_serde::CairoSerde for Src5ComponentEvent { - type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; - #[inline] - fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - match __rust { - _ => 0, - } - } - fn cairo_serialize(__rust: &Self::RustType) -> Vec { - match __rust { - _ => vec![], - } - } - fn cairo_deserialize( - __felts: &[starknet::core::types::Felt], - __offset: usize, - ) -> cainome::cairo_serde::Result { - let __f = __felts[__offset]; - let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); - match __index as usize { - _ => { - return Err(cainome::cairo_serde::Error::Deserialize(format!( - "Index not handle for enum {}", - "Src5ComponentEvent" - ))) - } - } - } -} -impl TryFrom for Src5ComponentEvent { - type Error = String; - fn try_from(event: starknet::core::types::EmittedEvent) -> Result { - use cainome::cairo_serde::CairoSerde; - if event.keys.is_empty() { - return Err("Event has no key".to_string()); - } - Err(format!( - "Could not match any event from keys {:?}", - event.keys - )) - } -} -#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] pub enum Event { TransactionExecuted(TransactionExecuted), MultipleOwnersEvent(MultipleOwnersEvent), @@ -1754,27 +1768,167 @@ impl TryFrom for Event { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum UpgradeEvent { - Upgraded(Upgraded), -} -impl cainome::cairo_serde::CairoSerde for UpgradeEvent { +pub enum SignerSignature { + Starknet((StarknetSigner, StarknetSignature)), + Secp256k1((Secp256k1Signer, Signature)), + Secp256r1((Secp256r1Signer, Signature)), + Eip191((Eip191Signer, Signature)), + Webauthn((WebauthnSigner, WebauthnSignature)), +} +impl cainome::cairo_serde::CairoSerde for SignerSignature { + type RustType = Self; + const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; + #[inline] + fn cairo_serialized_size(__rust: &Self::RustType) -> usize { + match __rust { + SignerSignature::Starknet(val) => { + <(StarknetSigner, StarknetSignature)>::cairo_serialized_size(val) + 1 + } + SignerSignature::Secp256k1(val) => { + <(Secp256k1Signer, Signature)>::cairo_serialized_size(val) + 1 + } + SignerSignature::Secp256r1(val) => { + <(Secp256r1Signer, Signature)>::cairo_serialized_size(val) + 1 + } + SignerSignature::Eip191(val) => { + <(Eip191Signer, Signature)>::cairo_serialized_size(val) + 1 + } + SignerSignature::Webauthn(val) => { + <(WebauthnSigner, WebauthnSignature)>::cairo_serialized_size(val) + 1 + } + _ => 0, + } + } + fn cairo_serialize(__rust: &Self::RustType) -> Vec { + match __rust { + SignerSignature::Starknet(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&0usize)); + temp.extend(<(StarknetSigner, StarknetSignature)>::cairo_serialize(val)); + temp + } + SignerSignature::Secp256k1(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&1usize)); + temp.extend(<(Secp256k1Signer, Signature)>::cairo_serialize(val)); + temp + } + SignerSignature::Secp256r1(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&2usize)); + temp.extend(<(Secp256r1Signer, Signature)>::cairo_serialize(val)); + temp + } + SignerSignature::Eip191(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&3usize)); + temp.extend(<(Eip191Signer, Signature)>::cairo_serialize(val)); + temp + } + SignerSignature::Webauthn(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&4usize)); + temp.extend(<(WebauthnSigner, WebauthnSignature)>::cairo_serialize(val)); + temp + } + _ => vec![], + } + } + fn cairo_deserialize( + __felts: &[starknet::core::types::Felt], + __offset: usize, + ) -> cainome::cairo_serde::Result { + let __f = __felts[__offset]; + let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); + match __index as usize { + 0usize => Ok(SignerSignature::Starknet(<( + StarknetSigner, + StarknetSignature, + )>::cairo_deserialize( + __felts, __offset + 1 + )?)), + 1usize => Ok(SignerSignature::Secp256k1( + <(Secp256k1Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, + )), + 2usize => Ok(SignerSignature::Secp256r1( + <(Secp256r1Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, + )), + 3usize => Ok(SignerSignature::Eip191( + <(Eip191Signer, Signature)>::cairo_deserialize(__felts, __offset + 1)?, + )), + 4usize => Ok(SignerSignature::Webauthn(<( + WebauthnSigner, + WebauthnSignature, + )>::cairo_deserialize( + __felts, __offset + 1 + )?)), + _ => { + return Err(cainome::cairo_serde::Error::Deserialize(format!( + "Index not handle for enum {}", + "SignerSignature" + ))) + } + } + } +} +#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] +pub enum Src5ComponentEvent {} +impl cainome::cairo_serde::CairoSerde for Src5ComponentEvent { + type RustType = Self; + const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; + #[inline] + fn cairo_serialized_size(__rust: &Self::RustType) -> usize { + match __rust { + _ => 0, + } + } + fn cairo_serialize(__rust: &Self::RustType) -> Vec { + match __rust { + _ => vec![], + } + } + fn cairo_deserialize( + __felts: &[starknet::core::types::Felt], + __offset: usize, + ) -> cainome::cairo_serde::Result { + let __f = __felts[__offset]; + let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); + match __index as usize { + _ => { + return Err(cainome::cairo_serde::Error::Deserialize(format!( + "Index not handle for enum {}", + "Src5ComponentEvent" + ))) + } + } + } +} +impl TryFrom for Src5ComponentEvent { + type Error = String; + fn try_from(event: starknet::core::types::EmittedEvent) -> Result { + use cainome::cairo_serde::CairoSerde; + if event.keys.is_empty() { + return Err("Event has no key".to_string()); + } + Err(format!( + "Could not match any event from keys {:?}", + event.keys + )) + } +} +#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] +pub enum ReentrancyGuardEvent {} +impl cainome::cairo_serde::CairoSerde for ReentrancyGuardEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { - UpgradeEvent::Upgraded(val) => Upgraded::cairo_serialized_size(val) + 1, _ => 0, } } fn cairo_serialize(__rust: &Self::RustType) -> Vec { match __rust { - UpgradeEvent::Upgraded(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&0usize)); - temp.extend(Upgraded::cairo_serialize(val)); - temp - } _ => vec![], } } @@ -1785,48 +1939,22 @@ impl cainome::cairo_serde::CairoSerde for UpgradeEvent { let __f = __felts[__offset]; let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); match __index as usize { - 0usize => Ok(UpgradeEvent::Upgraded(Upgraded::cairo_deserialize( - __felts, - __offset + 1, - )?)), _ => { return Err(cainome::cairo_serde::Error::Deserialize(format!( "Index not handle for enum {}", - "UpgradeEvent" + "ReentrancyGuardEvent" ))) } } } } -impl TryFrom for UpgradeEvent { +impl TryFrom for ReentrancyGuardEvent { type Error = String; fn try_from(event: starknet::core::types::EmittedEvent) -> Result { use cainome::cairo_serde::CairoSerde; if event.keys.is_empty() { return Err("Event has no key".to_string()); } - let selector = event.keys[0]; - if selector - == starknet::core::utils::get_selector_from_name("Upgraded") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "Upgraded")) - { - let mut key_offset = 0 + 1; - let mut data_offset = 0; - let class_hash = match cainome::cairo_serde::ClassHash::cairo_deserialize( - &event.data, - data_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "class_hash", "Upgraded", e - )) - } - }; - data_offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); - return Ok(UpgradeEvent::Upgraded(Upgraded { class_hash })); - }; Err(format!( "Could not match any event from keys {:?}", event.keys @@ -1947,215 +2075,65 @@ impl TryFrom for SessionEvent { )) } } -#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum ReentrancyGuardEvent {} -impl cainome::cairo_serde::CairoSerde for ReentrancyGuardEvent { - type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; - #[inline] - fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - match __rust { - _ => 0, - } - } - fn cairo_serialize(__rust: &Self::RustType) -> Vec { - match __rust { - _ => vec![], - } - } - fn cairo_deserialize( - __felts: &[starknet::core::types::Felt], - __offset: usize, - ) -> cainome::cairo_serde::Result { - let __f = __felts[__offset]; - let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); - match __index as usize { - _ => { - return Err(cainome::cairo_serde::Error::Deserialize(format!( - "Index not handle for enum {}", - "ReentrancyGuardEvent" - ))) - } - } - } -} -impl TryFrom for ReentrancyGuardEvent { - type Error = String; - fn try_from(event: starknet::core::types::EmittedEvent) -> Result { - use cainome::cairo_serde::CairoSerde; - if event.keys.is_empty() { - return Err("Event has no key".to_string()); - } - Err(format!( - "Could not match any event from keys {:?}", - event.keys - )) - } -} -#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum DelegateAccountEvent { - DelegateAccountChanged(DelegateAccountChanged), -} -impl cainome::cairo_serde::CairoSerde for DelegateAccountEvent { - type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; - #[inline] - fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - match __rust { - DelegateAccountEvent::DelegateAccountChanged(val) => { - DelegateAccountChanged::cairo_serialized_size(val) + 1 - } - _ => 0, - } - } - fn cairo_serialize(__rust: &Self::RustType) -> Vec { - match __rust { - DelegateAccountEvent::DelegateAccountChanged(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&0usize)); - temp.extend(DelegateAccountChanged::cairo_serialize(val)); - temp - } - _ => vec![], - } - } - fn cairo_deserialize( - __felts: &[starknet::core::types::Felt], - __offset: usize, - ) -> cainome::cairo_serde::Result { - let __f = __felts[__offset]; - let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); - match __index as usize { - 0usize => Ok(DelegateAccountEvent::DelegateAccountChanged( - DelegateAccountChanged::cairo_deserialize(__felts, __offset + 1)?, - )), - _ => { - return Err(cainome::cairo_serde::Error::Deserialize(format!( - "Index not handle for enum {}", - "DelegateAccountEvent" - ))) - } - } - } -} -impl TryFrom for DelegateAccountEvent { - type Error = String; - fn try_from(event: starknet::core::types::EmittedEvent) -> Result { - use cainome::cairo_serde::CairoSerde; - if event.keys.is_empty() { - return Err("Event has no key".to_string()); - } - let selector = event.keys[0]; - if selector - == starknet::core::utils::get_selector_from_name("DelegateAccountChanged") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "DelegateAccountChanged")) - { - let mut key_offset = 0 + 1; - let mut data_offset = 0; - let address = match cainome::cairo_serde::ContractAddress::cairo_deserialize( - &event.data, - data_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "address", "DelegateAccountChanged", e - )) - } - }; - data_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&address); - return Ok(DelegateAccountEvent::DelegateAccountChanged( - DelegateAccountChanged { address }, - )); - }; - Err(format!( - "Could not match any event from keys {:?}", - event.keys - )) - } -} impl Controller { #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_external_owner( + pub fn is_owner( &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, + owner_guid: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(owner_guid)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_external_owner"), + entry_point_selector: starknet::macros::selector!("is_owner"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn delegate_account( + pub fn assert_valid_owner_signature( &self, - ) -> cainome::cairo_serde::call::FCall { + signer_signature: &SignerSignature, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(SignerSignature::cairo_serialize(signer_signature)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("delegate_account"), + entry_point_selector: starknet::macros::selector!("assert_valid_owner_signature"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_valid_outside_execution_nonce( + pub fn is_session_revoked( &self, - nonce: &starknet::core::types::Felt, + session_hash: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(nonce)); - let __call = starknet::core::types::FunctionCall { - contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_valid_outside_execution_nonce"), - calldata: __calldata, - }; - cainome::cairo_serde::call::FCall::new(__call, self.provider()) - } - #[allow(clippy::ptr_arg)] - #[allow(clippy::too_many_arguments)] - pub fn get_outside_execution_message_hash_rev_0( - &self, - outside_execution: &OutsideExecution, - ) -> cainome::cairo_serde::call::FCall { - use cainome::cairo_serde::CairoSerde; - let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!( - "get_outside_execution_message_hash_rev_0" - ), + entry_point_selector: starknet::macros::selector!("is_session_revoked"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn get_outside_execution_message_hash_rev_1( + pub fn delegate_account( &self, - outside_execution: &OutsideExecution, - ) -> cainome::cairo_serde::call::FCall { + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!( - "get_outside_execution_message_hash_rev_1" - ), + entry_point_selector: starknet::macros::selector!("delegate_account"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) @@ -2182,540 +2160,562 @@ impl Controller { } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_session_revoked( + pub fn supports_interface( &self, - session_hash: &starknet::core::types::Felt, + interface_id: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(interface_id)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_session_revoked"), + entry_point_selector: starknet::macros::selector!("supports_interface"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_owner( + pub fn is_external_owner( &self, - owner_guid: &starknet::core::types::Felt, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(owner_guid)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, + )); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_owner"), + entry_point_selector: starknet::macros::selector!("is_external_owner"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn assert_valid_owner_signature( + pub fn is_valid_outside_execution_nonce( &self, - signer_signature: &SignerSignature, - ) -> cainome::cairo_serde::call::FCall { + nonce: &starknet::core::types::Felt, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(SignerSignature::cairo_serialize(signer_signature)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(nonce)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("assert_valid_owner_signature"), + entry_point_selector: starknet::macros::selector!("is_valid_outside_execution_nonce"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn supports_interface( + pub fn get_outside_execution_message_hash_rev_0( &self, - interface_id: &starknet::core::types::Felt, - ) -> cainome::cairo_serde::call::FCall { + outside_execution: &OutsideExecution, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(interface_id)); + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("supports_interface"), + entry_point_selector: starknet::macros::selector!( + "get_outside_execution_message_hash_rev_0" + ), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn register_external_owner_getcall( + pub fn get_outside_execution_message_hash_rev_1( &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, + outside_execution: &OutsideExecution, + ) -> cainome::cairo_serde::call::FCall { + use cainome::cairo_serde::CairoSerde; + let mut __calldata = vec![]; + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + let __call = starknet::core::types::FunctionCall { + contract_address: self.address, + entry_point_selector: starknet::macros::selector!( + "get_outside_execution_message_hash_rev_1" + ), + calldata: __calldata, + }; + cainome::cairo_serde::call::FCall::new(__call, self.provider()) + } + #[allow(clippy::ptr_arg)] + #[allow(clippy::too_many_arguments)] + pub fn add_owner_getcall( + &self, + owner: &Signer, + signature: &SignerSignature, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(SignerSignature::cairo_serialize(signature)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("register_external_owner"), + selector: starknet::macros::selector!("add_owner"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn register_external_owner( + pub fn add_owner( &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, + owner: &Signer, + signature: &SignerSignature, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(SignerSignature::cairo_serialize(signature)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("register_external_owner"), + selector: starknet::macros::selector!("add_owner"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn remove_external_owner_getcall( - &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::Call { + pub fn remove_owner_getcall(&self, owner: &Signer) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(Signer::cairo_serialize(owner)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("remove_external_owner"), + selector: starknet::macros::selector!("remove_owner"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn remove_external_owner( - &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::ExecutionV1 { + pub fn remove_owner(&self, owner: &Signer) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(Signer::cairo_serialize(owner)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("remove_external_owner"), + selector: starknet::macros::selector!("remove_owner"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn set_delegate_account_getcall( + pub fn __validate_declare___getcall( &self, - delegate_address: &cainome::cairo_serde::ContractAddress, + class_hash: &starknet::core::types::Felt, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - delegate_address, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("set_delegate_account"), + selector: starknet::macros::selector!("__validate_declare__"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn set_delegate_account( + pub fn __validate_declare__( &self, - delegate_address: &cainome::cairo_serde::ContractAddress, + class_hash: &starknet::core::types::Felt, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - delegate_address, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("set_delegate_account"), + selector: starknet::macros::selector!("__validate_declare__"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn execute_from_outside_getcall( + pub fn __validate_deploy___getcall( &self, - outside_execution: &OutsideExecution, - signature: &Vec, + class_hash: &starknet::core::types::Felt, + contract_address_salt: &starknet::core::types::Felt, + owner: &Signer, + guardian: &Option, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); - __calldata.extend(Vec::::cairo_serialize( - signature, + __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize( + contract_address_salt, )); + __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(Option::::cairo_serialize(guardian)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("execute_from_outside"), + selector: starknet::macros::selector!("__validate_deploy__"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn execute_from_outside( + pub fn __validate_deploy__( &self, - outside_execution: &OutsideExecution, - signature: &Vec, + class_hash: &starknet::core::types::Felt, + contract_address_salt: &starknet::core::types::Felt, + owner: &Signer, + guardian: &Option, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); - __calldata.extend(Vec::::cairo_serialize( - signature, + __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize( + contract_address_salt, )); + __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(Option::::cairo_serialize(guardian)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("execute_from_outside"), + selector: starknet::macros::selector!("__validate_deploy__"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn execute_from_outside_v2_getcall( + pub fn revoke_session_getcall( &self, - outside_execution: &OutsideExecution, - signature: &Vec, + session_hash: &starknet::core::types::Felt, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); - __calldata.extend(Vec::::cairo_serialize( - signature, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("execute_from_outside_v2"), + selector: starknet::macros::selector!("revoke_session"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn execute_from_outside_v2( + pub fn revoke_session( &self, - outside_execution: &OutsideExecution, - signature: &Vec, + session_hash: &starknet::core::types::Felt, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); - __calldata.extend(Vec::::cairo_serialize( - signature, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("execute_from_outside_v2"), + selector: starknet::macros::selector!("revoke_session"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate___getcall(&self, calls: &Vec) -> starknet::accounts::Call { + pub fn register_session_getcall( + &self, + session: &Session, + guid_or_address: &starknet::core::types::Felt, + ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Vec::::cairo_serialize(calls)); + __calldata.extend(Session::cairo_serialize(session)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize( + guid_or_address, + )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate__"), + selector: starknet::macros::selector!("register_session"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate__(&self, calls: &Vec) -> starknet::accounts::ExecutionV1 { + pub fn register_session( + &self, + session: &Session, + guid_or_address: &starknet::core::types::Felt, + ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Vec::::cairo_serialize(calls)); + __calldata.extend(Session::cairo_serialize(session)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize( + guid_or_address, + )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate__"), + selector: starknet::macros::selector!("register_session"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __execute___getcall(&self, calls: &Vec) -> starknet::accounts::Call { + pub fn upgrade_getcall( + &self, + new_class_hash: &cainome::cairo_serde::ClassHash, + ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Vec::::cairo_serialize(calls)); + __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + new_class_hash, + )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__execute__"), + selector: starknet::macros::selector!("upgrade"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __execute__(&self, calls: &Vec) -> starknet::accounts::ExecutionV1 { + pub fn upgrade( + &self, + new_class_hash: &cainome::cairo_serde::ClassHash, + ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Vec::::cairo_serialize(calls)); + __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + new_class_hash, + )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__execute__"), + selector: starknet::macros::selector!("upgrade"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate_declare___getcall( + pub fn set_delegate_account_getcall( &self, - class_hash: &starknet::core::types::Felt, + delegate_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + delegate_address, + )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate_declare__"), + selector: starknet::macros::selector!("set_delegate_account"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate_declare__( + pub fn set_delegate_account( &self, - class_hash: &starknet::core::types::Felt, + delegate_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + delegate_address, + )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate_declare__"), + selector: starknet::macros::selector!("set_delegate_account"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate_deploy___getcall( - &self, - class_hash: &starknet::core::types::Felt, - contract_address_salt: &starknet::core::types::Felt, - owner: &Signer, - guardian: &Option, - ) -> starknet::accounts::Call { + pub fn __validate___getcall(&self, calls: &Vec) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); - __calldata.extend(starknet::core::types::Felt::cairo_serialize( - contract_address_salt, - )); - __calldata.extend(Signer::cairo_serialize(owner)); - __calldata.extend(Option::::cairo_serialize(guardian)); + __calldata.extend(Vec::::cairo_serialize(calls)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate_deploy__"), + selector: starknet::macros::selector!("__validate__"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn __validate_deploy__( - &self, - class_hash: &starknet::core::types::Felt, - contract_address_salt: &starknet::core::types::Felt, - owner: &Signer, - guardian: &Option, - ) -> starknet::accounts::ExecutionV1 { + pub fn __validate__(&self, calls: &Vec) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(class_hash)); - __calldata.extend(starknet::core::types::Felt::cairo_serialize( - contract_address_salt, - )); - __calldata.extend(Signer::cairo_serialize(owner)); - __calldata.extend(Option::::cairo_serialize(guardian)); + __calldata.extend(Vec::::cairo_serialize(calls)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("__validate_deploy__"), + selector: starknet::macros::selector!("__validate__"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn revoke_session_getcall( - &self, - session_hash: &starknet::core::types::Felt, - ) -> starknet::accounts::Call { + pub fn __execute___getcall(&self, calls: &Vec) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); + __calldata.extend(Vec::::cairo_serialize(calls)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("revoke_session"), + selector: starknet::macros::selector!("__execute__"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn revoke_session( - &self, - session_hash: &starknet::core::types::Felt, - ) -> starknet::accounts::ExecutionV1 { + pub fn __execute__(&self, calls: &Vec) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); + __calldata.extend(Vec::::cairo_serialize(calls)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("revoke_session"), + selector: starknet::macros::selector!("__execute__"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn register_session_getcall( + pub fn register_external_owner_getcall( &self, - session: &Session, - guid_or_address: &starknet::core::types::Felt, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Session::cairo_serialize(session)); - __calldata.extend(starknet::core::types::Felt::cairo_serialize( - guid_or_address, + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("register_session"), + selector: starknet::macros::selector!("register_external_owner"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn register_session( + pub fn register_external_owner( &self, - session: &Session, - guid_or_address: &starknet::core::types::Felt, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Session::cairo_serialize(session)); - __calldata.extend(starknet::core::types::Felt::cairo_serialize( - guid_or_address, + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("register_session"), + selector: starknet::macros::selector!("register_external_owner"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn add_owner_getcall( + pub fn remove_external_owner_getcall( &self, - owner: &Signer, - signature: &SignerSignature, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Signer::cairo_serialize(owner)); - __calldata.extend(SignerSignature::cairo_serialize(signature)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, + )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("add_owner"), + selector: starknet::macros::selector!("remove_external_owner"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn add_owner( + pub fn remove_external_owner( &self, - owner: &Signer, - signature: &SignerSignature, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Signer::cairo_serialize(owner)); - __calldata.extend(SignerSignature::cairo_serialize(signature)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, + )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("add_owner"), + selector: starknet::macros::selector!("remove_external_owner"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn remove_owner_getcall(&self, owner: &Signer) -> starknet::accounts::Call { + pub fn execute_from_outside_getcall( + &self, + outside_execution: &OutsideExecution, + signature: &Vec, + ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(Vec::::cairo_serialize( + signature, + )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("remove_owner"), + selector: starknet::macros::selector!("execute_from_outside"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn remove_owner(&self, owner: &Signer) -> starknet::accounts::ExecutionV1 { + pub fn execute_from_outside( + &self, + outside_execution: &OutsideExecution, + signature: &Vec, + ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(Signer::cairo_serialize(owner)); + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(Vec::::cairo_serialize( + signature, + )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("remove_owner"), + selector: starknet::macros::selector!("execute_from_outside"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn upgrade_getcall( + pub fn execute_from_outside_v2_getcall( &self, - new_class_hash: &cainome::cairo_serde::ClassHash, + outside_execution: &OutsideExecution, + signature: &Vec, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - new_class_hash, + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(Vec::::cairo_serialize( + signature, )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("upgrade"), + selector: starknet::macros::selector!("execute_from_outside_v2"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn upgrade( + pub fn execute_from_outside_v2( &self, - new_class_hash: &cainome::cairo_serde::ClassHash, + outside_execution: &OutsideExecution, + signature: &Vec, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - new_class_hash, + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(Vec::::cairo_serialize( + signature, )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("upgrade"), + selector: starknet::macros::selector!("execute_from_outside_v2"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) @@ -2724,168 +2724,168 @@ impl Controller { impl ControllerReader

{ #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_external_owner( + pub fn is_owner( &self, - external_owner_address: &cainome::cairo_serde::ContractAddress, + owner_guid: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - external_owner_address, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(owner_guid)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_external_owner"), + entry_point_selector: starknet::macros::selector!("is_owner"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn delegate_account( + pub fn assert_valid_owner_signature( &self, - ) -> cainome::cairo_serde::call::FCall { + signer_signature: &SignerSignature, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(SignerSignature::cairo_serialize(signer_signature)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("delegate_account"), + entry_point_selector: starknet::macros::selector!("assert_valid_owner_signature"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_valid_outside_execution_nonce( + pub fn is_session_revoked( &self, - nonce: &starknet::core::types::Felt, + session_hash: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(nonce)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_valid_outside_execution_nonce"), + entry_point_selector: starknet::macros::selector!("is_session_revoked"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn get_outside_execution_message_hash_rev_0( + pub fn delegate_account( &self, - outside_execution: &OutsideExecution, - ) -> cainome::cairo_serde::call::FCall { + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!( - "get_outside_execution_message_hash_rev_0" - ), + entry_point_selector: starknet::macros::selector!("delegate_account"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn get_outside_execution_message_hash_rev_1( + pub fn is_valid_signature( &self, - outside_execution: &OutsideExecution, + hash: &starknet::core::types::Felt, + signature: &Vec, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(hash)); + __calldata.extend(Vec::::cairo_serialize( + signature, + )); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!( - "get_outside_execution_message_hash_rev_1" - ), + entry_point_selector: starknet::macros::selector!("is_valid_signature"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_valid_signature( + pub fn supports_interface( &self, - hash: &starknet::core::types::Felt, - signature: &Vec, - ) -> cainome::cairo_serde::call::FCall { + interface_id: &starknet::core::types::Felt, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(hash)); - __calldata.extend(Vec::::cairo_serialize( - signature, - )); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(interface_id)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_valid_signature"), + entry_point_selector: starknet::macros::selector!("supports_interface"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_session_revoked( + pub fn is_external_owner( &self, - session_hash: &starknet::core::types::Felt, + external_owner_address: &cainome::cairo_serde::ContractAddress, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(session_hash)); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + external_owner_address, + )); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_session_revoked"), + entry_point_selector: starknet::macros::selector!("is_external_owner"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn is_owner( + pub fn is_valid_outside_execution_nonce( &self, - owner_guid: &starknet::core::types::Felt, + nonce: &starknet::core::types::Felt, ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(owner_guid)); + __calldata.extend(starknet::core::types::Felt::cairo_serialize(nonce)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("is_owner"), + entry_point_selector: starknet::macros::selector!("is_valid_outside_execution_nonce"), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn assert_valid_owner_signature( + pub fn get_outside_execution_message_hash_rev_0( &self, - signer_signature: &SignerSignature, - ) -> cainome::cairo_serde::call::FCall { + outside_execution: &OutsideExecution, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(SignerSignature::cairo_serialize(signer_signature)); + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("assert_valid_owner_signature"), + entry_point_selector: starknet::macros::selector!( + "get_outside_execution_message_hash_rev_0" + ), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn supports_interface( + pub fn get_outside_execution_message_hash_rev_1( &self, - interface_id: &starknet::core::types::Felt, - ) -> cainome::cairo_serde::call::FCall { + outside_execution: &OutsideExecution, + ) -> cainome::cairo_serde::call::FCall { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(starknet::core::types::Felt::cairo_serialize(interface_id)); + __calldata.extend(OutsideExecution::cairo_serialize(outside_execution)); let __call = starknet::core::types::FunctionCall { contract_address: self.address, - entry_point_selector: starknet::macros::selector!("supports_interface"), + entry_point_selector: starknet::macros::selector!( + "get_outside_execution_message_hash_rev_1" + ), calldata: __calldata, }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) diff --git a/packages/account_sdk/src/abigen/erc_20.rs b/packages/account_sdk/src/abigen/erc_20.rs index c86d21c42..38fc68e50 100644 --- a/packages/account_sdk/src/abigen/erc_20.rs +++ b/packages/account_sdk/src/abigen/erc_20.rs @@ -53,23 +53,31 @@ impl Erc20Reader

{ } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Upgraded { - pub class_hash: cainome::cairo_serde::ClassHash, +pub struct Approval { + pub owner: cainome::cairo_serde::ContractAddress, + pub spender: cainome::cairo_serde::ContractAddress, + pub value: cainome::cairo_serde::U256, } -impl cainome::cairo_serde::CairoSerde for Upgraded { +impl cainome::cairo_serde::CairoSerde for Approval { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { let mut __size = 0; - __size += cainome::cairo_serde::ClassHash::cairo_serialized_size(&__rust.class_hash); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.owner); + __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.spender); + __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.value); __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - &__rust.class_hash, + __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + &__rust.owner, )); + __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + &__rust.spender, + )); + __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.value)); __out } fn cairo_deserialize( @@ -77,17 +85,25 @@ impl cainome::cairo_serde::CairoSerde for Upgraded { __offset: usize, ) -> cainome::cairo_serde::Result { let mut __offset = __offset; - let class_hash = cainome::cairo_serde::ClassHash::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); - Ok(Upgraded { class_hash }) + let owner = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&owner); + let spender = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&spender); + let value = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::U256::cairo_serialized_size(&value); + Ok(Approval { + owner, + spender, + value, + }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct OwnershipTransferStarted { +pub struct OwnershipTransferred { pub previous_owner: cainome::cairo_serde::ContractAddress, pub new_owner: cainome::cairo_serde::ContractAddress, } -impl cainome::cairo_serde::CairoSerde for OwnershipTransferStarted { +impl cainome::cairo_serde::CairoSerde for OwnershipTransferred { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] @@ -119,7 +135,7 @@ impl cainome::cairo_serde::CairoSerde for OwnershipTransferStarted { let new_owner = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); - Ok(OwnershipTransferStarted { + Ok(OwnershipTransferred { previous_owner, new_owner, }) @@ -168,57 +184,11 @@ impl cainome::cairo_serde::CairoSerde for Transfer { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct Approval { - pub owner: cainome::cairo_serde::ContractAddress, - pub spender: cainome::cairo_serde::ContractAddress, - pub value: cainome::cairo_serde::U256, -} -impl cainome::cairo_serde::CairoSerde for Approval { - type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = None; - #[inline] - fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - let mut __size = 0; - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.owner); - __size += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&__rust.spender); - __size += cainome::cairo_serde::U256::cairo_serialized_size(&__rust.value); - __size - } - fn cairo_serialize(__rust: &Self::RustType) -> Vec { - let mut __out: Vec = vec![]; - __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.owner, - )); - __out.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - &__rust.spender, - )); - __out.extend(cainome::cairo_serde::U256::cairo_serialize(&__rust.value)); - __out - } - fn cairo_deserialize( - __felts: &[starknet::core::types::Felt], - __offset: usize, - ) -> cainome::cairo_serde::Result { - let mut __offset = __offset; - let owner = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&owner); - let spender = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&spender); - let value = cainome::cairo_serde::U256::cairo_deserialize(__felts, __offset)?; - __offset += cainome::cairo_serde::U256::cairo_serialized_size(&value); - Ok(Approval { - owner, - spender, - value, - }) - } -} -#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub struct OwnershipTransferred { +pub struct OwnershipTransferStarted { pub previous_owner: cainome::cairo_serde::ContractAddress, pub new_owner: cainome::cairo_serde::ContractAddress, } -impl cainome::cairo_serde::CairoSerde for OwnershipTransferred { +impl cainome::cairo_serde::CairoSerde for OwnershipTransferStarted { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = None; #[inline] @@ -250,164 +220,40 @@ impl cainome::cairo_serde::CairoSerde for OwnershipTransferred { let new_owner = cainome::cairo_serde::ContractAddress::cairo_deserialize(__felts, __offset)?; __offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); - Ok(OwnershipTransferred { + Ok(OwnershipTransferStarted { previous_owner, new_owner, }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum OwnableComponentEvent { - OwnershipTransferred(OwnershipTransferred), - OwnershipTransferStarted(OwnershipTransferStarted), +pub struct Upgraded { + pub class_hash: cainome::cairo_serde::ClassHash, } -impl cainome::cairo_serde::CairoSerde for OwnableComponentEvent { +impl cainome::cairo_serde::CairoSerde for Upgraded { type RustType = Self; - const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; + const SERIALIZED_SIZE: std::option::Option = None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { - match __rust { - OwnableComponentEvent::OwnershipTransferred(val) => { - OwnershipTransferred::cairo_serialized_size(val) + 1 - } - OwnableComponentEvent::OwnershipTransferStarted(val) => { - OwnershipTransferStarted::cairo_serialized_size(val) + 1 - } - _ => 0, - } + let mut __size = 0; + __size += cainome::cairo_serde::ClassHash::cairo_serialized_size(&__rust.class_hash); + __size } fn cairo_serialize(__rust: &Self::RustType) -> Vec { - match __rust { - OwnableComponentEvent::OwnershipTransferred(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&0usize)); - temp.extend(OwnershipTransferred::cairo_serialize(val)); - temp - } - OwnableComponentEvent::OwnershipTransferStarted(val) => { - let mut temp = vec![]; - temp.extend(usize::cairo_serialize(&1usize)); - temp.extend(OwnershipTransferStarted::cairo_serialize(val)); - temp - } - _ => vec![], - } + let mut __out: Vec = vec![]; + __out.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + &__rust.class_hash, + )); + __out } fn cairo_deserialize( __felts: &[starknet::core::types::Felt], __offset: usize, ) -> cainome::cairo_serde::Result { - let __f = __felts[__offset]; - let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); - match __index as usize { - 0usize => Ok(OwnableComponentEvent::OwnershipTransferred( - OwnershipTransferred::cairo_deserialize(__felts, __offset + 1)?, - )), - 1usize => Ok(OwnableComponentEvent::OwnershipTransferStarted( - OwnershipTransferStarted::cairo_deserialize(__felts, __offset + 1)?, - )), - _ => { - return Err(cainome::cairo_serde::Error::Deserialize(format!( - "Index not handle for enum {}", - "OwnableComponentEvent" - ))) - } - } - } -} -impl TryFrom for OwnableComponentEvent { - type Error = String; - fn try_from(event: starknet::core::types::EmittedEvent) -> Result { - use cainome::cairo_serde::CairoSerde; - if event.keys.is_empty() { - return Err("Event has no key".to_string()); - } - let selector = event.keys[0]; - if selector - == starknet::core::utils::get_selector_from_name("OwnershipTransferred") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnershipTransferred")) - { - let mut key_offset = 0 + 1; - let mut data_offset = 0; - let previous_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( - &event.keys, - key_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "previous_owner", "OwnershipTransferred", e - )) - } - }; - key_offset += - cainome::cairo_serde::ContractAddress::cairo_serialized_size(&previous_owner); - let new_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( - &event.keys, - key_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "new_owner", "OwnershipTransferred", e - )) - } - }; - key_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); - return Ok(OwnableComponentEvent::OwnershipTransferred( - OwnershipTransferred { - previous_owner, - new_owner, - }, - )); - }; - let selector = event.keys[0]; - if selector - == starknet::core::utils::get_selector_from_name("OwnershipTransferStarted") - .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnershipTransferStarted")) - { - let mut key_offset = 0 + 1; - let mut data_offset = 0; - let previous_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( - &event.keys, - key_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "previous_owner", "OwnershipTransferStarted", e - )) - } - }; - key_offset += - cainome::cairo_serde::ContractAddress::cairo_serialized_size(&previous_owner); - let new_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( - &event.keys, - key_offset, - ) { - Ok(v) => v, - Err(e) => { - return Err(format!( - "Could not deserialize field {} for {}: {:?}", - "new_owner", "OwnershipTransferStarted", e - )) - } - }; - key_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); - return Ok(OwnableComponentEvent::OwnershipTransferStarted( - OwnershipTransferStarted { - previous_owner, - new_owner, - }, - )); - }; - Err(format!( - "Could not match any event from keys {:?}", - event.keys - )) + let mut __offset = __offset; + let class_hash = cainome::cairo_serde::ClassHash::cairo_deserialize(__felts, __offset)?; + __offset += cainome::cairo_serde::ClassHash::cairo_serialized_size(&class_hash); + Ok(Upgraded { class_hash }) } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] @@ -864,16 +710,170 @@ impl TryFrom for ERC20ComponentEvent { } } #[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] -pub enum UpgradeEvent { - Upgraded(Upgraded), +pub enum OwnableComponentEvent { + OwnershipTransferred(OwnershipTransferred), + OwnershipTransferStarted(OwnershipTransferStarted), } -impl cainome::cairo_serde::CairoSerde for UpgradeEvent { +impl cainome::cairo_serde::CairoSerde for OwnableComponentEvent { type RustType = Self; const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; #[inline] fn cairo_serialized_size(__rust: &Self::RustType) -> usize { match __rust { - UpgradeEvent::Upgraded(val) => Upgraded::cairo_serialized_size(val) + 1, + OwnableComponentEvent::OwnershipTransferred(val) => { + OwnershipTransferred::cairo_serialized_size(val) + 1 + } + OwnableComponentEvent::OwnershipTransferStarted(val) => { + OwnershipTransferStarted::cairo_serialized_size(val) + 1 + } + _ => 0, + } + } + fn cairo_serialize(__rust: &Self::RustType) -> Vec { + match __rust { + OwnableComponentEvent::OwnershipTransferred(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&0usize)); + temp.extend(OwnershipTransferred::cairo_serialize(val)); + temp + } + OwnableComponentEvent::OwnershipTransferStarted(val) => { + let mut temp = vec![]; + temp.extend(usize::cairo_serialize(&1usize)); + temp.extend(OwnershipTransferStarted::cairo_serialize(val)); + temp + } + _ => vec![], + } + } + fn cairo_deserialize( + __felts: &[starknet::core::types::Felt], + __offset: usize, + ) -> cainome::cairo_serde::Result { + let __f = __felts[__offset]; + let __index = u128::from_be_bytes(__f.to_bytes_be()[16..].try_into().unwrap()); + match __index as usize { + 0usize => Ok(OwnableComponentEvent::OwnershipTransferred( + OwnershipTransferred::cairo_deserialize(__felts, __offset + 1)?, + )), + 1usize => Ok(OwnableComponentEvent::OwnershipTransferStarted( + OwnershipTransferStarted::cairo_deserialize(__felts, __offset + 1)?, + )), + _ => { + return Err(cainome::cairo_serde::Error::Deserialize(format!( + "Index not handle for enum {}", + "OwnableComponentEvent" + ))) + } + } + } +} +impl TryFrom for OwnableComponentEvent { + type Error = String; + fn try_from(event: starknet::core::types::EmittedEvent) -> Result { + use cainome::cairo_serde::CairoSerde; + if event.keys.is_empty() { + return Err("Event has no key".to_string()); + } + let selector = event.keys[0]; + if selector + == starknet::core::utils::get_selector_from_name("OwnershipTransferred") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnershipTransferred")) + { + let mut key_offset = 0 + 1; + let mut data_offset = 0; + let previous_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( + &event.keys, + key_offset, + ) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "previous_owner", "OwnershipTransferred", e + )) + } + }; + key_offset += + cainome::cairo_serde::ContractAddress::cairo_serialized_size(&previous_owner); + let new_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( + &event.keys, + key_offset, + ) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "new_owner", "OwnershipTransferred", e + )) + } + }; + key_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); + return Ok(OwnableComponentEvent::OwnershipTransferred( + OwnershipTransferred { + previous_owner, + new_owner, + }, + )); + }; + let selector = event.keys[0]; + if selector + == starknet::core::utils::get_selector_from_name("OwnershipTransferStarted") + .unwrap_or_else(|_| panic!("Invalid selector for {}", "OwnershipTransferStarted")) + { + let mut key_offset = 0 + 1; + let mut data_offset = 0; + let previous_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( + &event.keys, + key_offset, + ) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "previous_owner", "OwnershipTransferStarted", e + )) + } + }; + key_offset += + cainome::cairo_serde::ContractAddress::cairo_serialized_size(&previous_owner); + let new_owner = match cainome::cairo_serde::ContractAddress::cairo_deserialize( + &event.keys, + key_offset, + ) { + Ok(v) => v, + Err(e) => { + return Err(format!( + "Could not deserialize field {} for {}: {:?}", + "new_owner", "OwnershipTransferStarted", e + )) + } + }; + key_offset += cainome::cairo_serde::ContractAddress::cairo_serialized_size(&new_owner); + return Ok(OwnableComponentEvent::OwnershipTransferStarted( + OwnershipTransferStarted { + previous_owner, + new_owner, + }, + )); + }; + Err(format!( + "Could not match any event from keys {:?}", + event.keys + )) + } +} +#[derive(Debug, PartialEq, PartialOrd, Clone, serde :: Serialize, serde :: Deserialize)] +pub enum UpgradeEvent { + Upgraded(Upgraded), +} +impl cainome::cairo_serde::CairoSerde for UpgradeEvent { + type RustType = Self; + const SERIALIZED_SIZE: std::option::Option = std::option::Option::None; + #[inline] + fn cairo_serialized_size(__rust: &Self::RustType) -> usize { + match __rust { + UpgradeEvent::Upgraded(val) => Upgraded::cairo_serialized_size(val) + 1, _ => 0, } } @@ -944,6 +944,20 @@ impl TryFrom for UpgradeEvent { } } impl Erc20 { + #[allow(clippy::ptr_arg)] + #[allow(clippy::too_many_arguments)] + pub fn owner( + &self, + ) -> cainome::cairo_serde::call::FCall { + use cainome::cairo_serde::CairoSerde; + let mut __calldata = vec![]; + let __call = starknet::core::types::FunctionCall { + contract_address: self.address, + entry_point_selector: starknet::macros::selector!("owner"), + calldata: __calldata, + }; + cainome::cairo_serde::call::FCall::new(__call, self.provider()) + } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] pub fn total_supply( @@ -1072,343 +1086,343 @@ impl Erc20 { } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn owner( - &self, - ) -> cainome::cairo_serde::call::FCall { - use cainome::cairo_serde::CairoSerde; - let mut __calldata = vec![]; - let __call = starknet::core::types::FunctionCall { - contract_address: self.address, - entry_point_selector: starknet::macros::selector!("owner"), - calldata: __calldata, - }; - cainome::cairo_serde::call::FCall::new(__call, self.provider()) - } - #[allow(clippy::ptr_arg)] - #[allow(clippy::too_many_arguments)] - pub fn transfer_getcall( + pub fn upgrade_getcall( &self, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + new_class_hash: &cainome::cairo_serde::ClassHash, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + new_class_hash, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer"), + selector: starknet::macros::selector!("upgrade"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transfer( + pub fn upgrade( &self, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + new_class_hash: &cainome::cairo_serde::ClassHash, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( + new_class_hash, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer"), + selector: starknet::macros::selector!("upgrade"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transfer_from_getcall( + pub fn transfer_ownership_getcall( &self, - sender: &cainome::cairo_serde::ContractAddress, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + new_owner: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - sender, - )); - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + new_owner, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer_from"), + selector: starknet::macros::selector!("transfer_ownership"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transfer_from( + pub fn transfer_ownership( &self, - sender: &cainome::cairo_serde::ContractAddress, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + new_owner: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - sender, - )); - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + new_owner, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer_from"), + selector: starknet::macros::selector!("transfer_ownership"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn approve_getcall( - &self, - spender: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, - ) -> starknet::accounts::Call { + pub fn renounce_ownership_getcall(&self) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - spender, - )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("approve"), + selector: starknet::macros::selector!("renounce_ownership"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn approve( - &self, - spender: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, - ) -> starknet::accounts::ExecutionV1 { + pub fn renounce_ownership(&self) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - spender, - )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("approve"), + selector: starknet::macros::selector!("renounce_ownership"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transferFrom_getcall( + pub fn transferOwnership_getcall( &self, - sender: &cainome::cairo_serde::ContractAddress, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + newOwner: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - sender, - )); - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + newOwner, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transferFrom"), + selector: starknet::macros::selector!("transferOwnership"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transferFrom( + pub fn transferOwnership( &self, - sender: &cainome::cairo_serde::ContractAddress, - recipient: &cainome::cairo_serde::ContractAddress, - amount: &cainome::cairo_serde::U256, + newOwner: &cainome::cairo_serde::ContractAddress, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - sender, - )); - __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - recipient, + newOwner, )); - __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transferFrom"), + selector: starknet::macros::selector!("transferOwnership"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn upgrade_getcall( - &self, - new_class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::Call { + pub fn renounceOwnership_getcall(&self) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - new_class_hash, - )); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("upgrade"), + selector: starknet::macros::selector!("renounceOwnership"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn upgrade( - &self, - new_class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + pub fn renounceOwnership(&self) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; - __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize( - new_class_hash, - )); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("upgrade"), + selector: starknet::macros::selector!("renounceOwnership"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transfer_ownership_getcall( + pub fn transfer_getcall( &self, - new_owner: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - new_owner, + recipient, )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer_ownership"), + selector: starknet::macros::selector!("transfer"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transfer_ownership( + pub fn transfer( &self, - new_owner: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - new_owner, + recipient, )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transfer_ownership"), + selector: starknet::macros::selector!("transfer"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn renounce_ownership_getcall(&self) -> starknet::accounts::Call { + pub fn transfer_from_getcall( + &self, + sender: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, + ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + sender, + )); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + recipient, + )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("renounce_ownership"), + selector: starknet::macros::selector!("transfer_from"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn renounce_ownership(&self) -> starknet::accounts::ExecutionV1 { + pub fn transfer_from( + &self, + sender: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, + ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + sender, + )); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + recipient, + )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("renounce_ownership"), + selector: starknet::macros::selector!("transfer_from"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transferOwnership_getcall( + pub fn approve_getcall( &self, - newOwner: &cainome::cairo_serde::ContractAddress, + spender: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - newOwner, + spender, )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transferOwnership"), + selector: starknet::macros::selector!("approve"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn transferOwnership( + pub fn approve( &self, - newOwner: &cainome::cairo_serde::ContractAddress, + spender: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( - newOwner, + spender, )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("transferOwnership"), + selector: starknet::macros::selector!("approve"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn renounceOwnership_getcall(&self) -> starknet::accounts::Call { + pub fn transferFrom_getcall( + &self, + sender: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, + ) -> starknet::accounts::Call { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + sender, + )); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + recipient, + )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("renounceOwnership"), + selector: starknet::macros::selector!("transferFrom"), calldata: __calldata, } } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn renounceOwnership(&self) -> starknet::accounts::ExecutionV1 { + pub fn transferFrom( + &self, + sender: &cainome::cairo_serde::ContractAddress, + recipient: &cainome::cairo_serde::ContractAddress, + amount: &cainome::cairo_serde::U256, + ) -> starknet::accounts::ExecutionV1 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + sender, + )); + __calldata.extend(cainome::cairo_serde::ContractAddress::cairo_serialize( + recipient, + )); + __calldata.extend(cainome::cairo_serde::U256::cairo_serialize(amount)); let __call = starknet::accounts::Call { to: self.address, - selector: starknet::macros::selector!("renounceOwnership"), + selector: starknet::macros::selector!("transferFrom"), calldata: __calldata, }; self.account.execute_v1(vec![__call]) } } impl Erc20Reader

{ + #[allow(clippy::ptr_arg)] + #[allow(clippy::too_many_arguments)] + pub fn owner( + &self, + ) -> cainome::cairo_serde::call::FCall { + use cainome::cairo_serde::CairoSerde; + let mut __calldata = vec![]; + let __call = starknet::core::types::FunctionCall { + contract_address: self.address, + entry_point_selector: starknet::macros::selector!("owner"), + calldata: __calldata, + }; + cainome::cairo_serde::call::FCall::new(__call, self.provider()) + } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] pub fn total_supply(&self) -> cainome::cairo_serde::call::FCall { @@ -1527,18 +1541,4 @@ impl Erc20Reader

{ }; cainome::cairo_serde::call::FCall::new(__call, self.provider()) } - #[allow(clippy::ptr_arg)] - #[allow(clippy::too_many_arguments)] - pub fn owner( - &self, - ) -> cainome::cairo_serde::call::FCall { - use cainome::cairo_serde::CairoSerde; - let mut __calldata = vec![]; - let __call = starknet::core::types::FunctionCall { - contract_address: self.address, - entry_point_selector: starknet::macros::selector!("owner"), - calldata: __calldata, - }; - cainome::cairo_serde::call::FCall::new(__call, self.provider()) - } }