Crates.io | spark-proxy-sdk |
lib.rs | spark-proxy-sdk |
version | 0.0.2 |
source | src |
created_at | 2024-11-06 10:11:02.419513 |
updated_at | 2024-11-06 10:11:02.419513 |
description | SDK for interacting with the Spark Proxy |
homepage | |
repository | https://github.com/compolabs/orderbook-contract |
max_upload_size | |
id | 1438067 |
size | 27,416 |
The Spark Proxy Contract SDK designed for Spark Market contract communication.
The sdk object as contract instance wrapper.
pub struct SparkProxyContract {
instance: SparkProxy<WalletUnlocked>,
}
pub async fn deploy(target: ContractId, owner: WalletUnlocked) -> anyhow::Result<Self>
Deploys proxy with market target.
target
The SparkMarketContract instance
owner
The Wallet object
Returns a SparkProxyContract instance
pub async fn set_proxy_target(
&self,
new_target: ContractId,
) -> anyhow::Result<CallResponse<()>>
Sets a new target(implementation) for proxy. Only proxy owner can call.
self
The SparkProxyContract instance
new_target
The SparkMarketContract instance
Returns a call result
async fn proxy_target(&self) -> anyhow::Result<CallResponse<Option<ContractId>>>
Withdraws assets from market caller account.
self
The SparkProxyContract instance
Returns an optional market contract id
pub async fn set_proxy_owner(
&self,
new_proxy_owner: State,
) -> anyhow::Result<CallResponse<()>>
Sets a new proxy owner. Ony proxy owner can call.
self
The SparkProxyContract instance
new_proxy_owner
A new proxy owner
Returns a call result
pub async fn proxy_owner(&self) -> anyhow::Result<CallResponse<State>>
Retrieves a proxy owner.
self
The SparkProxyContract instance
Returns a proxy owner