@tradeport/sui-trading-sdk 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/index.d.mts +38 -42
- package/dist/index.d.ts +38 -42
- package/dist/index.js +1081 -858
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1072 -859
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
- package/src/SuiTradingClient.ts +115 -38
- package/src/apiClients/suiClient.ts +3 -3
- package/src/constants.ts +2 -2
- package/src/graphql/queries/fetchBidsById.ts +2 -0
- package/src/helpers/getSuiToUsdRate.ts +1 -4
- package/src/helpers/track.ts +25 -0
- package/src/methods/acceptCollectionBid/acceptCollectionBid.ts +25 -5
- package/src/methods/acceptNftBids/acceptNftBids.ts +25 -5
- package/src/methods/buyAndExerciseLock/buyAndExerciseLock.ts +7 -3
- package/src/methods/buyListings/buyListings.ts +25 -6
- package/src/methods/claimNfts/claimNfts.ts +22 -5
- package/src/methods/createLock/createLock.ts +4 -4
- package/src/methods/exerciseLock/exerciseLock.ts +25 -18
- package/src/methods/listNfts/listNfts.ts +25 -1
- package/src/methods/placeCollectionBids/placeCollectionBids.ts +23 -4
- package/src/methods/placeNftBids/placeNftBids.ts +25 -2
- package/src/methods/removeCollectionBid/removeCollectionBid.ts +24 -1
- package/src/methods/removeNftBids/removeNftBids.ts +24 -1
- package/src/methods/transferNfts/transferNfts.ts +22 -5
- package/src/methods/unlistListings/unlistListings.ts +25 -4
- package/tsconfig.json +1 -0
- package/src/methods/withdrawKioskProfits/withdrawKioskProfits.ts +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @tradeport/sui-trading-sdk
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7367aa7: Attempt to fix the tracking
|
|
8
|
+
|
|
9
|
+
## 0.1.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 76cc78e: Added segment tracking for api usage
|
|
14
|
+
|
|
15
|
+
## 0.1.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 81447dc: Added tracking data
|
|
20
|
+
- d08af66: Added segment tracking in github actions
|
|
21
|
+
|
|
22
|
+
## 0.1.4
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 8d94834: Updated Price Lock contract package and store objects
|
|
27
|
+
|
|
3
28
|
## 0.1.3
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -20,12 +20,48 @@ type BuyListings = {
|
|
|
20
20
|
kioskTx?: KioskTransaction;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
type BuyLock = {
|
|
24
|
+
lockId: string;
|
|
25
|
+
tx?: Transaction;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type CancelLock = {
|
|
29
|
+
lockId: string;
|
|
30
|
+
walletAddress: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
23
33
|
type ClaimNfts = {
|
|
24
34
|
nftIds: string[];
|
|
25
35
|
walletAddress: string;
|
|
26
36
|
tx?: Transaction;
|
|
27
37
|
};
|
|
28
38
|
|
|
39
|
+
type CreateLockCommon = {
|
|
40
|
+
type: string;
|
|
41
|
+
nftType?: string;
|
|
42
|
+
collectionId?: string;
|
|
43
|
+
price: bigint;
|
|
44
|
+
};
|
|
45
|
+
type CreateLongLock = CreateLockCommon & {
|
|
46
|
+
type: 'long';
|
|
47
|
+
nftId: string;
|
|
48
|
+
walletAddress: string;
|
|
49
|
+
};
|
|
50
|
+
type CreateShortLock = CreateLockCommon & {
|
|
51
|
+
type: 'short';
|
|
52
|
+
nftType: string;
|
|
53
|
+
};
|
|
54
|
+
type CreateLock = CreateLongLock | CreateShortLock;
|
|
55
|
+
|
|
56
|
+
type ExerciseLock = {
|
|
57
|
+
lockId: string;
|
|
58
|
+
walletAddress: string;
|
|
59
|
+
bidId?: string;
|
|
60
|
+
listingId?: string;
|
|
61
|
+
nftId?: string;
|
|
62
|
+
tx?: Transaction;
|
|
63
|
+
};
|
|
64
|
+
|
|
29
65
|
type ListNfts = {
|
|
30
66
|
nfts: Array<{
|
|
31
67
|
id: string;
|
|
@@ -68,52 +104,13 @@ type UnlistListings = {
|
|
|
68
104
|
walletAddress: string;
|
|
69
105
|
};
|
|
70
106
|
|
|
71
|
-
type WithdrawKioskProfits = {
|
|
72
|
-
amount?: number;
|
|
73
|
-
walletAddress: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type CreateLockCommon = {
|
|
77
|
-
type: string;
|
|
78
|
-
nftType?: string;
|
|
79
|
-
collectionId?: string;
|
|
80
|
-
price: bigint;
|
|
81
|
-
};
|
|
82
|
-
type CreateLongLock = CreateLockCommon & {
|
|
83
|
-
type: 'long';
|
|
84
|
-
nftId: string;
|
|
85
|
-
walletAddress: string;
|
|
86
|
-
};
|
|
87
|
-
type CreateShortLock = CreateLockCommon & {
|
|
88
|
-
type: 'short';
|
|
89
|
-
nftType: string;
|
|
90
|
-
};
|
|
91
|
-
type CreateLock = CreateLongLock | CreateShortLock;
|
|
92
|
-
|
|
93
|
-
type CancelLock = {
|
|
94
|
-
lockId: string;
|
|
95
|
-
walletAddress: string;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type BuyLock = {
|
|
99
|
-
lockId: string;
|
|
100
|
-
tx?: Transaction;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
type ExerciseLock = {
|
|
104
|
-
lockId: string;
|
|
105
|
-
walletAddress: string;
|
|
106
|
-
bidId?: string;
|
|
107
|
-
listingId?: string;
|
|
108
|
-
nftId?: string;
|
|
109
|
-
tx?: Transaction;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
107
|
type ApiConfig = {
|
|
113
108
|
apiUser: string;
|
|
114
109
|
apiKey: string;
|
|
115
110
|
};
|
|
116
111
|
declare class SuiTradingClient {
|
|
112
|
+
private readonly apiUser;
|
|
113
|
+
private readonly apiKey;
|
|
117
114
|
constructor({ apiUser, apiKey }: ApiConfig);
|
|
118
115
|
buyListings({ listingIds, walletAddress }: BuyListings): Promise<Transaction>;
|
|
119
116
|
listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
|
|
@@ -126,7 +123,6 @@ declare class SuiTradingClient {
|
|
|
126
123
|
removeCollectionBid({ bidId }: RemoveCollectionBid): Promise<Transaction>;
|
|
127
124
|
transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
|
|
128
125
|
claimNfts({ nftIds, walletAddress }: ClaimNfts): Promise<Transaction>;
|
|
129
|
-
withdrawKioskProfits({ amount, walletAddress }: WithdrawKioskProfits): Promise<Transaction>;
|
|
130
126
|
createLock(args: CreateLock): Promise<Transaction>;
|
|
131
127
|
cancelLock(args: CancelLock): Promise<Transaction>;
|
|
132
128
|
buyLock(args: BuyLock): Promise<Transaction>;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,12 +20,48 @@ type BuyListings = {
|
|
|
20
20
|
kioskTx?: KioskTransaction;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
type BuyLock = {
|
|
24
|
+
lockId: string;
|
|
25
|
+
tx?: Transaction;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type CancelLock = {
|
|
29
|
+
lockId: string;
|
|
30
|
+
walletAddress: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
23
33
|
type ClaimNfts = {
|
|
24
34
|
nftIds: string[];
|
|
25
35
|
walletAddress: string;
|
|
26
36
|
tx?: Transaction;
|
|
27
37
|
};
|
|
28
38
|
|
|
39
|
+
type CreateLockCommon = {
|
|
40
|
+
type: string;
|
|
41
|
+
nftType?: string;
|
|
42
|
+
collectionId?: string;
|
|
43
|
+
price: bigint;
|
|
44
|
+
};
|
|
45
|
+
type CreateLongLock = CreateLockCommon & {
|
|
46
|
+
type: 'long';
|
|
47
|
+
nftId: string;
|
|
48
|
+
walletAddress: string;
|
|
49
|
+
};
|
|
50
|
+
type CreateShortLock = CreateLockCommon & {
|
|
51
|
+
type: 'short';
|
|
52
|
+
nftType: string;
|
|
53
|
+
};
|
|
54
|
+
type CreateLock = CreateLongLock | CreateShortLock;
|
|
55
|
+
|
|
56
|
+
type ExerciseLock = {
|
|
57
|
+
lockId: string;
|
|
58
|
+
walletAddress: string;
|
|
59
|
+
bidId?: string;
|
|
60
|
+
listingId?: string;
|
|
61
|
+
nftId?: string;
|
|
62
|
+
tx?: Transaction;
|
|
63
|
+
};
|
|
64
|
+
|
|
29
65
|
type ListNfts = {
|
|
30
66
|
nfts: Array<{
|
|
31
67
|
id: string;
|
|
@@ -68,52 +104,13 @@ type UnlistListings = {
|
|
|
68
104
|
walletAddress: string;
|
|
69
105
|
};
|
|
70
106
|
|
|
71
|
-
type WithdrawKioskProfits = {
|
|
72
|
-
amount?: number;
|
|
73
|
-
walletAddress: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type CreateLockCommon = {
|
|
77
|
-
type: string;
|
|
78
|
-
nftType?: string;
|
|
79
|
-
collectionId?: string;
|
|
80
|
-
price: bigint;
|
|
81
|
-
};
|
|
82
|
-
type CreateLongLock = CreateLockCommon & {
|
|
83
|
-
type: 'long';
|
|
84
|
-
nftId: string;
|
|
85
|
-
walletAddress: string;
|
|
86
|
-
};
|
|
87
|
-
type CreateShortLock = CreateLockCommon & {
|
|
88
|
-
type: 'short';
|
|
89
|
-
nftType: string;
|
|
90
|
-
};
|
|
91
|
-
type CreateLock = CreateLongLock | CreateShortLock;
|
|
92
|
-
|
|
93
|
-
type CancelLock = {
|
|
94
|
-
lockId: string;
|
|
95
|
-
walletAddress: string;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type BuyLock = {
|
|
99
|
-
lockId: string;
|
|
100
|
-
tx?: Transaction;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
type ExerciseLock = {
|
|
104
|
-
lockId: string;
|
|
105
|
-
walletAddress: string;
|
|
106
|
-
bidId?: string;
|
|
107
|
-
listingId?: string;
|
|
108
|
-
nftId?: string;
|
|
109
|
-
tx?: Transaction;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
107
|
type ApiConfig = {
|
|
113
108
|
apiUser: string;
|
|
114
109
|
apiKey: string;
|
|
115
110
|
};
|
|
116
111
|
declare class SuiTradingClient {
|
|
112
|
+
private readonly apiUser;
|
|
113
|
+
private readonly apiKey;
|
|
117
114
|
constructor({ apiUser, apiKey }: ApiConfig);
|
|
118
115
|
buyListings({ listingIds, walletAddress }: BuyListings): Promise<Transaction>;
|
|
119
116
|
listNfts({ nfts, walletAddress }: ListNfts): Promise<Transaction>;
|
|
@@ -126,7 +123,6 @@ declare class SuiTradingClient {
|
|
|
126
123
|
removeCollectionBid({ bidId }: RemoveCollectionBid): Promise<Transaction>;
|
|
127
124
|
transferNfts({ nftIds, recipientAddress, walletAddress }: TransferNfts): Promise<Transaction>;
|
|
128
125
|
claimNfts({ nftIds, walletAddress }: ClaimNfts): Promise<Transaction>;
|
|
129
|
-
withdrawKioskProfits({ amount, walletAddress }: WithdrawKioskProfits): Promise<Transaction>;
|
|
130
126
|
createLock(args: CreateLock): Promise<Transaction>;
|
|
131
127
|
cancelLock(args: CancelLock): Promise<Transaction>;
|
|
132
128
|
buyLock(args: BuyLock): Promise<Transaction>;
|