Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coming-chat/object-market
Object Market is a unique object trading marketplace in the Sui network.
https://github.com/coming-chat/object-market
blockchain nft sui
Last synced: 12 days ago
JSON representation
Object Market is a unique object trading marketplace in the Sui network.
- Host: GitHub
- URL: https://github.com/coming-chat/object-market
- Owner: coming-chat
- License: apache-2.0
- Created: 2022-12-01T10:07:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-11T01:58:41.000Z (over 1 year ago)
- Last Synced: 2024-08-01T02:26:07.956Z (3 months ago)
- Topics: blockchain, nft, sui
- Language: Move
- Homepage:
- Size: 15.6 KB
- Stars: 5
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sui - ObjectMarket - A unique object trading marketplace in the Sui network. (Code / DeFi)
- awesome-move - ObjectMarket - A unique object trading marketplace in the Sui network. (Code / DeFi)
README
# ObjectMarket
Object Market is a unique object trading marketplace in the Sui network.
## Core Object
- `module marketplace`
```move
struct MarketplaceConfig has key,store {
id: UID,
is_paused: bool,
fee_bps: u16,
admin: address,
beneficiary: address,
balance: Balance,
list_items: ObjectTable
}struct Listing has key, store {
id: UID,
price: u64,
owner: address,
nft_type: String
}
```- `module royalty`
```move
struct RoyaltyBag has key,store {
id: UID,
admin: address,
royalties: Bag
}struct RoyaltyNftTypeItem has key,store {
id: UID,
nft_type: String,
creator: address,
bps: u16
}
```## Public entry function
- `module marketplace````move
// set marketplace config
// called by admin
public entry fun set_marketplace(
mc: &mut MarketplaceConfig,
new_admin: address,
new_fee_bps: u16,
ctx: &mut TxContext
);// for emergency pause marketplace
// list,buy,change_price will be paused
// delist, force_batch_delist will be still available
// called by admin
public entry fun set_status(
mc: &mut MarketplaceConfig,
is_pause: bool,
ctx: &mut TxContext
);// force delist nft items
// called by admin
public entry fun force_batch_delist(
mc: &mut MarketplaceConfig,
item_ids: vector,
ctx: &mut TxContext
);// list nft item
// called by user
public entry fun list(
mc: &mut MarketplaceConfig,
item: NftType,
price: u64,
ctx: &mut TxContext
);// delist nft item
// called by user
public entry fun delist(
mc: &mut MarketplaceConfig,
item_id: ID,
ctx: &mut TxContext
);// change nft item price
// called by user
public entry fun change_price(
mc: &mut MarketplaceConfig,
item_id: ID,
new_price: u64,
ctx: &mut TxContext
);// buy nft item
// called by user
public entry fun buy(
mc: &mut MarketplaceConfig,
rb: &mut RoyaltyBag,
item_id: ID,
paid_coins: vector>,
ctx: &mut TxContext
)```
- `module royalty_fee`
```move
// set new admin
// called by admin
public entry fun set_admin(
rb: &mut RoyaltyBag,
new_admin: address,
ctx: &mut TxContext
);// set nft collection royalty
// called by admin
public entry fun set_royalty(
rb: &mut RoyaltyBag,
creator: address,
bps: u16,
ctx: &mut TxContext
);
```