MetaClient

Struct MetaClient 

Source
pub struct MetaClient { /* private fields */ }

Implementations§

Source§

impl MetaClient

Source

pub fn new_target(target: MetaMinerTarget) -> Self

Source

pub fn new(miner_host: &str) -> Self

Source

pub fn with_timeout(self, request_timeout: Duration) -> Self

Source

pub async fn get_balance( &self, account: &ObjectId, coin_id: u8, ) -> BuckyResult<ViewBalanceResult>

Source

pub async fn trans( &self, from: &StandardObject, to: &ObjectId, v: i64, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn trans_ex( &self, from: TxCaller, to: &ObjectId, v: i64, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn trans_request( &self, from: &StandardObject, to: &ObjectId, v: i64, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn trans_request_ex( &self, from: TxCaller, to: &ObjectId, v: i64, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn create_tx_not_sign( &self, caller: TxCaller, body: MetaTxBody, gas_price: u16, max_fee: u32, tx_data: Vec<u8>, ) -> BuckyResult<Tx>

Source

pub async fn create_tx_not_sign2( &self, caller: TxCaller, bodys: Vec<MetaTxBody>, gas_price: u16, max_fee: u32, tx_data: Vec<u8>, ) -> BuckyResult<Tx>

Source

pub fn get_balance_request(&self, account: &ObjectId, coin_id: u8) -> Request

Source

pub fn view_request(&self, view: ViewRequest) -> Request

Source

pub async fn get_desc(&self, id: &ObjectId) -> BuckyResult<SavedMetaObject>

Source

pub fn get_raw_request(&self, id: &ObjectId) -> Request

Source

pub async fn get_raw_data(&self, id: &ObjectId) -> BuckyResult<Vec<u8>>

Source

pub async fn get_chain_status(&self) -> BuckyResult<ChainStatus>

Source

pub async fn get_block(&self, height: i64) -> BuckyResult<Block>

Source

pub fn get_desc_request(&self, id: &ObjectId) -> Request

Source

pub async fn create_desc( &self, owner: &StandardObject, desc: &SavedMetaObject, v: i64, price: u32, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn create_desc_ex( &self, caller: TxCaller, desc: &SavedMetaObject, v: i64, price: u32, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn create_desc_request( &self, owner: &StandardObject, desc: &SavedMetaObject, v: i64, coin_id: u8, price: u32, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn create_desc_request_ex( &self, owner: TxCaller, desc: &SavedMetaObject, v: i64, coin_id: u8, price: u32, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn update_desc( &self, owner: &StandardObject, desc: &SavedMetaObject, price: Option<u32>, coin_id: Option<u8>, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn update_desc_ex( &self, owner: TxCaller, desc: &SavedMetaObject, price: Option<u32>, coin_id: Option<u8>, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn update_desc_request( &self, owner: &StandardObject, desc: &SavedMetaObject, price: Option<u32>, coin_id: Option<u8>, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn update_desc_request_ex( &self, owner: TxCaller, desc: &SavedMetaObject, price: Option<u32>, coin_id: Option<u8>, secret: &PrivateKey, ) -> BuckyResult<Request>

Source

pub async fn bid_name( &self, caller: &StandardObject, owner: Option<ObjectId>, name: &str, price: u64, rent: u32, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn get_name( &self, name: &str, ) -> BuckyResult<Option<(NameInfo, NameState)>>

Source

pub async fn update_name( &self, caller: &StandardObject, name: &str, info: NameInfo, write_flag: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn trans_name( &self, caller: &StandardObject, new_owner: &ObjectId, sub_name: Option<&str>, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn get_tx_receipt( &self, tx_hash: &TxId, ) -> BuckyResult<Option<(Receipt, i64)>>

Source

pub async fn get_tx(&self, tx_hash: &TxId) -> BuckyResult<TxInfo>

Source

pub fn get_nonce_request(&self, account: &ObjectId) -> Request

Source

pub fn get_receipt_request(&self, tx: &TxId) -> Request

Source

pub async fn send_to_miner(&self, tx: MetaTx) -> BuckyResult<TxId>

Source

pub async fn request_miner<'de, T: RawDecode<'de>>( &self, req: Request, buf: &'de mut Vec<u8>, ) -> BuckyResult<T>

Source

pub async fn create_union_account( &self, caller: &StandardObject, create_union_tx: CreateUnionTx, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn create_deviate_tx( &self, caller: &StandardObject, deviate_tx: DeviateUnionTx, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn withdraw_union( &self, caller: &StandardObject, ctid: CoinTokenId, union_id: &ObjectId, value: i64, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn set_config( &self, caller: &StandardObject, key: &str, value: &str, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn auction_name( &self, caller: &StandardObject, name: &str, startting_price: u64, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn cancel_auction_name( &self, caller: &StandardObject, name: &str, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn buy_back_name( &self, caller: &StandardObject, name: &str, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn remove_desc( &self, caller: &StandardObject, desc_id: &ObjectId, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn withdraw_from_file( &self, caller: TxCaller, file_id: &ObjectId, v: i64, coin_id: u8, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn create_sub_chain_account( &self, caller: TxCaller, miner_group: MinerGroup, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn withdraw_from_sub_chain( &self, caller: TxCaller, coin_id: CoinTokenId, value: i64, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn commit_extension_tx( &self, caller: TxCaller, extension_tx: MetaExtensionTx, secret: &PrivateKey, tx_data: Vec<u8>, ) -> BuckyResult<TxId>

Source

pub async fn commit_tx(&self, tx: MetaTx) -> BuckyResult<TxId>

Source

pub async fn create_contract( &self, caller: &StandardObject, secret: &PrivateKey, value: u64, init_data: Vec<u8>, gas_price: u16, max_fee: u32, ) -> BuckyResult<TxId>

Source

pub async fn create_contract2( &self, caller: &StandardObject, secret: &PrivateKey, value: u64, init_data: Vec<u8>, salt: [u8; 32], gas_price: u16, max_fee: u32, ) -> BuckyResult<TxId>

Source

pub async fn call_contract( &self, caller: &StandardObject, secret: &PrivateKey, address: ObjectId, value: u64, data: Vec<u8>, gas_price: u16, max_fee: u32, ) -> BuckyResult<TxId>

Source

pub async fn view_contract( &self, address: ObjectId, data: Vec<u8>, ) -> BuckyResult<ViewContractResult>

Source

pub async fn set_benefi( &self, address: &ObjectId, benefi: &ObjectId, caller: &StandardObject, secret: &PrivateKey, ) -> BuckyResult<TxId>

Source

pub async fn get_benefi(&self, address: &ObjectId) -> BuckyResult<ObjectId>

Source

pub async fn get_logs( &self, address: ObjectId, topics: Vec<Option<H256>>, from: i64, to: i64, ) -> BuckyResult<Vec<(Vec<H256>, Vec<u8>)>>

Source

pub async fn nft_create( &self, caller: TxCaller, secret: &PrivateKey, desc: NFTDesc, name: String, state: NFTState, ) -> BuckyResult<TxId>

Source

pub async fn nft_get( &self, nft_id: ObjectId, ) -> BuckyResult<(NFTDesc, String, ObjectId, NFTState)>

Source

pub async fn nft_get_apply_buy_list( &self, nft_id: ObjectId, offset: u32, length: u8, ) -> BuckyResult<ViewNFTBuyListResult>

Source

pub async fn nft_get_bid_list( &self, nft_id: ObjectId, offset: u32, length: u8, ) -> BuckyResult<ViewNFTBuyListResult>

Source

pub async fn nft_get_largest_buy_price( &self, nft_id: ObjectId, ) -> BuckyResult<Option<(ObjectId, CoinTokenId, u64)>>

Source

pub async fn nft_auction( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, price: u64, coin_id: CoinTokenId, duration_block_num: u64, ) -> BuckyResult<TxId>

Source

pub async fn nft_bid( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, price: u64, coin_id: CoinTokenId, ) -> BuckyResult<TxId>

Source

pub async fn nft_buy( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, price: u64, coin_id: CoinTokenId, ) -> BuckyResult<TxId>

Source

pub async fn nft_sell( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, price: u64, coin_id: CoinTokenId, duration_block_num: u64, ) -> BuckyResult<TxId>

Source

pub async fn nft_apply_buy( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, price: u64, coin_id: CoinTokenId, ) -> BuckyResult<TxId>

Source

pub async fn nft_cancel_apply_buy( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, ) -> BuckyResult<TxId>

Source

pub async fn nft_agree_apply( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, user_id: ObjectId, ) -> BuckyResult<TxId>

Source

pub async fn nft_like( &self, caller: TxCaller, secret: &PrivateKey, nft_id: ObjectId, ) -> BuckyResult<TxId>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,