@zoralabs/coins-sdk 0.0.2-sdkalpha.8 → 0.0.3
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 +13 -0
- package/README.md +834 -410
- package/dist/actions/createCoin.d.ts +4 -3
- package/dist/actions/createCoin.d.ts.map +1 -1
- package/dist/actions/tradeCoin.d.ts +5 -4
- package/dist/actions/tradeCoin.d.ts.map +1 -1
- package/dist/actions/updateCoinURI.d.ts +4 -3
- package/dist/actions/updateCoinURI.d.ts.map +1 -1
- package/dist/actions/updatePayoutRecipient.d.ts +4 -3
- package/dist/actions/updatePayoutRecipient.d.ts.map +1 -1
- package/dist/api/explore.d.ts +9 -10
- package/dist/api/explore.d.ts.map +1 -1
- package/dist/api/queries.d.ts +105 -11
- package/dist/api/queries.d.ts.map +1 -1
- package/dist/api/query-types.d.ts +3 -0
- package/dist/api/query-types.d.ts.map +1 -0
- package/dist/index.cjs +55 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/createCoin.ts +2 -2
- package/src/actions/tradeCoin.ts +3 -4
- package/src/actions/updateCoinURI.ts +2 -2
- package/src/actions/updatePayoutRecipient.ts +2 -2
- package/src/api/explore.ts +36 -25
- package/src/api/queries.ts +22 -9
- package/src/api/query-types.ts +8 -0
- package/src/index.ts +1 -0
- package/dist/utils/retries.d.ts +0 -7
- package/dist/utils/retries.d.ts.map +0 -1
- package/src/utils/retries.ts +0 -49
package/README.md
CHANGED
|
@@ -13,11 +13,15 @@ All the SDK functions are accessible from the main export (for example: `import
|
|
|
13
13
|
## Table of Contents
|
|
14
14
|
|
|
15
15
|
### Onchain Actions
|
|
16
|
+
|
|
17
|
+
|
|
16
18
|
- [createCoin](#1-createcoin-creates-a-new-coin-with-the-given-parameters-to-trade)
|
|
17
19
|
- [tradeCoin](#2-tradecoin-buys-or-sells-an-existing-coin)
|
|
18
20
|
- [updateCoinURI](#3-updatecoinuri-updates-the-uri-for-an-existing-coin)
|
|
19
21
|
|
|
20
22
|
### Queries
|
|
23
|
+
|
|
24
|
+
|
|
21
25
|
- [On chain queries](#onchain-queries)
|
|
22
26
|
- [getOnchainCoinDetails](#1-getonchaincoindetails-gets-details-for-the-given-coin-from-the-blockchain)
|
|
23
27
|
- [API Queries](#3-api-queries)
|
|
@@ -42,122 +46,229 @@ These are functions that interact directly with the blockchain and require trans
|
|
|
42
46
|
|
|
43
47
|
### 1. `createCoin`: Creates a new coin with the given parameters to trade.
|
|
44
48
|
|
|
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
|
-
|
|
49
|
+
**Key Parameters:**
|
|
50
|
+
|
|
51
|
+
- `name`: The name of the new coin.
|
|
52
|
+
- `symbol`: The symbol for the new coin.
|
|
53
|
+
- `uri`: The URI for the coin metadata.
|
|
54
|
+
- `owners`: An array of owner addresses. (Optional)
|
|
55
|
+
- `payoutRecipient`: The address that will receive the payout.
|
|
56
|
+
- `platformReferrer`: The referrer address for the platform that earns referral fees. (Optional)
|
|
57
|
+
- `initialPurchaseWei`: The initial purchase amount in Wei. (Optional)
|
|
58
|
+
**Key Parameters:**
|
|
59
|
+
|
|
60
|
+
- `name`: The name of the new coin.
|
|
61
|
+
- `symbol`: The symbol for the new coin.
|
|
62
|
+
- `uri`: The URI for the coin metadata.
|
|
63
|
+
- `owners`: An array of owner addresses. (Optional)
|
|
64
|
+
- `payoutRecipient`: The address that will receive the payout.
|
|
65
|
+
- `platformReferrer`: The referrer address for the platform that earns referral fees. (Optional)
|
|
66
|
+
- `initialPurchaseWei`: The initial purchase amount in Wei. (Optional)
|
|
67
|
+
|
|
68
|
+
**Usage:**
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const createCoinParams = {
|
|
72
|
+
name: "MyCoin",
|
|
73
|
+
symbol: "MYC",
|
|
74
|
+
uri: "https://example.com/metadata",
|
|
75
|
+
payoutRecipient: "0xRecipientAddress",
|
|
76
|
+
};
|
|
77
|
+
**Usage:**
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const createCoinParams = {
|
|
81
|
+
name: "MyCoin",
|
|
82
|
+
symbol: "MYC",
|
|
83
|
+
uri: "https://example.com/metadata",
|
|
84
|
+
payoutRecipient: "0xRecipientAddress",
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const result = await createCoin(createCoinParams, walletClient, publicClient);
|
|
88
|
+
console.log(result);
|
|
89
|
+
```
|
|
90
|
+
const result = await createCoin(createCoinParams, walletClient, publicClient);
|
|
91
|
+
console.log(result);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Lower Level Call Method with WAGMI:**
|
|
95
|
+
Use the `createCoinCall` function to get the contract call parameters and then use WAGMI's `useContractWrite` hook.
|
|
96
|
+
**Lower Level Call Method with WAGMI:**
|
|
97
|
+
Use the `createCoinCall` function to get the contract call parameters and then use WAGMI's `useContractWrite` hook.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
const createCoinParams = {
|
|
101
|
+
name: "MyCoin",
|
|
102
|
+
symbol: "MYC",
|
|
103
|
+
uri: "https://example.com/metadata",
|
|
104
|
+
payoutRecipient: "0xRecipientAddress",
|
|
105
|
+
};
|
|
106
|
+
```typescript
|
|
107
|
+
const createCoinParams = {
|
|
108
|
+
name: "MyCoin",
|
|
109
|
+
symbol: "MYC",
|
|
110
|
+
uri: "https://example.com/metadata",
|
|
111
|
+
payoutRecipient: "0xRecipientAddress",
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const { config } = createCoinCall(createCoinParams);
|
|
115
|
+
const { write } = useContractWrite(config);
|
|
116
|
+
const { config } = createCoinCall(createCoinParams);
|
|
117
|
+
const { write } = useContractWrite(config);
|
|
118
|
+
|
|
119
|
+
write(); // Execute the contract write
|
|
120
|
+
// the receipt can be parsed from `getCoinCreateFromLogs(receipt.logs)`
|
|
121
|
+
```
|
|
122
|
+
write(); // Execute the contract write
|
|
123
|
+
// the receipt can be parsed from `getCoinCreateFromLogs(receipt.logs)`
|
|
124
|
+
```
|
|
84
125
|
|
|
85
126
|
### 2. `tradeCoin`: Buys or sells an existing coin.
|
|
86
127
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
**Key Parameters:**
|
|
129
|
+
|
|
130
|
+
- `direction`: The trade direction, either 'buy' or 'sell'.
|
|
131
|
+
- `target`: The target coin contract address.
|
|
132
|
+
- `args`: The trade arguments.
|
|
133
|
+
- `recipient`: The recipient of the trade output.
|
|
134
|
+
- `orderSize`: The size of the order.
|
|
135
|
+
- `minAmountOut`: The minimum amount to receive. (Optional)
|
|
136
|
+
- `sqrtPriceLimitX96`: The price limit for the trade. (Optional)
|
|
137
|
+
- `tradeReferrer`: The platform referrer fee recipient address for the trade. (Optional)
|
|
138
|
+
**Key Parameters:**
|
|
139
|
+
|
|
140
|
+
- `direction`: The trade direction, either 'buy' or 'sell'.
|
|
141
|
+
- `target`: The target coin contract address.
|
|
142
|
+
- `args`: The trade arguments.
|
|
143
|
+
- `recipient`: The recipient of the trade output.
|
|
144
|
+
- `orderSize`: The size of the order.
|
|
145
|
+
- `minAmountOut`: The minimum amount to receive. (Optional)
|
|
146
|
+
- `sqrtPriceLimitX96`: The price limit for the trade. (Optional)
|
|
147
|
+
- `tradeReferrer`: The platform referrer fee recipient address for the trade. (Optional)
|
|
148
|
+
|
|
149
|
+
**Usage:**
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
const tradeParams = {
|
|
153
|
+
direction: "buy",
|
|
154
|
+
target: "0xTargetAddress",
|
|
155
|
+
args: {
|
|
156
|
+
recipient: "0xRecipientAddress",
|
|
157
|
+
orderSize: 1000n,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
**Usage:**
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
const tradeParams = {
|
|
164
|
+
direction: "buy",
|
|
165
|
+
target: "0xTargetAddress",
|
|
166
|
+
args: {
|
|
167
|
+
recipient: "0xRecipientAddress",
|
|
168
|
+
orderSize: 1000n,
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const result = await tradeCoin(tradeParams, walletClient, publicClient);
|
|
173
|
+
console.log(result);
|
|
174
|
+
```
|
|
175
|
+
const result = await tradeCoin(tradeParams, walletClient, publicClient);
|
|
176
|
+
console.log(result);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Lower Level Call Method with WAGMI:**
|
|
180
|
+
Use the `tradeCoinCall` function to get the contract call parameters and then use WAGMI's `useContractWrite` hook.
|
|
181
|
+
**Lower Level Call Method with WAGMI:**
|
|
182
|
+
Use the `tradeCoinCall` function to get the contract call parameters and then use WAGMI's `useContractWrite` hook.
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
const tradeParams = {
|
|
186
|
+
direction: "buy",
|
|
187
|
+
target: "0xTargetAddress",
|
|
188
|
+
args: {
|
|
189
|
+
recipient: "0xRecipientAddress",
|
|
190
|
+
orderSize: 1000n,
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
```typescript
|
|
194
|
+
const tradeParams = {
|
|
195
|
+
direction: "buy",
|
|
196
|
+
target: "0xTargetAddress",
|
|
197
|
+
args: {
|
|
198
|
+
recipient: "0xRecipientAddress",
|
|
199
|
+
orderSize: 1000n,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const { config } = tradeCoinCall(tradeParams);
|
|
204
|
+
const { write } = useContractWrite(config);
|
|
205
|
+
const { config } = tradeCoinCall(tradeParams);
|
|
206
|
+
const { write } = useContractWrite(config);
|
|
207
|
+
|
|
208
|
+
write(); // Execute the contract write
|
|
209
|
+
// the receipt can be parsed from `getTradeFromLogs(receipt.logs)`
|
|
210
|
+
```
|
|
211
|
+
write(); // Execute the contract write
|
|
212
|
+
// the receipt can be parsed from `getTradeFromLogs(receipt.logs)`
|
|
213
|
+
```
|
|
131
214
|
|
|
132
215
|
### 3. `updateCoinURI`: Updates the URI for an existing coin.
|
|
133
216
|
|
|
134
|
-
|
|
135
|
-
- `coin`: The coin contract address.
|
|
136
|
-
- `newURI`: The new URI for the coin metadata (must start with "ipfs://").
|
|
217
|
+
**Key Parameters:**
|
|
137
218
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
coin: "0xCoinAddress",
|
|
142
|
-
newURI: "ipfs://new-metadata-uri",
|
|
143
|
-
};
|
|
219
|
+
- `coin`: The coin contract address.
|
|
220
|
+
- `newURI`: The new URI for the coin metadata (must start with "ipfs://").
|
|
221
|
+
**Key Parameters:**
|
|
144
222
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```
|
|
223
|
+
- `coin`: The coin contract address.
|
|
224
|
+
- `newURI`: The new URI for the coin metadata (must start with "ipfs://").
|
|
148
225
|
|
|
149
|
-
|
|
150
|
-
```typescript
|
|
151
|
-
const updateParams = {
|
|
152
|
-
coin: "0xCoinAddress",
|
|
153
|
-
newURI: "ipfs://new-metadata-uri",
|
|
154
|
-
};
|
|
226
|
+
**Usage:**
|
|
155
227
|
|
|
156
|
-
|
|
157
|
-
|
|
228
|
+
```typescript
|
|
229
|
+
const updateParams = {
|
|
230
|
+
coin: "0xCoinAddress",
|
|
231
|
+
newURI: "ipfs://new-metadata-uri",
|
|
232
|
+
};
|
|
233
|
+
**Usage:**
|
|
158
234
|
|
|
159
|
-
|
|
160
|
-
|
|
235
|
+
```typescript
|
|
236
|
+
const updateParams = {
|
|
237
|
+
coin: "0xCoinAddress",
|
|
238
|
+
newURI: "ipfs://new-metadata-uri",
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const result = await updateCoinURI(updateParams, walletClient, publicClient);
|
|
242
|
+
console.log(result);
|
|
243
|
+
```
|
|
244
|
+
const result = await updateCoinURI(updateParams, walletClient, publicClient);
|
|
245
|
+
console.log(result);
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Lower Level Call Method with WAGMI:**
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
const updateParams = {
|
|
252
|
+
coin: "0xCoinAddress",
|
|
253
|
+
newURI: "ipfs://new-metadata-uri",
|
|
254
|
+
};
|
|
255
|
+
**Lower Level Call Method with WAGMI:**
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
const updateParams = {
|
|
259
|
+
coin: "0xCoinAddress",
|
|
260
|
+
newURI: "ipfs://new-metadata-uri",
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const { config } = updateCoinURICall(updateParams);
|
|
264
|
+
const { write } = useContractWrite(config);
|
|
265
|
+
const { config } = updateCoinURICall(updateParams);
|
|
266
|
+
const { write } = useContractWrite(config);
|
|
267
|
+
|
|
268
|
+
write(); // Execute the contract write
|
|
269
|
+
```
|
|
270
|
+
write(); // Execute the contract write
|
|
271
|
+
```
|
|
161
272
|
|
|
162
273
|
## Onchain Queries
|
|
163
274
|
|
|
@@ -168,293 +279,590 @@ These are functions that read data from the blockchain or API without requiring
|
|
|
168
279
|
This query retrieves the most up-to-date coin information directly from the blockchain.
|
|
169
280
|
It is strongly recommended to use the other API queries to fetch this information if possible.
|
|
170
281
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
282
|
+
**Key Parameters:**
|
|
283
|
+
|
|
284
|
+
- `coin`: The coin contract address.
|
|
285
|
+
- `user`: The user address to check balance for. (Optional)
|
|
286
|
+
- `publicClient`: The viem public client instance.
|
|
287
|
+
**Key Parameters:**
|
|
288
|
+
|
|
289
|
+
- `coin`: The coin contract address.
|
|
290
|
+
- `user`: The user address to check balance for. (Optional)
|
|
291
|
+
- `publicClient`: The viem public client instance.
|
|
175
292
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
293
|
+
**Return Value:**
|
|
294
|
+
|
|
295
|
+
- `balance`: The user's balance of the coin.
|
|
296
|
+
- `marketCap`: The market cap of the coin.
|
|
297
|
+
- `liquidity`: The liquidity of the coin.
|
|
298
|
+
- `pool`: Pool address.
|
|
299
|
+
- `poolState`: Current state of the UniswapV3 pool.
|
|
300
|
+
- `owners`: List of owners for the coin.
|
|
301
|
+
- `payoutRecipient`: The payout recipient address.
|
|
302
|
+
**Return Value:**
|
|
303
|
+
|
|
304
|
+
- `balance`: The user's balance of the coin.
|
|
305
|
+
- `marketCap`: The market cap of the coin.
|
|
306
|
+
- `liquidity`: The liquidity of the coin.
|
|
307
|
+
- `pool`: Pool address.
|
|
308
|
+
- `poolState`: Current state of the UniswapV3 pool.
|
|
309
|
+
- `owners`: List of owners for the coin.
|
|
310
|
+
- `payoutRecipient`: The payout recipient address.
|
|
184
311
|
|
|
185
312
|
### 2. API Queries
|
|
186
313
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
314
|
+
These functions interact with the Zora API to fetch additional data:
|
|
315
|
+
These functions interact with the Zora API to fetch additional data:
|
|
316
|
+
|
|
317
|
+
#### API Key
|
|
318
|
+
#### API Key
|
|
319
|
+
|
|
320
|
+
To get a higher rate limit and fully use the zora API, an API key is required.
|
|
321
|
+
To get a higher rate limit and fully use the zora API, an API key is required.
|
|
322
|
+
|
|
323
|
+
To set the API key, you can use the `setApiKey` function which will apply your API key to all requests.
|
|
324
|
+
To set the API key, you can use the `setApiKey` function which will apply your API key to all requests.
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
setApiKey("your-api-key");
|
|
328
|
+
```
|
|
329
|
+
```typescript
|
|
330
|
+
setApiKey("your-api-key");
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Please DM the Zora team to get the API key.
|
|
334
|
+
Please DM the Zora team to get the API key.
|
|
335
|
+
|
|
336
|
+
These queries allow non-api-key access for reasonable development usage.
|
|
337
|
+
These queries allow non-api-key access for reasonable development usage.
|
|
338
|
+
|
|
339
|
+
#### Cursor Pagination
|
|
340
|
+
#### Cursor Pagination
|
|
341
|
+
|
|
342
|
+
Many queries support cursor-based pagination using the `after` parameter. To paginate through results:
|
|
343
|
+
Many queries support cursor-based pagination using the `after` parameter. To paginate through results:
|
|
344
|
+
|
|
345
|
+
1. Make your initial query without an `after` parameter
|
|
346
|
+
2. From the response, get the `endCursor` from the `pageInfo` object
|
|
347
|
+
3. Pass this `endCursor` as the `after` parameter in your next query
|
|
348
|
+
1. Make your initial query without an `after` parameter
|
|
349
|
+
2. From the response, get the `endCursor` from the `pageInfo` object
|
|
350
|
+
3. Pass this `endCursor` as the `after` parameter in your next query
|
|
351
|
+
|
|
352
|
+
**Example:**
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
// First page
|
|
356
|
+
const firstPage = await getCoinsTopGainers({
|
|
357
|
+
count: 10,
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// Get the cursor for the next page
|
|
361
|
+
const nextCursor = firstPage.exploreList?.pageInfo?.endCursor;
|
|
362
|
+
|
|
363
|
+
// Fetch next page using the cursor
|
|
364
|
+
if (nextCursor) {
|
|
365
|
+
const nextPage = await getCoinsTopGainers({
|
|
366
|
+
count: 10,
|
|
367
|
+
after: nextCursor,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
**Example:**
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
// First page
|
|
375
|
+
const firstPage = await getCoinsTopGainers({
|
|
376
|
+
count: 10,
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
// Get the cursor for the next page
|
|
380
|
+
const nextCursor = firstPage.exploreList?.pageInfo?.endCursor;
|
|
381
|
+
|
|
382
|
+
// Fetch next page using the cursor
|
|
383
|
+
if (nextCursor) {
|
|
384
|
+
const nextPage = await getCoinsTopGainers({
|
|
385
|
+
count: 10,
|
|
386
|
+
after: nextCursor,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Complete Pagination Example:**
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
async function fetchAllTopGainers() {
|
|
395
|
+
const allResults = [];
|
|
396
|
+
let hasNextPage = true;
|
|
397
|
+
let cursor: string | undefined;
|
|
398
|
+
|
|
399
|
+
while (hasNextPage) {
|
|
400
|
+
const response = await getCoinsTopGainers({
|
|
401
|
+
count: 10,
|
|
402
|
+
after: cursor,
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
const { edges, pageInfo } = response.exploreList || {};
|
|
406
|
+
|
|
407
|
+
if (edges) {
|
|
408
|
+
allResults.push(...edges.map((edge) => edge.node));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
hasNextPage = pageInfo?.hasNextPage || false;
|
|
412
|
+
cursor = pageInfo?.endCursor;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return allResults;
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
**Complete Pagination Example:**
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
async function fetchAllTopGainers() {
|
|
422
|
+
const allResults = [];
|
|
423
|
+
let hasNextPage = true;
|
|
424
|
+
let cursor: string | undefined;
|
|
425
|
+
|
|
426
|
+
while (hasNextPage) {
|
|
427
|
+
const response = await getCoinsTopGainers({
|
|
428
|
+
count: 10,
|
|
429
|
+
after: cursor,
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
const { edges, pageInfo } = response.exploreList || {};
|
|
433
|
+
|
|
434
|
+
if (edges) {
|
|
435
|
+
allResults.push(...edges.map((edge) => edge.node));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
hasNextPage = pageInfo?.hasNextPage || false;
|
|
439
|
+
cursor = pageInfo?.endCursor;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return allResults;
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
This pagination pattern works for all queries that return `pageInfo` with `endCursor` and `hasNextPage`, including:
|
|
447
|
+
|
|
448
|
+
- All explore queries
|
|
449
|
+
- `getCoinComments`
|
|
450
|
+
- `getProfileOwned`
|
|
451
|
+
|
|
452
|
+
## All API Queries
|
|
453
|
+
This pagination pattern works for all queries that return `pageInfo` with `endCursor` and `hasNextPage`, including:
|
|
454
|
+
|
|
455
|
+
- All explore queries
|
|
456
|
+
- `getCoinComments`
|
|
457
|
+
- `getProfileOwned`
|
|
458
|
+
|
|
459
|
+
## All API Queries
|
|
460
|
+
|
|
461
|
+
#### `getCoin`: Get details for a specific coin
|
|
462
|
+
|
|
463
|
+
**Parameters:**
|
|
464
|
+
|
|
465
|
+
- `address`: The coin contract address
|
|
466
|
+
- `chain`: (Optional) The chain ID
|
|
467
|
+
#### `getCoin`: Get details for a specific coin
|
|
468
|
+
|
|
469
|
+
**Parameters:**
|
|
470
|
+
|
|
471
|
+
- `address`: The coin contract address
|
|
472
|
+
- `chain`: (Optional) The chain ID
|
|
473
|
+
|
|
474
|
+
**Returns:**
|
|
475
|
+
|
|
476
|
+
```typescript
|
|
477
|
+
{
|
|
478
|
+
zora20Token?: {
|
|
479
|
+
id?: string;
|
|
480
|
+
name?: string;
|
|
481
|
+
description?: string;
|
|
482
|
+
address?: string;
|
|
483
|
+
symbol?: string;
|
|
484
|
+
totalSupply?: string;
|
|
485
|
+
totalVolume?: string;
|
|
486
|
+
volume24h?: string;
|
|
487
|
+
createdAt?: string;
|
|
488
|
+
creatorAddress?: string;
|
|
489
|
+
creatorEarnings?: Array<{
|
|
490
|
+
amount?: {
|
|
491
|
+
currency?: { address?: string };
|
|
492
|
+
amountRaw?: string;
|
|
493
|
+
amountDecimal?: number;
|
|
494
|
+
};
|
|
495
|
+
amountUsd?: string;
|
|
496
|
+
}>;
|
|
497
|
+
marketCap?: string;
|
|
498
|
+
marketCapDelta24h?: string;
|
|
499
|
+
chainId?: number;
|
|
500
|
+
creatorProfile?: string;
|
|
501
|
+
handle?: string;
|
|
502
|
+
avatar?: {
|
|
503
|
+
previewImage?: string;
|
|
504
|
+
blurhash?: string;
|
|
505
|
+
small?: string;
|
|
506
|
+
};
|
|
507
|
+
media?: {
|
|
508
|
+
mimeType?: string;
|
|
509
|
+
originalUri?: string;
|
|
510
|
+
format?: string;
|
|
511
|
+
previewImage?: string;
|
|
512
|
+
medium?: string;
|
|
513
|
+
blurhash?: string;
|
|
514
|
+
};
|
|
515
|
+
transfers?: { count?: number };
|
|
516
|
+
uniqueHolders?: number;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
```
|
|
520
|
+
**Returns:**
|
|
521
|
+
|
|
522
|
+
```typescript
|
|
523
|
+
{
|
|
524
|
+
zora20Token?: {
|
|
525
|
+
id?: string;
|
|
526
|
+
name?: string;
|
|
527
|
+
description?: string;
|
|
528
|
+
address?: string;
|
|
529
|
+
symbol?: string;
|
|
530
|
+
totalSupply?: string;
|
|
531
|
+
totalVolume?: string;
|
|
532
|
+
volume24h?: string;
|
|
533
|
+
createdAt?: string;
|
|
534
|
+
creatorAddress?: string;
|
|
535
|
+
creatorEarnings?: Array<{
|
|
536
|
+
amount?: {
|
|
537
|
+
currency?: { address?: string };
|
|
538
|
+
amountRaw?: string;
|
|
539
|
+
amountDecimal?: number;
|
|
540
|
+
};
|
|
541
|
+
amountUsd?: string;
|
|
542
|
+
}>;
|
|
543
|
+
marketCap?: string;
|
|
544
|
+
marketCapDelta24h?: string;
|
|
545
|
+
chainId?: number;
|
|
546
|
+
creatorProfile?: string;
|
|
547
|
+
handle?: string;
|
|
548
|
+
avatar?: {
|
|
549
|
+
previewImage?: string;
|
|
550
|
+
blurhash?: string;
|
|
551
|
+
small?: string;
|
|
552
|
+
};
|
|
553
|
+
media?: {
|
|
554
|
+
mimeType?: string;
|
|
555
|
+
originalUri?: string;
|
|
556
|
+
format?: string;
|
|
557
|
+
previewImage?: string;
|
|
558
|
+
medium?: string;
|
|
559
|
+
blurhash?: string;
|
|
560
|
+
};
|
|
561
|
+
transfers?: { count?: number };
|
|
562
|
+
uniqueHolders?: number;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
#### `getCoins`: Get details for multiple coins
|
|
568
|
+
|
|
569
|
+
**Parameters:**
|
|
570
|
+
|
|
571
|
+
- `coins`: Array of coin objects with:
|
|
572
|
+
- `chainId`: (Optional) The chain ID
|
|
573
|
+
- `collectionAddress`: The coin contract address
|
|
574
|
+
#### `getCoins`: Get details for multiple coins
|
|
575
|
+
|
|
576
|
+
**Parameters:**
|
|
577
|
+
|
|
578
|
+
- `coins`: Array of coin objects with:
|
|
579
|
+
- `chainId`: (Optional) The chain ID
|
|
580
|
+
- `collectionAddress`: The coin contract address
|
|
581
|
+
|
|
582
|
+
**Returns:** Array of coin details in the same format as `getCoin`
|
|
583
|
+
**Returns:** Array of coin details in the same format as `getCoin`
|
|
584
|
+
|
|
585
|
+
#### `getCoinComments`: Get comments for a coin
|
|
586
|
+
|
|
587
|
+
**Parameters:**
|
|
588
|
+
|
|
589
|
+
- `address`: The coin contract address
|
|
590
|
+
- `chain`: (Optional) The chain ID
|
|
591
|
+
- `after`: (Optional) Pagination cursor
|
|
592
|
+
- `count`: (Optional) Number of comments to return
|
|
593
|
+
#### `getCoinComments`: Get comments for a coin
|
|
594
|
+
|
|
595
|
+
**Parameters:**
|
|
596
|
+
|
|
597
|
+
- `address`: The coin contract address
|
|
598
|
+
- `chain`: (Optional) The chain ID
|
|
599
|
+
- `after`: (Optional) Pagination cursor
|
|
600
|
+
- `count`: (Optional) Number of comments to return
|
|
601
|
+
|
|
602
|
+
**Returns:**
|
|
603
|
+
|
|
604
|
+
```typescript
|
|
605
|
+
{
|
|
606
|
+
zora20Token?: {
|
|
607
|
+
zoraComments?: {
|
|
608
|
+
pageInfo?: {
|
|
609
|
+
endCursor?: string;
|
|
610
|
+
hasNextPage?: boolean;
|
|
611
|
+
};
|
|
612
|
+
count?: number;
|
|
613
|
+
edges?: Array<{
|
|
614
|
+
node?: string;
|
|
615
|
+
txHash?: string;
|
|
616
|
+
comment?: string;
|
|
617
|
+
userAddress?: string;
|
|
618
|
+
timestamp?: number;
|
|
619
|
+
userProfile?: string;
|
|
620
|
+
id?: string;
|
|
621
|
+
handle?: string;
|
|
622
|
+
avatar?: {
|
|
623
|
+
previewImage?: string;
|
|
624
|
+
blurhash?: string;
|
|
625
|
+
small?: string;
|
|
626
|
+
};
|
|
627
|
+
replies?: {
|
|
628
|
+
count?: number;
|
|
629
|
+
edges?: Array<{
|
|
630
|
+
node?: {
|
|
631
|
+
txHash?: string;
|
|
632
|
+
comment?: string;
|
|
633
|
+
userAddress?: string;
|
|
634
|
+
timestamp?: number;
|
|
635
|
+
userProfile?: string;
|
|
636
|
+
id?: string;
|
|
637
|
+
handle?: string;
|
|
638
|
+
avatar?: {
|
|
639
|
+
previewImage?: string;
|
|
640
|
+
blurhash?: string;
|
|
641
|
+
small?: string;
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
}>;
|
|
645
|
+
};
|
|
646
|
+
}>;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
**Returns:**
|
|
652
|
+
|
|
653
|
+
```typescript
|
|
654
|
+
{
|
|
655
|
+
zora20Token?: {
|
|
656
|
+
zoraComments?: {
|
|
657
|
+
pageInfo?: {
|
|
658
|
+
endCursor?: string;
|
|
659
|
+
hasNextPage?: boolean;
|
|
660
|
+
};
|
|
661
|
+
count?: number;
|
|
662
|
+
edges?: Array<{
|
|
663
|
+
node?: string;
|
|
664
|
+
txHash?: string;
|
|
665
|
+
comment?: string;
|
|
666
|
+
userAddress?: string;
|
|
667
|
+
timestamp?: number;
|
|
668
|
+
userProfile?: string;
|
|
669
|
+
id?: string;
|
|
670
|
+
handle?: string;
|
|
671
|
+
avatar?: {
|
|
672
|
+
previewImage?: string;
|
|
673
|
+
blurhash?: string;
|
|
674
|
+
small?: string;
|
|
675
|
+
};
|
|
676
|
+
replies?: {
|
|
677
|
+
count?: number;
|
|
678
|
+
edges?: Array<{
|
|
679
|
+
node?: {
|
|
680
|
+
txHash?: string;
|
|
681
|
+
comment?: string;
|
|
682
|
+
userAddress?: string;
|
|
683
|
+
timestamp?: number;
|
|
684
|
+
userProfile?: string;
|
|
685
|
+
id?: string;
|
|
686
|
+
handle?: string;
|
|
687
|
+
avatar?: {
|
|
688
|
+
previewImage?: string;
|
|
689
|
+
blurhash?: string;
|
|
690
|
+
small?: string;
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
}>;
|
|
694
|
+
};
|
|
695
|
+
}>;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
#### `getProfile`: Get profile information
|
|
702
|
+
|
|
703
|
+
**Parameters:**
|
|
704
|
+
|
|
705
|
+
- `identifier`: The profile identifier (username, handle, or address)
|
|
706
|
+
#### `getProfile`: Get profile information
|
|
707
|
+
|
|
708
|
+
**Parameters:**
|
|
709
|
+
|
|
710
|
+
- `identifier`: The profile identifier (username, handle, or address)
|
|
711
|
+
|
|
712
|
+
**Returns:**
|
|
713
|
+
|
|
714
|
+
```typescript
|
|
715
|
+
{
|
|
716
|
+
profile?: string;
|
|
717
|
+
id?: string;
|
|
718
|
+
handle?: string;
|
|
719
|
+
avatar?: {
|
|
720
|
+
small?: string;
|
|
721
|
+
medium?: string;
|
|
722
|
+
blurhash?: string;
|
|
723
|
+
};
|
|
724
|
+
username?: string;
|
|
725
|
+
displayName?: string;
|
|
726
|
+
bio?: string;
|
|
727
|
+
website?: string;
|
|
728
|
+
publicWallet?: {
|
|
729
|
+
walletAddress?: string;
|
|
730
|
+
};
|
|
731
|
+
linkedWallets?: {
|
|
732
|
+
edges?: Array<{
|
|
733
|
+
node?: {
|
|
734
|
+
walletType?: "PRIVY" | "EXTERNAL" | "SMART_WALLET";
|
|
735
|
+
walletAddress?: string;
|
|
736
|
+
};
|
|
737
|
+
}>;
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
```
|
|
741
|
+
**Returns:**
|
|
742
|
+
|
|
743
|
+
```typescript
|
|
744
|
+
{
|
|
745
|
+
profile?: string;
|
|
746
|
+
id?: string;
|
|
747
|
+
handle?: string;
|
|
748
|
+
avatar?: {
|
|
749
|
+
small?: string;
|
|
750
|
+
medium?: string;
|
|
751
|
+
blurhash?: string;
|
|
752
|
+
};
|
|
753
|
+
username?: string;
|
|
754
|
+
displayName?: string;
|
|
755
|
+
bio?: string;
|
|
756
|
+
website?: string;
|
|
757
|
+
publicWallet?: {
|
|
758
|
+
walletAddress?: string;
|
|
759
|
+
};
|
|
760
|
+
linkedWallets?: {
|
|
761
|
+
edges?: Array<{
|
|
762
|
+
node?: {
|
|
763
|
+
walletType?: "PRIVY" | "EXTERNAL" | "SMART_WALLET";
|
|
764
|
+
walletAddress?: string;
|
|
765
|
+
};
|
|
766
|
+
}>;
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
#### `getProfileOwned`: Get coins owned by a profile
|
|
772
|
+
|
|
773
|
+
**Parameters:**
|
|
774
|
+
|
|
775
|
+
- `identifier`: The profile identifier (username, handle, or address)
|
|
776
|
+
- `count`: (Optional) Number of items to return
|
|
777
|
+
- `after`: (Optional) Pagination cursor
|
|
778
|
+
- `chainIds`: (Optional) Array of chain IDs to filter by
|
|
779
|
+
#### `getProfileOwned`: Get coins owned by a profile
|
|
780
|
+
|
|
781
|
+
**Parameters:**
|
|
782
|
+
|
|
783
|
+
- `identifier`: The profile identifier (username, handle, or address)
|
|
784
|
+
- `count`: (Optional) Number of items to return
|
|
785
|
+
- `after`: (Optional) Pagination cursor
|
|
786
|
+
- `chainIds`: (Optional) Array of chain IDs to filter by
|
|
787
|
+
|
|
788
|
+
**Returns:**
|
|
789
|
+
|
|
790
|
+
```typescript
|
|
791
|
+
{
|
|
792
|
+
profile?: string;
|
|
793
|
+
id?: string;
|
|
794
|
+
handle?: string;
|
|
795
|
+
avatar?: {
|
|
796
|
+
previewImage?: string;
|
|
797
|
+
blurhash?: string;
|
|
798
|
+
small?: string;
|
|
799
|
+
};
|
|
800
|
+
coinBalances?: {
|
|
801
|
+
count?: number;
|
|
802
|
+
edges?: Array<{
|
|
803
|
+
node?: {
|
|
804
|
+
balance?: string;
|
|
805
|
+
id?: string;
|
|
806
|
+
coin?: {
|
|
807
|
+
// Same coin details as getCoin
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
}>;
|
|
811
|
+
pageInfo?: {
|
|
812
|
+
hasNextPage?: boolean;
|
|
813
|
+
endCursor?: string;
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
```
|
|
818
|
+
**Returns:**
|
|
819
|
+
|
|
820
|
+
```typescript
|
|
821
|
+
{
|
|
822
|
+
profile?: string;
|
|
823
|
+
id?: string;
|
|
824
|
+
handle?: string;
|
|
825
|
+
avatar?: {
|
|
826
|
+
previewImage?: string;
|
|
827
|
+
blurhash?: string;
|
|
828
|
+
small?: string;
|
|
829
|
+
};
|
|
830
|
+
coinBalances?: {
|
|
831
|
+
count?: number;
|
|
832
|
+
edges?: Array<{
|
|
833
|
+
node?: {
|
|
834
|
+
balance?: string;
|
|
835
|
+
id?: string;
|
|
836
|
+
coin?: {
|
|
837
|
+
// Same coin details as getCoin
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
}>;
|
|
841
|
+
pageInfo?: {
|
|
842
|
+
hasNextPage?: boolean;
|
|
843
|
+
endCursor?: string;
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
```
|
|
448
848
|
|
|
449
849
|
#### `getCoinsTopGainers`: Get top gaining coins
|
|
850
|
+
|
|
851
|
+
|
|
450
852
|
**Parameters:**
|
|
853
|
+
|
|
451
854
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
452
855
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
453
856
|
|
|
454
857
|
**Request Type:**
|
|
858
|
+
|
|
859
|
+
|
|
455
860
|
```typescript
|
|
456
|
-
|
|
457
|
-
|
|
861
|
+
// Types from @zoralabs/coins-sdk
|
|
862
|
+
export type RequestOptionsType = Omit<GetExploreData, "query">;
|
|
863
|
+
|
|
864
|
+
export type QueryInnerType = {
|
|
865
|
+
query: {
|
|
458
866
|
count?: number;
|
|
459
867
|
after?: string;
|
|
460
868
|
};
|
|
@@ -462,6 +870,7 @@ type Options<T extends boolean = false> = {
|
|
|
462
870
|
```
|
|
463
871
|
|
|
464
872
|
**Return Type:**
|
|
873
|
+
|
|
465
874
|
```typescript
|
|
466
875
|
{
|
|
467
876
|
exploreList?: {
|
|
@@ -499,86 +908,101 @@ type Options<T extends boolean = false> = {
|
|
|
499
908
|
```
|
|
500
909
|
|
|
501
910
|
#### `getCoinsTopVolume24h`: Get coins with highest 24h volume
|
|
911
|
+
|
|
912
|
+
|
|
502
913
|
**Parameters:**
|
|
914
|
+
|
|
503
915
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
504
916
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
505
917
|
|
|
506
918
|
**Request Type:**
|
|
919
|
+
|
|
507
920
|
```typescript
|
|
508
|
-
|
|
509
|
-
query
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
};
|
|
513
|
-
};
|
|
921
|
+
function getCoinsTopVolume24h(
|
|
922
|
+
query: QueryInnerType,
|
|
923
|
+
options?: RequestOptionsType,
|
|
924
|
+
): Promise<ExploreResponse>;
|
|
514
925
|
```
|
|
515
926
|
|
|
927
|
+
**Request Type:** Same as `getCoinsTopGainers`
|
|
516
928
|
**Return Type:** Same as `getCoinsTopGainers`
|
|
517
929
|
|
|
518
930
|
#### `getCoinsMostValuable`: Get most valuable coins
|
|
931
|
+
|
|
932
|
+
|
|
519
933
|
**Parameters:**
|
|
934
|
+
|
|
520
935
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
521
936
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
522
937
|
|
|
523
938
|
**Request Type:**
|
|
939
|
+
|
|
524
940
|
```typescript
|
|
525
|
-
|
|
526
|
-
query
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
};
|
|
530
|
-
};
|
|
941
|
+
function getCoinsMostValuable(
|
|
942
|
+
query: QueryInnerType,
|
|
943
|
+
options?: RequestOptionsType,
|
|
944
|
+
): Promise<ExploreResponse>;
|
|
531
945
|
```
|
|
532
946
|
|
|
947
|
+
**Request Type:** Same as `getCoinsTopGainers`
|
|
533
948
|
**Return Type:** Same as `getCoinsTopGainers`
|
|
534
949
|
|
|
535
950
|
#### `getCoinsNew`: Get newly created coins
|
|
951
|
+
|
|
952
|
+
|
|
536
953
|
**Parameters:**
|
|
954
|
+
|
|
537
955
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
538
956
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
539
957
|
|
|
540
958
|
**Request Type:**
|
|
959
|
+
|
|
541
960
|
```typescript
|
|
542
|
-
|
|
543
|
-
query
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
};
|
|
547
|
-
};
|
|
961
|
+
function getCoinsNew(
|
|
962
|
+
query: QueryInnerType,
|
|
963
|
+
options?: RequestOptionsType,
|
|
964
|
+
): Promise<ExploreResponse>;
|
|
548
965
|
```
|
|
549
966
|
|
|
967
|
+
**Request Type:** Same as `getCoinsTopGainers`
|
|
550
968
|
**Return Type:** Same as `getCoinsTopGainers`
|
|
551
969
|
|
|
552
970
|
#### `getCoinsLastTraded`: Get recently traded coins
|
|
971
|
+
|
|
972
|
+
|
|
553
973
|
**Parameters:**
|
|
974
|
+
|
|
554
975
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
555
976
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
556
977
|
|
|
557
978
|
**Request Type:**
|
|
979
|
+
|
|
558
980
|
```typescript
|
|
559
|
-
|
|
560
|
-
query
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
};
|
|
564
|
-
};
|
|
981
|
+
function getCoinsLastTraded(
|
|
982
|
+
query: QueryInnerType,
|
|
983
|
+
options?: RequestOptionsType,
|
|
984
|
+
): Promise<ExploreResponse>;
|
|
565
985
|
```
|
|
566
986
|
|
|
987
|
+
**Request Type:** Same as `getCoinsTopGainers`
|
|
567
988
|
**Return Type:** Same as `getCoinsTopGainers`
|
|
568
989
|
|
|
569
990
|
#### `getCoinsLastTradedUnique`: Get recently traded unique coins
|
|
991
|
+
|
|
992
|
+
|
|
570
993
|
**Parameters:**
|
|
994
|
+
|
|
571
995
|
- `count`: (Optional) Number of items to return, type: `number`
|
|
572
996
|
- `after`: (Optional) Pagination cursor, type: `string`
|
|
573
997
|
|
|
574
998
|
**Request Type:**
|
|
999
|
+
|
|
575
1000
|
```typescript
|
|
576
|
-
|
|
577
|
-
query
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
};
|
|
581
|
-
};
|
|
1001
|
+
function getCoinsLastTradedUnique(
|
|
1002
|
+
query: QueryInnerType,
|
|
1003
|
+
options?: RequestOptionsType,
|
|
1004
|
+
): Promise<ExploreResponse>;
|
|
582
1005
|
```
|
|
583
1006
|
|
|
1007
|
+
**Request Type:** Same as `getCoinsTopGainers`
|
|
584
1008
|
**Return Type:** Same as `getCoinsTopGainers`
|