Skip to content

Actions

hugomartinez edited this page Dec 11, 2023 · 8 revisions

init

Parameters:

None

Description:

Initializes the config table if it hasn't been initialized before, otherwise does nothing. Has to be called once after deploying the contract.

Required Authorization:

atomicmarket account.


setminbidinc

Parameters:

Type Name Description
double minimum_bid_increase New minimum bid increase

Description:

Set the minimum bid increase that will be stored in the config table.

Required Authorization:

atomicmarket account.


setversion

Parameters:

Type Name Description
string new_version New version

Description:

Updates the version in the config table.

Required Authorization:

atomicmarket account.


addconftoken

Parameters:

Type Name Description
name token_contract Contract that the token is stored in
symbol token_symbol Symbol of the token

Description:

Adds a new TOKEN to the supported_tokens vector in the config.

Required Authorization:

atomicmarket account.


adddelphi

Parameters:

Type Name Description
name delphi_pair_name Name of the pair in the delphioracle account
bool invert_delphi_pair If true, the price coming from the delphioracle is inverted
symbol listing_symbol Symbol that the sales using this pair will be listed for
symbol settlement_symbol Symbol that the sales using this pair will be paid in

Description:

Adds a new SYMBOLPAIR to the supported_symbol_pairs vector in the config. See Sales for more details.

Required Authorization:

atomicmarket account.


setmarketfee

Parameters:

Type Name Description
double maker_market_fee Fee that the maker market of a sale / auction will receive
double taker_market_fee Fee that the taker market of a sale / auction will receive

Description:

Sets the maker_market_fee and taker_market_fee values in the config.

Required Authorization:

atomicmarket account.


regmarket

Parameters:

Type Name Description
name creator Creator of the marketplace. This account will get any fees generated.
name marketplace_name Name of the marketplace

Description:

Creates a new marketplace. See Creating a marketplace for more details.

Required Authorization:

<creator>


withdraw

Parameters:

Type Name Description
name owner Account to withdraw balance from
asset token_to_withdraw The token and amount to withdraw

Description:

Withdraws a token from owner's balance

Required Authorization:

<owner>


announcesale

Parameters:

Type Name Description
name seller Seller
vector<uint64_t> asset_ids IDs of the assets to sell. They must all belong to the same collection.
asset listing_price Listing price of the sale
symbol settlement_symbol Symbol that the sale will be paid in. See Sales for more details.
name maker_marketplace Name of the marketplace facilitating the listing. Can be left empty, then a default marketplace will be used.

Description:

Announces a sale. The seller needs to own all of the assets specified in the asset_ids vector, they must all belong to the same collection and must all be transferable. See Sales for more details.

Required Authorization:

<seller>


cancelsale

Parameters:

Type Name Description
uint64_t sale_id ID of the sale to cancel

Description:

Cancels a sale. If an offer for this sale has already been created by the seller which still exists, it is declined.

A sale is considered invalid if either an offer for it has been created in the past but has been cancelled by the seller, or if the seller does not own at least one of the assets listed in this sale. If a sale is invalid, no authorization is required to cancel it.

Required Authorization:

Seller of the sale if the sale is valid, otherwise none


purchasesale

Parameters:

Type Name Description
name buyer Buyer
uint64_t sale_id ID of the sale to purchase
uint64_t intended_delphi_median 0 when the sale is a direct sale, delphi median to use when the sale is a delphi sale. See Sales for more details
name taker_marketplace Name of the marketplace facilitating the purchase. Can be left empty, then a default marketplace will be used.

Description:

Purchases a sale. The price is deducted from the buyer's balance table entry.

If the sale is a direct sale (symbol of listing_price is the same as settlement_symbol), the intended_delphi_median must be 0.

Otherwise, intended_delphi_median is the delphi median to use for the sale. This value must be present in the delphioracle's datapoints table for the delphi pair used, otherwise the purchase action will throw.

This system (instead of e.g. always using the newest median in the delphioracle contract) is used in order to know for certain the price that will be paid for the asset at the time of signing the action.

Required Authorization:

<buyer>


announceauct

Parameters:

Type Name Description
name seller Seller / Creator of the auction
vector<uint64_t> asset_ids IDs of the assets to auction
asset starting_bid Starting bid
uint32_t duration Duration until the auction ends in seconds
name maker_marketplace Name of the marketplace facilitating the listing. Can be left empty, then a default marketplace will be used.

Description:

Announces an auction. The seller needs to own all of the assets specified in the asset_ids vector, they must all belong to the same collection and must all be transferable.

Required Authorization:

<seller>


cancelauct

Parameters:

Type Name Description
uint64_t auction_id ID of the auction to cancel

Description:

Cancels an auction. An auction can only be cancelled if nobody has bid on it yet. If the seller has already transferred the assets for this auction to the AtomicMarket account, they are sent back.

An auction is considered invalid if the assets have not yet been transferred to the AtomicMarket account and the seller does not own at least one of the assets listed in this auction. If an auction is invalid, no authorization is required to cancel it.

Required Authorization:

Seller / Creator of the auction if the auction is valid, otherwise none


auctionbid

Parameters:

Type Name Description
name bidder Bidder
uint64_t auction_id ID of the auction to bid on
asset bid Bid to place
name taker_marketplace Name of the marketplace facilitating the bid. Can be left empty, then a default marketplace will be used.

Description:

Places a bid on an auction.

If the auction has no previous bidders, the bid must be at least as big as the starting bid (stored in the current_bid field).

If the auction has a previous bidder, the bid must be bigger than the previous bid by at least minimum_bid_increase (stored in the config singleton).

If the auction would end in less than auction_reset_duration seconds (stored in the config singleton), the auction's end time is set to auction_reset_duration seconds in the future.

Required Authorization:

<bidder>


auctclaimbuy

Parameters:

Type Name Description
uint64_t auction_id ID of the auction to claim the assets of

Description:

Claims the assets won in an auction as the highest bidder.

Required Authorization:

The buyer / highest bidder of the auction


auctclaimsel

Parameters:

Type Name Description
uint64_t auction_id ID of the auction to claim the tokens of

Description:

Claims the tokens won in an auction as the seller.

Required Authorization:

The seller / creator of the auction


acceptbuyo

Parameters:

Type Name Description
uint64_t buyoffer_id ID of the buyoffer
vector<uint64_t> expected_asset_ids Asset IDs included in the buyoffer
asset expected_price Price of the buyoffer
name taker_marketplace Name of the marketplace facilitating the purchase. Can be left empty, then a default marketplace will be used.

Description:

Accepts a buyoffer. The assets and price must match the ones specified in the buyoffer. See Buyoffers for more details.

Required Authorization:

<recipient>


cancelbuyo

Parameters:

Type Name Description
uint64_t buyoffer_id ID of the buyoffer

Description:

Cancels a buyoffer.

Required Authorization:

<buyer>


createbuyo

Parameters:

Type Name Description
name buyer Buyer
name recipient Owner of the assets
asset price Price of the buyoffer
vector<uint64_t> asset_ids IDs of the assets
string memo Message for the recipient (256 chars max)
name maker_marketplace Name of the marketplace facilitating the listing. Can be left empty, then a default marketplace will be used.

Description:

Creates a buyoffer. The recipient needs to own all the assets specified in the asset_ids vector, they must all belong to the same collection and must all be transferable. See Buyoffers for more details.

Required Authorization:

<buyer>


declinebuyo

Parameters:

Type Name Description
uint64_t buyoffer_id IDs of the buyoffer
string decline_memo Message for buyer

Description:

Declines a buyoffer.

Required Authorization:

<recipient>


canceltbuyo

Parameters:

Type Name Description
uint64_t buyoffer_id ID of the template buyoffer

Description:

Cancels a template buyoffer.

Required Authorization:

<buyer>


createtbuyo

Parameters:

Type Name Description
name buyer Buyer
asset price Price of the buyoffer
name collection_name Collection name of the template
uint64 template_id Template ID to buy
name maker_marketplace Name of the marketplace facilitating the listing. Can be left empty, then a default marketplace will be used.

Description:

Creates a template buyoffer. See Template Buyoffers for more details.

Required Authorization:

<buyer>


fulfilltbuyo

Parameters:

Type Name Description
name seller Seller, owner of the template
uint64_t buyoffer_id ID of the template buyoffer
uint64_t asset_id Asset ID to be sold
asset expected_price Price of the buyoffer
name taker_marketplace Name of the marketplace facilitating the purchase. Can be left empty, then a default marketplace will be used.

Description:

Fulfills a buyoffer. The price and the asset's template_id must match the ones specified in the template buyoffer. See Template Buyoffers for more details.

Required Authorization:

<seller>


paysaleram

Parameters:

Type Name Description
name payer Account that will pay for the RAM
uint64_t sale_id ID of the sale to pay the RAM for

Description:

Pays for the RAM costs of a sale. This is useful e.g. for dapps that want to pay the RAM of sales of assets of their collection by running an off-chain script that automatically calls this action.

Required Authorization:

<payer>


payauctram

Parameters:

Type Name Description
name payer Account that will pay for the RAM
uint64_t auction_id ID of the auction to pay the RAM for

Description:

Pays for the RAM costs of an auction. This is useful e.g. for dapps that want to pay the RAM of auctions of assets of their collection by running an off-chain script that automatically calls this action.

Required Authorization:

<payer>


paybuyoram

Parameters:

Type Name Description
name payer Account that will pay for the RAM
uint64_t buyoffer_id ID of the buyoffer to pay the RAM for

Description:

Pays for the RAM costs of a buyoffer. This is useful e.g. for dapps that want to pay the RAM of auctions of assets of their collection by running an off-chain script that automatically calls this action.

Required Authorization:

<payer>

Clone this wiki locally