Skip to content

Latest commit

 

History

History
93 lines (69 loc) · 2.49 KB

TraderFactory.md

File metadata and controls

93 lines (69 loc) · 2.49 KB

TraderFactory

Function ICLWithdraw

func ICLWithdraw(_to : ICRC1.Account, _amount : Nat) : async ()

Admin: Withdraw ICL

Function config

func config(_args : { BLACKHOLE : ?Principal; SYSTOKEN : ?Principal; SYSTOKEN_FEE : ?Nat; TRADER_CREATION_FEE : ?Nat }) : async ()

Admin: Config

Function getConfig

func getConfig() : async { BLACKHOLE : Principal; SYSTOKEN : Principal; SYSTOKEN_FEE : Nat; TRADER_CREATION_FEE : Nat }

Returns configurations

Function create

func create(_name : Text, _initPair : Principal, _traderOwner : ?Principal, _sa : ?[Nat8]) : async ?Principal

Create a trader.
Creating a Trader Canister requires payment of TRADER_CREATION_FEE ICLs, which are used to add an initial 0.5 T Cycles to the canister.
Note: The controller of Trader Canister is the creator, and the Cycles balance of the canister needs to be monitored and topped up by the creator.
WARNING: If the Cycles balance of Trader Canister is insufficient, it may result in the deletion of the canister, which will result in the loss of all assets in the canister. The creator needs to monitor the Cycles balance of the canister at all times!

Function modifyTrader

func modifyTrader(_trader : Principal, _name : ?Text, _newOwner : ?AccountId, _sa : ?[Nat8]) : async Bool

Modify the Trader.

Function deleteTrader

func deleteTrader(_trader : Principal, _sa : ?[Nat8]) : async Bool

Delete from the Trader list of the 'user' account. (Note: not deleting Trader Canister).

Function getTraders

func getTraders(_user : AccountId) : async ?[Trader]

get user's Traders

Function getMemory

func getMemory() : async (Nat, Nat, Nat)

Admin: Canister memory

Function cyclesWithdraw

func cyclesWithdraw(_wallet : Principal, _amount : Nat) : async ()

Admin: Cycles withdraw

Function drc207

func drc207() : async DRC207.DRC207Support

DRC207 support

Function canister_status

func canister_status() : async DRC207.canister_status

canister_status

Function wallet_receive

func wallet_receive() : async ()

receive cycles