@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.
- package/CHANGELOG.md +6 -0
- package/dist/api/explore.d.ts +13 -333
- 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 +26 -243
- package/dist/api/queries.d.ts.map +1 -1
- package/dist/index.cjs +107 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api/explore.ts +17 -10
- package/src/api/index.ts +2 -0
- package/src/api/queries.ts +41 -7
- package/src/index.ts +3 -3
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/api/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAU7B,KAAK,oBAAoB,CAAC,CAAC,IAAI,OAAO,CAAC;IAAE,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,KAAK,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,OAAO,UACX,YAAY,KAClB,OAAO,CAAC;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,CAKpC,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,YAAY,EAAE,aAAa,EAAE,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,QAAQ,gCAGlB,aAAa,KAAG,oBAAoB,CAAC,gBAAgB,CAUvD,CAAC;AAEF,KAAK,oBAAoB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AACrC,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,eAAO,MAAM,eAAe,UACnB,oBAAoB,KAC1B,oBAAoB,CAAC,uBAAuB,CAK9C,CAAC;AAEF,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,eAAO,MAAM,UAAU,UACd,eAAe,KACrB,oBAAoB,CAAC,kBAAkB,CAKzC,CAAC;AAEF,KAAK,uBAAuB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,CAAC;AACxC,YAAY,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEtE,eAAO,MAAM,kBAAkB,UACtB,sBAAsB,CAAC,OAAO,CAAC;;;;;;;;;wBAOo0O,CAAC;oBAAwB,CAAC;iBAAqB,CAAC;;;iBAAiD,CAAC;iBAAqB,CAAC;oBAAsB,CAAC;2BAAqB,CAAC;sBAAqG,CAAC;wBAAwB,CAAC;0BAAuG,CAAC;4BAA0B,CAAC;mCAAiC,CAAC;+BAA6B,CAAC;8BAA4B,CAAC;mCAAiC,CAAC;mCAAiC,CAAC;iCAA+B,CAAC;iCAA+B,CAAC;sCAAoC,CAAC;uCAAqC,CAAC;kCAA8B,CAAC;wCAA4B,CAAC;2CAA6B,CAAC;;yCAAsD,CAAC;6CAAuC,CAAC;;qCAAkD,CAAC;;iCAA+C,CAAC;yCAAuC,CAAC;+BAA6B,CAAC;sCAAoC,CAAC;8BAA4B,CAAC;8BAA4B,CAAC;wCAA8B,CAAC;oCAAgC,CAAC;iCAA6B,CAAC;;6BAA0C,CAAC;oCAA0B,CAAC;uCAAmC,CAAC;kCAA8B,CAAC;wCAAoC,CAAC;kCAA8B,CAAC;oCAAgC,CAAC;;iCAA8C,CAAC;iCAAuB,CAAC;;qCAAkD,CAAC;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
|
|
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,19 @@ 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
|
+
|
|
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 =
|
|
107
|
+
tradeReferrer = _viem.zeroAddress
|
|
153
108
|
}
|
|
154
109
|
}) {
|
|
155
110
|
return {
|
|
156
|
-
abi:
|
|
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,
|
|
171
|
-
abi:
|
|
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")
|
|
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")
|
|
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
|
-
|
|
197
|
-
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
198
158
|
async function getOnchainCoinDetails({
|
|
199
159
|
coin,
|
|
200
|
-
user =
|
|
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:
|
|
169
|
+
abi: _coins.coinABI,
|
|
210
170
|
functionName: "balanceOf",
|
|
211
171
|
args: [user]
|
|
212
172
|
},
|
|
213
173
|
{
|
|
214
174
|
address: coin,
|
|
215
|
-
abi:
|
|
175
|
+
abi: _coins.coinABI,
|
|
216
176
|
functionName: "poolAddress"
|
|
217
177
|
},
|
|
218
178
|
{
|
|
219
179
|
address: coin,
|
|
220
|
-
abi:
|
|
180
|
+
abi: _coins.coinABI,
|
|
221
181
|
functionName: "owners"
|
|
222
182
|
},
|
|
223
183
|
{
|
|
224
184
|
address: coin,
|
|
225
|
-
abi:
|
|
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
|
|
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:
|
|
204
|
+
abi: _coins.iUniswapV3PoolABI,
|
|
245
205
|
functionName: "slot0"
|
|
246
206
|
},
|
|
247
207
|
{
|
|
248
208
|
address: pool,
|
|
249
|
-
abi:
|
|
209
|
+
abi: _coins.iUniswapV3PoolABI,
|
|
250
210
|
functionName: "token0"
|
|
251
211
|
},
|
|
252
212
|
{
|
|
253
213
|
address: coin,
|
|
254
|
-
abi:
|
|
214
|
+
abi: _viem.erc20Abi,
|
|
255
215
|
functionName: "balanceOf",
|
|
256
216
|
args: [pool]
|
|
257
217
|
},
|
|
258
218
|
{
|
|
259
219
|
address: coin,
|
|
260
|
-
abi:
|
|
220
|
+
abi: _coins.coinABI,
|
|
261
221
|
functionName: "totalSupply"
|
|
262
222
|
},
|
|
263
223
|
{
|
|
264
224
|
address: SUPERCHAIN_WETH_ADDRESS,
|
|
265
|
-
abi:
|
|
225
|
+
abi: _viem.erc20Abi,
|
|
266
226
|
functionName: "balanceOf",
|
|
267
227
|
args: [pool]
|
|
268
228
|
},
|
|
269
229
|
{
|
|
270
|
-
address: USDC_WETH_POOL
|
|
271
|
-
abi:
|
|
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,
|
|
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,
|
|
270
|
+
ethDecimal: parseFloat(_viem.formatEther.call(void 0, amountETH)),
|
|
311
271
|
usdc: wethToUsdc ? amountETH * wethToUsdc : null,
|
|
312
|
-
usdcDecimal: wethToUsdc ? parseFloat((0,
|
|
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
|
-
|
|
337
|
-
|
|
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:
|
|
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,
|
|
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
|
-
|
|
370
|
-
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
371
335
|
function updatePayoutRecipientCall({
|
|
372
336
|
newPayoutRecipient,
|
|
373
337
|
coin
|
|
374
338
|
}) {
|
|
375
339
|
return {
|
|
376
|
-
abi:
|
|
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,
|
|
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
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
});
|
|
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
|