pub struct TradeAccountDeploy<W> {
pub oracle: TradingAccountOracle<W>,
pub oracle_id: ContractId,
pub trade_account_blob_id: BlobId,
pub deployer_wallet: W,
pub proxy: Option<TradingAccountProxy<W>>,
pub proxy_id: Option<ContractId>,
}Expand description
Result of a complete trade account deployment. Contains all deployed contract instances and their IDs for easy access.
Fields§
§oracle: TradingAccountOracle<W>The deployed oracle contract instance
oracle_id: ContractIdContract ID of the deployed oracle
trade_account_blob_id: BlobIdBlob ID of the trade account implementation
deployer_wallet: WThe wallet to use for deployment (pays all gas fees)
proxy: Option<TradingAccountProxy<W>>The deployed proxy contract instance
proxy_id: Option<ContractId>Contract ID of the deployed proxy
Implementations§
Source§impl<W> TradeAccountDeploy<W>
impl<W> TradeAccountDeploy<W>
pub fn change_wallet(self, wallet: &W) -> Self
pub async fn from_oracle_id( deployer_wallet: &W, oracle_id: ContractId, ) -> Result<Self>
Sourcepub fn trade_account_blob_from_config(
config: &TradeAccountDeployConfig,
) -> Result<(Vec<Blob>, Blob)>
pub fn trade_account_blob_from_config( config: &TradeAccountDeployConfig, ) -> Result<(Vec<Blob>, Blob)>
Build the (data_blobs, loader_blob) pair for the TradeAccount
implementation contract. The proxy will point at loader_blob;
every data blob must be uploaded before the proxy dispatches.
Sourcepub fn trade_account_proxy_blob_from_config(
config: &TradeAccountDeployConfig,
) -> Result<(Vec<Blob>, Blob)>
pub fn trade_account_proxy_blob_from_config( config: &TradeAccountDeployConfig, ) -> Result<(Vec<Blob>, Blob)>
Same as trade_account_blob_from_config but for the
trade-account proxy bytecode.
pub async fn trade_account_blob( deployer_wallet: &W, config: &TradeAccountDeployConfig, ) -> Result<TradeAccountBlob>
Sourcepub async fn deploy_trade_account_blob(
deployer_wallet: &W,
config: &DeployConfig,
) -> Result<BlobId>
pub async fn deploy_trade_account_blob( deployer_wallet: &W, config: &DeployConfig, ) -> Result<BlobId>
Deploys the trade account implementation as a blob. Large contracts are deployed as blobs to handle size limitations.
§Arguments
deployer_wallet- The wallet to use for deployment (pays gas fees)config- Deployment configuration containing bytecode and settings
§Returns
Ok(BlobId)- The ID of the deployed blobErr(anyhow::Error)- If deployment fails
Sourcepub async fn deploy_oracle(
deployer_wallet: &W,
trade_account_blob_id: &BlobId,
config: &DeployConfig,
) -> Result<(TradingAccountOracle<W>, ContractId)>
pub async fn deploy_oracle( deployer_wallet: &W, trade_account_blob_id: &BlobId, config: &DeployConfig, ) -> Result<(TradingAccountOracle<W>, ContractId)>
Deploys the oracle contract that manages trade account implementation addresses. The oracle is initialized with the deployer as owner and the blob ID as the current implementation.
§Arguments
deployer_wallet- The wallet to use for deployment and set as initial ownertrade_account_blob_id- The blob ID of the trade account implementationconfig- Deployment configuration containing oracle bytecode and settings
§Returns
Ok((TradingAccountOracle, ContractId))- The oracle instance and its contract IDErr(anyhow::Error)- If deployment or initialization fails
pub fn trade_account_contract( oracle_id: &ContractId, owner_identity: &Identity, config: &DeployConfig, ) -> Result<Contract<Regular>>
Sourcepub async fn deploy_proxy(
deployer_wallet: &Wallet,
owner_identity: &Identity,
oracle_id: ContractId,
config: &DeployConfig,
call_option: &CallOption,
dry_run_client: Option<&FuelClient>,
submit_clients: &[FuelClient],
) -> Result<(TradingAccountProxy<Wallet>, ContractId)>
pub async fn deploy_proxy( deployer_wallet: &Wallet, owner_identity: &Identity, oracle_id: ContractId, config: &DeployConfig, call_option: &CallOption, dry_run_client: Option<&FuelClient>, submit_clients: &[FuelClient], ) -> Result<(TradingAccountProxy<Wallet>, ContractId)>
Deploys the proxy contract that delegates calls to the current implementation. The proxy is configured with the oracle contract ID and initialized with the specified owner.
§Arguments
deployer_wallet- The wallet to use for deployment (pays gas fees)owner_wallet- The wallet to set as the proxy owneroracle_id- The contract ID of the deployed oracleconfig- Deployment configuration containing proxy bytecode and settings
§Returns
Ok((TradingAccountProxy, ContractId))- The proxy instance and its contract IDErr(anyhow::Error)- If deployment or initialization fails
Sourcepub async fn deploy(
deployer_wallet: &W,
config: &DeployConfig,
) -> Result<TradeAccountDeploy<W>>
pub async fn deploy( deployer_wallet: &W, config: &DeployConfig, ) -> Result<TradeAccountDeploy<W>>
Deploys a complete trade account system including implementation blob, oracle, and proxy. This is the main deployment function that orchestrates the entire process.
§Arguments
deployer_wallet- The wallet to use for deployment (pays all gas fees)owner_wallet- The wallet to set as the trade account ownerconfig- Deployment configuration containing all bytecode and settings
§Returns
Ok(TradeAccountDeploy)- Complete deployment result with all contract instancesErr(anyhow::Error)- If any part of the deployment fails
§Process
- Deploys the trade account implementation as a blob
- Deploys the oracle contract and registers the blob ID
- Deploys the proxy contract configured with the oracle
Source§impl TradeAccountDeploy<Wallet>
impl TradeAccountDeploy<Wallet>
pub async fn deploy_with_account( &self, owner_identity: &Identity, config: &DeployConfig, call_option: &CallOption, dry_run_client: Option<&FuelClient>, submit_clients: &[FuelClient], ) -> Result<Self>
Trait Implementations§
Source§impl<W: Clone> Clone for TradeAccountDeploy<W>
impl<W: Clone> Clone for TradeAccountDeploy<W>
Source§fn clone(&self) -> TradeAccountDeploy<W>
fn clone(&self) -> TradeAccountDeploy<W>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<W> Freeze for TradeAccountDeploy<W>where
W: Freeze,
impl<W> RefUnwindSafe for TradeAccountDeploy<W>where
W: RefUnwindSafe,
impl<W> Send for TradeAccountDeploy<W>where
W: Send,
impl<W> Sync for TradeAccountDeploy<W>where
W: Sync,
impl<W> Unpin for TradeAccountDeploy<W>where
W: Unpin,
impl<W> UnsafeUnpin for TradeAccountDeploy<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for TradeAccountDeploy<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> IsFieldType<T> for T
Source§impl<S> IteratorOverTable for S
impl<S> IteratorOverTable for S
Source§fn iter_all_keys<M>(
&self,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>where
M: Mappable,
Self: IterableTable<M>,
fn iter_all_keys<M>(
&self,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>where
M: Mappable,
Self: IterableTable<M>,
Source§fn iter_all_by_prefix_keys<M, P>(
&self,
prefix: Option<P>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>
fn iter_all_by_prefix_keys<M, P>( &self, prefix: Option<P>, ) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>
Source§fn iter_all_by_start_keys<M>(
&self,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>where
M: Mappable,
Self: IterableTable<M>,
fn iter_all_by_start_keys<M>(
&self,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>where
M: Mappable,
Self: IterableTable<M>,
Source§fn iter_all_filtered_keys<M, P>(
&self,
prefix: Option<P>,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>
fn iter_all_filtered_keys<M, P>( &self, prefix: Option<P>, start: Option<&<M as Mappable>::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<<M as Mappable>::OwnedKey, Error>>
Source§fn iter_all<M>(
&self,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>where
M: Mappable,
Self: IterableTable<M>,
fn iter_all<M>(
&self,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>where
M: Mappable,
Self: IterableTable<M>,
Source§fn iter_all_by_prefix<M, P>(
&self,
prefix: Option<P>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>
fn iter_all_by_prefix<M, P>( &self, prefix: Option<P>, ) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>
Source§fn iter_all_by_start<M>(
&self,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>where
M: Mappable,
Self: IterableTable<M>,
fn iter_all_by_start<M>(
&self,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>where
M: Mappable,
Self: IterableTable<M>,
Source§fn iter_all_filtered<M, P>(
&self,
prefix: Option<P>,
start: Option<&<M as Mappable>::Key>,
direction: Option<IterDirection>,
) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>
fn iter_all_filtered<M, P>( &self, prefix: Option<P>, start: Option<&<M as Mappable>::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<(<M as Mappable>::OwnedKey, <M as Mappable>::OwnedValue), Error>>
impl<T> JsonSchemaMaybe for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> StorageAsMut for T
impl<T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
Source§impl<T> StorageAsRef for T
impl<T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.