diff --git a/examples/abigen.rs b/examples/abigen.rs index e8aeb84c..7506722f 100644 --- a/examples/abigen.rs +++ b/examples/abigen.rs @@ -5,7 +5,7 @@ use starknet::{ contract::abi::ContractAddress, core::{chain_id, types::FieldElement}, macros::abigen, - providers::{Provider, SequencerGatewayProvider}, + providers::SequencerGatewayProvider, signers::{LocalWallet, SigningKey}, }; diff --git a/starknet-contract/src/abi/cairo_types/types/starknet.rs b/starknet-contract/src/abi/cairo_types/types/starknet.rs index f191f682..6ce7aff4 100644 --- a/starknet-contract/src/abi/cairo_types/types/starknet.rs +++ b/starknet-contract/src/abi/cairo_types/types/starknet.rs @@ -14,6 +14,12 @@ impl From for ContractAddress { } } +impl From for FieldElement { + fn from(item: ContractAddress) -> Self { + item.0 + } +} + impl CairoType for ContractAddress { type RustType = Self; @@ -36,6 +42,12 @@ impl From for ClassHash { } } +impl From for FieldElement { + fn from(item: ClassHash) -> Self { + item.0 + } +} + impl CairoType for ClassHash { type RustType = Self; @@ -58,6 +70,12 @@ impl From for EthAddress { } } +impl From for FieldElement { + fn from(item: EthAddress) -> Self { + item.0 + } +} + impl CairoType for EthAddress { type RustType = Self;