Skip to content

[fastx client api] Expand the Rust Client API #63

Closed
@patrickkuo

Description

The current client API supports transfer, receive and get balance

It should be expended to support all the operations supported by OrderKind.

Also get_spendable_amount should be replaced by get_possesed_objects as we no longer have the concept of balance in the system.

The expended Client should contains the following functions :

fn transfer_to_fastpay(
    &mut self, 
    object_id: ObjectID, 
    recipient: FastPayAddress, 
    user_data: UserData
) -> AsyncResult<CertifiedOrder, Error>
fn transfer_to_primary(
    &mut self,
    object_id: ObjectID,
    recipient: PrimaryAddress,
    user_data: UserData,
) -> AsyncResult<CertifiedOrder, Error>
fn publish_module(
    &mut self, 
    gas_payment: ObjectRef, 
    module_bytes: Dec<u8>
) -> AsyncResult<CertifiedOrder, Error>
fn call_module(
    &mut self, 
    module: ModuleId,
    function: Identifier,
    type_arguments: Vec<TypeTag>,
    gas_payment: ObjectRef,
    object_arguments: Vec<ObjectRef>,
    pure_arguments: Vec<Vec<u8>>,
    gas_budget: u64,
) -> AsyncResult<CertifiedOrder, Error>
fn receive_from_fastpay(
    &mut self,
    certificate: CertifiedOrder,
) -> AsyncResult<(), Error> 
fn get_possesed_objects(&mut self) -> AsyncResult<Vec<ObjectRef>, Error>

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions