-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmarketplace.did
101 lines (101 loc) · 3.05 KB
/
marketplace.did
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
type Collection = record {
collection_fee : nat;
creation_time : nat64;
nft_canister_standard : NFTStandard;
owner : principal;
collection_name : text;
fungible_volume : nat;
fungible_canister_standard : FungibleStandard;
fungible_canister_id : principal;
nft_canister_id : principal;
};
type FungibleStandard = variant { DIP20 };
type Listing = record {
fee : vec record { text; principal; nat };
status : ListingStatus;
created : nat64;
seller : principal;
price : nat;
};
type ListingStatus = variant { Selling; Uninitialized; Created };
type MPApiError = variant {
TransferFromFungibleError : text;
NonExistentCollection;
NoDeposit;
InvalidListingStatus;
InsufficientFungibleBalance;
InvalidListing;
TransferFromNonFungibleError : text;
TransferNonFungibleError;
Unauthorized;
InsufficientFungibleAllowance;
TransferFungibleError;
InvalidOffer;
InvalidOwner;
Other : text;
InsufficientNonFungibleBalance;
InvalidOfferStatus;
InvalidOperator;
CAPInsertionError;
};
type NFTStandard = variant { EXT; DIP721v2 };
type Offer = record {
status : OfferStatus;
created : nat64;
token_id : nat;
token_owner : principal;
buyer : principal;
price : nat;
nft_canister_id : principal;
};
type OfferStatus = variant {
Bought;
Uninitialized;
Denied;
Cancelled;
Created;
};
type Result = variant { Ok; Err : MPApiError };
type Result_1 = variant { Ok : vec TxLogEntry; Err : MPApiError };
type Result_2 = variant { Ok : nat; Err : MPApiError };
type Result_3 = variant { Ok : Listing; Err : MPApiError };
type TxLogEntry = record { to : principal; from : principal; memo : text };
service : (principal, nat, opt principal) -> {
acceptOffer : (principal, nat, principal) -> (Result);
addCollection : (
principal,
nat,
nat64,
text,
principal,
NFTStandard,
principal,
FungibleStandard,
) -> (Result);
balanceOf : (principal) -> (vec record { principal; nat }) query;
cancelListing : (principal, nat) -> (Result);
cancelOffer : (principal, nat) -> (Result);
denyOffer : (principal, nat, principal) -> (Result);
dfxInfo : () -> (text) query;
directBuy : (principal, nat) -> (Result);
failed_log : () -> (Result_1) query;
fix_balance : (principal, principal, nat) -> (Result);
getAllBalances : () -> (
vec record { record { principal; principal }; nat },
) query;
getBuyerOffers : (principal, principal) -> (vec Offer) query;
getCollections : () -> (vec record { principal; Collection }) query;
getFloor : (principal) -> (Result_2) query;
getProtocolFee : () -> (nat) query;
getTokenListing : (principal, nat) -> (Result_3) query;
getTokenOffers : (principal, vec nat) -> (
vec record { nat; vec Offer },
) query;
gitCommitHash : () -> (text) query;
makeListing : (principal, nat, nat) -> (Result);
makeOffer : (principal, nat, nat) -> (Result);
rustToolchainInfo : () -> (text) query;
setProtocolFee : (nat) -> (Result);
verify_listing : (principal, nat) -> (Result);
withdrawFungible : (principal, FungibleStandard) -> (Result);
}