@zoralabs/coins-sdk 0.0.2-sdkalpha.7 → 0.0.2
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 +12 -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 +15 -336
- package/dist/api/explore.d.ts.map +1 -1
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/queries.d.ts +100 -223
- 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 +160 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- 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 +46 -28
- package/src/api/index.ts +2 -0
- package/src/api/queries.ts +55 -8
- package/src/api/query-types.ts +8 -0
- package/src/index.ts +4 -3
- 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/dist/index.cjs
CHANGED
|
@@ -1,75 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
cleanAndValidateMetadataURI: () => cleanAndValidateMetadataURI,
|
|
24
|
-
createCoin: () => createCoin,
|
|
25
|
-
createCoinCall: () => createCoinCall,
|
|
26
|
-
getCoin: () => getCoin2,
|
|
27
|
-
getCoinComments: () => getCoinComments2,
|
|
28
|
-
getCoinCreateFromLogs: () => getCoinCreateFromLogs,
|
|
29
|
-
getCoins: () => getCoins2,
|
|
30
|
-
getCoinsLastTraded: () => getCoinsLastTraded,
|
|
31
|
-
getCoinsLastTradedUnique: () => getCoinsLastTradedUnique,
|
|
32
|
-
getCoinsMostValuable: () => getCoinsMostValuable,
|
|
33
|
-
getCoinsNew: () => getCoinsNew,
|
|
34
|
-
getCoinsTopGainers: () => getCoinsTopGainers,
|
|
35
|
-
getCoinsTopVolume24h: () => getCoinsTopVolume24h,
|
|
36
|
-
getOnchainCoinDetails: () => getOnchainCoinDetails,
|
|
37
|
-
getProfile: () => getProfile2,
|
|
38
|
-
getProfileBalances: () => getProfileBalances2,
|
|
39
|
-
getTradeFromLogs: () => getTradeFromLogs,
|
|
40
|
-
setApiKey: () => setApiKey,
|
|
41
|
-
tradeCoin: () => tradeCoin,
|
|
42
|
-
tradeCoinCall: () => tradeCoinCall,
|
|
43
|
-
updateCoinURI: () => updateCoinURI,
|
|
44
|
-
updateCoinURICall: () => updateCoinURICall,
|
|
45
|
-
updatePayoutRecipient: () => updatePayoutRecipient,
|
|
46
|
-
updatePayoutRecipientCall: () => updatePayoutRecipientCall,
|
|
47
|
-
validateMetadataJSON: () => validateMetadataJSON,
|
|
48
|
-
validateMetadataURIContent: () => validateMetadataURIContent
|
|
49
|
-
});
|
|
50
|
-
module.exports = __toCommonJS(src_exports);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/actions/createCoin.ts
|
|
2
|
+
var _coins = require('@zoralabs/coins');
|
|
51
3
|
|
|
52
|
-
|
|
53
|
-
var
|
|
54
|
-
var import_viem = require("viem");
|
|
4
|
+
|
|
5
|
+
var _viem = require('viem');
|
|
55
6
|
|
|
56
7
|
// src/constants.ts
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
var COIN_FACTORY_ADDRESS =
|
|
8
|
+
|
|
9
|
+
var _chains = require('viem/chains');
|
|
10
|
+
var COIN_FACTORY_ADDRESS = _coins.zoraFactoryImplAddress["8453"];
|
|
60
11
|
var SUPERCHAIN_WETH_ADDRESS = "0x4200000000000000000000000000000000000006";
|
|
61
12
|
var USDC_WETH_POOLS_BY_CHAIN = {
|
|
62
|
-
[
|
|
13
|
+
[_chains.base.id]: "0xd0b53D9277642d899DF5C87A3966A349A798F224"
|
|
63
14
|
};
|
|
64
15
|
|
|
65
16
|
// src/utils/validateClientNetwork.ts
|
|
66
|
-
|
|
17
|
+
|
|
67
18
|
var validateClientNetwork = (publicClient) => {
|
|
68
|
-
const clientChainId = publicClient
|
|
69
|
-
if (clientChainId ===
|
|
19
|
+
const clientChainId = _optionalChain([publicClient, 'optionalAccess', _ => _.chain, 'optionalAccess', _2 => _2.id]);
|
|
20
|
+
if (clientChainId === _chains.base.id) {
|
|
70
21
|
return;
|
|
71
22
|
}
|
|
72
|
-
if (clientChainId ===
|
|
23
|
+
if (clientChainId === _chains.baseSepolia.id) {
|
|
73
24
|
return;
|
|
74
25
|
}
|
|
75
26
|
throw new Error(
|
|
@@ -93,7 +44,7 @@ function createCoinCall({
|
|
|
93
44
|
}
|
|
94
45
|
const currency = "0x4200000000000000000000000000000000000006";
|
|
95
46
|
return {
|
|
96
|
-
abi:
|
|
47
|
+
abi: _coins.zoraFactoryImplABI,
|
|
97
48
|
functionName: "deploy",
|
|
98
49
|
address: COIN_FACTORY_ADDRESS,
|
|
99
50
|
args: [
|
|
@@ -111,11 +62,11 @@ function createCoinCall({
|
|
|
111
62
|
};
|
|
112
63
|
}
|
|
113
64
|
function getCoinCreateFromLogs(receipt) {
|
|
114
|
-
const eventLogs = (0,
|
|
115
|
-
abi:
|
|
65
|
+
const eventLogs = _viem.parseEventLogs.call(void 0, {
|
|
66
|
+
abi: _coins.zoraFactoryImplABI,
|
|
116
67
|
logs: receipt.logs
|
|
117
68
|
});
|
|
118
|
-
return eventLogs.find((log) => log.eventName === "CoinCreated")
|
|
69
|
+
return _optionalChain([eventLogs, 'access', _3 => _3.find, 'call', _4 => _4((log) => log.eventName === "CoinCreated"), 'optionalAccess', _5 => _5.args]);
|
|
119
70
|
}
|
|
120
71
|
async function createCoin(call, walletClient, publicClient, options) {
|
|
121
72
|
validateClientNetwork(publicClient);
|
|
@@ -124,7 +75,7 @@ async function createCoin(call, walletClient, publicClient, options) {
|
|
|
124
75
|
account: walletClient.account
|
|
125
76
|
});
|
|
126
77
|
if (request.gas) {
|
|
127
|
-
request.gas = request.gas * BigInt(options
|
|
78
|
+
request.gas = request.gas * BigInt(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _6 => _6.gasMultiplier]), () => ( 100))) / 100n;
|
|
128
79
|
}
|
|
129
80
|
const hash = await walletClient.writeContract(request);
|
|
130
81
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
@@ -132,15 +83,50 @@ async function createCoin(call, walletClient, publicClient, options) {
|
|
|
132
83
|
return {
|
|
133
84
|
hash,
|
|
134
85
|
receipt,
|
|
135
|
-
address: deployment
|
|
86
|
+
address: _optionalChain([deployment, 'optionalAccess', _7 => _7.coin]),
|
|
136
87
|
deployment
|
|
137
88
|
};
|
|
138
89
|
}
|
|
139
90
|
|
|
140
91
|
// src/actions/tradeCoin.ts
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
async function simulateBuy({
|
|
100
|
+
target,
|
|
101
|
+
requestedOrderSize,
|
|
102
|
+
publicClient
|
|
103
|
+
}) {
|
|
104
|
+
const numberResult = await publicClient.simulateContract({
|
|
105
|
+
address: target,
|
|
106
|
+
abi: _coins.coinABI,
|
|
107
|
+
functionName: "buy",
|
|
108
|
+
args: [
|
|
109
|
+
_viem.zeroAddress,
|
|
110
|
+
requestedOrderSize,
|
|
111
|
+
0n,
|
|
112
|
+
// minAmountOut
|
|
113
|
+
0n,
|
|
114
|
+
// sqrtPriceLimitX96
|
|
115
|
+
_viem.zeroAddress
|
|
116
|
+
// tradeReferrer
|
|
117
|
+
],
|
|
118
|
+
// We want to ensure that the multicall3 contract has enough ETH to buy in the simulation
|
|
119
|
+
stateOverride: [
|
|
120
|
+
{
|
|
121
|
+
address: _chains.baseSepolia.contracts.multicall3.address,
|
|
122
|
+
balance: _viem.parseEther.call(void 0, "10000000")
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
const orderSize = numberResult.result[0];
|
|
127
|
+
const amountOut = numberResult.result[1];
|
|
128
|
+
return { orderSize, amountOut };
|
|
129
|
+
}
|
|
144
130
|
function tradeCoinCall({
|
|
145
131
|
target,
|
|
146
132
|
direction,
|
|
@@ -149,11 +135,11 @@ function tradeCoinCall({
|
|
|
149
135
|
orderSize,
|
|
150
136
|
minAmountOut = 0n,
|
|
151
137
|
sqrtPriceLimitX96 = 0n,
|
|
152
|
-
tradeReferrer =
|
|
138
|
+
tradeReferrer = _viem.zeroAddress
|
|
153
139
|
}
|
|
154
140
|
}) {
|
|
155
141
|
return {
|
|
156
|
-
abi:
|
|
142
|
+
abi: _coins.coinABI,
|
|
157
143
|
functionName: direction,
|
|
158
144
|
address: target,
|
|
159
145
|
args: [
|
|
@@ -167,14 +153,14 @@ function tradeCoinCall({
|
|
|
167
153
|
};
|
|
168
154
|
}
|
|
169
155
|
function getTradeFromLogs(receipt, direction) {
|
|
170
|
-
const eventLogs = (0,
|
|
171
|
-
abi:
|
|
156
|
+
const eventLogs = _viem.parseEventLogs.call(void 0, {
|
|
157
|
+
abi: _coins.coinABI,
|
|
172
158
|
logs: receipt.logs
|
|
173
159
|
});
|
|
174
160
|
if (direction === "buy") {
|
|
175
|
-
return eventLogs.find((log) => log.eventName === "CoinBuy")
|
|
161
|
+
return _optionalChain([eventLogs, 'access', _8 => _8.find, 'call', _9 => _9((log) => log.eventName === "CoinBuy"), 'optionalAccess', _10 => _10.args]);
|
|
176
162
|
}
|
|
177
|
-
return eventLogs.find((log) => log.eventName === "CoinSell")
|
|
163
|
+
return _optionalChain([eventLogs, 'access', _11 => _11.find, 'call', _12 => _12((log) => log.eventName === "CoinSell"), 'optionalAccess', _13 => _13.args]);
|
|
178
164
|
}
|
|
179
165
|
async function tradeCoin(params, walletClient, publicClient) {
|
|
180
166
|
validateClientNetwork(publicClient);
|
|
@@ -193,11 +179,16 @@ async function tradeCoin(params, walletClient, publicClient) {
|
|
|
193
179
|
}
|
|
194
180
|
|
|
195
181
|
// src/actions/getOnchainCoinDetails.ts
|
|
196
|
-
|
|
197
|
-
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
198
189
|
async function getOnchainCoinDetails({
|
|
199
190
|
coin,
|
|
200
|
-
user =
|
|
191
|
+
user = _viem.zeroAddress,
|
|
201
192
|
publicClient
|
|
202
193
|
}) {
|
|
203
194
|
validateClientNetwork(publicClient);
|
|
@@ -206,30 +197,30 @@ async function getOnchainCoinDetails({
|
|
|
206
197
|
contracts: [
|
|
207
198
|
{
|
|
208
199
|
address: coin,
|
|
209
|
-
abi:
|
|
200
|
+
abi: _coins.coinABI,
|
|
210
201
|
functionName: "balanceOf",
|
|
211
202
|
args: [user]
|
|
212
203
|
},
|
|
213
204
|
{
|
|
214
205
|
address: coin,
|
|
215
|
-
abi:
|
|
206
|
+
abi: _coins.coinABI,
|
|
216
207
|
functionName: "poolAddress"
|
|
217
208
|
},
|
|
218
209
|
{
|
|
219
210
|
address: coin,
|
|
220
|
-
abi:
|
|
211
|
+
abi: _coins.coinABI,
|
|
221
212
|
functionName: "owners"
|
|
222
213
|
},
|
|
223
214
|
{
|
|
224
215
|
address: coin,
|
|
225
|
-
abi:
|
|
216
|
+
abi: _coins.coinABI,
|
|
226
217
|
functionName: "payoutRecipient"
|
|
227
218
|
}
|
|
228
219
|
],
|
|
229
220
|
allowFailure: false
|
|
230
221
|
}
|
|
231
222
|
);
|
|
232
|
-
const USDC_WETH_POOL = USDC_WETH_POOLS_BY_CHAIN[publicClient.chain
|
|
223
|
+
const USDC_WETH_POOL = USDC_WETH_POOLS_BY_CHAIN[_optionalChain([publicClient, 'access', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) || 0];
|
|
233
224
|
const [
|
|
234
225
|
coinWethPoolSlot0,
|
|
235
226
|
coinWethPoolToken0,
|
|
@@ -241,34 +232,34 @@ async function getOnchainCoinDetails({
|
|
|
241
232
|
contracts: [
|
|
242
233
|
{
|
|
243
234
|
address: pool,
|
|
244
|
-
abi:
|
|
235
|
+
abi: _coins.iUniswapV3PoolABI,
|
|
245
236
|
functionName: "slot0"
|
|
246
237
|
},
|
|
247
238
|
{
|
|
248
239
|
address: pool,
|
|
249
|
-
abi:
|
|
240
|
+
abi: _coins.iUniswapV3PoolABI,
|
|
250
241
|
functionName: "token0"
|
|
251
242
|
},
|
|
252
243
|
{
|
|
253
244
|
address: coin,
|
|
254
|
-
abi:
|
|
245
|
+
abi: _viem.erc20Abi,
|
|
255
246
|
functionName: "balanceOf",
|
|
256
247
|
args: [pool]
|
|
257
248
|
},
|
|
258
249
|
{
|
|
259
250
|
address: coin,
|
|
260
|
-
abi:
|
|
251
|
+
abi: _coins.coinABI,
|
|
261
252
|
functionName: "totalSupply"
|
|
262
253
|
},
|
|
263
254
|
{
|
|
264
255
|
address: SUPERCHAIN_WETH_ADDRESS,
|
|
265
|
-
abi:
|
|
256
|
+
abi: _viem.erc20Abi,
|
|
266
257
|
functionName: "balanceOf",
|
|
267
258
|
args: [pool]
|
|
268
259
|
},
|
|
269
260
|
{
|
|
270
|
-
address: USDC_WETH_POOL
|
|
271
|
-
abi:
|
|
261
|
+
address: _nullishCoalesce(USDC_WETH_POOL, () => ( coin)),
|
|
262
|
+
abi: _coins.iUniswapV3PoolABI,
|
|
272
263
|
functionName: "slot0"
|
|
273
264
|
}
|
|
274
265
|
],
|
|
@@ -285,7 +276,7 @@ async function getOnchainCoinDetails({
|
|
|
285
276
|
coinWethPoolSlot0.sqrtPriceX96,
|
|
286
277
|
18,
|
|
287
278
|
18,
|
|
288
|
-
(0,
|
|
279
|
+
_viem.isAddressEqual.call(void 0, coinWethPoolToken0, coin),
|
|
289
280
|
18
|
|
290
281
|
);
|
|
291
282
|
const marketCap = coinPriceInWeth * coinTotalSupply / 10n ** 18n;
|
|
@@ -307,9 +298,9 @@ async function getOnchainCoinDetails({
|
|
|
307
298
|
function convertEthOutput(amountETH, wethToUsdc) {
|
|
308
299
|
return {
|
|
309
300
|
eth: amountETH,
|
|
310
|
-
ethDecimal: parseFloat((0,
|
|
301
|
+
ethDecimal: parseFloat(_viem.formatEther.call(void 0, amountETH)),
|
|
311
302
|
usdc: wethToUsdc ? amountETH * wethToUsdc : null,
|
|
312
|
-
usdcDecimal: wethToUsdc ? parseFloat((0,
|
|
303
|
+
usdcDecimal: wethToUsdc ? parseFloat(_viem.formatEther.call(void 0, amountETH * wethToUsdc / 10n ** 18n)) : null
|
|
313
304
|
};
|
|
314
305
|
}
|
|
315
306
|
function uniswapV3SqrtPriceToBigIntScaled(sqrtPriceX96, token0Decimals, token1Decimals, isToken0Coin, scaleDecimals = 18) {
|
|
@@ -333,8 +324,10 @@ function uniswapV3SqrtPriceToBigIntScaled(sqrtPriceX96, token0Decimals, token1De
|
|
|
333
324
|
}
|
|
334
325
|
|
|
335
326
|
// src/actions/updateCoinURI.ts
|
|
336
|
-
|
|
337
|
-
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
338
331
|
function updateCoinURICall({
|
|
339
332
|
newURI,
|
|
340
333
|
coin
|
|
@@ -343,7 +336,7 @@ function updateCoinURICall({
|
|
|
343
336
|
throw new Error("URI needs to be an ipfs:// prefix uri");
|
|
344
337
|
}
|
|
345
338
|
return {
|
|
346
|
-
abi:
|
|
339
|
+
abi: _coins.coinABI,
|
|
347
340
|
address: coin,
|
|
348
341
|
functionName: "setContractURI",
|
|
349
342
|
args: [newURI]
|
|
@@ -358,7 +351,7 @@ async function updateCoinURI(args, walletClient, publicClient) {
|
|
|
358
351
|
});
|
|
359
352
|
const hash = await walletClient.writeContract(request);
|
|
360
353
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
361
|
-
const eventLogs = (0,
|
|
354
|
+
const eventLogs = _viem.parseEventLogs.call(void 0, { abi: _coins.coinABI, logs: receipt.logs });
|
|
362
355
|
const uriUpdated = eventLogs.find(
|
|
363
356
|
(log) => log.eventName === "ContractURIUpdated"
|
|
364
357
|
);
|
|
@@ -366,14 +359,16 @@ async function updateCoinURI(args, walletClient, publicClient) {
|
|
|
366
359
|
}
|
|
367
360
|
|
|
368
361
|
// src/actions/updatePayoutRecipient.ts
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
371
366
|
function updatePayoutRecipientCall({
|
|
372
367
|
newPayoutRecipient,
|
|
373
368
|
coin
|
|
374
369
|
}) {
|
|
375
370
|
return {
|
|
376
|
-
abi:
|
|
371
|
+
abi: _coins.coinABI,
|
|
377
372
|
address: coin,
|
|
378
373
|
functionName: "setPayoutRecipient",
|
|
379
374
|
args: [newPayoutRecipient]
|
|
@@ -388,7 +383,7 @@ async function updatePayoutRecipient(args, walletClient, publicClient) {
|
|
|
388
383
|
});
|
|
389
384
|
const hash = await walletClient.writeContract(request);
|
|
390
385
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
391
|
-
const eventLogs = (0,
|
|
386
|
+
const eventLogs = _viem.parseEventLogs.call(void 0, { abi: _coins.coinABI, logs: receipt.logs });
|
|
392
387
|
const payoutRecipientUpdated = eventLogs.find(
|
|
393
388
|
(log) => log.eventName === "CoinPayoutRecipientUpdated"
|
|
394
389
|
);
|
|
@@ -396,46 +391,49 @@ async function updatePayoutRecipient(args, walletClient, publicClient) {
|
|
|
396
391
|
}
|
|
397
392
|
|
|
398
393
|
// src/client/client.gen.ts
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
var _clientfetch = require('@hey-api/client-fetch');
|
|
398
|
+
var client = _clientfetch.createClient.call(void 0,
|
|
399
|
+
_clientfetch.createConfig.call(void 0, {
|
|
402
400
|
baseUrl: "https://api-sdk.zora.engineering/"
|
|
403
401
|
})
|
|
404
402
|
);
|
|
405
403
|
|
|
406
404
|
// src/client/sdk.gen.ts
|
|
407
405
|
var getCoin = (options) => {
|
|
408
|
-
return (options.client
|
|
406
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
409
407
|
url: "/coin",
|
|
410
408
|
...options
|
|
411
409
|
});
|
|
412
410
|
};
|
|
413
411
|
var getCoinComments = (options) => {
|
|
414
|
-
return (options.client
|
|
412
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
415
413
|
url: "/coinComments",
|
|
416
414
|
...options
|
|
417
415
|
});
|
|
418
416
|
};
|
|
419
417
|
var getCoins = (options) => {
|
|
420
|
-
return (options.client
|
|
418
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
421
419
|
url: "/coins",
|
|
422
420
|
...options
|
|
423
421
|
});
|
|
424
422
|
};
|
|
425
423
|
var getExplore = (options) => {
|
|
426
|
-
return (options.client
|
|
424
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
427
425
|
url: "/explore",
|
|
428
426
|
...options
|
|
429
427
|
});
|
|
430
428
|
};
|
|
431
429
|
var getProfile = (options) => {
|
|
432
|
-
return (options.client
|
|
430
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
433
431
|
url: "/profile",
|
|
434
432
|
...options
|
|
435
433
|
});
|
|
436
434
|
};
|
|
437
435
|
var getProfileBalances = (options) => {
|
|
438
|
-
return (options.client
|
|
436
|
+
return (_nullishCoalesce(options.client, () => ( client))).get({
|
|
439
437
|
url: "/profileBalances",
|
|
440
438
|
...options
|
|
441
439
|
});
|
|
@@ -458,16 +456,14 @@ function getApiKeyMeta() {
|
|
|
458
456
|
}
|
|
459
457
|
|
|
460
458
|
// src/api/queries.ts
|
|
461
|
-
var getCoin2 = async (query) => {
|
|
459
|
+
var getCoin2 = async (query, options) => {
|
|
462
460
|
return await getCoin({
|
|
461
|
+
...options,
|
|
463
462
|
query,
|
|
464
463
|
meta: getApiKeyMeta()
|
|
465
464
|
});
|
|
466
465
|
};
|
|
467
|
-
var getCoins2 = async ({
|
|
468
|
-
coinAddresses,
|
|
469
|
-
chainId
|
|
470
|
-
}) => {
|
|
466
|
+
var getCoins2 = async ({ coinAddresses, chainId }, options) => {
|
|
471
467
|
return await getCoins({
|
|
472
468
|
query: {
|
|
473
469
|
coins: coinAddresses.map((collectionAddress) => ({
|
|
@@ -475,40 +471,44 @@ var getCoins2 = async ({
|
|
|
475
471
|
collectionAddress
|
|
476
472
|
}))
|
|
477
473
|
},
|
|
478
|
-
meta: getApiKeyMeta()
|
|
474
|
+
meta: getApiKeyMeta(),
|
|
475
|
+
...options
|
|
479
476
|
});
|
|
480
477
|
};
|
|
481
|
-
var getCoinComments2 = async (query) => {
|
|
478
|
+
var getCoinComments2 = async (query, options) => {
|
|
482
479
|
return await getCoinComments({
|
|
483
480
|
query,
|
|
484
|
-
meta: getApiKeyMeta()
|
|
481
|
+
meta: getApiKeyMeta(),
|
|
482
|
+
...options
|
|
485
483
|
});
|
|
486
484
|
};
|
|
487
|
-
var getProfile2 = async (query) => {
|
|
485
|
+
var getProfile2 = async (query, options) => {
|
|
488
486
|
return await getProfile({
|
|
489
487
|
query,
|
|
490
|
-
meta: getApiKeyMeta()
|
|
488
|
+
meta: getApiKeyMeta(),
|
|
489
|
+
...options
|
|
491
490
|
});
|
|
492
491
|
};
|
|
493
|
-
var getProfileBalances2 = async (query) => {
|
|
492
|
+
var getProfileBalances2 = async (query, options) => {
|
|
494
493
|
return await getProfileBalances({
|
|
495
494
|
query,
|
|
496
|
-
meta: getApiKeyMeta()
|
|
495
|
+
meta: getApiKeyMeta(),
|
|
496
|
+
...options
|
|
497
497
|
});
|
|
498
498
|
};
|
|
499
499
|
|
|
500
500
|
// src/api/explore.ts
|
|
501
|
-
var createExploreQuery = (listType, options) => getExplore({
|
|
501
|
+
var createExploreQuery = (query, listType, options) => getExplore({
|
|
502
502
|
...options,
|
|
503
|
-
query: { ...
|
|
503
|
+
query: { ...query, listType },
|
|
504
504
|
meta: getApiKeyMeta()
|
|
505
505
|
});
|
|
506
|
-
var getCoinsTopGainers = (options) => createExploreQuery("TOP_GAINERS", options);
|
|
507
|
-
var getCoinsTopVolume24h = (options) => createExploreQuery("TOP_VOLUME_24H", options);
|
|
508
|
-
var getCoinsMostValuable = (options) => createExploreQuery("MOST_VALUABLE", options);
|
|
509
|
-
var getCoinsNew = (options) => createExploreQuery("NEW", options);
|
|
510
|
-
var getCoinsLastTraded = (options) => createExploreQuery("LAST_TRADED", options);
|
|
511
|
-
var getCoinsLastTradedUnique = (options) => createExploreQuery("LAST_TRADED_UNIQUE", options);
|
|
506
|
+
var getCoinsTopGainers = (query = {}, options) => createExploreQuery(query, "TOP_GAINERS", options);
|
|
507
|
+
var getCoinsTopVolume24h = (query = {}, options) => createExploreQuery(query, "TOP_VOLUME_24H", options);
|
|
508
|
+
var getCoinsMostValuable = (query = {}, options) => createExploreQuery(query, "MOST_VALUABLE", options);
|
|
509
|
+
var getCoinsNew = (query = {}, options) => createExploreQuery(query, "NEW", options);
|
|
510
|
+
var getCoinsLastTraded = (query = {}, options) => createExploreQuery(query, "LAST_TRADED", options);
|
|
511
|
+
var getCoinsLastTradedUnique = (query = {}, options) => createExploreQuery(query, "LAST_TRADED_UNIQUE", options);
|
|
512
512
|
|
|
513
513
|
// src/metadata/cleanAndValidateMetadataURI.ts
|
|
514
514
|
function cleanAndValidateMetadataURI(uri) {
|
|
@@ -570,33 +570,33 @@ async function validateMetadataURIContent(metadataURI) {
|
|
|
570
570
|
const metadataJson = await response.json();
|
|
571
571
|
return validateMetadataJSON(metadataJson);
|
|
572
572
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
exports.cleanAndValidateMetadataURI = cleanAndValidateMetadataURI; exports.createCoin = createCoin; exports.createCoinCall = createCoinCall; exports.getCoin = getCoin2; exports.getCoinComments = getCoinComments2; exports.getCoinCreateFromLogs = getCoinCreateFromLogs; exports.getCoins = getCoins2; exports.getCoinsLastTraded = getCoinsLastTraded; exports.getCoinsLastTradedUnique = getCoinsLastTradedUnique; exports.getCoinsMostValuable = getCoinsMostValuable; exports.getCoinsNew = getCoinsNew; exports.getCoinsTopGainers = getCoinsTopGainers; exports.getCoinsTopVolume24h = getCoinsTopVolume24h; exports.getOnchainCoinDetails = getOnchainCoinDetails; exports.getProfile = getProfile2; exports.getProfileBalances = getProfileBalances2; exports.getTradeFromLogs = getTradeFromLogs; exports.setApiKey = setApiKey; exports.simulateBuy = simulateBuy; exports.tradeCoin = tradeCoin; exports.tradeCoinCall = tradeCoinCall; exports.updateCoinURI = updateCoinURI; exports.updateCoinURICall = updateCoinURICall; exports.updatePayoutRecipient = updatePayoutRecipient; exports.updatePayoutRecipientCall = updatePayoutRecipientCall; exports.validateMetadataJSON = validateMetadataJSON; exports.validateMetadataURIContent = validateMetadataURIContent;
|
|
602
602
|
//# sourceMappingURL=index.cjs.map
|