Struct cubist_sdk::TargetProject
source · pub struct TargetProject<M: Middleware = HttpStack> { /* private fields */ }
Expand description
Re-export some very commonly used types. Generic project targeting a single chain either via HTTP or WS.
Implementations§
source§impl TargetProject<HttpStack>
impl TargetProject<HttpStack>
sourcepub async fn create(project: TargetProjectInfo) -> Result<Self>
pub async fn create(project: TargetProjectInfo) -> Result<Self>
Factory method for connections over HTTP
source§impl TargetProject<WsStack>
impl TargetProject<WsStack>
sourcepub async fn create(project: TargetProjectInfo) -> Result<Self>
pub async fn create(project: TargetProjectInfo) -> Result<Self>
Factory method for connections over Web Sockets
source§impl<M: Middleware> TargetProject<M>
impl<M: Middleware> TargetProject<M>
sourcepub fn new(project: TargetProjectInfo, provider: M) -> Self
pub fn new(project: TargetProjectInfo, provider: M) -> Self
Constructor
sourcepub async fn accounts(&self) -> Result<Vec<Address>>
pub async fn accounts(&self) -> Result<Vec<Address>>
Retrieve all accounts used on this target.
sourcepub async fn deploy<T: Tokenize>(
&self,
contract: &ContractInfo,
constructor_args: T
) -> Result<Contract<M>>
pub async fn deploy<T: Tokenize>(
&self,
contract: &ContractInfo,
constructor_args: T
) -> Result<Contract<M>>
Deploy a contract.
sourcepub fn at(&self, contract: &ContractInfo, address: Address) -> Contract<M>
pub fn at(&self, contract: &ContractInfo, address: Address) -> Contract<M>
Initialize a given contract with a given address
sourcepub async fn deployed(&self, contract: &ContractInfo) -> Result<Contract<M>>
pub async fn deployed(&self, contract: &ContractInfo) -> Result<Contract<M>>
Initialize a given contract from its deployment receipt. Succeeds only if there is exactly one corresponding deployment receipt found.
sourcepub fn load_bridge(&self, cc: &ContractInfo) -> Result<Bridge>
pub fn load_bridge(&self, cc: &ContractInfo) -> Result<Bridge>
Try to find and load bridge metadata for this contract. The bridge metadata file is expected to be co-located with the contract’s source file.
Methods from Deref<Target = TargetProjectInfo>§
sourcepub fn contract_files(&self) -> impl Iterator<Item = PathBuf> + '_
pub fn contract_files(&self) -> impl Iterator<Item = PathBuf> + '_
Return absolute paths to all contract files.
sourcepub fn compile_file(&self, file: &Path) -> Result<CompileResult>
pub fn compile_file(&self, file: &Path) -> Result<CompileResult>
Compile a contract file.
sourcepub fn is_dependency(&self, cc: &ContractInfo, dep: &ContractInfo) -> bool
pub fn is_dependency(&self, cc: &ContractInfo, dep: &ContractInfo) -> bool
Whether contract cc
is allowed to call contract dep
(i.e.,
whether dep
is a dependency of cc
)
sourcepub fn find_shim_contracts(&self) -> Result<Vec<ContractInfo>>
pub fn find_shim_contracts(&self) -> Result<Vec<ContractInfo>>
Find all shim contracts generated for this chain.
sourcepub fn find_contracts(&self) -> Result<Vec<ContractInfo>>
pub fn find_contracts(&self) -> Result<Vec<ContractInfo>>
Find all (non-shim) contracts targeting this chain.
sourcepub fn contract(&self, name: &str) -> Result<Option<ContractInfo>>
pub fn contract(&self, name: &str) -> Result<Option<ContractInfo>>
Find a non-shim contract targeting this chain by its name.
sourcepub fn shim_contract(&self, name: &str) -> Result<Option<ContractInfo>>
pub fn shim_contract(&self, name: &str) -> Result<Option<ContractInfo>>
Find a shim contract targeting for chain by its name.
sourcepub fn endpoint_url(&self) -> Result<SecretUrl>
pub fn endpoint_url(&self) -> Result<SecretUrl>
Create a cubist localchains provider (CubistProvider
) from a
given EndpointConfig
then return that provider’s endpoint url.
Trait Implementations§
source§impl<M: Middleware> Deref for TargetProject<M>
impl<M: Middleware> Deref for TargetProject<M>
Instances of TargetProject
can be automatically dereferenced
to TargetProjectInfo
.
Auto Trait Implementations§
impl<M> RefUnwindSafe for TargetProject<M>where
M: RefUnwindSafe,
impl<M> Send for TargetProject<M>
impl<M> Sync for TargetProject<M>
impl<M> Unpin for TargetProject<M>
impl<M> UnwindSafe for TargetProject<M>where
M: RefUnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more