@zoralabs/coins-sdk 0.0.2-sdkalpha.7 → 0.0.2-sdkalpha.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/api/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,sBAAsB,EACtB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAU7B,eAAO,MAAM,OAAO,UAAiB,WAAW,CAAC,OAAO,CAAC;;;cAF/B,CAAC;gBAExB,CAAC;uBAA2B,CAAC;mBAAuB,CAAC;kBACzC,CAAA;uBAEX,CAAA;uBACA,CAAC;qBAGe,CAAC;qBACR,CAAC;0BAGH,CAAC;2BACI,CAAC;sBAEJ,CAAC;4BACP,CAAC;+BACU,CAAC;;6BACX,CAAH;iCACgB,CAAC;;yBAGP,CAAC;;qBAIF,CAAC;6BAAiC,CAAC;mBAAuB,CAAC;0BAClD,CAAC;kBAEpB,CAAJ;kBAAsB,CAAC;4BAIb,CAAC;wBAA0B,CAAC;qBAAuB,CAAC;;iBACxC,CAAC;wBAEnB,CAAF;2BACE,CAAC;sBAGc,CAAC;4BACX,CAAA;sBAAwB,CAAC;wBAEvB,CAAC;;qBACL,CAAC;qBACM,CAAC;;yBAGE,CAAC;wBAA4B,CAAC;wBAAyF,CAAC;6BAAkH,CAAC;+BAAwH,CAAC;;qBAAmC,CAAC;qBAAuB,CAAC;wBAAwB,CAAC;0BAA0B,CAAC;2BAA2B,CAAC;+BAA+B,CAAC;6BAA6B,CAAC;+BAA+B,CAAC;sBAAqG,CAAC;0BAA0B,CAAC;0BAA0B,CAAC;oCAA4B,CAAC;gCAA8B,CAAC;6BAA2B,CAAC;;;;;;;;;;;;;EA1Cl1B,CAAC;AAEF,eAAO,MAAM,QAAQ,gCAGlB;IACD,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CA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AC;oCAAkC,CAAC;oCAAiH,CAAC;yCAA0I,CAAC;2CAAgJ,CAAC;;iCAA+C,CAAC;iCAA6B,CAAC;oCAA8B,CAAC;sCAAgC,CAAC;uCAAiC,CAAC;2CAAqC,CAAC;yCAAmC,CAAC;2CAAqC,CAAC;kCAA6H,CAAC;sCAAgC,CAAC;sCAAgC,CAAC;gDAAkC,CAAC;4CAAoC,CAAC;yCAAiC,CAAC;;;;;;;oBAA6K,CAAC;2BAA0G,CAAC;yBAAiH,CAAC;;;;;;;;EAD30U,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,75 +1,26 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
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
- // src/actions/createCoin.ts
53
- var import_coins2 = require("@zoralabs/coins");
54
- var import_viem = require("viem");
4
+
5
+ var _viem = require('viem');
55
6
 
56
7
  // src/constants.ts
57
- var import_coins = require("@zoralabs/coins");
58
- var import_chains = require("viem/chains");
59
- var COIN_FACTORY_ADDRESS = import_coins.zoraFactoryImplAddress["8453"];
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
- [import_chains.base.id]: "0xd0b53D9277642d899DF5C87A3966A349A798F224"
13
+ [_chains.base.id]: "0xd0b53D9277642d899DF5C87A3966A349A798F224"
63
14
  };
64
15
 
65
16
  // src/utils/validateClientNetwork.ts
66
- var import_chains2 = require("viem/chains");
17
+
67
18
  var validateClientNetwork = (publicClient) => {
68
- const clientChainId = publicClient?.chain?.id;
69
- if (clientChainId === import_chains2.base.id) {
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 === import_chains2.baseSepolia.id) {
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: import_coins2.zoraFactoryImplABI,
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, import_viem.parseEventLogs)({
115
- abi: import_coins2.zoraFactoryImplABI,
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")?.args;
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?.gasMultiplier ?? 100) / 100n;
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,19 @@ async function createCoin(call, walletClient, publicClient, options) {
132
83
  return {
133
84
  hash,
134
85
  receipt,
135
- address: deployment?.coin,
86
+ address: _optionalChain([deployment, 'optionalAccess', _7 => _7.coin]),
136
87
  deployment
137
88
  };
138
89
  }
139
90
 
140
91
  // src/actions/tradeCoin.ts
141
- var import_coins3 = require("@zoralabs/coins");
142
- var import_viem2 = require("viem");
143
- var import_chains3 = require("viem/chains");
92
+
93
+
94
+
95
+
96
+
97
+
98
+
144
99
  function tradeCoinCall({
145
100
  target,
146
101
  direction,
@@ -149,11 +104,11 @@ function tradeCoinCall({
149
104
  orderSize,
150
105
  minAmountOut = 0n,
151
106
  sqrtPriceLimitX96 = 0n,
152
- tradeReferrer = import_viem2.zeroAddress
107
+ tradeReferrer = _viem.zeroAddress
153
108
  }
154
109
  }) {
155
110
  return {
156
- abi: import_coins3.coinABI,
111
+ abi: _coins.coinABI,
157
112
  functionName: direction,
158
113
  address: target,
159
114
  args: [
@@ -167,14 +122,14 @@ function tradeCoinCall({
167
122
  };
168
123
  }
169
124
  function getTradeFromLogs(receipt, direction) {
170
- const eventLogs = (0, import_viem2.parseEventLogs)({
171
- abi: import_coins3.coinABI,
125
+ const eventLogs = _viem.parseEventLogs.call(void 0, {
126
+ abi: _coins.coinABI,
172
127
  logs: receipt.logs
173
128
  });
174
129
  if (direction === "buy") {
175
- return eventLogs.find((log) => log.eventName === "CoinBuy")?.args;
130
+ return _optionalChain([eventLogs, 'access', _8 => _8.find, 'call', _9 => _9((log) => log.eventName === "CoinBuy"), 'optionalAccess', _10 => _10.args]);
176
131
  }
177
- return eventLogs.find((log) => log.eventName === "CoinSell")?.args;
132
+ return _optionalChain([eventLogs, 'access', _11 => _11.find, 'call', _12 => _12((log) => log.eventName === "CoinSell"), 'optionalAccess', _13 => _13.args]);
178
133
  }
179
134
  async function tradeCoin(params, walletClient, publicClient) {
180
135
  validateClientNetwork(publicClient);
@@ -193,11 +148,16 @@ async function tradeCoin(params, walletClient, publicClient) {
193
148
  }
194
149
 
195
150
  // src/actions/getOnchainCoinDetails.ts
196
- var import_coins4 = require("@zoralabs/coins");
197
- var import_viem3 = require("viem");
151
+
152
+
153
+
154
+
155
+
156
+
157
+
198
158
  async function getOnchainCoinDetails({
199
159
  coin,
200
- user = import_viem3.zeroAddress,
160
+ user = _viem.zeroAddress,
201
161
  publicClient
202
162
  }) {
203
163
  validateClientNetwork(publicClient);
@@ -206,30 +166,30 @@ async function getOnchainCoinDetails({
206
166
  contracts: [
207
167
  {
208
168
  address: coin,
209
- abi: import_coins4.coinABI,
169
+ abi: _coins.coinABI,
210
170
  functionName: "balanceOf",
211
171
  args: [user]
212
172
  },
213
173
  {
214
174
  address: coin,
215
- abi: import_coins4.coinABI,
175
+ abi: _coins.coinABI,
216
176
  functionName: "poolAddress"
217
177
  },
218
178
  {
219
179
  address: coin,
220
- abi: import_coins4.coinABI,
180
+ abi: _coins.coinABI,
221
181
  functionName: "owners"
222
182
  },
223
183
  {
224
184
  address: coin,
225
- abi: import_coins4.coinABI,
185
+ abi: _coins.coinABI,
226
186
  functionName: "payoutRecipient"
227
187
  }
228
188
  ],
229
189
  allowFailure: false
230
190
  }
231
191
  );
232
- const USDC_WETH_POOL = USDC_WETH_POOLS_BY_CHAIN[publicClient.chain?.id || 0];
192
+ const USDC_WETH_POOL = USDC_WETH_POOLS_BY_CHAIN[_optionalChain([publicClient, 'access', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) || 0];
233
193
  const [
234
194
  coinWethPoolSlot0,
235
195
  coinWethPoolToken0,
@@ -241,34 +201,34 @@ async function getOnchainCoinDetails({
241
201
  contracts: [
242
202
  {
243
203
  address: pool,
244
- abi: import_coins4.iUniswapV3PoolABI,
204
+ abi: _coins.iUniswapV3PoolABI,
245
205
  functionName: "slot0"
246
206
  },
247
207
  {
248
208
  address: pool,
249
- abi: import_coins4.iUniswapV3PoolABI,
209
+ abi: _coins.iUniswapV3PoolABI,
250
210
  functionName: "token0"
251
211
  },
252
212
  {
253
213
  address: coin,
254
- abi: import_viem3.erc20Abi,
214
+ abi: _viem.erc20Abi,
255
215
  functionName: "balanceOf",
256
216
  args: [pool]
257
217
  },
258
218
  {
259
219
  address: coin,
260
- abi: import_coins4.coinABI,
220
+ abi: _coins.coinABI,
261
221
  functionName: "totalSupply"
262
222
  },
263
223
  {
264
224
  address: SUPERCHAIN_WETH_ADDRESS,
265
- abi: import_viem3.erc20Abi,
225
+ abi: _viem.erc20Abi,
266
226
  functionName: "balanceOf",
267
227
  args: [pool]
268
228
  },
269
229
  {
270
- address: USDC_WETH_POOL ?? coin,
271
- abi: import_coins4.iUniswapV3PoolABI,
230
+ address: _nullishCoalesce(USDC_WETH_POOL, () => ( coin)),
231
+ abi: _coins.iUniswapV3PoolABI,
272
232
  functionName: "slot0"
273
233
  }
274
234
  ],
@@ -285,7 +245,7 @@ async function getOnchainCoinDetails({
285
245
  coinWethPoolSlot0.sqrtPriceX96,
286
246
  18,
287
247
  18,
288
- (0, import_viem3.isAddressEqual)(coinWethPoolToken0, coin),
248
+ _viem.isAddressEqual.call(void 0, coinWethPoolToken0, coin),
289
249
  18
290
250
  );
291
251
  const marketCap = coinPriceInWeth * coinTotalSupply / 10n ** 18n;
@@ -307,9 +267,9 @@ async function getOnchainCoinDetails({
307
267
  function convertEthOutput(amountETH, wethToUsdc) {
308
268
  return {
309
269
  eth: amountETH,
310
- ethDecimal: parseFloat((0, import_viem3.formatEther)(amountETH)),
270
+ ethDecimal: parseFloat(_viem.formatEther.call(void 0, amountETH)),
311
271
  usdc: wethToUsdc ? amountETH * wethToUsdc : null,
312
- usdcDecimal: wethToUsdc ? parseFloat((0, import_viem3.formatEther)(amountETH * wethToUsdc / 10n ** 18n)) : null
272
+ usdcDecimal: wethToUsdc ? parseFloat(_viem.formatEther.call(void 0, amountETH * wethToUsdc / 10n ** 18n)) : null
313
273
  };
314
274
  }
315
275
  function uniswapV3SqrtPriceToBigIntScaled(sqrtPriceX96, token0Decimals, token1Decimals, isToken0Coin, scaleDecimals = 18) {
@@ -333,8 +293,10 @@ function uniswapV3SqrtPriceToBigIntScaled(sqrtPriceX96, token0Decimals, token1De
333
293
  }
334
294
 
335
295
  // src/actions/updateCoinURI.ts
336
- var import_coins5 = require("@zoralabs/coins");
337
- var import_viem4 = require("viem");
296
+
297
+
298
+
299
+
338
300
  function updateCoinURICall({
339
301
  newURI,
340
302
  coin
@@ -343,7 +305,7 @@ function updateCoinURICall({
343
305
  throw new Error("URI needs to be an ipfs:// prefix uri");
344
306
  }
345
307
  return {
346
- abi: import_coins5.coinABI,
308
+ abi: _coins.coinABI,
347
309
  address: coin,
348
310
  functionName: "setContractURI",
349
311
  args: [newURI]
@@ -358,7 +320,7 @@ async function updateCoinURI(args, walletClient, publicClient) {
358
320
  });
359
321
  const hash = await walletClient.writeContract(request);
360
322
  const receipt = await publicClient.waitForTransactionReceipt({ hash });
361
- const eventLogs = (0, import_viem4.parseEventLogs)({ abi: import_coins5.coinABI, logs: receipt.logs });
323
+ const eventLogs = _viem.parseEventLogs.call(void 0, { abi: _coins.coinABI, logs: receipt.logs });
362
324
  const uriUpdated = eventLogs.find(
363
325
  (log) => log.eventName === "ContractURIUpdated"
364
326
  );
@@ -366,14 +328,16 @@ async function updateCoinURI(args, walletClient, publicClient) {
366
328
  }
367
329
 
368
330
  // src/actions/updatePayoutRecipient.ts
369
- var import_coins6 = require("@zoralabs/coins");
370
- var import_viem5 = require("viem");
331
+
332
+
333
+
334
+
371
335
  function updatePayoutRecipientCall({
372
336
  newPayoutRecipient,
373
337
  coin
374
338
  }) {
375
339
  return {
376
- abi: import_coins6.coinABI,
340
+ abi: _coins.coinABI,
377
341
  address: coin,
378
342
  functionName: "setPayoutRecipient",
379
343
  args: [newPayoutRecipient]
@@ -388,7 +352,7 @@ async function updatePayoutRecipient(args, walletClient, publicClient) {
388
352
  });
389
353
  const hash = await walletClient.writeContract(request);
390
354
  const receipt = await publicClient.waitForTransactionReceipt({ hash });
391
- const eventLogs = (0, import_viem5.parseEventLogs)({ abi: import_coins6.coinABI, logs: receipt.logs });
355
+ const eventLogs = _viem.parseEventLogs.call(void 0, { abi: _coins.coinABI, logs: receipt.logs });
392
356
  const payoutRecipientUpdated = eventLogs.find(
393
357
  (log) => log.eventName === "CoinPayoutRecipientUpdated"
394
358
  );
@@ -396,46 +360,49 @@ async function updatePayoutRecipient(args, walletClient, publicClient) {
396
360
  }
397
361
 
398
362
  // src/client/client.gen.ts
399
- var import_client_fetch = require("@hey-api/client-fetch");
400
- var client = (0, import_client_fetch.createClient)(
401
- (0, import_client_fetch.createConfig)({
363
+
364
+
365
+
366
+ var _clientfetch = require('@hey-api/client-fetch');
367
+ var client = _clientfetch.createClient.call(void 0,
368
+ _clientfetch.createConfig.call(void 0, {
402
369
  baseUrl: "https://api-sdk.zora.engineering/"
403
370
  })
404
371
  );
405
372
 
406
373
  // src/client/sdk.gen.ts
407
374
  var getCoin = (options) => {
408
- return (options.client ?? client).get({
375
+ return (_nullishCoalesce(options.client, () => ( client))).get({
409
376
  url: "/coin",
410
377
  ...options
411
378
  });
412
379
  };
413
380
  var getCoinComments = (options) => {
414
- return (options.client ?? client).get({
381
+ return (_nullishCoalesce(options.client, () => ( client))).get({
415
382
  url: "/coinComments",
416
383
  ...options
417
384
  });
418
385
  };
419
386
  var getCoins = (options) => {
420
- return (options.client ?? client).get({
387
+ return (_nullishCoalesce(options.client, () => ( client))).get({
421
388
  url: "/coins",
422
389
  ...options
423
390
  });
424
391
  };
425
392
  var getExplore = (options) => {
426
- return (options.client ?? client).get({
393
+ return (_nullishCoalesce(options.client, () => ( client))).get({
427
394
  url: "/explore",
428
395
  ...options
429
396
  });
430
397
  };
431
398
  var getProfile = (options) => {
432
- return (options.client ?? client).get({
399
+ return (_nullishCoalesce(options.client, () => ( client))).get({
433
400
  url: "/profile",
434
401
  ...options
435
402
  });
436
403
  };
437
404
  var getProfileBalances = (options) => {
438
- return (options.client ?? client).get({
405
+ return (_nullishCoalesce(options.client, () => ( client))).get({
439
406
  url: "/profileBalances",
440
407
  ...options
441
408
  });
@@ -500,7 +467,7 @@ var getProfileBalances2 = async (query) => {
500
467
  // src/api/explore.ts
501
468
  var createExploreQuery = (listType, options) => getExplore({
502
469
  ...options,
503
- query: { ...options?.query, listType },
470
+ query: { ..._optionalChain([options, 'optionalAccess', _16 => _16.query]), listType },
504
471
  meta: getApiKeyMeta()
505
472
  });
506
473
  var getCoinsTopGainers = (options) => createExploreQuery("TOP_GAINERS", options);
@@ -570,33 +537,32 @@ async function validateMetadataURIContent(metadataURI) {
570
537
  const metadataJson = await response.json();
571
538
  return validateMetadataJSON(metadataJson);
572
539
  }
573
- // Annotate the CommonJS export names for ESM import in node:
574
- 0 && (module.exports = {
575
- cleanAndValidateMetadataURI,
576
- createCoin,
577
- createCoinCall,
578
- getCoin,
579
- getCoinComments,
580
- getCoinCreateFromLogs,
581
- getCoins,
582
- getCoinsLastTraded,
583
- getCoinsLastTradedUnique,
584
- getCoinsMostValuable,
585
- getCoinsNew,
586
- getCoinsTopGainers,
587
- getCoinsTopVolume24h,
588
- getOnchainCoinDetails,
589
- getProfile,
590
- getProfileBalances,
591
- getTradeFromLogs,
592
- setApiKey,
593
- tradeCoin,
594
- tradeCoinCall,
595
- updateCoinURI,
596
- updateCoinURICall,
597
- updatePayoutRecipient,
598
- updatePayoutRecipientCall,
599
- validateMetadataJSON,
600
- validateMetadataURIContent
601
- });
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+ 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.tradeCoin = tradeCoin; exports.tradeCoinCall = tradeCoinCall; exports.updateCoinURI = updateCoinURI; exports.updateCoinURICall = updateCoinURICall; exports.updatePayoutRecipient = updatePayoutRecipient; exports.updatePayoutRecipientCall = updatePayoutRecipientCall; exports.validateMetadataJSON = validateMetadataJSON; exports.validateMetadataURIContent = validateMetadataURIContent;
602
568
  //# sourceMappingURL=index.cjs.map