@medialane/sdk 0.155.0 → 0.156.0
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/dist/chunk-3PZUSEAW.js +63 -0
- package/dist/chunk-3PZUSEAW.js.map +1 -0
- package/dist/chunk-ASDN46XU.js +1778 -0
- package/dist/chunk-ASDN46XU.js.map +1 -0
- package/dist/chunk-OUPVVMLK.cjs +68 -0
- package/dist/chunk-OUPVVMLK.cjs.map +1 -0
- package/dist/chunk-ZFRHADHR.cjs +1854 -0
- package/dist/chunk-ZFRHADHR.cjs.map +1 -0
- package/dist/evm/index.cjs +3 -55
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.js +1 -53
- package/dist/evm/index.js.map +1 -1
- package/dist/index.cjs +275 -1718
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1651
- package/dist/index.js.map +1 -1
- package/dist/solana/index.cjs +2 -56
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.js +1 -55
- package/dist/solana/index.js.map +1 -1
- package/dist/starknet/index.cjs +113 -1967
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +1 -111
- package/dist/starknet/index.d.ts +1 -111
- package/dist/starknet/index.js +9 -1887
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.cjs +2 -56
- package/dist/stellar/index.cjs.map +1 -1
- package/dist/stellar/index.js +1 -55
- package/dist/stellar/index.js.map +1 -1
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -1,1150 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var base = require('@scure/base');
|
|
3
|
+
var chunkZFRHADHR_cjs = require('../chunk-ZFRHADHR.cjs');
|
|
4
|
+
var chunkOUPVVMLK_cjs = require('../chunk-OUPVVMLK.cjs');
|
|
6
5
|
var starknet = require('starknet');
|
|
7
6
|
var hkdf_js = require('@noble/hashes/hkdf.js');
|
|
8
7
|
var sha2_js = require('@noble/hashes/sha2.js');
|
|
9
8
|
|
|
10
|
-
// src/config.ts
|
|
11
|
-
|
|
12
|
-
// src/chains.ts
|
|
13
|
-
var CHAINS = ["STARKNET", "ETHEREUM", "SOLANA", "BASE", "STELLAR", "BITCOIN"];
|
|
14
|
-
var COORDINATES = {
|
|
15
|
-
STARKNET: {
|
|
16
|
-
rpcUrl: "https://rpc.starknet.lava.build",
|
|
17
|
-
marketplace721: "0x03eda9a2b6ad90845a43591bac8083ebaf677d51fdf20f503b2c01889e3131fc",
|
|
18
|
-
marketplace721ClassHash: "0x0700d9230d07e5203e27778c0dc70f9134d2b25bf319f7cf8348dc66a6923e90",
|
|
19
|
-
marketplace721StartBlock: 11198146,
|
|
20
|
-
marketplace1155: "0x07c4ce1c19ea48cc11135ed22b19ff745f5aec508c3828593002e4f76fdb1b38",
|
|
21
|
-
marketplace1155ClassHash: "0x0242f5c388da7cee2d99e2a69453c8159bf927fbec4e797a3cfdcbbcb5b68328",
|
|
22
|
-
marketplace1155StartBlock: 11198267,
|
|
23
|
-
collection721: "0x0225c3ae09506b8d97adc39649ca740dad5aac195b7f5f0441cc1852947acaea",
|
|
24
|
-
collection721StartBlock: 11198496,
|
|
25
|
-
dataTokenization721: "0x07421b4442f7f2052c65408fb3561484154cf8175a0bbb41e3cd38d9087af6d2",
|
|
26
|
-
dataTokenization721StartBlock: 14670294,
|
|
27
|
-
ipNftClassHash: "0x012d3ae40ba35c7e2be0946532dac60e48932447912fdf96b674da67c029b9cc",
|
|
28
|
-
ipCollectionClassHash: "0x022155a1a130a40e57aac4b89c07fab3f616bc351b1270fc40f756b963afe8b4",
|
|
29
|
-
collection1155: "0x015368976d46fae5bfa1c58600f641d5aa5dbbf53ebc6b78aa3922194aad3551",
|
|
30
|
-
collection1155FactoryClassHash: "0x04eb6b419770f13bd191f120b9fc9ee624c0613ad4490062d293ca2016b3b1d2",
|
|
31
|
-
collection1155ClassHash: "0x06cf3f5a2322dac35e07a6064a5b8802f19fda8aa3f4726f0cb7bc05dea1bd78",
|
|
32
|
-
collection1155StartBlock: 11199527,
|
|
33
|
-
popFactory: "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111",
|
|
34
|
-
popCollectionClassHash: "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f",
|
|
35
|
-
dropFactory: "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800",
|
|
36
|
-
dropCollectionClassHash: "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282",
|
|
37
|
-
nftComments: "0x02cdac70c94447189af0389dfea63f4d5e4154ea8a563de288a5ab1c39e37843",
|
|
38
|
-
creatorCoinFactory: "0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c",
|
|
39
|
-
creatorCoinEkuboLauncher: "0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4",
|
|
40
|
-
creatorCoinClassHash: "0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6",
|
|
41
|
-
creatorCoinFactoryClassHash: "0x51765926b1344c9a20b8cd4b5abe7b7d47375ae97cf6804db3ea5d4b05a9b55",
|
|
42
|
-
creatorCoinStartBlock: 10474544,
|
|
43
|
-
ekuboCore: "0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
|
|
44
|
-
ipTicketsFactory: "0x0767bf5b57e1f812463159b5ed683183e1b0c3f942b74871b5c6cd6a93c15e99",
|
|
45
|
-
ipTicketCollectionClassHash: "0x0449e8eb7c117740d07cb8e0157d32c8ba3d19d1cfd2784ed5e139f5a1e04acc",
|
|
46
|
-
ipTicketsFactoryClassHash: "0x04a739ac3a673ebd0db96bb24475600797c3ed34827e79517f9b2b1640276e6a",
|
|
47
|
-
ipTicketsStartBlock: 11933694,
|
|
48
|
-
ipClubFactory: "0x06a0b0be16d70c78f2e18119dbf90e5911cbfd5d8d484bc555dc61d96f56a2b9",
|
|
49
|
-
ipClubFactoryClassHash: "0x05d9d431bd3532b1fa4d5bab572f49c5ad8034ee3cc83951aa41ae82c9cad266",
|
|
50
|
-
ipClubCollectionClassHash: "0x05b8477c72e6bf0cf64967d71155021fd4d77d9a57e8805c6b40709121c002c5",
|
|
51
|
-
ipClubFactoryStartBlock: 11928775,
|
|
52
|
-
ipSponsorship: "0x03729ebe0fedf29ec97fca34db09174772af7f870af26a26e024a61040143e5c",
|
|
53
|
-
ipSponsorshipClassHash: "0x0626daac2ed7e2bf630ef5b10104b3202db1559216c0c1a504c0e99be2fbfec3",
|
|
54
|
-
ipSponsorshipStartBlock: 11896456,
|
|
55
|
-
mediaWalletClassHash: "0x014b210c7d47392691144bafecdca3c6c7791cc295ea305988da0a724c05ac31",
|
|
56
|
-
genesisMint: "0x06ed61abba98a44d45bed2c4b1a456df15053c3321cfd6e007afb33b7226c9f0"
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
function getCoordinates(chain) {
|
|
60
|
-
const c = COORDINATES[chain];
|
|
61
|
-
if (!c) throw new Error(`No coordinates configured for chain "${chain}"`);
|
|
62
|
-
return c;
|
|
63
|
-
}
|
|
64
|
-
var DEFAULT_CHAIN = "STARKNET";
|
|
65
|
-
function getStarknetCoordinates(chain) {
|
|
66
|
-
if (chain !== "STARKNET") {
|
|
67
|
-
throw new Error(`This module is Starknet-only (client chain: "${chain}")`);
|
|
68
|
-
}
|
|
69
|
-
return getCoordinates("STARKNET");
|
|
70
|
-
}
|
|
71
|
-
var FeeConfigSchema = zod.z.object({
|
|
72
|
-
enabled: zod.z.boolean().default(true),
|
|
73
|
-
fundAddress: zod.z.string().min(1).optional(),
|
|
74
|
-
marketplaceBps: zod.z.number().int().min(0).max(1e4).default(100),
|
|
75
|
-
launchpadBps: zod.z.number().int().min(0).max(1e4).default(100),
|
|
76
|
-
sponsorshipBps: zod.z.number().int().min(0).max(1e4).default(100)
|
|
77
|
-
});
|
|
78
|
-
function resolveFeeConfig(raw) {
|
|
79
|
-
const p = FeeConfigSchema.parse(raw ?? {});
|
|
80
|
-
return {
|
|
81
|
-
enabled: p.enabled,
|
|
82
|
-
fundAddress: p.fundAddress,
|
|
83
|
-
marketplaceBps: p.marketplaceBps,
|
|
84
|
-
launchpadBps: p.launchpadBps,
|
|
85
|
-
sponsorshipBps: p.sponsorshipBps
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/config.ts
|
|
90
|
-
var MedialaneConfigSchema = zod.z.object({
|
|
91
|
-
chain: zod.z.enum(CHAINS).default(DEFAULT_CHAIN),
|
|
92
|
-
rpcUrl: zod.z.string().url().optional(),
|
|
93
|
-
backendUrl: zod.z.string().url().optional(),
|
|
94
|
-
apiKey: zod.z.string().optional(),
|
|
95
|
-
marketplace721Contract: zod.z.string().optional(),
|
|
96
|
-
marketplaceContract: zod.z.string().optional(),
|
|
97
|
-
marketplace1155Contract: zod.z.string().optional(),
|
|
98
|
-
collection721Contract: zod.z.string().optional(),
|
|
99
|
-
collectionContract: zod.z.string().optional(),
|
|
100
|
-
collection1155Contract: zod.z.string().optional(),
|
|
101
|
-
retryOptions: zod.z.object({
|
|
102
|
-
maxAttempts: zod.z.number().int().min(1).max(10).optional(),
|
|
103
|
-
baseDelayMs: zod.z.number().int().min(0).optional(),
|
|
104
|
-
maxDelayMs: zod.z.number().int().min(0).optional()
|
|
105
|
-
}).optional(),
|
|
106
|
-
feeConfig: FeeConfigSchema.optional()
|
|
107
|
-
});
|
|
108
|
-
function resolveConfig(raw) {
|
|
109
|
-
const parsed = MedialaneConfigSchema.parse(raw);
|
|
110
|
-
const coords = getCoordinates(parsed.chain);
|
|
111
|
-
const sn = parsed.chain === "STARKNET" ? coords : {};
|
|
112
|
-
const marketplace721Contract = parsed.marketplace721Contract ?? parsed.marketplaceContract ?? sn.marketplace721;
|
|
113
|
-
const collection721Contract = parsed.collection721Contract ?? parsed.collectionContract ?? sn.collection721;
|
|
114
|
-
return {
|
|
115
|
-
chain: parsed.chain,
|
|
116
|
-
rpcUrl: parsed.rpcUrl ?? coords.rpcUrl,
|
|
117
|
-
backendUrl: parsed.backendUrl,
|
|
118
|
-
apiKey: parsed.apiKey,
|
|
119
|
-
marketplace721Contract,
|
|
120
|
-
marketplaceContract: marketplace721Contract,
|
|
121
|
-
marketplace1155Contract: parsed.marketplace1155Contract ?? sn.marketplace1155,
|
|
122
|
-
collection721Contract,
|
|
123
|
-
collectionContract: collection721Contract,
|
|
124
|
-
collection1155Contract: parsed.collection1155Contract ?? sn.collection1155,
|
|
125
|
-
retryOptions: parsed.retryOptions,
|
|
126
|
-
feeConfig: resolveFeeConfig(parsed.feeConfig)
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
function normalizeAddress(chain, address) {
|
|
130
|
-
switch (chain) {
|
|
131
|
-
case "STARKNET":
|
|
132
|
-
return normalizeStarknet(address);
|
|
133
|
-
case "ETHEREUM":
|
|
134
|
-
case "BASE":
|
|
135
|
-
return normalizeEvm(address);
|
|
136
|
-
case "SOLANA":
|
|
137
|
-
return normalizeSolana(address);
|
|
138
|
-
case "STELLAR":
|
|
139
|
-
return normalizeStellar(address);
|
|
140
|
-
case "BITCOIN":
|
|
141
|
-
throw new Error("BITCOIN address normalization not implemented");
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function normalizeStarknet(address) {
|
|
145
|
-
try {
|
|
146
|
-
const hex = BigInt(address).toString(16);
|
|
147
|
-
return "0x" + hex.padStart(64, "0").toLowerCase();
|
|
148
|
-
} catch {
|
|
149
|
-
throw new Error(`Invalid STARKNET address: "${address}"`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function normalizeEvm(address) {
|
|
153
|
-
const m = /^0x([0-9a-fA-F]{40})$/.exec(address);
|
|
154
|
-
if (!m) throw new Error(`Invalid ETHEREUM/BASE address: "${address}"`);
|
|
155
|
-
const lower = m[1].toLowerCase();
|
|
156
|
-
const hash8 = sha3_js.keccak_256(new TextEncoder().encode(lower));
|
|
157
|
-
let out = "0x";
|
|
158
|
-
for (let i = 0; i < 40; i++) {
|
|
159
|
-
const nibble = hash8[i >> 1] >> (i % 2 === 0 ? 4 : 0) & 15;
|
|
160
|
-
out += nibble >= 8 ? lower[i].toUpperCase() : lower[i];
|
|
161
|
-
}
|
|
162
|
-
return out;
|
|
163
|
-
}
|
|
164
|
-
function normalizeSolana(address) {
|
|
165
|
-
try {
|
|
166
|
-
const bytes = base.base58.decode(address);
|
|
167
|
-
if (bytes.length !== 32) throw new Error("not a 32-byte key");
|
|
168
|
-
return address;
|
|
169
|
-
} catch {
|
|
170
|
-
throw new Error(`Invalid SOLANA address: "${address}"`);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
var STELLAR_VERSION_BYTES = /* @__PURE__ */ new Set([6 << 3, 2 << 3]);
|
|
174
|
-
function normalizeStellar(address) {
|
|
175
|
-
const upper = address.toUpperCase();
|
|
176
|
-
if (!/^[GC][A-Z2-7]{55}$/.test(upper)) {
|
|
177
|
-
throw new Error(`Invalid STELLAR address: "${address}"`);
|
|
178
|
-
}
|
|
179
|
-
let decoded;
|
|
180
|
-
try {
|
|
181
|
-
decoded = base.base32.decode(upper);
|
|
182
|
-
} catch {
|
|
183
|
-
throw new Error(`Invalid STELLAR address: "${address}"`);
|
|
184
|
-
}
|
|
185
|
-
if (decoded.length !== 35 || !STELLAR_VERSION_BYTES.has(decoded[0])) {
|
|
186
|
-
throw new Error(`Invalid STELLAR address: "${address}"`);
|
|
187
|
-
}
|
|
188
|
-
const payload = decoded.subarray(0, 33);
|
|
189
|
-
const checksum = decoded[33] | decoded[34] << 8;
|
|
190
|
-
if (crc16xmodem(payload) !== checksum) {
|
|
191
|
-
throw new Error(`Invalid STELLAR address: "${address}"`);
|
|
192
|
-
}
|
|
193
|
-
return upper;
|
|
194
|
-
}
|
|
195
|
-
function crc16xmodem(bytes) {
|
|
196
|
-
let crc = 0;
|
|
197
|
-
for (const byte of bytes) {
|
|
198
|
-
crc ^= byte << 8;
|
|
199
|
-
for (let i = 0; i < 8; i++) {
|
|
200
|
-
crc = crc & 32768 ? (crc << 1 ^ 4129) & 65535 : crc << 1 & 65535;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return crc;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// src/utils/retry.ts
|
|
207
|
-
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
208
|
-
var DEFAULT_BASE_DELAY_MS = 300;
|
|
209
|
-
var DEFAULT_MAX_DELAY_MS = 5e3;
|
|
210
|
-
function sleep(ms) {
|
|
211
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
212
|
-
}
|
|
213
|
-
function isRetryableFor(method, err) {
|
|
214
|
-
if (err instanceof MedialaneApiError && err.status === 429) return true;
|
|
215
|
-
const isRead = method === "GET" || method === "HEAD";
|
|
216
|
-
if (!isRead) return false;
|
|
217
|
-
return err instanceof MedialaneApiError && err.status >= 500 || err instanceof TypeError;
|
|
218
|
-
}
|
|
219
|
-
async function withRetry(fn, opts, method = "GET") {
|
|
220
|
-
const maxAttempts = opts?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
221
|
-
const baseDelayMs = opts?.baseDelayMs ?? DEFAULT_BASE_DELAY_MS;
|
|
222
|
-
const maxDelayMs = opts?.maxDelayMs ?? DEFAULT_MAX_DELAY_MS;
|
|
223
|
-
let lastError;
|
|
224
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
225
|
-
try {
|
|
226
|
-
return await fn();
|
|
227
|
-
} catch (err) {
|
|
228
|
-
lastError = err;
|
|
229
|
-
if (!isRetryableFor(method, err) || attempt === maxAttempts - 1) {
|
|
230
|
-
throw err;
|
|
231
|
-
}
|
|
232
|
-
const retryAfterMs = err instanceof MedialaneApiError ? err.retryAfterMs : void 0;
|
|
233
|
-
const backoff = baseDelayMs * Math.pow(2, attempt) + Math.random() * baseDelayMs;
|
|
234
|
-
const delay = Math.min(retryAfterMs ?? backoff, maxDelayMs);
|
|
235
|
-
await sleep(delay);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
throw lastError;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// src/api/client.ts
|
|
242
|
-
function deriveErrorCode(status) {
|
|
243
|
-
if (status === 404) return "TOKEN_NOT_FOUND";
|
|
244
|
-
if (status === 429) return "RATE_LIMITED";
|
|
245
|
-
if (status === 410) return "INTENT_EXPIRED";
|
|
246
|
-
if (status === 401 || status === 403) return "UNAUTHORIZED";
|
|
247
|
-
if (status === 400) return "INVALID_PARAMS";
|
|
248
|
-
return "UNKNOWN";
|
|
249
|
-
}
|
|
250
|
-
var MedialaneApiError = class extends Error {
|
|
251
|
-
constructor(status, message, retryAfterMs, details) {
|
|
252
|
-
super(message);
|
|
253
|
-
this.status = status;
|
|
254
|
-
this.retryAfterMs = retryAfterMs;
|
|
255
|
-
this.details = details;
|
|
256
|
-
this.name = "MedialaneApiError";
|
|
257
|
-
this.code = deriveErrorCode(status);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
function parseRetryAfter(value) {
|
|
261
|
-
if (!value) return void 0;
|
|
262
|
-
const seconds = Number(value);
|
|
263
|
-
if (Number.isFinite(seconds)) return Math.max(0, seconds * 1e3);
|
|
264
|
-
const date = Date.parse(value);
|
|
265
|
-
if (!Number.isNaN(date)) return Math.max(0, date - Date.now());
|
|
266
|
-
return void 0;
|
|
267
|
-
}
|
|
268
|
-
var ApiClient = class {
|
|
269
|
-
constructor(baseUrl, apiKey, retryOptions, chain = "STARKNET") {
|
|
270
|
-
this.baseUrl = baseUrl;
|
|
271
|
-
this.chain = chain;
|
|
272
|
-
this.baseHeaders = apiKey ? { "x-api-key": apiKey } : {};
|
|
273
|
-
this.retryOptions = retryOptions;
|
|
274
|
-
}
|
|
275
|
-
addr(a) {
|
|
276
|
-
return normalizeAddress(this.chain, a);
|
|
277
|
-
}
|
|
278
|
-
async request(path, init, opts) {
|
|
279
|
-
const url = `${this.baseUrl.replace(/\/$/, "")}${path}`;
|
|
280
|
-
const headers = { ...this.baseHeaders };
|
|
281
|
-
if (!(init?.body instanceof FormData)) {
|
|
282
|
-
headers["Content-Type"] = "application/json";
|
|
283
|
-
}
|
|
284
|
-
const allowed = (status) => opts?.allow404 === true && status === 404 || opts?.allow403 === true && status === 403;
|
|
285
|
-
const res = await withRetry(async () => {
|
|
286
|
-
const response = await fetch(url, {
|
|
287
|
-
...init,
|
|
288
|
-
headers: { ...headers, ...init?.headers }
|
|
289
|
-
});
|
|
290
|
-
if (!response.ok && !allowed(response.status)) {
|
|
291
|
-
const text = await response.text().catch(() => response.statusText);
|
|
292
|
-
let message = `Request failed with status ${response.status}`;
|
|
293
|
-
let details = text;
|
|
294
|
-
try {
|
|
295
|
-
const body = JSON.parse(text);
|
|
296
|
-
if (typeof body.error === "string" && body.error.trim() !== "") {
|
|
297
|
-
message = body.error;
|
|
298
|
-
}
|
|
299
|
-
details = body;
|
|
300
|
-
} catch {
|
|
301
|
-
}
|
|
302
|
-
throw new MedialaneApiError(
|
|
303
|
-
response.status,
|
|
304
|
-
message,
|
|
305
|
-
parseRetryAfter(response.headers.get("retry-after")),
|
|
306
|
-
details
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
return response;
|
|
310
|
-
}, this.retryOptions, (init?.method ?? "GET").toUpperCase());
|
|
311
|
-
if (allowed(res.status)) return null;
|
|
312
|
-
return res.json();
|
|
313
|
-
}
|
|
314
|
-
get(path) {
|
|
315
|
-
return this.request(path, { method: "GET" });
|
|
316
|
-
}
|
|
317
|
-
post(path, body) {
|
|
318
|
-
return this.request(path, { method: "POST", body: JSON.stringify(body) });
|
|
319
|
-
}
|
|
320
|
-
patch(path, body) {
|
|
321
|
-
return this.request(path, { method: "PATCH", body: JSON.stringify(body) });
|
|
322
|
-
}
|
|
323
|
-
bearer(siwsToken) {
|
|
324
|
-
return { Authorization: `Bearer ${siwsToken}` };
|
|
325
|
-
}
|
|
326
|
-
asSubject(siwsToken) {
|
|
327
|
-
return siwsToken ? this.bearer(siwsToken) : void 0;
|
|
328
|
-
}
|
|
329
|
-
getOrders(query = {}) {
|
|
330
|
-
const params = new URLSearchParams();
|
|
331
|
-
if (query.status) params.set("status", query.status);
|
|
332
|
-
if (query.collection) params.set("collection", query.collection);
|
|
333
|
-
if (query.currency) params.set("currency", query.currency);
|
|
334
|
-
if (query.sort) params.set("sort", query.sort);
|
|
335
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
336
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
337
|
-
if (query.offerer) params.set("offerer", this.addr(query.offerer));
|
|
338
|
-
if (query.minPrice) params.set("minPrice", query.minPrice);
|
|
339
|
-
if (query.maxPrice) params.set("maxPrice", query.maxPrice);
|
|
340
|
-
if (query.chain) params.set("chain", query.chain);
|
|
341
|
-
const qs = params.toString();
|
|
342
|
-
return this.get(`/v1/orders${qs ? `?${qs}` : ""}`);
|
|
343
|
-
}
|
|
344
|
-
getOrder(orderHash) {
|
|
345
|
-
return this.get(`/v1/orders/${orderHash}`);
|
|
346
|
-
}
|
|
347
|
-
getActiveOrdersForToken(contract, tokenId) {
|
|
348
|
-
return this.get(`/v1/orders/token/${this.addr(contract)}/${tokenId}`);
|
|
349
|
-
}
|
|
350
|
-
getReceivedOffers(address, opts = {}) {
|
|
351
|
-
const params = new URLSearchParams({ page: String(opts.page ?? 1), limit: String(opts.limit ?? 50) });
|
|
352
|
-
return this.get(`/v1/orders/received/${this.addr(address)}?${params}`);
|
|
353
|
-
}
|
|
354
|
-
getOrdersByUser(address, page = 1, limit = 20) {
|
|
355
|
-
return this.get(
|
|
356
|
-
`/v1/orders/user/${this.addr(address)}?page=${page}&limit=${limit}`
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
getToken(contract, tokenId, wait = false) {
|
|
360
|
-
return this.get(
|
|
361
|
-
`/v1/tokens/${contract}/${tokenId}${wait ? "?wait=true" : ""}`
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
getTokensByOwner(address, page = 1, limit = 20) {
|
|
365
|
-
return this.get(
|
|
366
|
-
`/v1/tokens/owned/${this.addr(address)}?page=${page}&limit=${limit}`
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
getTokenHistory(contract, tokenId, page = 1, limit = 20) {
|
|
370
|
-
return this.get(
|
|
371
|
-
`/v1/tokens/${contract}/${tokenId}/history?page=${page}&limit=${limit}`
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
getCollection(contract) {
|
|
375
|
-
return this.get(`/v1/collections/${this.addr(contract)}`);
|
|
376
|
-
}
|
|
377
|
-
getCollectionTokens(contract, page = 1, limit = 20, sort = "recent") {
|
|
378
|
-
return this.get(
|
|
379
|
-
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}&sort=${sort}`
|
|
380
|
-
);
|
|
381
|
-
}
|
|
382
|
-
getActivities(query = {}) {
|
|
383
|
-
const params = new URLSearchParams();
|
|
384
|
-
if (query.type) params.set("type", query.type);
|
|
385
|
-
if (query.contract) params.set("contract", query.contract);
|
|
386
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
387
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
388
|
-
if (query.chain) params.set("chain", query.chain);
|
|
389
|
-
const qs = params.toString();
|
|
390
|
-
return this.get(`/v1/activities${qs ? `?${qs}` : ""}`);
|
|
391
|
-
}
|
|
392
|
-
getActivitiesByAddress(address, page = 1, limit = 20) {
|
|
393
|
-
return this.get(
|
|
394
|
-
`/v1/activities/${this.addr(address)}?page=${page}&limit=${limit}`
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
getTokenComments(contract, tokenId, opts = {}) {
|
|
398
|
-
const params = new URLSearchParams();
|
|
399
|
-
if (opts.page !== void 0) params.set("page", String(opts.page));
|
|
400
|
-
if (opts.limit !== void 0) params.set("limit", String(opts.limit));
|
|
401
|
-
const qs = params.toString();
|
|
402
|
-
return this.get(
|
|
403
|
-
`/v1/tokens/${this.addr(contract)}/${tokenId}/comments${qs ? `?${qs}` : ""}`
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
search(q, limit = 10, chain) {
|
|
407
|
-
const params = new URLSearchParams({ q, limit: String(limit) });
|
|
408
|
-
if (chain) params.set("chain", chain);
|
|
409
|
-
return this.get(
|
|
410
|
-
`/v1/search?${params.toString()}`
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
createListingIntent(params) {
|
|
414
|
-
return this.post("/v1/intents/listing", params);
|
|
415
|
-
}
|
|
416
|
-
createOfferIntent(params) {
|
|
417
|
-
return this.post("/v1/intents/offer", params);
|
|
418
|
-
}
|
|
419
|
-
createFulfillIntent(params) {
|
|
420
|
-
return this.post("/v1/intents/fulfill", params);
|
|
421
|
-
}
|
|
422
|
-
createCancelIntent(params) {
|
|
423
|
-
return this.post("/v1/intents/cancel", params);
|
|
424
|
-
}
|
|
425
|
-
createCheckoutIntent(params) {
|
|
426
|
-
return this.post("/v1/intents/checkout", params);
|
|
427
|
-
}
|
|
428
|
-
getIntent(id) {
|
|
429
|
-
return this.get(`/v1/intents/${id}`);
|
|
430
|
-
}
|
|
431
|
-
submitIntentSignature(id, signature) {
|
|
432
|
-
return this.patch(`/v1/intents/${id}/signature`, { signature });
|
|
433
|
-
}
|
|
434
|
-
confirmIntent(id, txHash) {
|
|
435
|
-
return this.patch(`/v1/intents/${id}/confirm`, { txHash });
|
|
436
|
-
}
|
|
437
|
-
syncTransaction(txHash) {
|
|
438
|
-
return this.post("/v1/tx/sync", { txHash });
|
|
439
|
-
}
|
|
440
|
-
createMintIntent(params) {
|
|
441
|
-
return this.post("/v1/intents/mint", params);
|
|
442
|
-
}
|
|
443
|
-
createCollectionIntent(params) {
|
|
444
|
-
return this.post("/v1/intents/create-collection", params);
|
|
445
|
-
}
|
|
446
|
-
createTierIntent(params) {
|
|
447
|
-
return this.post("/v1/intents/create-tier", params);
|
|
448
|
-
}
|
|
449
|
-
emitToRecipients(params) {
|
|
450
|
-
return this.post("/v1/business/issuance/emission", params);
|
|
451
|
-
}
|
|
452
|
-
createCoinIntent(params) {
|
|
453
|
-
return this.post("/v1/intents/create-coin", params);
|
|
454
|
-
}
|
|
455
|
-
launchCoinIntent(params) {
|
|
456
|
-
return this.post("/v1/intents/launch-coin", params);
|
|
457
|
-
}
|
|
458
|
-
createSponsorshipOfferIntent(params) {
|
|
459
|
-
return this.post("/v1/intents/sponsorship-offer", params);
|
|
460
|
-
}
|
|
461
|
-
setSponsorshipOfferOpenIntent(params) {
|
|
462
|
-
return this.post("/v1/intents/sponsorship-offer-open", params);
|
|
463
|
-
}
|
|
464
|
-
placeSponsorshipBidIntent(params) {
|
|
465
|
-
return this.post("/v1/intents/sponsorship-bid", params);
|
|
466
|
-
}
|
|
467
|
-
retractSponsorshipBidIntent(params) {
|
|
468
|
-
return this.post("/v1/intents/sponsorship-bid-retract", params);
|
|
469
|
-
}
|
|
470
|
-
acceptSponsorshipBidIntent(params) {
|
|
471
|
-
return this.post("/v1/intents/sponsorship-bid-accept", params);
|
|
472
|
-
}
|
|
473
|
-
createSponsorshipProposalIntent(params) {
|
|
474
|
-
return this.post("/v1/intents/sponsorship-proposal", params);
|
|
475
|
-
}
|
|
476
|
-
withdrawSponsorshipProposalIntent(params) {
|
|
477
|
-
return this.post("/v1/intents/sponsorship-proposal-withdraw", params);
|
|
478
|
-
}
|
|
479
|
-
acceptSponsorshipProposalIntent(params) {
|
|
480
|
-
return this.post("/v1/intents/sponsorship-proposal-accept", params);
|
|
481
|
-
}
|
|
482
|
-
rejectSponsorshipProposalIntent(params) {
|
|
483
|
-
return this.post("/v1/intents/sponsorship-proposal-reject", params);
|
|
484
|
-
}
|
|
485
|
-
createCounterOfferIntent(params, siwsToken) {
|
|
486
|
-
const extraHeaders = siwsToken ? { "Authorization": `Bearer ${siwsToken}` } : {};
|
|
487
|
-
return this.request("/v1/intents/counter-offer", {
|
|
488
|
-
method: "POST",
|
|
489
|
-
body: JSON.stringify(params),
|
|
490
|
-
headers: extraHeaders
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
getCounterOffers(query) {
|
|
494
|
-
const params = new URLSearchParams();
|
|
495
|
-
if (query.originalOrderHash) params.set("originalOrderHash", query.originalOrderHash);
|
|
496
|
-
if (query.sellerAddress) params.set("sellerAddress", query.sellerAddress);
|
|
497
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
498
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
499
|
-
return this.get(`/v1/orders/counter-offers?${params}`);
|
|
500
|
-
}
|
|
501
|
-
getMetadataSignedUrl(kind) {
|
|
502
|
-
const params = kind ? `?kind=${kind}` : "";
|
|
503
|
-
return this.get(`/v1/metadata/signed-url${params}`);
|
|
504
|
-
}
|
|
505
|
-
uploadMetadata(metadata) {
|
|
506
|
-
return this.post("/v1/metadata/upload", metadata);
|
|
507
|
-
}
|
|
508
|
-
async uploadMetadataDirectory(files) {
|
|
509
|
-
const res = await this.post("/v1/metadata/upload-directory", { files });
|
|
510
|
-
return res.data;
|
|
511
|
-
}
|
|
512
|
-
resolveMetadata(uri) {
|
|
513
|
-
const params = new URLSearchParams({ uri });
|
|
514
|
-
return this.get(`/v1/metadata/resolve?${params.toString()}`);
|
|
515
|
-
}
|
|
516
|
-
uploadFile(file) {
|
|
517
|
-
const formData = new FormData();
|
|
518
|
-
formData.append("file", file);
|
|
519
|
-
return this.request("/v1/metadata/upload-file", {
|
|
520
|
-
method: "POST",
|
|
521
|
-
body: formData
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
getMe(siwsToken) {
|
|
525
|
-
return this.request("/v1/portal/me", {
|
|
526
|
-
method: "GET",
|
|
527
|
-
headers: this.asSubject(siwsToken)
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
getApiKeys(siwsToken) {
|
|
531
|
-
return this.request("/v1/portal/keys", {
|
|
532
|
-
method: "GET",
|
|
533
|
-
headers: this.asSubject(siwsToken)
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
createApiKey(input, siwsToken) {
|
|
537
|
-
return this.request("/v1/portal/keys", {
|
|
538
|
-
method: "POST",
|
|
539
|
-
body: JSON.stringify(input ?? {}),
|
|
540
|
-
headers: this.asSubject(siwsToken)
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
deleteApiKey(id, siwsToken) {
|
|
544
|
-
return this.request(`/v1/portal/keys/${id}`, {
|
|
545
|
-
method: "DELETE",
|
|
546
|
-
headers: this.asSubject(siwsToken)
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
getCreditHistory(siwsToken) {
|
|
550
|
-
return this.request("/v1/portal/credits/history", {
|
|
551
|
-
method: "GET",
|
|
552
|
-
headers: this.asSubject(siwsToken)
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
getSpend(siwsToken) {
|
|
556
|
-
return this.request("/v1/portal/credits/spend", {
|
|
557
|
-
method: "GET",
|
|
558
|
-
headers: this.asSubject(siwsToken)
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
checkDeposit(txHash, siwsToken) {
|
|
562
|
-
return this.request("/v1/portal/credits/check", {
|
|
563
|
-
method: "POST",
|
|
564
|
-
body: JSON.stringify({ txHash }),
|
|
565
|
-
headers: this.asSubject(siwsToken)
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
getFundingMethods(siwsToken) {
|
|
569
|
-
return this.request("/v1/portal/funding/methods", {
|
|
570
|
-
method: "GET",
|
|
571
|
-
headers: this.asSubject(siwsToken)
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
createFunding(input, siwsToken) {
|
|
575
|
-
return this.request("/v1/portal/funding", {
|
|
576
|
-
method: "POST",
|
|
577
|
-
body: JSON.stringify({ method: input.method, params: input.params }),
|
|
578
|
-
headers: this.asSubject(siwsToken)
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
getFunding(id, siwsToken) {
|
|
582
|
-
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}`, {
|
|
583
|
-
method: "GET",
|
|
584
|
-
headers: this.asSubject(siwsToken)
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
getFundingChallenge(id, payer, siwsToken) {
|
|
588
|
-
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/challenge`, {
|
|
589
|
-
method: "POST",
|
|
590
|
-
body: JSON.stringify({ payer }),
|
|
591
|
-
headers: this.asSubject(siwsToken)
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
authorizeFunding(id, input, siwsToken) {
|
|
595
|
-
return this.request(
|
|
596
|
-
`/v1/portal/funding/${encodeURIComponent(id)}/authorize`,
|
|
597
|
-
{ method: "POST", body: JSON.stringify({ payer: input.payer, signature: input.signature }), headers: this.asSubject(siwsToken) }
|
|
598
|
-
);
|
|
599
|
-
}
|
|
600
|
-
submitFunding(id, txHash, siwsToken) {
|
|
601
|
-
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/submit`, {
|
|
602
|
-
method: "POST",
|
|
603
|
-
body: JSON.stringify({ txHash }),
|
|
604
|
-
headers: this.asSubject(siwsToken)
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
cancelFunding(id, siwsToken) {
|
|
608
|
-
return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/cancel`, {
|
|
609
|
-
method: "POST",
|
|
610
|
-
body: JSON.stringify({}),
|
|
611
|
-
headers: this.asSubject(siwsToken)
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
async claimCollection(contractAddress, walletAddress, siwsToken) {
|
|
615
|
-
return this.request("/v1/collections/claim", {
|
|
616
|
-
method: "POST",
|
|
617
|
-
body: JSON.stringify({ contractAddress, walletAddress }),
|
|
618
|
-
headers: this.bearer(siwsToken)
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
requestCollectionClaim(params) {
|
|
622
|
-
return this.request("/v1/collections/claim/request", {
|
|
623
|
-
method: "POST",
|
|
624
|
-
body: JSON.stringify(params)
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
registerBusinessProvisioning(params) {
|
|
628
|
-
return this.post(
|
|
629
|
-
"/v1/business/provisioning",
|
|
630
|
-
{ chain: params.chain ?? "STARKNET", email: params.email }
|
|
631
|
-
);
|
|
632
|
-
}
|
|
633
|
-
getCollectionProfile(contractAddress) {
|
|
634
|
-
return this.request(
|
|
635
|
-
`/v1/collections/${this.addr(contractAddress)}/profile`,
|
|
636
|
-
{ method: "GET" },
|
|
637
|
-
{ allow404: true }
|
|
638
|
-
);
|
|
639
|
-
}
|
|
640
|
-
updateCollectionProfile(contractAddress, data, siwsToken) {
|
|
641
|
-
return this.request(
|
|
642
|
-
`/v1/collections/${this.addr(contractAddress)}/profile`,
|
|
643
|
-
{ method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
|
-
getWalletActivity(address, chain = "STARKNET") {
|
|
647
|
-
return this.get(
|
|
648
|
-
`/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`
|
|
649
|
-
);
|
|
650
|
-
}
|
|
651
|
-
getGatedContent(contractAddress, siwsToken) {
|
|
652
|
-
return this.request(
|
|
653
|
-
`/v1/collections/${this.addr(contractAddress)}/gated-content`,
|
|
654
|
-
{ method: "GET", headers: this.bearer(siwsToken) },
|
|
655
|
-
{ allow404: true, allow403: true }
|
|
656
|
-
);
|
|
657
|
-
}
|
|
658
|
-
getCreators(opts = {}) {
|
|
659
|
-
const params = new URLSearchParams();
|
|
660
|
-
if (opts.search) params.set("search", opts.search);
|
|
661
|
-
if (opts.page) params.set("page", String(opts.page));
|
|
662
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
663
|
-
const qs = params.toString();
|
|
664
|
-
return this.get(`/v1/creators${qs ? `?${qs}` : ""}`);
|
|
665
|
-
}
|
|
666
|
-
getCreatorProfile(walletAddress) {
|
|
667
|
-
return this.request(
|
|
668
|
-
`/v1/creators/${this.addr(walletAddress)}/profile`,
|
|
669
|
-
{ method: "GET" },
|
|
670
|
-
{ allow404: true }
|
|
671
|
-
);
|
|
672
|
-
}
|
|
673
|
-
getCreatorByUsername(username) {
|
|
674
|
-
return this.request(
|
|
675
|
-
`/v1/creators/by-username/${encodeURIComponent(username.toLowerCase().trim())}`,
|
|
676
|
-
{ method: "GET" },
|
|
677
|
-
{ allow404: true }
|
|
678
|
-
);
|
|
679
|
-
}
|
|
680
|
-
updateCreatorProfile(walletAddress, data, siwsToken) {
|
|
681
|
-
return this.request(
|
|
682
|
-
`/v1/creators/${this.addr(walletAddress)}/profile`,
|
|
683
|
-
{ method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
|
|
684
|
-
);
|
|
685
|
-
}
|
|
686
|
-
checkCollectionSlugAvailability(slug) {
|
|
687
|
-
return this.get(
|
|
688
|
-
`/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
submitCollectionSlugClaim(contractAddress, slug, siwsToken, notifyEmail) {
|
|
692
|
-
return this.request("/v1/collection-slug-claims", {
|
|
693
|
-
method: "POST",
|
|
694
|
-
body: JSON.stringify({ contractAddress, slug, notifyEmail }),
|
|
695
|
-
headers: this.bearer(siwsToken)
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
getMyCollectionSlugClaims(siwsToken) {
|
|
699
|
-
return this.request("/v1/collection-slug-claims/me", {
|
|
700
|
-
method: "GET",
|
|
701
|
-
headers: this.bearer(siwsToken)
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
async getCollectionBySlug(slug) {
|
|
705
|
-
const res = await this.request(
|
|
706
|
-
`/v1/collections/by-slug/${encodeURIComponent(slug.toLowerCase().trim())}`,
|
|
707
|
-
{ method: "GET" },
|
|
708
|
-
{ allow404: true }
|
|
709
|
-
);
|
|
710
|
-
return res?.data ?? null;
|
|
711
|
-
}
|
|
712
|
-
async registerUser(params) {
|
|
713
|
-
return this.post("/v1/users/register", params);
|
|
714
|
-
}
|
|
715
|
-
async upsertMyWallet(siwsToken, options = {}) {
|
|
716
|
-
const body = {
|
|
717
|
-
walletType: options.walletType ?? "UNKNOWN"
|
|
718
|
-
};
|
|
719
|
-
if (options.chain) body.chain = options.chain;
|
|
720
|
-
if (options.email) body.email = options.email;
|
|
721
|
-
if (options.accountToken) body.accountToken = options.accountToken;
|
|
722
|
-
return this.request("/v1/users/me", {
|
|
723
|
-
method: "POST",
|
|
724
|
-
body: JSON.stringify(body),
|
|
725
|
-
headers: this.bearer(siwsToken)
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
async checkEmail(email) {
|
|
729
|
-
const body = await this.get(`/v1/auth/email/exists?email=${encodeURIComponent(email)}`);
|
|
730
|
-
return { exists: body.exists };
|
|
731
|
-
}
|
|
732
|
-
async requestEmailCode(email) {
|
|
733
|
-
await this.post("/v1/auth/email/request-code", { email });
|
|
734
|
-
}
|
|
735
|
-
async registerEmailAccount(email) {
|
|
736
|
-
await this.post("/v1/auth/email/register-account", { email });
|
|
737
|
-
}
|
|
738
|
-
async verifyEmailCode(email, code) {
|
|
739
|
-
await this.post("/v1/auth/email/verify-code", { email, code });
|
|
740
|
-
}
|
|
741
|
-
async confirmEmail(token) {
|
|
742
|
-
const body = await this.post("/v1/auth/email/confirm", { token });
|
|
743
|
-
return { email: body.email };
|
|
744
|
-
}
|
|
745
|
-
setupWalletKey(params) {
|
|
746
|
-
return this.post("/v1/users/me/wallet/key", params);
|
|
747
|
-
}
|
|
748
|
-
async getSessionWallet() {
|
|
749
|
-
const body = await this.post("/v1/users/me/wallet", {});
|
|
750
|
-
return body.walletAddress ? { walletAddress: body.walletAddress, needsKeySetup: body.needsKeySetup === true } : null;
|
|
751
|
-
}
|
|
752
|
-
getMyWallet(siwsToken) {
|
|
753
|
-
return this.request(
|
|
754
|
-
"/v1/users/me",
|
|
755
|
-
{ method: "GET", headers: this.bearer(siwsToken) },
|
|
756
|
-
{ allow404: true }
|
|
757
|
-
);
|
|
758
|
-
}
|
|
759
|
-
changeMyEmail(email, siwsToken) {
|
|
760
|
-
return this.request("/v1/users/me/email", {
|
|
761
|
-
method: "POST",
|
|
762
|
-
headers: this.bearer(siwsToken),
|
|
763
|
-
body: JSON.stringify({ email })
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
getTokenRemixes(contract, tokenId, opts = {}) {
|
|
767
|
-
const params = new URLSearchParams();
|
|
768
|
-
if (opts.page !== void 0) params.set("page", String(opts.page));
|
|
769
|
-
if (opts.limit !== void 0) params.set("limit", String(opts.limit));
|
|
770
|
-
const qs = params.toString();
|
|
771
|
-
return this.get(
|
|
772
|
-
`/v1/tokens/${this.addr(contract)}/${tokenId}/remixes${qs ? `?${qs}` : ""}`
|
|
773
|
-
);
|
|
774
|
-
}
|
|
775
|
-
submitRemixOffer(params, siwsToken) {
|
|
776
|
-
return this.request("/v1/remix-offers", {
|
|
777
|
-
method: "POST",
|
|
778
|
-
body: JSON.stringify(params),
|
|
779
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
submitAutoRemixOffer(params, siwsToken) {
|
|
783
|
-
return this.request("/v1/remix-offers/auto", {
|
|
784
|
-
method: "POST",
|
|
785
|
-
body: JSON.stringify(params),
|
|
786
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
confirmSelfRemix(params, siwsToken) {
|
|
790
|
-
return this.request("/v1/remix-offers/self/confirm", {
|
|
791
|
-
method: "POST",
|
|
792
|
-
body: JSON.stringify(params),
|
|
793
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
getRemixOffers(query, siwsToken) {
|
|
797
|
-
const params = new URLSearchParams({ role: query.role });
|
|
798
|
-
if (query.status) params.set("status", query.status);
|
|
799
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
800
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
801
|
-
return this.request(`/v1/remix-offers?${params}`, {
|
|
802
|
-
method: "GET",
|
|
803
|
-
headers: this.bearer(siwsToken)
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
getRemixOffer(id, siwsToken) {
|
|
807
|
-
return this.request(`/v1/remix-offers/${id}`, {
|
|
808
|
-
method: "GET",
|
|
809
|
-
headers: siwsToken ? this.bearer(siwsToken) : void 0
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
confirmRemixOffer(id, params, siwsToken) {
|
|
813
|
-
return this.request(`/v1/remix-offers/${id}/confirm`, {
|
|
814
|
-
method: "POST",
|
|
815
|
-
body: JSON.stringify(params),
|
|
816
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
rejectRemixOffer(id, siwsToken) {
|
|
820
|
-
return this.request(`/v1/remix-offers/${id}/reject`, {
|
|
821
|
-
method: "POST",
|
|
822
|
-
body: JSON.stringify({}),
|
|
823
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
extendRemixOffer(id, days, siwsToken) {
|
|
827
|
-
return this.request(`/v1/remix-offers/${id}/extend`, {
|
|
828
|
-
method: "POST",
|
|
829
|
-
body: JSON.stringify({ days }),
|
|
830
|
-
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
async getPopEligibility(collection, wallet) {
|
|
834
|
-
const res = await this.get(
|
|
835
|
-
`/v1/pop/eligibility/${this.addr(collection)}/${this.addr(wallet)}`
|
|
836
|
-
);
|
|
837
|
-
return res.data;
|
|
838
|
-
}
|
|
839
|
-
async getPopEligibilityBatch(collection, wallets) {
|
|
840
|
-
const params = new URLSearchParams({ wallets: wallets.map((w) => this.addr(w)).join(",") });
|
|
841
|
-
const res = await this.get(
|
|
842
|
-
`/v1/pop/eligibility/${this.addr(collection)}?${params}`
|
|
843
|
-
);
|
|
844
|
-
return res.data;
|
|
845
|
-
}
|
|
846
|
-
getCoins(opts = {}) {
|
|
847
|
-
const params = new URLSearchParams();
|
|
848
|
-
if (opts.page) params.set("page", String(opts.page));
|
|
849
|
-
if (opts.limit) params.set("limit", String(opts.limit));
|
|
850
|
-
if (opts.service) params.set("service", opts.service);
|
|
851
|
-
if (opts.sort) params.set("sort", opts.sort);
|
|
852
|
-
if (opts.creator) params.set("creator", this.addr(opts.creator));
|
|
853
|
-
if (opts.chain) params.set("chain", opts.chain);
|
|
854
|
-
const qs = params.toString();
|
|
855
|
-
return this.get(`/v1/coins${qs ? `?${qs}` : ""}`);
|
|
856
|
-
}
|
|
857
|
-
getCoin(contract) {
|
|
858
|
-
return this.get(`/v1/coins/${this.addr(contract)}`);
|
|
859
|
-
}
|
|
860
|
-
getCoinPrices() {
|
|
861
|
-
return this.get("/v1/coins/prices");
|
|
862
|
-
}
|
|
863
|
-
claimCoin(coinAddress, siwsToken) {
|
|
864
|
-
return this.request("/v1/coins/claim", {
|
|
865
|
-
method: "POST",
|
|
866
|
-
headers: { Authorization: `Bearer ${siwsToken}` },
|
|
867
|
-
body: JSON.stringify({ coinAddress })
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
getCoinClaims(status = "PENDING") {
|
|
871
|
-
return this.get(
|
|
872
|
-
`/v1/coins/claims?status=${encodeURIComponent(status)}`
|
|
873
|
-
);
|
|
874
|
-
}
|
|
875
|
-
updateCoinProfile(contract, data, siwsToken) {
|
|
876
|
-
return this.request(`/v1/coins/${this.addr(contract)}`, {
|
|
877
|
-
method: "PATCH",
|
|
878
|
-
body: JSON.stringify(data),
|
|
879
|
-
headers: this.bearer(siwsToken)
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
async getDropMintStatus(collection, wallet) {
|
|
883
|
-
const res = await this.get(
|
|
884
|
-
`/v1/drop/mint-status/${this.addr(collection)}/${this.addr(wallet)}`
|
|
885
|
-
);
|
|
886
|
-
return res.data;
|
|
887
|
-
}
|
|
888
|
-
async getDropInfo(contract) {
|
|
889
|
-
const res = await this.request(
|
|
890
|
-
`/v1/drop/${this.addr(contract)}/info`,
|
|
891
|
-
{ method: "GET" },
|
|
892
|
-
{ allow404: true }
|
|
893
|
-
);
|
|
894
|
-
return res?.data ?? null;
|
|
895
|
-
}
|
|
896
|
-
async getDropState(contract) {
|
|
897
|
-
const res = await this.get(`/v1/drop/${this.addr(contract)}/state`);
|
|
898
|
-
return res.data;
|
|
899
|
-
}
|
|
900
|
-
async getTicket(contract, tokenId) {
|
|
901
|
-
const res = await this.get(`/v1/tickets/${this.addr(contract)}/${tokenId}`);
|
|
902
|
-
return res.data;
|
|
903
|
-
}
|
|
904
|
-
async getTicketCount(contract) {
|
|
905
|
-
const res = await this.get(`/v1/tickets/${this.addr(contract)}/count`);
|
|
906
|
-
return res.data.count;
|
|
907
|
-
}
|
|
908
|
-
async getClubMembershipCount(contract) {
|
|
909
|
-
const res = await this.get(`/v1/club/${this.addr(contract)}/count`);
|
|
910
|
-
return res.data.count;
|
|
911
|
-
}
|
|
912
|
-
async getClubMembership(contract, tokenId) {
|
|
913
|
-
const res = await this.get(`/v1/club/${this.addr(contract)}/${tokenId}`);
|
|
914
|
-
return res.data;
|
|
915
|
-
}
|
|
916
|
-
async isClubMember(contract, tokenId, wallet) {
|
|
917
|
-
const res = await this.get(
|
|
918
|
-
`/v1/club/${this.addr(contract)}/${tokenId}/member/${this.addr(wallet)}`
|
|
919
|
-
);
|
|
920
|
-
return res.data.isMember;
|
|
921
|
-
}
|
|
922
|
-
async getIpNftTokenData(contract, tokenId) {
|
|
923
|
-
const res = await this.get(`/v1/ipnft/${this.addr(contract)}/${tokenId}`);
|
|
924
|
-
return res.data;
|
|
925
|
-
}
|
|
926
|
-
async getPlatformStats() {
|
|
927
|
-
const res = await this.get("/v1/stats");
|
|
928
|
-
return res.data;
|
|
929
|
-
}
|
|
930
|
-
getTokens(query = {}) {
|
|
931
|
-
const params = new URLSearchParams();
|
|
932
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
933
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
934
|
-
if (query.sort) params.set("sort", query.sort);
|
|
935
|
-
if (query.ipType) params.set("ipType", query.ipType);
|
|
936
|
-
if (query.derivatives) params.set("derivatives", query.derivatives);
|
|
937
|
-
const qs = params.toString();
|
|
938
|
-
return this.get(`/v1/tokens${qs ? `?${qs}` : ""}`);
|
|
939
|
-
}
|
|
940
|
-
async isCreatorHidden(wallet) {
|
|
941
|
-
const res = await this.get(`/v1/creators/${this.addr(wallet)}/hidden`);
|
|
942
|
-
return res.isHidden;
|
|
943
|
-
}
|
|
944
|
-
getMyUsernameClaim(siwsToken) {
|
|
945
|
-
return this.request("/v1/username-claims/me", {
|
|
946
|
-
method: "GET",
|
|
947
|
-
headers: this.bearer(siwsToken)
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
checkUsernameAvailability(username) {
|
|
951
|
-
return this.get(
|
|
952
|
-
`/v1/username-claims/check/${encodeURIComponent(username)}`
|
|
953
|
-
);
|
|
954
|
-
}
|
|
955
|
-
async submitUsernameClaim(username, siwsToken, notifyEmail) {
|
|
956
|
-
const res = await this.request("/v1/username-claims", {
|
|
957
|
-
method: "POST",
|
|
958
|
-
headers: this.bearer(siwsToken),
|
|
959
|
-
body: JSON.stringify({ username, ...notifyEmail ? { notifyEmail } : {} })
|
|
960
|
-
});
|
|
961
|
-
return res.claim;
|
|
962
|
-
}
|
|
963
|
-
async submitReport(report, siwsToken) {
|
|
964
|
-
const targetContract = report.targetContract ? this.addr(report.targetContract) : void 0;
|
|
965
|
-
const targetAddress = report.targetAddress ? this.addr(report.targetAddress) : void 0;
|
|
966
|
-
let targetKey = null;
|
|
967
|
-
if (report.targetType === "TOKEN" && targetContract && report.targetTokenId) {
|
|
968
|
-
targetKey = `TOKEN:${targetContract}:${report.targetTokenId}`;
|
|
969
|
-
} else if (report.targetType === "COLLECTION" && targetContract) {
|
|
970
|
-
targetKey = `COLLECTION:${targetContract}`;
|
|
971
|
-
} else if (report.targetType === "CREATOR" && targetAddress) {
|
|
972
|
-
targetKey = `CREATOR:${targetAddress}`;
|
|
973
|
-
} else if (report.targetType === "COMMENT" && report.targetId) {
|
|
974
|
-
targetKey = `COMMENT::${report.targetId}`;
|
|
975
|
-
}
|
|
976
|
-
if (!targetKey) throw new Error(`A ${report.targetType} report needs its target`);
|
|
977
|
-
await this.request("/v1/reports", {
|
|
978
|
-
method: "POST",
|
|
979
|
-
headers: this.bearer(siwsToken),
|
|
980
|
-
body: JSON.stringify({ ...report, targetKey, targetContract, targetAddress })
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
getPricing() {
|
|
984
|
-
return this.get("/v1/pricing");
|
|
985
|
-
}
|
|
986
|
-
listCollections(query = {}) {
|
|
987
|
-
const params = new URLSearchParams();
|
|
988
|
-
if (query.page !== void 0) params.set("page", String(query.page));
|
|
989
|
-
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
990
|
-
if (query.owner) params.set("owner", this.addr(query.owner));
|
|
991
|
-
if (query.service) params.set("service", query.service);
|
|
992
|
-
if (query.sort) params.set("sort", query.sort);
|
|
993
|
-
if (query.isFeatured !== void 0) params.set("isFeatured", String(query.isFeatured));
|
|
994
|
-
if (query.hideEmpty !== void 0) params.set("hideEmpty", String(query.hideEmpty));
|
|
995
|
-
if (query.standard) params.set("standard", query.standard);
|
|
996
|
-
if (query.chain) params.set("chain", query.chain);
|
|
997
|
-
const qs = params.toString();
|
|
998
|
-
return this.get(`/v1/collections${qs ? `?${qs}` : ""}`);
|
|
999
|
-
}
|
|
1000
|
-
generateWallet(newWalletSiwsToken, siwsToken) {
|
|
1001
|
-
return this.request("/v1/users/me/generate-wallet", {
|
|
1002
|
-
method: "POST",
|
|
1003
|
-
headers: this.bearer(siwsToken),
|
|
1004
|
-
body: JSON.stringify({ newWalletSiwsToken })
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
syncCoin(coinAddress, owner) {
|
|
1008
|
-
return this.post("/v1/coins/sync", { coinAddress, ...owner ? { owner } : {} });
|
|
1009
|
-
}
|
|
1010
|
-
registerCollection(contractAddress) {
|
|
1011
|
-
return this.post("/v1/collections/register", { contractAddress });
|
|
1012
|
-
}
|
|
1013
|
-
getSponsorshipOffers(query = {}) {
|
|
1014
|
-
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1015
|
-
if (query.nftContract) params.set("nftContract", query.nftContract);
|
|
1016
|
-
if (query.author) params.set("author", query.author);
|
|
1017
|
-
if (query.owner) params.set("owner", query.owner);
|
|
1018
|
-
if (query.open !== void 0) params.set("open", String(query.open));
|
|
1019
|
-
return this.get(`/v1/sponsorship/offers?${params}`);
|
|
1020
|
-
}
|
|
1021
|
-
async getSponsorshipOffer(offerId) {
|
|
1022
|
-
const res = await this.request(
|
|
1023
|
-
`/v1/sponsorship/offers/${encodeURIComponent(offerId)}`,
|
|
1024
|
-
{ method: "GET" },
|
|
1025
|
-
{ allow404: true }
|
|
1026
|
-
);
|
|
1027
|
-
return res?.data ?? null;
|
|
1028
|
-
}
|
|
1029
|
-
async getSponsorshipProposal(proposalId) {
|
|
1030
|
-
const res = await this.request(
|
|
1031
|
-
`/v1/sponsorship/proposals/${encodeURIComponent(proposalId)}`,
|
|
1032
|
-
{ method: "GET" },
|
|
1033
|
-
{ allow404: true }
|
|
1034
|
-
);
|
|
1035
|
-
return res?.data ?? null;
|
|
1036
|
-
}
|
|
1037
|
-
async getSponsorshipBids(offerId) {
|
|
1038
|
-
const res = await this.get(`/v1/sponsorship/offers/${encodeURIComponent(offerId)}/bids`);
|
|
1039
|
-
return res.data;
|
|
1040
|
-
}
|
|
1041
|
-
getSponsorshipProposals(query = {}) {
|
|
1042
|
-
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1043
|
-
if (query.nftContract) params.set("nftContract", query.nftContract);
|
|
1044
|
-
if (query.proposer) params.set("proposer", query.proposer);
|
|
1045
|
-
if (query.owner) params.set("owner", query.owner);
|
|
1046
|
-
if (query.open !== void 0) params.set("open", String(query.open));
|
|
1047
|
-
return this.get(`/v1/sponsorship/proposals?${params}`);
|
|
1048
|
-
}
|
|
1049
|
-
getSponsorshipLicenses(query = {}) {
|
|
1050
|
-
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1051
|
-
if (query.holder) params.set("holder", query.holder);
|
|
1052
|
-
if (query.author) params.set("author", query.author);
|
|
1053
|
-
return this.get(`/v1/sponsorship/licenses?${params}`);
|
|
1054
|
-
}
|
|
1055
|
-
async getRewards(address) {
|
|
1056
|
-
const res = await this.get(`/v1/rewards/${this.addr(address)}`);
|
|
1057
|
-
return res.data;
|
|
1058
|
-
}
|
|
1059
|
-
getRewardsLeaderboard(page = 1, limit = 50) {
|
|
1060
|
-
return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
|
|
1061
|
-
}
|
|
1062
|
-
getRewardsEvents(address, page = 1, limit = 20) {
|
|
1063
|
-
return this.get(
|
|
1064
|
-
`/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
|
|
1065
|
-
);
|
|
1066
|
-
}
|
|
1067
|
-
async getRewardsConfig() {
|
|
1068
|
-
const res = await this.get(`/v1/rewards/config`);
|
|
1069
|
-
return res.data;
|
|
1070
|
-
}
|
|
1071
|
-
async getRewardsBatch(addresses) {
|
|
1072
|
-
if (addresses.length === 0) return [];
|
|
1073
|
-
const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
|
|
1074
|
-
const res = await this.get(`/v1/rewards/batch?${params}`);
|
|
1075
|
-
return res.data;
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
|
|
1079
|
-
// src/constants.ts
|
|
1080
|
-
var SN = getCoordinates("STARKNET");
|
|
1081
|
-
SN.marketplace721;
|
|
1082
|
-
SN.marketplace721ClassHash;
|
|
1083
|
-
SN.marketplace721StartBlock;
|
|
1084
|
-
SN.marketplace1155;
|
|
1085
|
-
SN.marketplace1155ClassHash;
|
|
1086
|
-
SN.marketplace1155StartBlock;
|
|
1087
|
-
SN.collection721;
|
|
1088
|
-
SN.dataTokenization721;
|
|
1089
|
-
SN.collection721StartBlock;
|
|
1090
|
-
SN.ipNftClassHash;
|
|
1091
|
-
SN.ipCollectionClassHash;
|
|
1092
|
-
SN.collection1155;
|
|
1093
|
-
SN.collection1155FactoryClassHash;
|
|
1094
|
-
SN.collection1155ClassHash;
|
|
1095
|
-
SN.collection1155StartBlock;
|
|
1096
|
-
SN.popFactory;
|
|
1097
|
-
SN.popCollectionClassHash;
|
|
1098
|
-
SN.dropFactory;
|
|
1099
|
-
SN.dropCollectionClassHash;
|
|
1100
|
-
SN.nftComments;
|
|
1101
|
-
SN.ipTicketsFactory;
|
|
1102
|
-
SN.ipTicketCollectionClassHash;
|
|
1103
|
-
SN.ipClubFactory;
|
|
1104
|
-
SN.ipClubCollectionClassHash;
|
|
1105
|
-
SN.ipSponsorship;
|
|
1106
|
-
SN.ipSponsorshipClassHash;
|
|
1107
|
-
var STARKNET_MEDIAWALLET_CLASS_HASH = SN.mediaWalletClassHash;
|
|
1108
|
-
SN.creatorCoinFactory;
|
|
1109
|
-
SN.creatorCoinEkuboLauncher;
|
|
1110
|
-
SN.creatorCoinClassHash;
|
|
1111
|
-
SN.creatorCoinFactoryClassHash;
|
|
1112
|
-
SN.creatorCoinStartBlock;
|
|
1113
|
-
SN.genesisMint;
|
|
1114
|
-
SN.ekuboCore;
|
|
1115
|
-
var SUPPORTED_TOKENS = [
|
|
1116
|
-
{
|
|
1117
|
-
symbol: "USDC",
|
|
1118
|
-
address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
|
|
1119
|
-
decimals: 6,
|
|
1120
|
-
listable: true
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
symbol: "USDT",
|
|
1124
|
-
address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
1125
|
-
decimals: 6,
|
|
1126
|
-
listable: true
|
|
1127
|
-
},
|
|
1128
|
-
{
|
|
1129
|
-
symbol: "ETH",
|
|
1130
|
-
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
1131
|
-
decimals: 18,
|
|
1132
|
-
listable: true
|
|
1133
|
-
},
|
|
1134
|
-
{
|
|
1135
|
-
symbol: "STRK",
|
|
1136
|
-
address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
|
|
1137
|
-
decimals: 18,
|
|
1138
|
-
listable: true
|
|
1139
|
-
},
|
|
1140
|
-
{
|
|
1141
|
-
symbol: "WBTC",
|
|
1142
|
-
address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
|
|
1143
|
-
decimals: 8,
|
|
1144
|
-
listable: true
|
|
1145
|
-
}
|
|
1146
|
-
];
|
|
1147
|
-
|
|
1148
9
|
// src/starknet/marketplace/errors.ts
|
|
1149
10
|
var MedialaneError = class extends Error {
|
|
1150
11
|
constructor(message, code = "UNKNOWN", cause) {
|
|
@@ -1155,71 +16,6 @@ var MedialaneError = class extends Error {
|
|
|
1155
16
|
}
|
|
1156
17
|
};
|
|
1157
18
|
|
|
1158
|
-
// src/utils/rpc.ts
|
|
1159
|
-
var TRANSIENT_BODY_RE = /"code"\s*:\s*-32001|"code"\s*:\s*-32603|unable to complete|rate.?limit|too many|throttl|exceed.*quota|temporarily unavailable|service unavailable|overload|gateway.*time|upstream.*time|backend.*error/i;
|
|
1160
|
-
var POLICY_REFUSAL_CODES = [-32003, -32005, -32600];
|
|
1161
|
-
function isPolicyRefusal(input) {
|
|
1162
|
-
let body = input.body;
|
|
1163
|
-
if (typeof body === "string") {
|
|
1164
|
-
try {
|
|
1165
|
-
body = JSON.parse(body);
|
|
1166
|
-
} catch {
|
|
1167
|
-
return false;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
const err = body?.error;
|
|
1171
|
-
const code = err && typeof err === "object" ? err.code : void 0;
|
|
1172
|
-
return typeof code === "number" && POLICY_REFUSAL_CODES.includes(code);
|
|
1173
|
-
}
|
|
1174
|
-
function isTransientRpcError(input) {
|
|
1175
|
-
const { status, body } = input;
|
|
1176
|
-
if (isPolicyRefusal({ body })) return false;
|
|
1177
|
-
if (typeof status === "number" && (status === 429 || status >= 500)) return true;
|
|
1178
|
-
if (body == null) return false;
|
|
1179
|
-
if (typeof body === "object") {
|
|
1180
|
-
const err = body.error;
|
|
1181
|
-
if (!err || typeof err !== "object") return false;
|
|
1182
|
-
const code = err.code;
|
|
1183
|
-
if (typeof code === "number") {
|
|
1184
|
-
if (code === 429) return true;
|
|
1185
|
-
if (code >= -32099 && code <= -32e3) return true;
|
|
1186
|
-
if (code === -32603) return true;
|
|
1187
|
-
}
|
|
1188
|
-
const message = err.message;
|
|
1189
|
-
return typeof message === "string" ? TRANSIENT_BODY_RE.test(message) : false;
|
|
1190
|
-
}
|
|
1191
|
-
return TRANSIENT_BODY_RE.test(String(body));
|
|
1192
|
-
}
|
|
1193
|
-
function createFailoverFetch(urls, options = {}) {
|
|
1194
|
-
const endpoints = urls.filter((u) => Boolean(u));
|
|
1195
|
-
if (endpoints.length === 0) {
|
|
1196
|
-
throw new Error("createFailoverFetch: at least one RPC URL is required");
|
|
1197
|
-
}
|
|
1198
|
-
const doFetch = options.baseFetch ?? fetch;
|
|
1199
|
-
const failover = async (_input, init) => {
|
|
1200
|
-
let lastError;
|
|
1201
|
-
for (let i = 0; i < endpoints.length; i++) {
|
|
1202
|
-
const url = endpoints[i];
|
|
1203
|
-
const isLast = i === endpoints.length - 1;
|
|
1204
|
-
try {
|
|
1205
|
-
const res = await doFetch(url, init);
|
|
1206
|
-
const text = await res.text();
|
|
1207
|
-
const rebuilt = () => new Response(text, { status: res.status, statusText: res.statusText, headers: res.headers });
|
|
1208
|
-
if (isLast || !isTransientRpcError({ status: res.status, body: text })) {
|
|
1209
|
-
return rebuilt();
|
|
1210
|
-
}
|
|
1211
|
-
options.onFailover?.({ url, status: res.status });
|
|
1212
|
-
} catch (err) {
|
|
1213
|
-
lastError = err;
|
|
1214
|
-
if (isLast) throw err;
|
|
1215
|
-
options.onFailover?.({ url, error: err });
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
throw lastError ?? new Error("createFailoverFetch: all endpoints failed");
|
|
1219
|
-
};
|
|
1220
|
-
return failover;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
19
|
// src/starknet/marketplace/utils.ts
|
|
1224
20
|
var START_TIME_BUFFER_SECS = 30;
|
|
1225
21
|
function newContract(abi, address, providerOrAccount) {
|
|
@@ -1237,7 +33,7 @@ function getChainId(config) {
|
|
|
1237
33
|
return starknet.constants.StarknetChainId.SN_MAIN;
|
|
1238
34
|
}
|
|
1239
35
|
function resolveToken(currency) {
|
|
1240
|
-
const token = SUPPORTED_TOKENS.find(
|
|
36
|
+
const token = chunkZFRHADHR_cjs.SUPPORTED_TOKENS.find(
|
|
1241
37
|
(t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
|
|
1242
38
|
);
|
|
1243
39
|
if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
|
|
@@ -1248,7 +44,7 @@ function getProvider(config) {
|
|
|
1248
44
|
let p = _providerCache.get(config);
|
|
1249
45
|
if (!p) {
|
|
1250
46
|
const urls = [config.rpcUrl];
|
|
1251
|
-
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
|
|
47
|
+
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: chunkZFRHADHR_cjs.createFailoverFetch(urls) });
|
|
1252
48
|
_providerCache.set(config, p);
|
|
1253
49
|
}
|
|
1254
50
|
return p;
|
|
@@ -10284,10 +9080,10 @@ var IPGenesisABI = [
|
|
|
10284
9080
|
// src/starknet/services/pop.ts
|
|
10285
9081
|
var PopService = class {
|
|
10286
9082
|
constructor(config) {
|
|
10287
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).popFactory;
|
|
9083
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).popFactory;
|
|
10288
9084
|
}
|
|
10289
9085
|
_collection(address, account) {
|
|
10290
|
-
return newContract(POPCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9086
|
+
return newContract(POPCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10291
9087
|
}
|
|
10292
9088
|
async claim(account, collectionAddress) {
|
|
10293
9089
|
const call = this._collection(collectionAddress, account).populate("claim", []);
|
|
@@ -10374,11 +9170,11 @@ function toContractConditions(c) {
|
|
|
10374
9170
|
}
|
|
10375
9171
|
var DropService = class {
|
|
10376
9172
|
constructor(config) {
|
|
10377
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).dropFactory;
|
|
9173
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).dropFactory;
|
|
10378
9174
|
this.config = config;
|
|
10379
9175
|
}
|
|
10380
9176
|
_collection(address, account) {
|
|
10381
|
-
return newContract(DropCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9177
|
+
return newContract(DropCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10382
9178
|
}
|
|
10383
9179
|
async claim(account, collectionAddress, quantity = 1) {
|
|
10384
9180
|
const collection = this._collection(collectionAddress, account);
|
|
@@ -10458,19 +9254,19 @@ var DropService = class {
|
|
|
10458
9254
|
// src/starknet/services/erc1155collection.ts
|
|
10459
9255
|
var ERC1155CollectionService = class {
|
|
10460
9256
|
constructor(config) {
|
|
10461
|
-
this.factoryAddress = config.collection1155Contract ?? getStarknetCoordinates(config.chain).collection1155;
|
|
9257
|
+
this.factoryAddress = config.collection1155Contract ?? chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).collection1155;
|
|
10462
9258
|
}
|
|
10463
9259
|
_factory(account) {
|
|
10464
9260
|
return newContract(
|
|
10465
9261
|
IPCollection1155FactoryABI,
|
|
10466
|
-
normalizeAddress("STARKNET", this.factoryAddress),
|
|
9262
|
+
chunkZFRHADHR_cjs.normalizeAddress("STARKNET", this.factoryAddress),
|
|
10467
9263
|
account
|
|
10468
9264
|
);
|
|
10469
9265
|
}
|
|
10470
9266
|
_collection(address, account) {
|
|
10471
9267
|
return newContract(
|
|
10472
9268
|
IPCollection1155ABI,
|
|
10473
|
-
normalizeAddress("STARKNET", address),
|
|
9269
|
+
chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address),
|
|
10474
9270
|
account
|
|
10475
9271
|
);
|
|
10476
9272
|
}
|
|
@@ -10653,7 +9449,7 @@ function factoryContract() {
|
|
|
10653
9449
|
if (!_factoryContract) {
|
|
10654
9450
|
_factoryContract = newContract(
|
|
10655
9451
|
CreatorCoinFactoryABI,
|
|
10656
|
-
getStarknetCoordinates("STARKNET").creatorCoinFactory
|
|
9452
|
+
chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory
|
|
10657
9453
|
);
|
|
10658
9454
|
}
|
|
10659
9455
|
return _factoryContract;
|
|
@@ -10690,7 +9486,7 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
10690
9486
|
calls.push({
|
|
10691
9487
|
contractAddress: params.quoteToken,
|
|
10692
9488
|
entrypoint: "transfer",
|
|
10693
|
-
calldata: [getStarknetCoordinates("STARKNET").creatorCoinFactory, amt.low, amt.high]
|
|
9489
|
+
calldata: [chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory, amt.low, amt.high]
|
|
10694
9490
|
});
|
|
10695
9491
|
}
|
|
10696
9492
|
calls.push(factoryContract().populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
|
|
@@ -10698,26 +9494,26 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
10698
9494
|
}
|
|
10699
9495
|
var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
|
|
10700
9496
|
function parseCreatorCoinCreated(receipt) {
|
|
10701
|
-
const factory = normalizeAddress("STARKNET", getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
9497
|
+
const factory = chunkZFRHADHR_cjs.normalizeAddress("STARKNET", chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
10702
9498
|
for (const ev of receipt?.events ?? []) {
|
|
10703
9499
|
let from;
|
|
10704
9500
|
try {
|
|
10705
|
-
from = normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
9501
|
+
from = chunkZFRHADHR_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
10706
9502
|
} catch {
|
|
10707
9503
|
continue;
|
|
10708
9504
|
}
|
|
10709
9505
|
if (from !== factory) continue;
|
|
10710
9506
|
const k0 = ev.keys?.[0];
|
|
10711
|
-
if (!k0 || normalizeAddress("STARKNET", k0) !== normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
9507
|
+
if (!k0 || chunkZFRHADHR_cjs.normalizeAddress("STARKNET", k0) !== chunkZFRHADHR_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
10712
9508
|
const data = ev.data ?? [];
|
|
10713
9509
|
if (data.length < 1) continue;
|
|
10714
|
-
return normalizeAddress("STARKNET", data[data.length - 1]);
|
|
9510
|
+
return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
|
|
10715
9511
|
}
|
|
10716
9512
|
throw new Error("Coin deployed but the coin address could not be read from the receipt");
|
|
10717
9513
|
}
|
|
10718
9514
|
var CreatorCoinService = class {
|
|
10719
9515
|
constructor(config) {
|
|
10720
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).creatorCoinFactory;
|
|
9516
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).creatorCoinFactory;
|
|
10721
9517
|
this.config = config;
|
|
10722
9518
|
}
|
|
10723
9519
|
_factory(account) {
|
|
@@ -10742,19 +9538,19 @@ var CreatorCoinService = class {
|
|
|
10742
9538
|
var TicketService = class {
|
|
10743
9539
|
constructor(config) {
|
|
10744
9540
|
this.config = config;
|
|
10745
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).ipTicketsFactory;
|
|
9541
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipTicketsFactory;
|
|
10746
9542
|
}
|
|
10747
9543
|
_factory(account, factoryAddress) {
|
|
10748
9544
|
const address = factoryAddress ?? this.factoryAddress;
|
|
10749
9545
|
if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
|
|
10750
|
-
return newContract(IPTicketCollectionFactoryABI, normalizeAddress("STARKNET", address), account);
|
|
9546
|
+
return newContract(IPTicketCollectionFactoryABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10751
9547
|
}
|
|
10752
9548
|
_collection(address, account) {
|
|
10753
|
-
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9549
|
+
return newContract(IPTicketCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10754
9550
|
}
|
|
10755
9551
|
_collectionRead(address) {
|
|
10756
9552
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10757
|
-
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
9553
|
+
return newContract(IPTicketCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), provider);
|
|
10758
9554
|
}
|
|
10759
9555
|
async deployCollection(account, params) {
|
|
10760
9556
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -10815,19 +9611,19 @@ var TicketService = class {
|
|
|
10815
9611
|
var ClubService = class {
|
|
10816
9612
|
constructor(config) {
|
|
10817
9613
|
this.config = config;
|
|
10818
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).ipClubFactory;
|
|
9614
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipClubFactory;
|
|
10819
9615
|
}
|
|
10820
9616
|
_factory(account, factoryAddress) {
|
|
10821
9617
|
const address = factoryAddress ?? this.factoryAddress;
|
|
10822
9618
|
if (!address) throw new Error("IP-Club factory address not configured for this chain");
|
|
10823
|
-
return newContract(IPClubFactoryABI, normalizeAddress("STARKNET", address), account);
|
|
9619
|
+
return newContract(IPClubFactoryABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10824
9620
|
}
|
|
10825
9621
|
_collection(address, account) {
|
|
10826
|
-
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9622
|
+
return newContract(IPClubCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10827
9623
|
}
|
|
10828
9624
|
_collectionRead(address) {
|
|
10829
9625
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10830
|
-
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
9626
|
+
return newContract(IPClubCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), provider);
|
|
10831
9627
|
}
|
|
10832
9628
|
async deployCollection(account, params) {
|
|
10833
9629
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -10890,14 +9686,14 @@ var ClubService = class {
|
|
|
10890
9686
|
var SponsorshipService = class {
|
|
10891
9687
|
constructor(config) {
|
|
10892
9688
|
this.config = config;
|
|
10893
|
-
this.sponsorshipAddress = getStarknetCoordinates(config.chain).ipSponsorship;
|
|
9689
|
+
this.sponsorshipAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipSponsorship;
|
|
10894
9690
|
}
|
|
10895
9691
|
_contract(account, address) {
|
|
10896
9692
|
const resolved = address ?? this.sponsorshipAddress;
|
|
10897
9693
|
if (!resolved) {
|
|
10898
9694
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
10899
9695
|
}
|
|
10900
|
-
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), account);
|
|
9696
|
+
return newContract(IPSponsorshipABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", resolved), account);
|
|
10901
9697
|
}
|
|
10902
9698
|
_contractRead(address) {
|
|
10903
9699
|
const resolved = address ?? this.sponsorshipAddress;
|
|
@@ -10905,7 +9701,7 @@ var SponsorshipService = class {
|
|
|
10905
9701
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
10906
9702
|
}
|
|
10907
9703
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10908
|
-
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
|
|
9704
|
+
return newContract(IPSponsorshipABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", resolved), provider);
|
|
10909
9705
|
}
|
|
10910
9706
|
async createOffer(account, params) {
|
|
10911
9707
|
const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
@@ -10940,7 +9736,7 @@ var SponsorshipService = class {
|
|
|
10940
9736
|
const approveCall = {
|
|
10941
9737
|
contractAddress: params.paymentToken,
|
|
10942
9738
|
entrypoint: "approve",
|
|
10943
|
-
calldata: [normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
9739
|
+
calldata: [chunkZFRHADHR_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
10944
9740
|
};
|
|
10945
9741
|
const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
|
|
10946
9742
|
starknet.cairo.uint256(params.offerId),
|
|
@@ -11067,7 +9863,7 @@ var SponsorshipService = class {
|
|
|
11067
9863
|
// src/starknet/client.ts
|
|
11068
9864
|
var MedialaneClient = class {
|
|
11069
9865
|
constructor(rawConfig = {}) {
|
|
11070
|
-
this.config = resolveConfig(rawConfig);
|
|
9866
|
+
this.config = chunkZFRHADHR_cjs.resolveConfig(rawConfig);
|
|
11071
9867
|
this.services = {
|
|
11072
9868
|
pop: new PopService(this.config),
|
|
11073
9869
|
drop: new DropService(this.config),
|
|
@@ -11078,9 +9874,9 @@ var MedialaneClient = class {
|
|
|
11078
9874
|
sponsorship: new SponsorshipService(this.config)
|
|
11079
9875
|
};
|
|
11080
9876
|
if (!this.config.backendUrl) {
|
|
11081
|
-
const sentinel = new ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
9877
|
+
const sentinel = new chunkZFRHADHR_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
11082
9878
|
const apiMethodNames = new Set(
|
|
11083
|
-
Object.getOwnPropertyNames(ApiClient.prototype).filter(
|
|
9879
|
+
Object.getOwnPropertyNames(chunkZFRHADHR_cjs.ApiClient.prototype).filter(
|
|
11084
9880
|
(k) => k !== "constructor" && typeof sentinel[k] === "function"
|
|
11085
9881
|
)
|
|
11086
9882
|
);
|
|
@@ -11097,7 +9893,7 @@ var MedialaneClient = class {
|
|
|
11097
9893
|
}
|
|
11098
9894
|
});
|
|
11099
9895
|
} else {
|
|
11100
|
-
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
9896
|
+
this.api = new chunkZFRHADHR_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
11101
9897
|
}
|
|
11102
9898
|
}
|
|
11103
9899
|
get chain() {
|
|
@@ -11152,25 +9948,6 @@ async function getCounter1155(address, config) {
|
|
|
11152
9948
|
const contract = getContract(config);
|
|
11153
9949
|
return BigInt((await contract.get_counter(address)).toString());
|
|
11154
9950
|
}
|
|
11155
|
-
|
|
11156
|
-
// src/utils/bigint.ts
|
|
11157
|
-
function stringifyBigInts(obj) {
|
|
11158
|
-
if (typeof obj === "bigint") {
|
|
11159
|
-
return obj.toString();
|
|
11160
|
-
}
|
|
11161
|
-
if (Array.isArray(obj)) {
|
|
11162
|
-
return obj.map(stringifyBigInts);
|
|
11163
|
-
}
|
|
11164
|
-
if (obj !== null && typeof obj === "object") {
|
|
11165
|
-
return Object.fromEntries(
|
|
11166
|
-
Object.entries(obj).map(([key, value]) => [
|
|
11167
|
-
key,
|
|
11168
|
-
stringifyBigInts(value)
|
|
11169
|
-
])
|
|
11170
|
-
);
|
|
11171
|
-
}
|
|
11172
|
-
return obj;
|
|
11173
|
-
}
|
|
11174
9951
|
var STARKNET_DOMAIN = [
|
|
11175
9952
|
{ name: "name", type: "shortstring" },
|
|
11176
9953
|
{ name: "version", type: "shortstring" },
|
|
@@ -11288,7 +10065,7 @@ function buildListingOrder(i, cfg) {
|
|
|
11288
10065
|
salt: i.salt,
|
|
11289
10066
|
counter: i.counter
|
|
11290
10067
|
};
|
|
11291
|
-
const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10068
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
11292
10069
|
return { orderParams, typedData };
|
|
11293
10070
|
}
|
|
11294
10071
|
function buildOfferOrder(i, cfg) {
|
|
@@ -11309,11 +10086,11 @@ function buildOfferOrder(i, cfg) {
|
|
|
11309
10086
|
salt: i.salt,
|
|
11310
10087
|
counter: i.counter
|
|
11311
10088
|
};
|
|
11312
|
-
const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10089
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
11313
10090
|
return { orderParams, typedData };
|
|
11314
10091
|
}
|
|
11315
10092
|
function registerPayload(orderParams, signature) {
|
|
11316
|
-
return stringifyBigInts({
|
|
10093
|
+
return chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11317
10094
|
parameters: {
|
|
11318
10095
|
...orderParams,
|
|
11319
10096
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -11344,14 +10121,14 @@ function buildFulfillCalls(a, cfg) {
|
|
|
11344
10121
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
11345
10122
|
}
|
|
11346
10123
|
function buildCancelCalls(a, cfg) {
|
|
11347
|
-
const cancelRequest = stringifyBigInts({
|
|
10124
|
+
const cancelRequest = chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11348
10125
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
11349
10126
|
signature: a.signature
|
|
11350
10127
|
});
|
|
11351
10128
|
return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
|
|
11352
10129
|
}
|
|
11353
10130
|
function buildCancelTypedData(orderHash, offerer, cfg) {
|
|
11354
|
-
return stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
10131
|
+
return chunkZFRHADHR_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
11355
10132
|
}
|
|
11356
10133
|
function contractFor2(cfg) {
|
|
11357
10134
|
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
@@ -11374,7 +10151,7 @@ function buildListing1155Order(i, cfg) {
|
|
|
11374
10151
|
salt: i.salt,
|
|
11375
10152
|
counter: i.counter
|
|
11376
10153
|
};
|
|
11377
|
-
const typedData = stringifyBigInts(
|
|
10154
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11378
10155
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
11379
10156
|
);
|
|
11380
10157
|
return { orderParams, typedData };
|
|
@@ -11397,13 +10174,13 @@ function buildOffer1155Order(i, cfg) {
|
|
|
11397
10174
|
salt: i.salt,
|
|
11398
10175
|
counter: i.counter
|
|
11399
10176
|
};
|
|
11400
|
-
const typedData = stringifyBigInts(
|
|
10177
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11401
10178
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
11402
10179
|
);
|
|
11403
10180
|
return { orderParams, typedData };
|
|
11404
10181
|
}
|
|
11405
10182
|
function registerPayload2(orderParams, signature) {
|
|
11406
|
-
return stringifyBigInts({
|
|
10183
|
+
return chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11407
10184
|
parameters: {
|
|
11408
10185
|
...orderParams,
|
|
11409
10186
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -11434,14 +10211,14 @@ function buildFulfill1155Calls(a, cfg) {
|
|
|
11434
10211
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
11435
10212
|
}
|
|
11436
10213
|
function buildCancel1155Calls(a, cfg) {
|
|
11437
|
-
const cancelPayload = stringifyBigInts({
|
|
10214
|
+
const cancelPayload = chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11438
10215
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
11439
10216
|
signature: a.signature
|
|
11440
10217
|
});
|
|
11441
10218
|
return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
|
|
11442
10219
|
}
|
|
11443
10220
|
function buildCancel1155TypedData(orderHash, offerer, cfg) {
|
|
11444
|
-
return stringifyBigInts(
|
|
10221
|
+
return chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11445
10222
|
build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
|
|
11446
10223
|
);
|
|
11447
10224
|
}
|
|
@@ -11602,135 +10379,6 @@ var StarknetVenue = class {
|
|
|
11602
10379
|
}
|
|
11603
10380
|
};
|
|
11604
10381
|
|
|
11605
|
-
// src/starknet/admin-auth/types.ts
|
|
11606
|
-
var ADMIN_SCOPE = "admin-api";
|
|
11607
|
-
function adminRequestDigest(req) {
|
|
11608
|
-
return starknet.hash.computePoseidonHashOnElements([
|
|
11609
|
-
starknet.hash.starknetKeccak(req.method.toUpperCase()),
|
|
11610
|
-
starknet.hash.starknetKeccak(req.path),
|
|
11611
|
-
starknet.hash.starknetKeccak(req.body ?? ""),
|
|
11612
|
-
starknet.num.toBigInt(req.nonce),
|
|
11613
|
-
BigInt(req.ts)
|
|
11614
|
-
]);
|
|
11615
|
-
}
|
|
11616
|
-
function signAdminRequest(sessionPrivateKey, req) {
|
|
11617
|
-
const digest = adminRequestDigest(req);
|
|
11618
|
-
return starknet.ec.starkCurve.sign(digest, sessionPrivateKey).toCompactHex();
|
|
11619
|
-
}
|
|
11620
|
-
function verifyAdminRequestSig(sessionPublicKey, req, sig) {
|
|
11621
|
-
try {
|
|
11622
|
-
return starknet.ec.starkCurve.verify(sig, adminRequestDigest(req), sessionPublicKey);
|
|
11623
|
-
} catch {
|
|
11624
|
-
return false;
|
|
11625
|
-
}
|
|
11626
|
-
}
|
|
11627
|
-
function buildAdminSessionTypedData(p) {
|
|
11628
|
-
return {
|
|
11629
|
-
types: {
|
|
11630
|
-
StarknetDomain: [
|
|
11631
|
-
{ name: "name", type: "shortstring" },
|
|
11632
|
-
{ name: "version", type: "shortstring" },
|
|
11633
|
-
{ name: "chainId", type: "shortstring" },
|
|
11634
|
-
{ name: "revision", type: "shortstring" }
|
|
11635
|
-
],
|
|
11636
|
-
AdminSession: [
|
|
11637
|
-
{ name: "sessionKeyHash", type: "felt" },
|
|
11638
|
-
{ name: "scope", type: "shortstring" },
|
|
11639
|
-
{ name: "issuedAt", type: "felt" },
|
|
11640
|
-
{ name: "expiresAt", type: "felt" }
|
|
11641
|
-
]
|
|
11642
|
-
},
|
|
11643
|
-
primaryType: "AdminSession",
|
|
11644
|
-
domain: { name: "Medialane Admin", version: "1", chainId: p.chainId ?? "SN_MAIN", revision: "1" },
|
|
11645
|
-
message: {
|
|
11646
|
-
sessionKeyHash: p.sessionKeyHash,
|
|
11647
|
-
scope: p.scope,
|
|
11648
|
-
issuedAt: String(p.issuedAt),
|
|
11649
|
-
expiresAt: String(p.expiresAt)
|
|
11650
|
-
}
|
|
11651
|
-
};
|
|
11652
|
-
}
|
|
11653
|
-
function sessionKeyHashOf(sessionPublicKey) {
|
|
11654
|
-
return starknet.num.toHex(starknet.hash.starknetKeccak(sessionPublicKey));
|
|
11655
|
-
}
|
|
11656
|
-
async function createAdminSessionGrant(signTypedData, opts) {
|
|
11657
|
-
const priv = starknet.ec.starkCurve.utils.randomPrivateKey();
|
|
11658
|
-
const sessionPrivateKey = "0x" + starknet.encode.buf2hex(priv);
|
|
11659
|
-
const sessionPublicKey = "0x" + starknet.encode.buf2hex(starknet.ec.starkCurve.getPublicKey(sessionPrivateKey, false));
|
|
11660
|
-
const sessionKeyHash = sessionKeyHashOf(sessionPublicKey);
|
|
11661
|
-
const nowSec = Math.floor((opts.now?.() ?? Date.now()) / 1e3);
|
|
11662
|
-
const issuedAt = nowSec;
|
|
11663
|
-
const expiresAt = nowSec + (opts.ttlSeconds ?? 7200);
|
|
11664
|
-
const data = buildAdminSessionTypedData({ sessionKeyHash, scope: ADMIN_SCOPE, issuedAt, expiresAt, chainId: opts.chainId });
|
|
11665
|
-
const walletSig = await signTypedData(data);
|
|
11666
|
-
const grant = {
|
|
11667
|
-
wallet: opts.wallet,
|
|
11668
|
-
chain: opts.chain ?? "STARKNET",
|
|
11669
|
-
sessionPublicKey,
|
|
11670
|
-
sessionKeyHash,
|
|
11671
|
-
scope: ADMIN_SCOPE,
|
|
11672
|
-
issuedAt,
|
|
11673
|
-
expiresAt,
|
|
11674
|
-
walletSig
|
|
11675
|
-
};
|
|
11676
|
-
return { grant, sessionPrivateKey };
|
|
11677
|
-
}
|
|
11678
|
-
|
|
11679
|
-
// src/starknet/admin-auth/headers.ts
|
|
11680
|
-
var ADMIN_HEADERS = {
|
|
11681
|
-
grant: "x-ml-admin-grant",
|
|
11682
|
-
sig: "x-ml-admin-sig",
|
|
11683
|
-
nonce: "x-ml-admin-nonce",
|
|
11684
|
-
ts: "x-ml-admin-ts"
|
|
11685
|
-
};
|
|
11686
|
-
function b64urlEncode(s) {
|
|
11687
|
-
const bytes = new TextEncoder().encode(s);
|
|
11688
|
-
let bin = "";
|
|
11689
|
-
for (const b of bytes) bin += String.fromCharCode(b);
|
|
11690
|
-
return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
11691
|
-
}
|
|
11692
|
-
function b64urlDecode(s) {
|
|
11693
|
-
const pad = s.length % 4 ? "=".repeat(4 - s.length % 4) : "";
|
|
11694
|
-
const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad);
|
|
11695
|
-
const bytes = Uint8Array.from(bin, (c) => c.charCodeAt(0));
|
|
11696
|
-
return new TextDecoder().decode(bytes);
|
|
11697
|
-
}
|
|
11698
|
-
function randomNonce() {
|
|
11699
|
-
const b = new Uint8Array(16);
|
|
11700
|
-
crypto.getRandomValues(b);
|
|
11701
|
-
let hex = "";
|
|
11702
|
-
for (const x of b) hex += x.toString(16).padStart(2, "0");
|
|
11703
|
-
return "0x" + hex;
|
|
11704
|
-
}
|
|
11705
|
-
function encodeAdminHeaders(session, reqInit) {
|
|
11706
|
-
const nonce = randomNonce();
|
|
11707
|
-
const ts = Math.floor((reqInit.now?.() ?? Date.now()) / 1e3);
|
|
11708
|
-
const req = { method: reqInit.method, path: reqInit.path, body: reqInit.body ?? "", nonce, ts };
|
|
11709
|
-
const sig = signAdminRequest(session.sessionPrivateKey, req);
|
|
11710
|
-
return {
|
|
11711
|
-
[ADMIN_HEADERS.grant]: b64urlEncode(JSON.stringify(session.grant)),
|
|
11712
|
-
[ADMIN_HEADERS.sig]: sig,
|
|
11713
|
-
[ADMIN_HEADERS.nonce]: nonce,
|
|
11714
|
-
[ADMIN_HEADERS.ts]: String(ts)
|
|
11715
|
-
};
|
|
11716
|
-
}
|
|
11717
|
-
function parseAdminHeaders(get) {
|
|
11718
|
-
const rawGrant = get(ADMIN_HEADERS.grant);
|
|
11719
|
-
const sig = get(ADMIN_HEADERS.sig);
|
|
11720
|
-
const nonce = get(ADMIN_HEADERS.nonce);
|
|
11721
|
-
const tsRaw = get(ADMIN_HEADERS.ts);
|
|
11722
|
-
if (!rawGrant || !sig || !nonce || !tsRaw) return null;
|
|
11723
|
-
try {
|
|
11724
|
-
const grant = JSON.parse(b64urlDecode(rawGrant));
|
|
11725
|
-
if (!grant.wallet || !grant.sessionPublicKey || !grant.sessionKeyHash || !Array.isArray(grant.walletSig) || typeof grant.expiresAt !== "number") return null;
|
|
11726
|
-
const ts = Number(tsRaw);
|
|
11727
|
-
if (!Number.isFinite(ts)) return null;
|
|
11728
|
-
return { grant, sig, nonce, ts };
|
|
11729
|
-
} catch {
|
|
11730
|
-
return null;
|
|
11731
|
-
}
|
|
11732
|
-
}
|
|
11733
|
-
|
|
11734
10382
|
// src/starknet/siws/client.ts
|
|
11735
10383
|
var STORAGE_PREFIX = "ml_siws_";
|
|
11736
10384
|
function decodeBase64url(str) {
|
|
@@ -11849,7 +10497,7 @@ function buildFundingTransferCall(instructions) {
|
|
|
11849
10497
|
async function fundWithChainTransfer(api, wallet, options) {
|
|
11850
10498
|
const step = options.onStep ?? (() => {
|
|
11851
10499
|
});
|
|
11852
|
-
const
|
|
10500
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
11853
10501
|
const pollMs = options.pollMs ?? 3e3;
|
|
11854
10502
|
const maxPolls = options.maxPolls ?? 20;
|
|
11855
10503
|
step("creating");
|
|
@@ -11879,19 +10527,11 @@ async function fundWithChainTransfer(api, wallet, options) {
|
|
|
11879
10527
|
return { status: "SETTLED", intentId: intent.id, credited: res.data.credited };
|
|
11880
10528
|
}
|
|
11881
10529
|
reason = res.data.reason;
|
|
11882
|
-
await
|
|
10530
|
+
await sleep(pollMs);
|
|
11883
10531
|
}
|
|
11884
10532
|
return { status: "PENDING", intentId: intent.id, reason };
|
|
11885
10533
|
}
|
|
11886
10534
|
|
|
11887
|
-
// src/errors.ts
|
|
11888
|
-
var UserFacingError = class extends Error {
|
|
11889
|
-
constructor(message) {
|
|
11890
|
-
super(message);
|
|
11891
|
-
this.name = "UserFacingError";
|
|
11892
|
-
}
|
|
11893
|
-
};
|
|
11894
|
-
|
|
11895
10535
|
// src/starknet/services/executeIntent.ts
|
|
11896
10536
|
async function confirmIntentBestEffort(client, intentId, txHash) {
|
|
11897
10537
|
await client.api.confirmIntent(intentId, txHash).catch(() => {
|
|
@@ -11921,14 +10561,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
11921
10561
|
const receipt = await provider.getTransactionReceipt(txHash);
|
|
11922
10562
|
const status = receipt.execution_status ?? receipt.status;
|
|
11923
10563
|
if (status === "REVERTED" || status === "REJECTED") {
|
|
11924
|
-
throw new UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
10564
|
+
throw new chunkZFRHADHR_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
11925
10565
|
}
|
|
11926
10566
|
if (status) return receipt;
|
|
11927
10567
|
} catch (err) {
|
|
11928
10568
|
if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
|
|
11929
10569
|
}
|
|
11930
10570
|
}
|
|
11931
|
-
throw new UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
10571
|
+
throw new chunkZFRHADHR_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
11932
10572
|
}
|
|
11933
10573
|
async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
11934
10574
|
let calls;
|
|
@@ -11960,323 +10600,6 @@ async function executeIntents(provider, signer, client, intents, opts = {}) {
|
|
|
11960
10600
|
]);
|
|
11961
10601
|
return { txHash, receipt };
|
|
11962
10602
|
}
|
|
11963
|
-
|
|
11964
|
-
// src/services/registry.ts
|
|
11965
|
-
var SN2 = getStarknetCoordinates("STARKNET");
|
|
11966
|
-
var SERVICES = {
|
|
11967
|
-
"mip-erc721": {
|
|
11968
|
-
id: "mip-erc721",
|
|
11969
|
-
displayName: "IP Collection",
|
|
11970
|
-
description: "Tokenize intellectual property as a per-creator ERC-721 collection.",
|
|
11971
|
-
standard: "ERC721",
|
|
11972
|
-
provenance: "MEDIALANE",
|
|
11973
|
-
onchain: {
|
|
11974
|
-
STARKNET: {
|
|
11975
|
-
factoryAddress: SN2.collection721,
|
|
11976
|
-
startBlock: SN2.collection721StartBlock
|
|
11977
|
-
}
|
|
11978
|
-
},
|
|
11979
|
-
uiVariant: "standard",
|
|
11980
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
|
|
11981
|
-
events: [
|
|
11982
|
-
{ name: "CollectionCreated", emittedBy: "factory" }
|
|
11983
|
-
],
|
|
11984
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
11985
|
-
},
|
|
11986
|
-
"ip-erc721": {
|
|
11987
|
-
id: "ip-erc721",
|
|
11988
|
-
displayName: "Programmable IP",
|
|
11989
|
-
description: "One shared ERC-721 contract any wallet can mint into.",
|
|
11990
|
-
standard: "ERC721",
|
|
11991
|
-
provenance: "MEDIALANE",
|
|
11992
|
-
uiVariant: "standard",
|
|
11993
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
|
|
11994
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
11995
|
-
},
|
|
11996
|
-
"data-tokenization-erc721": {
|
|
11997
|
-
id: "data-tokenization-erc721",
|
|
11998
|
-
displayName: "Data Tokenization",
|
|
11999
|
-
description: "Establish verifiable ownership of your data, with licensing terms that hold up wherever it travels.",
|
|
12000
|
-
standard: "ERC721",
|
|
12001
|
-
provenance: "MEDIALANE",
|
|
12002
|
-
onchain: {
|
|
12003
|
-
STARKNET: {
|
|
12004
|
-
factoryAddress: SN2.dataTokenization721,
|
|
12005
|
-
startBlock: SN2.dataTokenization721StartBlock
|
|
12006
|
-
}
|
|
12007
|
-
},
|
|
12008
|
-
uiVariant: "standard",
|
|
12009
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
|
|
12010
|
-
events: [
|
|
12011
|
-
{ name: "CollectionCreated", emittedBy: "factory" }
|
|
12012
|
-
],
|
|
12013
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12014
|
-
},
|
|
12015
|
-
"mip-erc1155": {
|
|
12016
|
-
id: "mip-erc1155",
|
|
12017
|
-
displayName: "NFT Editions",
|
|
12018
|
-
description: "Per-creator ERC-1155 collection; creator mints editions.",
|
|
12019
|
-
standard: "ERC1155",
|
|
12020
|
-
provenance: "MEDIALANE",
|
|
12021
|
-
onchain: {
|
|
12022
|
-
STARKNET: {
|
|
12023
|
-
factoryAddress: SN2.collection1155,
|
|
12024
|
-
classHash: SN2.collection1155ClassHash,
|
|
12025
|
-
startBlock: SN2.collection1155StartBlock
|
|
12026
|
-
}
|
|
12027
|
-
},
|
|
12028
|
-
uiVariant: "edition",
|
|
12029
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer", "mint", "remix", "license"],
|
|
12030
|
-
events: [
|
|
12031
|
-
{ name: "CollectionDeployed", emittedBy: "factory" }
|
|
12032
|
-
],
|
|
12033
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12034
|
-
},
|
|
12035
|
-
"pop-protocol": {
|
|
12036
|
-
id: "pop-protocol",
|
|
12037
|
-
displayName: "POP Protocol",
|
|
12038
|
-
description: "Soulbound proof-of-presence collectibles per event.",
|
|
12039
|
-
standard: "ERC721",
|
|
12040
|
-
provenance: "MEDIALANE",
|
|
12041
|
-
onchain: {
|
|
12042
|
-
STARKNET: {
|
|
12043
|
-
factoryAddress: SN2.popFactory,
|
|
12044
|
-
classHash: SN2.popCollectionClassHash
|
|
12045
|
-
}
|
|
12046
|
-
},
|
|
12047
|
-
uiVariant: "pop",
|
|
12048
|
-
capabilities: ["claim", "mint"],
|
|
12049
|
-
events: [
|
|
12050
|
-
{ name: "CollectionCreated", emittedBy: "factory" },
|
|
12051
|
-
{ name: "AllowlistUpdated", emittedBy: "instance", poll: "slow" }
|
|
12052
|
-
],
|
|
12053
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12054
|
-
},
|
|
12055
|
-
"certificate-emission": {
|
|
12056
|
-
id: "certificate-emission",
|
|
12057
|
-
displayName: "Certificate Emission",
|
|
12058
|
-
description: "Issue a soulbound credential to a list of recipients in one run \u2014 everyone gets a wallet and their certificate.",
|
|
12059
|
-
standard: "ERC721",
|
|
12060
|
-
provenance: "MEDIALANE",
|
|
12061
|
-
onchain: {
|
|
12062
|
-
STARKNET: {
|
|
12063
|
-
factoryAddress: SN2.popFactory,
|
|
12064
|
-
classHash: SN2.popCollectionClassHash
|
|
12065
|
-
}
|
|
12066
|
-
},
|
|
12067
|
-
uiVariant: "pop",
|
|
12068
|
-
capabilities: ["mint", "airdrop"],
|
|
12069
|
-
events: [
|
|
12070
|
-
{ name: "CollectionCreated", emittedBy: "factory" }
|
|
12071
|
-
],
|
|
12072
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12073
|
-
},
|
|
12074
|
-
"drop-collection": {
|
|
12075
|
-
id: "drop-collection",
|
|
12076
|
-
displayName: "Collection Drop",
|
|
12077
|
-
description: "Sequential mint with claim windows + allowlist.",
|
|
12078
|
-
standard: "ERC721",
|
|
12079
|
-
provenance: "MEDIALANE",
|
|
12080
|
-
onchain: {
|
|
12081
|
-
STARKNET: {
|
|
12082
|
-
factoryAddress: SN2.dropFactory,
|
|
12083
|
-
classHash: SN2.dropCollectionClassHash
|
|
12084
|
-
}
|
|
12085
|
-
},
|
|
12086
|
-
uiVariant: "drop",
|
|
12087
|
-
capabilities: ["claim", "list", "buy", "make_offer", "cancel", "transfer"],
|
|
12088
|
-
events: [
|
|
12089
|
-
{ name: "DropCreated", emittedBy: "factory" },
|
|
12090
|
-
{ name: "AllowlistUpdated", emittedBy: "instance", poll: "slow" }
|
|
12091
|
-
],
|
|
12092
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12093
|
-
},
|
|
12094
|
-
"ip-tickets": {
|
|
12095
|
-
id: "ip-tickets",
|
|
12096
|
-
displayName: "IP Tickets",
|
|
12097
|
-
description: "Create verifiable on-chain tickets \u2014 mint to attendees, trade like any collection.",
|
|
12098
|
-
standard: "ERC1155",
|
|
12099
|
-
provenance: "MEDIALANE",
|
|
12100
|
-
onchain: {
|
|
12101
|
-
STARKNET: {
|
|
12102
|
-
factoryAddress: SN2.ipTicketsFactory,
|
|
12103
|
-
classHash: SN2.ipTicketCollectionClassHash
|
|
12104
|
-
}
|
|
12105
|
-
},
|
|
12106
|
-
uiVariant: "ticket",
|
|
12107
|
-
capabilities: ["mint", "redeem", "list", "buy", "make_offer", "cancel", "transfer"],
|
|
12108
|
-
events: [
|
|
12109
|
-
{ name: "CollectionDeployed", emittedBy: "factory" },
|
|
12110
|
-
{ name: "TicketCreated", emittedBy: "instance" }
|
|
12111
|
-
],
|
|
12112
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12113
|
-
},
|
|
12114
|
-
"ip-ticketing": {
|
|
12115
|
-
id: "ip-ticketing",
|
|
12116
|
-
displayName: "IP Ticketing",
|
|
12117
|
-
description: "Distribute verifiable on-chain tickets to a list of recipients in one run \u2014 everyone gets a wallet and their ticket.",
|
|
12118
|
-
standard: "ERC1155",
|
|
12119
|
-
provenance: "MEDIALANE",
|
|
12120
|
-
onchain: {
|
|
12121
|
-
STARKNET: {
|
|
12122
|
-
factoryAddress: SN2.ipTicketsFactory,
|
|
12123
|
-
classHash: SN2.ipTicketCollectionClassHash
|
|
12124
|
-
}
|
|
12125
|
-
},
|
|
12126
|
-
uiVariant: "ticket",
|
|
12127
|
-
capabilities: ["mint", "airdrop", "redeem", "list", "buy", "make_offer", "cancel", "transfer"],
|
|
12128
|
-
events: [
|
|
12129
|
-
{ name: "CollectionDeployed", emittedBy: "factory" },
|
|
12130
|
-
{ name: "TicketCreated", emittedBy: "instance" }
|
|
12131
|
-
],
|
|
12132
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12133
|
-
},
|
|
12134
|
-
"ip-club": {
|
|
12135
|
-
id: "ip-club",
|
|
12136
|
-
displayName: "IP Club",
|
|
12137
|
-
description: "Membership clubs \u2014 create tiers, mint membership cards, trade like any collection.",
|
|
12138
|
-
standard: "ERC1155",
|
|
12139
|
-
provenance: "MEDIALANE",
|
|
12140
|
-
onchain: {
|
|
12141
|
-
STARKNET: {
|
|
12142
|
-
factoryAddress: SN2.ipClubFactory,
|
|
12143
|
-
classHash: SN2.ipClubCollectionClassHash
|
|
12144
|
-
}
|
|
12145
|
-
},
|
|
12146
|
-
uiVariant: "club",
|
|
12147
|
-
capabilities: ["mint", "list", "buy", "make_offer", "cancel", "transfer"],
|
|
12148
|
-
events: [
|
|
12149
|
-
{ name: "ClubDeployed", emittedBy: "factory" },
|
|
12150
|
-
{ name: "MembershipCreated", emittedBy: "instance" }
|
|
12151
|
-
],
|
|
12152
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12153
|
-
},
|
|
12154
|
-
"ip-sponsorship": {
|
|
12155
|
-
id: "ip-sponsorship",
|
|
12156
|
-
displayName: "IP Sponsorship",
|
|
12157
|
-
description: "Sponsorship offers and licenses anchored to an existing Medialane asset.",
|
|
12158
|
-
standard: "ERC721",
|
|
12159
|
-
provenance: "MEDIALANE",
|
|
12160
|
-
onchain: {
|
|
12161
|
-
STARKNET: {
|
|
12162
|
-
factoryAddress: SN2.ipSponsorship,
|
|
12163
|
-
classHash: SN2.ipSponsorshipClassHash,
|
|
12164
|
-
startBlock: SN2.ipSponsorshipStartBlock
|
|
12165
|
-
}
|
|
12166
|
-
},
|
|
12167
|
-
uiVariant: "standard",
|
|
12168
|
-
capabilities: ["sponsor", "transfer"],
|
|
12169
|
-
events: [
|
|
12170
|
-
{ name: "OfferCreated", emittedBy: "factory" },
|
|
12171
|
-
{ name: "ProposalCreated", emittedBy: "factory" },
|
|
12172
|
-
{ name: "LicenseMinted", emittedBy: "factory" }
|
|
12173
|
-
],
|
|
12174
|
-
metadataSchema: { licenseDefault: "CC BY-SA" }
|
|
12175
|
-
},
|
|
12176
|
-
"creator-coin": {
|
|
12177
|
-
id: "creator-coin",
|
|
12178
|
-
displayName: "Creator Coin",
|
|
12179
|
-
description: "Launch a fixed-supply social token with permanently-locked Ekubo liquidity.",
|
|
12180
|
-
standard: "ERC20",
|
|
12181
|
-
provenance: "MEDIALANE",
|
|
12182
|
-
onchain: {
|
|
12183
|
-
STARKNET: {
|
|
12184
|
-
factoryAddress: SN2.creatorCoinFactory,
|
|
12185
|
-
classHash: SN2.creatorCoinFactoryClassHash,
|
|
12186
|
-
startBlock: SN2.creatorCoinStartBlock
|
|
12187
|
-
}
|
|
12188
|
-
},
|
|
12189
|
-
uiVariant: "coin",
|
|
12190
|
-
capabilities: ["launch", "swap", "transfer"],
|
|
12191
|
-
events: [
|
|
12192
|
-
{ name: "CreatorCoinCreated", emittedBy: "factory" },
|
|
12193
|
-
{ name: "CreatorCoinLaunched", emittedBy: "factory" }
|
|
12194
|
-
]
|
|
12195
|
-
},
|
|
12196
|
-
"medialane-marketplace-erc721": {
|
|
12197
|
-
id: "medialane-marketplace-erc721",
|
|
12198
|
-
displayName: "Medialane Marketplace (ERC-721)",
|
|
12199
|
-
description: "ERC-721 order matching venue.",
|
|
12200
|
-
standard: "ERC721",
|
|
12201
|
-
provenance: "MEDIALANE",
|
|
12202
|
-
onchain: {
|
|
12203
|
-
STARKNET: {
|
|
12204
|
-
factoryAddress: SN2.marketplace721,
|
|
12205
|
-
classHash: SN2.marketplace721ClassHash,
|
|
12206
|
-
startBlock: SN2.marketplace721StartBlock
|
|
12207
|
-
}
|
|
12208
|
-
},
|
|
12209
|
-
uiVariant: "standard",
|
|
12210
|
-
capabilities: ["list", "buy", "make_offer", "cancel"],
|
|
12211
|
-
events: [
|
|
12212
|
-
{ name: "OrderCreated", emittedBy: "factory" },
|
|
12213
|
-
{ name: "OrderFulfilled", emittedBy: "factory" },
|
|
12214
|
-
{ name: "OrderCancelled", emittedBy: "factory" }
|
|
12215
|
-
]
|
|
12216
|
-
},
|
|
12217
|
-
"medialane-marketplace-erc1155": {
|
|
12218
|
-
id: "medialane-marketplace-erc1155",
|
|
12219
|
-
displayName: "Medialane Marketplace (ERC-1155)",
|
|
12220
|
-
description: "ERC-1155 order matching venue.",
|
|
12221
|
-
standard: "ERC1155",
|
|
12222
|
-
provenance: "MEDIALANE",
|
|
12223
|
-
onchain: {
|
|
12224
|
-
STARKNET: {
|
|
12225
|
-
factoryAddress: SN2.marketplace1155,
|
|
12226
|
-
classHash: SN2.marketplace1155ClassHash,
|
|
12227
|
-
startBlock: SN2.marketplace1155StartBlock
|
|
12228
|
-
}
|
|
12229
|
-
},
|
|
12230
|
-
uiVariant: "edition",
|
|
12231
|
-
capabilities: ["list", "buy", "make_offer", "cancel"],
|
|
12232
|
-
events: [
|
|
12233
|
-
{ name: "OrderCreated", emittedBy: "factory" },
|
|
12234
|
-
{ name: "OrderFulfilled", emittedBy: "factory" },
|
|
12235
|
-
{ name: "OrderCancelled", emittedBy: "factory" }
|
|
12236
|
-
]
|
|
12237
|
-
},
|
|
12238
|
-
"unruggable-erc20": {
|
|
12239
|
-
id: "unruggable-erc20",
|
|
12240
|
-
displayName: "Unruggable",
|
|
12241
|
-
description: "An ERC-20 launched through the unruggable.meme protocol, the same contract Medialane's Creator Coin is forked from. Not deployed via a Medialane service, but exposes the same on-chain guarantees: capped team allocation, permanently locked liquidity, fixed supply. Brought in by owner claim or admin/partnership \u2014 never bulk-indexed.",
|
|
12242
|
-
standard: "ERC20",
|
|
12243
|
-
provenance: "EXTERNAL",
|
|
12244
|
-
uiVariant: "coin",
|
|
12245
|
-
capabilities: ["swap", "transfer"]
|
|
12246
|
-
},
|
|
12247
|
-
"external-erc20": {
|
|
12248
|
-
id: "external-erc20",
|
|
12249
|
-
displayName: "Memecoin",
|
|
12250
|
-
description: "A plain ERC-20 not deployed via a Medialane service and carrying no protocol-level guarantees. Brought in by owner claim or admin/partnership \u2014 never bulk-indexed. Generalizes to future chains.",
|
|
12251
|
-
standard: "ERC20",
|
|
12252
|
-
provenance: "EXTERNAL",
|
|
12253
|
-
uiVariant: "coin",
|
|
12254
|
-
capabilities: ["swap", "transfer"]
|
|
12255
|
-
},
|
|
12256
|
-
"external-erc721": {
|
|
12257
|
-
id: "external-erc721",
|
|
12258
|
-
displayName: "External ERC-721",
|
|
12259
|
-
description: "ERC-721 contract not deployed via a Medialane service.",
|
|
12260
|
-
standard: "ERC721",
|
|
12261
|
-
provenance: "EXTERNAL",
|
|
12262
|
-
uiVariant: "standard",
|
|
12263
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer"]
|
|
12264
|
-
},
|
|
12265
|
-
"external-erc1155": {
|
|
12266
|
-
id: "external-erc1155",
|
|
12267
|
-
displayName: "External ERC-1155",
|
|
12268
|
-
description: "ERC-1155 contract not deployed via a Medialane service.",
|
|
12269
|
-
standard: "ERC1155",
|
|
12270
|
-
provenance: "EXTERNAL",
|
|
12271
|
-
uiVariant: "edition",
|
|
12272
|
-
capabilities: ["list", "buy", "make_offer", "cancel", "transfer"]
|
|
12273
|
-
}
|
|
12274
|
-
};
|
|
12275
|
-
function getService(id) {
|
|
12276
|
-
return id && id in SERVICES ? SERVICES[id] : void 0;
|
|
12277
|
-
}
|
|
12278
|
-
|
|
12279
|
-
// src/starknet/services/receipts.ts
|
|
12280
10603
|
var DEPLOY_EVENTS = {
|
|
12281
10604
|
"mip-erc1155": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
|
|
12282
10605
|
"ip-tickets": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
|
|
@@ -12298,14 +10621,14 @@ function u2562(low, high) {
|
|
|
12298
10621
|
return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
|
|
12299
10622
|
}
|
|
12300
10623
|
function deployedCollectionFromReceipt(receipt, service) {
|
|
12301
|
-
const factory = getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
10624
|
+
const factory = chunkZFRHADHR_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
12302
10625
|
const { event, address } = DEPLOY_EVENTS[service];
|
|
12303
10626
|
const selector = BigInt(starknet.hash.getSelectorFromName(event));
|
|
12304
10627
|
for (const e of receipt.events ?? []) {
|
|
12305
10628
|
if (factory && !sameFelt(e.from_address, factory)) continue;
|
|
12306
10629
|
if (!sameFelt(e.keys?.[0], selector)) continue;
|
|
12307
10630
|
const value = address(e);
|
|
12308
|
-
if (value) return normalizeAddress("STARKNET", value);
|
|
10631
|
+
if (value) return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", value);
|
|
12309
10632
|
}
|
|
12310
10633
|
return null;
|
|
12311
10634
|
}
|
|
@@ -12396,17 +10719,6 @@ function deriveOwnerKeyPair(secret, recipientId) {
|
|
|
12396
10719
|
const publicKey = starknet.ec.starkCurve.getStarkKey(privateKey);
|
|
12397
10720
|
return { privateKey, publicKey };
|
|
12398
10721
|
}
|
|
12399
|
-
function ownerConstructorCalldata(ownerPubkey) {
|
|
12400
|
-
return ["0x0", starknet.num.toHex(ownerPubkey), "0x1"];
|
|
12401
|
-
}
|
|
12402
|
-
function computeAccountAddress(ownerPubkey, salt = 0) {
|
|
12403
|
-
return starknet.hash.calculateContractAddressFromHash(
|
|
12404
|
-
starknet.num.toHex(salt),
|
|
12405
|
-
STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
12406
|
-
ownerConstructorCalldata(ownerPubkey),
|
|
12407
|
-
0
|
|
12408
|
-
);
|
|
12409
|
-
}
|
|
12410
10722
|
var STARKNET_SIGNER_TYPE = "0x537461726b6e6574205369676e6572";
|
|
12411
10723
|
var OPTION_NONE = "0x1";
|
|
12412
10724
|
var SIGNER_STARKNET = "0x0";
|
|
@@ -12437,13 +10749,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
|
|
|
12437
10749
|
}
|
|
12438
10750
|
function buildDeployAccountParams(ownerPubkey, salt = 0) {
|
|
12439
10751
|
return {
|
|
12440
|
-
classHash: STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
12441
|
-
constructorCalldata: ownerConstructorCalldata(ownerPubkey),
|
|
10752
|
+
classHash: chunkZFRHADHR_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
10753
|
+
constructorCalldata: chunkZFRHADHR_cjs.ownerConstructorCalldata(ownerPubkey),
|
|
12442
10754
|
addressSalt: starknet.num.toHex(salt),
|
|
12443
|
-
contractAddress: computeAccountAddress(ownerPubkey, salt)
|
|
10755
|
+
contractAddress: chunkZFRHADHR_cjs.computeAccountAddress(ownerPubkey, salt)
|
|
12444
10756
|
};
|
|
12445
10757
|
}
|
|
12446
|
-
var norm = (address) => normalizeAddress("STARKNET", address);
|
|
10758
|
+
var norm = (address) => chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address);
|
|
12447
10759
|
var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
|
|
12448
10760
|
function encodeFeltArray(items) {
|
|
12449
10761
|
return [starknet.num.toHex(items.length), ...items];
|
|
@@ -12529,53 +10841,6 @@ async function getEscapeSecurityPeriod(provider, address) {
|
|
|
12529
10841
|
});
|
|
12530
10842
|
return Number(res[0]);
|
|
12531
10843
|
}
|
|
12532
|
-
async function deriveAesKey(prfSecret, hkdfInfo) {
|
|
12533
|
-
const hkdf = await crypto.subtle.importKey("raw", prfSecret, "HKDF", false, ["deriveKey"]);
|
|
12534
|
-
return crypto.subtle.deriveKey(
|
|
12535
|
-
{ name: "HKDF", hash: "SHA-256", salt: new Uint8Array(0), info: hkdfInfo },
|
|
12536
|
-
hkdf,
|
|
12537
|
-
{ name: "AES-GCM", length: 256 },
|
|
12538
|
-
false,
|
|
12539
|
-
["encrypt", "decrypt"]
|
|
12540
|
-
);
|
|
12541
|
-
}
|
|
12542
|
-
function generateStarkKeyPair() {
|
|
12543
|
-
const privateKeyHex = "0x" + Array.from(starknet.ec.starkCurve.utils.randomPrivateKey()).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
12544
|
-
return { privateKeyHex, publicKeyHex: starknet.ec.starkCurve.getStarkKey(privateKeyHex) };
|
|
12545
|
-
}
|
|
12546
|
-
var InvalidStarkPrivateKeyError = class extends Error {
|
|
12547
|
-
constructor(reason) {
|
|
12548
|
-
super(`Not a valid Starknet private key: ${reason}`);
|
|
12549
|
-
this.name = "InvalidStarkPrivateKeyError";
|
|
12550
|
-
}
|
|
12551
|
-
};
|
|
12552
|
-
function starkKeyPairFromPrivateKey(input) {
|
|
12553
|
-
const trimmed = input.trim().replace(/\s+/g, "");
|
|
12554
|
-
const body = trimmed.startsWith("0x") || trimmed.startsWith("0X") ? trimmed.slice(2) : trimmed;
|
|
12555
|
-
if (body.length === 0) throw new InvalidStarkPrivateKeyError("it is empty");
|
|
12556
|
-
if (!/^[0-9a-fA-F]+$/.test(body)) throw new InvalidStarkPrivateKeyError("it is not hexadecimal");
|
|
12557
|
-
if (body.length > 64) throw new InvalidStarkPrivateKeyError("it is too long");
|
|
12558
|
-
const value = BigInt("0x" + body);
|
|
12559
|
-
if (value === 0n) throw new InvalidStarkPrivateKeyError("it is zero");
|
|
12560
|
-
if (value >= starknet.ec.starkCurve.CURVE.n) throw new InvalidStarkPrivateKeyError("it is outside the curve order");
|
|
12561
|
-
const privateKeyHex = "0x" + value.toString(16).padStart(64, "0");
|
|
12562
|
-
return { privateKeyHex, publicKeyHex: starknet.ec.starkCurve.getStarkKey(privateKeyHex) };
|
|
12563
|
-
}
|
|
12564
|
-
async function sealPrivateKey(aesKey, iv, privateKeyHex) {
|
|
12565
|
-
return crypto.subtle.encrypt(
|
|
12566
|
-
{ name: "AES-GCM", iv },
|
|
12567
|
-
aesKey,
|
|
12568
|
-
new TextEncoder().encode(privateKeyHex)
|
|
12569
|
-
);
|
|
12570
|
-
}
|
|
12571
|
-
async function unsealPrivateKey(aesKey, iv, ciphertext) {
|
|
12572
|
-
const buf = await crypto.subtle.decrypt({ name: "AES-GCM", iv }, aesKey, ciphertext);
|
|
12573
|
-
return new TextDecoder().decode(buf);
|
|
12574
|
-
}
|
|
12575
|
-
function signWithPrivateKey(privateKeyHex, msgHash) {
|
|
12576
|
-
const sig = starknet.ec.starkCurve.sign(msgHash, privateKeyHex);
|
|
12577
|
-
return [starknet.num.toHex(sig.r), starknet.num.toHex(sig.s)];
|
|
12578
|
-
}
|
|
12579
10844
|
|
|
12580
10845
|
// src/wallet/store.ts
|
|
12581
10846
|
function createOwnerStore(config) {
|
|
@@ -12683,7 +10948,7 @@ var InvalidRecoveryKeyError = class extends Error {
|
|
|
12683
10948
|
var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
|
|
12684
10949
|
function keyPair(privateKey) {
|
|
12685
10950
|
try {
|
|
12686
|
-
return starkKeyPairFromPrivateKey(privateKey);
|
|
10951
|
+
return chunkZFRHADHR_cjs.starkKeyPairFromPrivateKey(privateKey);
|
|
12687
10952
|
} catch {
|
|
12688
10953
|
throw new InvalidRecoveryKeyError();
|
|
12689
10954
|
}
|
|
@@ -12696,7 +10961,7 @@ function parseRecoveryKey(input) {
|
|
|
12696
10961
|
const trimmed = input.trim();
|
|
12697
10962
|
if (!trimmed.startsWith(PREFIX)) {
|
|
12698
10963
|
const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
|
|
12699
|
-
return { walletAddress: computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
10964
|
+
return { walletAddress: chunkZFRHADHR_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
12700
10965
|
}
|
|
12701
10966
|
const parts = trimmed.slice(PREFIX.length).split(":");
|
|
12702
10967
|
const [walletAddress, privateKey] = parts;
|
|
@@ -12718,7 +10983,7 @@ function describeRecoveryAction(escape) {
|
|
|
12718
10983
|
return "none";
|
|
12719
10984
|
}
|
|
12720
10985
|
function normalizeWalletAddress(address) {
|
|
12721
|
-
return normalizeAddress("STARKNET", address);
|
|
10986
|
+
return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address);
|
|
12722
10987
|
}
|
|
12723
10988
|
function isValidStarknetAddress(address) {
|
|
12724
10989
|
try {
|
|
@@ -12753,150 +11018,6 @@ function createSelfFundConsent(estimateFee) {
|
|
|
12753
11018
|
}
|
|
12754
11019
|
};
|
|
12755
11020
|
}
|
|
12756
|
-
|
|
12757
|
-
// src/wallet/passkey.ts
|
|
12758
|
-
var PasskeyCancelledError = class extends Error {
|
|
12759
|
-
constructor(message = "Passkey prompt was cancelled.") {
|
|
12760
|
-
super(message);
|
|
12761
|
-
this.name = "PasskeyCancelledError";
|
|
12762
|
-
}
|
|
12763
|
-
};
|
|
12764
|
-
var encodeBase64 = (buf) => {
|
|
12765
|
-
const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
|
|
12766
|
-
let binary = "";
|
|
12767
|
-
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
12768
|
-
return btoa(binary);
|
|
12769
|
-
};
|
|
12770
|
-
var decodeBase64 = (value) => {
|
|
12771
|
-
const binary = atob(value);
|
|
12772
|
-
const bytes = new Uint8Array(binary.length);
|
|
12773
|
-
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
12774
|
-
return bytes;
|
|
12775
|
-
};
|
|
12776
|
-
function isPasskeyCancellation(err) {
|
|
12777
|
-
const name = err?.name;
|
|
12778
|
-
return name === "NotAllowedError" || name === "AbortError";
|
|
12779
|
-
}
|
|
12780
|
-
function createPasskeyOwner(config) {
|
|
12781
|
-
const randomBytes = config.randomBytes ?? ((length) => crypto.getRandomValues(new Uint8Array(length)));
|
|
12782
|
-
const credentialsApi = () => {
|
|
12783
|
-
const api = config.credentials ?? (typeof navigator === "undefined" ? void 0 : navigator.credentials);
|
|
12784
|
-
if (!api) throw new Error("Passkeys are only available in a browser.");
|
|
12785
|
-
return api;
|
|
12786
|
-
};
|
|
12787
|
-
const prfUnsupportedMessage = () => {
|
|
12788
|
-
const isBrave = typeof navigator !== "undefined" && "brave" in navigator;
|
|
12789
|
-
const cause = isBrave ? "Brave doesn't currently support the WebAuthn PRF extension." : "This browser didn't return a passkey PRF secret.";
|
|
12790
|
-
return `${cause} ${config.appName} needs it to seal your key. Your device passkey (Touch ID) is fine, the limitation is the browser. Please open this in Safari or Chrome on an up-to-date OS.`;
|
|
12791
|
-
};
|
|
12792
|
-
async function registerPasskey() {
|
|
12793
|
-
let credential;
|
|
12794
|
-
try {
|
|
12795
|
-
credential = await credentialsApi().create({
|
|
12796
|
-
publicKey: {
|
|
12797
|
-
challenge: randomBytes(32),
|
|
12798
|
-
rp: { name: config.relyingPartyName, id: config.relyingPartyId() },
|
|
12799
|
-
user: await config.passkeyUser(),
|
|
12800
|
-
excludeCredentials: config.knownCredentials(),
|
|
12801
|
-
pubKeyCredParams: [
|
|
12802
|
-
{ type: "public-key", alg: -7 },
|
|
12803
|
-
{ type: "public-key", alg: -257 }
|
|
12804
|
-
],
|
|
12805
|
-
authenticatorSelection: {
|
|
12806
|
-
residentKey: "required",
|
|
12807
|
-
userVerification: "required",
|
|
12808
|
-
authenticatorAttachment: "platform"
|
|
12809
|
-
},
|
|
12810
|
-
extensions: { prf: { eval: { first: config.prfSalt } } }
|
|
12811
|
-
}
|
|
12812
|
-
});
|
|
12813
|
-
} catch (err) {
|
|
12814
|
-
if (isPasskeyCancellation(err)) throw new PasskeyCancelledError();
|
|
12815
|
-
throw err;
|
|
12816
|
-
}
|
|
12817
|
-
const prf = credential.getClientExtensionResults().prf;
|
|
12818
|
-
return { credentialId: encodeBase64(credential.rawId), prfFirst: prf?.results?.first ?? null };
|
|
12819
|
-
}
|
|
12820
|
-
async function prfSecret(credentialId) {
|
|
12821
|
-
let assertion;
|
|
12822
|
-
try {
|
|
12823
|
-
assertion = await credentialsApi().get({
|
|
12824
|
-
publicKey: {
|
|
12825
|
-
challenge: randomBytes(32),
|
|
12826
|
-
rpId: config.relyingPartyId(),
|
|
12827
|
-
allowCredentials: [{ type: "public-key", id: decodeBase64(credentialId) }],
|
|
12828
|
-
userVerification: "required",
|
|
12829
|
-
extensions: { prf: { eval: { first: config.prfSalt } } }
|
|
12830
|
-
}
|
|
12831
|
-
});
|
|
12832
|
-
} catch (err) {
|
|
12833
|
-
if (isPasskeyCancellation(err)) throw new PasskeyCancelledError();
|
|
12834
|
-
throw err;
|
|
12835
|
-
}
|
|
12836
|
-
const result = assertion.getClientExtensionResults().prf?.results?.first;
|
|
12837
|
-
if (!result) throw new Error("Passkey PRF unavailable on this device/browser.");
|
|
12838
|
-
return new Uint8Array(result);
|
|
12839
|
-
}
|
|
12840
|
-
async function secretFromRegistration(registration) {
|
|
12841
|
-
if (registration.prfFirst) return new Uint8Array(registration.prfFirst);
|
|
12842
|
-
try {
|
|
12843
|
-
return await prfSecret(registration.credentialId);
|
|
12844
|
-
} catch {
|
|
12845
|
-
throw new Error(prfUnsupportedMessage());
|
|
12846
|
-
}
|
|
12847
|
-
}
|
|
12848
|
-
async function seal(secret, privateKeyHex) {
|
|
12849
|
-
const aes = await deriveAesKey(secret, config.hkdfInfo);
|
|
12850
|
-
const iv = randomBytes(12);
|
|
12851
|
-
const ciphertext = await sealPrivateKey(aes, iv, privateKeyHex);
|
|
12852
|
-
return { iv: encodeBase64(iv), ciphertext: encodeBase64(ciphertext) };
|
|
12853
|
-
}
|
|
12854
|
-
return {
|
|
12855
|
-
async createOwnerKey() {
|
|
12856
|
-
const registration = await registerPasskey();
|
|
12857
|
-
const secret = await secretFromRegistration(registration);
|
|
12858
|
-
const { privateKeyHex, publicKeyHex } = generateStarkKeyPair();
|
|
12859
|
-
const { iv, ciphertext } = await seal(secret, privateKeyHex);
|
|
12860
|
-
return {
|
|
12861
|
-
sealed: {
|
|
12862
|
-
credentialId: registration.credentialId,
|
|
12863
|
-
ownerPubKey: publicKeyHex,
|
|
12864
|
-
address: computeAccountAddress(publicKeyHex, 0),
|
|
12865
|
-
iv,
|
|
12866
|
-
ciphertext
|
|
12867
|
-
},
|
|
12868
|
-
privateKeyHex
|
|
12869
|
-
};
|
|
12870
|
-
},
|
|
12871
|
-
async unlockOwnerKey(sealed) {
|
|
12872
|
-
const secret = await prfSecret(sealed.credentialId);
|
|
12873
|
-
const aes = await deriveAesKey(secret, config.hkdfInfo);
|
|
12874
|
-
return unsealPrivateKey(aes, decodeBase64(sealed.iv), decodeBase64(sealed.ciphertext));
|
|
12875
|
-
},
|
|
12876
|
-
async sealImportedOwnerKey(recovery) {
|
|
12877
|
-
const { privateKeyHex, publicKeyHex } = starkKeyPairFromPrivateKey(recovery.privateKey);
|
|
12878
|
-
const registration = await registerPasskey();
|
|
12879
|
-
const secret = await secretFromRegistration(registration);
|
|
12880
|
-
const { iv, ciphertext } = await seal(secret, privateKeyHex);
|
|
12881
|
-
return {
|
|
12882
|
-
credentialId: registration.credentialId,
|
|
12883
|
-
ownerPubKey: publicKeyHex,
|
|
12884
|
-
address: recovery.walletAddress,
|
|
12885
|
-
iv,
|
|
12886
|
-
ciphertext
|
|
12887
|
-
};
|
|
12888
|
-
}
|
|
12889
|
-
};
|
|
12890
|
-
}
|
|
12891
|
-
|
|
12892
|
-
// src/utils/token.ts
|
|
12893
|
-
function getTokenBySymbol(symbol) {
|
|
12894
|
-
if (typeof symbol !== "string") return void 0;
|
|
12895
|
-
const upper = symbol.toUpperCase();
|
|
12896
|
-
return SUPPORTED_TOKENS.find((t) => t.symbol === upper);
|
|
12897
|
-
}
|
|
12898
|
-
|
|
12899
|
-
// src/wallet/executors.ts
|
|
12900
11021
|
function accountFor(provider, address, privateKeyHex) {
|
|
12901
11022
|
return new starknet.Account({ provider, address, signer: privateKeyHex, cairoVersion: "1" });
|
|
12902
11023
|
}
|
|
@@ -12907,7 +11028,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
|
|
|
12907
11028
|
return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
|
|
12908
11029
|
}
|
|
12909
11030
|
async function feeTokenBalance(provider, address, unit) {
|
|
12910
|
-
const token = getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
11031
|
+
const token = chunkZFRHADHR_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
12911
11032
|
if (!token) throw new Error(`No fee token for unit ${unit}`);
|
|
12912
11033
|
const [low = "0x0", high = "0x0"] = await provider.callContract({
|
|
12913
11034
|
contractAddress: token.address,
|
|
@@ -12934,7 +11055,7 @@ function sponsoredExecutor(deps) {
|
|
|
12934
11055
|
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
12935
11056
|
{
|
|
12936
11057
|
address: userAddress,
|
|
12937
|
-
signTypedData: async (data) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
11058
|
+
signTypedData: async (data) => chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
12938
11059
|
},
|
|
12939
11060
|
calls
|
|
12940
11061
|
);
|
|
@@ -12984,7 +11105,7 @@ async function deploySponsored(input) {
|
|
|
12984
11105
|
return { transactionHash };
|
|
12985
11106
|
}
|
|
12986
11107
|
async function deploySelfFunded(input) {
|
|
12987
|
-
const classHash = getCoordinates("STARKNET").mediaWalletClassHash;
|
|
11108
|
+
const classHash = chunkOUPVVMLK_cjs.getCoordinates("STARKNET").mediaWalletClassHash;
|
|
12988
11109
|
if (!classHash) throw new Error("Media Wallet class hash is not configured");
|
|
12989
11110
|
const account = new starknet.Account({
|
|
12990
11111
|
provider: input.provider,
|
|
@@ -12994,13 +11115,13 @@ async function deploySelfFunded(input) {
|
|
|
12994
11115
|
});
|
|
12995
11116
|
const { transaction_hash } = await account.deployAccount({
|
|
12996
11117
|
classHash,
|
|
12997
|
-
constructorCalldata: ownerConstructorCalldata(input.ownerPubKey),
|
|
11118
|
+
constructorCalldata: chunkZFRHADHR_cjs.ownerConstructorCalldata(input.ownerPubKey),
|
|
12998
11119
|
addressSalt: 0,
|
|
12999
11120
|
contractAddress: input.ownerAddress
|
|
13000
11121
|
});
|
|
13001
11122
|
return { transactionHash: transaction_hash };
|
|
13002
11123
|
}
|
|
13003
|
-
async function waitUntilDeployed(provider, address, timeoutMs = 9e4,
|
|
11124
|
+
async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
|
|
13004
11125
|
const deadline = Date.now() + timeoutMs;
|
|
13005
11126
|
let wait = 1e3;
|
|
13006
11127
|
for (; ; ) {
|
|
@@ -13010,7 +11131,7 @@ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep2 = (m
|
|
|
13010
11131
|
"Your wallet was submitted but has not appeared on Starknet yet. Please try again in a moment."
|
|
13011
11132
|
);
|
|
13012
11133
|
}
|
|
13013
|
-
await
|
|
11134
|
+
await sleep(wait);
|
|
13014
11135
|
wait = Math.min(Math.round(wait * 1.5), 5e3);
|
|
13015
11136
|
}
|
|
13016
11137
|
}
|
|
@@ -13057,7 +11178,7 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
13057
11178
|
backendUrl: deps.backendUrl,
|
|
13058
11179
|
walletAddress: address,
|
|
13059
11180
|
signer: {
|
|
13060
|
-
signMessage: async (td) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
11181
|
+
signMessage: async (td) => chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
13061
11182
|
}
|
|
13062
11183
|
});
|
|
13063
11184
|
deps.store.notifyChange();
|
|
@@ -13162,7 +11283,7 @@ function createMediaWallet(config) {
|
|
|
13162
11283
|
address: sealed.address,
|
|
13163
11284
|
signTypedData: async (data) => {
|
|
13164
11285
|
const privateKeyHex = await unlockOnce(sealed);
|
|
13165
|
-
return signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
11286
|
+
return chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
13166
11287
|
},
|
|
13167
11288
|
execute: async (calls) => {
|
|
13168
11289
|
const { transactionHash } = await run(sealed, calls);
|
|
@@ -13232,8 +11353,54 @@ async function claimSessionWallet(api, walletAddress, deps) {
|
|
|
13232
11353
|
if (removeOwnerGuid) await deps.removeOwner(sealed, removeOwnerGuid);
|
|
13233
11354
|
}
|
|
13234
11355
|
|
|
13235
|
-
exports
|
|
13236
|
-
|
|
11356
|
+
Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
|
|
11357
|
+
enumerable: true,
|
|
11358
|
+
get: function () { return chunkZFRHADHR_cjs.InvalidStarkPrivateKeyError; }
|
|
11359
|
+
});
|
|
11360
|
+
Object.defineProperty(exports, "PasskeyCancelledError", {
|
|
11361
|
+
enumerable: true,
|
|
11362
|
+
get: function () { return chunkZFRHADHR_cjs.PasskeyCancelledError; }
|
|
11363
|
+
});
|
|
11364
|
+
Object.defineProperty(exports, "UserFacingError", {
|
|
11365
|
+
enumerable: true,
|
|
11366
|
+
get: function () { return chunkZFRHADHR_cjs.UserFacingError; }
|
|
11367
|
+
});
|
|
11368
|
+
Object.defineProperty(exports, "computeAccountAddress", {
|
|
11369
|
+
enumerable: true,
|
|
11370
|
+
get: function () { return chunkZFRHADHR_cjs.computeAccountAddress; }
|
|
11371
|
+
});
|
|
11372
|
+
Object.defineProperty(exports, "createPasskeyOwner", {
|
|
11373
|
+
enumerable: true,
|
|
11374
|
+
get: function () { return chunkZFRHADHR_cjs.createPasskeyOwner; }
|
|
11375
|
+
});
|
|
11376
|
+
Object.defineProperty(exports, "deriveAesKey", {
|
|
11377
|
+
enumerable: true,
|
|
11378
|
+
get: function () { return chunkZFRHADHR_cjs.deriveAesKey; }
|
|
11379
|
+
});
|
|
11380
|
+
Object.defineProperty(exports, "generateStarkKeyPair", {
|
|
11381
|
+
enumerable: true,
|
|
11382
|
+
get: function () { return chunkZFRHADHR_cjs.generateStarkKeyPair; }
|
|
11383
|
+
});
|
|
11384
|
+
Object.defineProperty(exports, "ownerConstructorCalldata", {
|
|
11385
|
+
enumerable: true,
|
|
11386
|
+
get: function () { return chunkZFRHADHR_cjs.ownerConstructorCalldata; }
|
|
11387
|
+
});
|
|
11388
|
+
Object.defineProperty(exports, "sealPrivateKey", {
|
|
11389
|
+
enumerable: true,
|
|
11390
|
+
get: function () { return chunkZFRHADHR_cjs.sealPrivateKey; }
|
|
11391
|
+
});
|
|
11392
|
+
Object.defineProperty(exports, "signWithPrivateKey", {
|
|
11393
|
+
enumerable: true,
|
|
11394
|
+
get: function () { return chunkZFRHADHR_cjs.signWithPrivateKey; }
|
|
11395
|
+
});
|
|
11396
|
+
Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
|
|
11397
|
+
enumerable: true,
|
|
11398
|
+
get: function () { return chunkZFRHADHR_cjs.starkKeyPairFromPrivateKey; }
|
|
11399
|
+
});
|
|
11400
|
+
Object.defineProperty(exports, "unsealPrivateKey", {
|
|
11401
|
+
enumerable: true,
|
|
11402
|
+
get: function () { return chunkZFRHADHR_cjs.unsealPrivateKey; }
|
|
11403
|
+
});
|
|
13237
11404
|
exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
|
|
13238
11405
|
exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
|
|
13239
11406
|
exports.ClubService = ClubService;
|
|
@@ -13257,7 +11424,6 @@ exports.IPTicketCollectionABI = IPTicketCollectionABI;
|
|
|
13257
11424
|
exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
|
|
13258
11425
|
exports.InvalidPairingPayloadError = InvalidPairingPayloadError;
|
|
13259
11426
|
exports.InvalidRecoveryKeyError = InvalidRecoveryKeyError;
|
|
13260
|
-
exports.InvalidStarkPrivateKeyError = InvalidStarkPrivateKeyError;
|
|
13261
11427
|
exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
|
|
13262
11428
|
exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
|
|
13263
11429
|
exports.Medialane1155ABI = Medialane1155ABI;
|
|
@@ -13265,24 +11431,20 @@ exports.MedialaneClient = MedialaneClient;
|
|
|
13265
11431
|
exports.MedialaneError = MedialaneError;
|
|
13266
11432
|
exports.POPCollectionABI = POPCollectionABI;
|
|
13267
11433
|
exports.POPFactoryABI = POPFactoryABI;
|
|
13268
|
-
exports.PasskeyCancelledError = PasskeyCancelledError;
|
|
13269
11434
|
exports.PopService = PopService;
|
|
13270
11435
|
exports.SUGGESTED_DEFAULT_PRICE = SUGGESTED_DEFAULT_PRICE;
|
|
13271
11436
|
exports.SponsoredCallRejectedError = SponsoredCallRejectedError;
|
|
13272
11437
|
exports.SponsorshipService = SponsorshipService;
|
|
13273
11438
|
exports.StarknetVenue = StarknetVenue;
|
|
13274
11439
|
exports.TicketService = TicketService;
|
|
13275
|
-
exports.UserFacingError = UserFacingError;
|
|
13276
11440
|
exports.VALIDATED_EKUBO_PARAMS = VALIDATED_EKUBO_PARAMS;
|
|
13277
11441
|
exports.accountFor = accountFor;
|
|
13278
|
-
exports.adminRequestDigest = adminRequestDigest;
|
|
13279
11442
|
exports.adoptSessionWallet = adoptSessionWallet;
|
|
13280
11443
|
exports.allowsFallbackFunding = allowsFallbackFunding;
|
|
13281
11444
|
exports.assertTransactionSucceeded = assertTransactionSucceeded;
|
|
13282
11445
|
exports.build1155CancellationTypedData = build1155CancellationTypedData;
|
|
13283
11446
|
exports.build1155OrderTypedData = build1155OrderTypedData;
|
|
13284
11447
|
exports.buildAddOwnerCall = buildAddOwnerCall;
|
|
13285
|
-
exports.buildAdminSessionTypedData = buildAdminSessionTypedData;
|
|
13286
11448
|
exports.buildCancelEscapeCall = buildCancelEscapeCall;
|
|
13287
11449
|
exports.buildCancellationTypedData = buildCancellationTypedData;
|
|
13288
11450
|
exports.buildCompleteEscapeOwnerCall = buildCompleteEscapeOwnerCall;
|
|
@@ -13301,26 +11463,21 @@ exports.canRemoveDevice = canRemoveDevice;
|
|
|
13301
11463
|
exports.claimSessionWallet = claimSessionWallet;
|
|
13302
11464
|
exports.coinToRaw = toRaw;
|
|
13303
11465
|
exports.completeDeployment = completeDeployment;
|
|
13304
|
-
exports.computeAccountAddress = computeAccountAddress;
|
|
13305
11466
|
exports.computeOwnerGuid = computeOwnerGuid;
|
|
13306
11467
|
exports.confirmIntentBestEffort = confirmIntentBestEffort;
|
|
13307
|
-
exports.createAdminSessionGrant = createAdminSessionGrant;
|
|
13308
11468
|
exports.createDeploymentCoordinator = createDeploymentCoordinator;
|
|
13309
11469
|
exports.createMediaWallet = createMediaWallet;
|
|
13310
11470
|
exports.createOwnerStore = createOwnerStore;
|
|
13311
|
-
exports.createPasskeyOwner = createPasskeyOwner;
|
|
13312
11471
|
exports.createSelfFundConsent = createSelfFundConsent;
|
|
13313
11472
|
exports.decodeEscapeAndStatus = decodeEscapeAndStatus;
|
|
13314
11473
|
exports.decodeGuardiansInfo = decodeGuardiansInfo;
|
|
13315
11474
|
exports.deploySelfFunded = deploySelfFunded;
|
|
13316
11475
|
exports.deploySponsored = deploySponsored;
|
|
13317
11476
|
exports.deployedCollectionFromReceipt = deployedCollectionFromReceipt;
|
|
13318
|
-
exports.deriveAesKey = deriveAesKey;
|
|
13319
11477
|
exports.deriveOwnerKeyPair = deriveOwnerKeyPair;
|
|
13320
11478
|
exports.describeDevices = describeDevices;
|
|
13321
11479
|
exports.describeGuardianStatus = describeGuardianStatus;
|
|
13322
11480
|
exports.describeRecoveryAction = describeRecoveryAction;
|
|
13323
|
-
exports.encodeAdminHeaders = encodeAdminHeaders;
|
|
13324
11481
|
exports.encodeByteArray = encodeByteArray;
|
|
13325
11482
|
exports.encodePairingPayload = encodePairingPayload;
|
|
13326
11483
|
exports.encodeRecoveryKey = encodeRecoveryKey;
|
|
@@ -13331,7 +11488,6 @@ exports.executeSponsored = executeSponsored;
|
|
|
13331
11488
|
exports.fdvHuman = fdvHuman;
|
|
13332
11489
|
exports.fundWithChainTransfer = fundWithChainTransfer;
|
|
13333
11490
|
exports.fundingApiFor = fundingApiFor;
|
|
13334
|
-
exports.generateStarkKeyPair = generateStarkKeyPair;
|
|
13335
11491
|
exports.getCounter = getCounter;
|
|
13336
11492
|
exports.getCounter1155 = getCounter1155;
|
|
13337
11493
|
exports.getCreatorCoinGuarantees = getCreatorCoinGuarantees;
|
|
@@ -13349,32 +11505,22 @@ exports.isValidStarknetAddress = isValidStarknetAddress;
|
|
|
13349
11505
|
exports.mintedTokenIdFromReceipt = mintedTokenIdFromReceipt;
|
|
13350
11506
|
exports.normalizeSiwsSignature = normalizeSiwsSignature;
|
|
13351
11507
|
exports.normalizeWalletAddress = normalizeWalletAddress;
|
|
13352
|
-
exports.ownerConstructorCalldata = ownerConstructorCalldata;
|
|
13353
11508
|
exports.parseAccountAddress = parseAccountAddress;
|
|
13354
|
-
exports.parseAdminHeaders = parseAdminHeaders;
|
|
13355
11509
|
exports.parseCreatorCoinCreated = parseCreatorCoinCreated;
|
|
13356
11510
|
exports.parsePairingPayload = parsePairingPayload;
|
|
13357
11511
|
exports.parseRecoveryKey = parseRecoveryKey;
|
|
13358
11512
|
exports.priceToEkuboParams = priceToEkuboParams;
|
|
13359
|
-
exports.randomNonce = randomNonce;
|
|
13360
11513
|
exports.requestSiwsToken = requestSiwsToken;
|
|
13361
|
-
exports.sealPrivateKey = sealPrivateKey;
|
|
13362
11514
|
exports.selfFundedExecutor = selfFundedExecutor;
|
|
13363
|
-
exports.sessionKeyHashOf = sessionKeyHashOf;
|
|
13364
|
-
exports.signAdminRequest = signAdminRequest;
|
|
13365
|
-
exports.signWithPrivateKey = signWithPrivateKey;
|
|
13366
11515
|
exports.sponsoredExecutor = sponsoredExecutor;
|
|
13367
|
-
exports.starkKeyPairFromPrivateKey = starkKeyPairFromPrivateKey;
|
|
13368
11516
|
exports.storeSiwsToken = storeSiwsToken;
|
|
13369
11517
|
exports.syncTransactionBestEffort = syncTransactionBestEffort;
|
|
13370
11518
|
exports.teamCoinsRaw = teamCoinsRaw;
|
|
13371
11519
|
exports.toDropContractConditions = toContractConditions;
|
|
13372
|
-
exports.unsealPrivateKey = unsealPrivateKey;
|
|
13373
11520
|
exports.validateCoinName = validateName;
|
|
13374
11521
|
exports.validateCoinSupply = validateSupply;
|
|
13375
11522
|
exports.validateCoinSymbol = validateSymbol;
|
|
13376
11523
|
exports.validatePrice = validatePrice;
|
|
13377
|
-
exports.verifyAdminRequestSig = verifyAdminRequestSig;
|
|
13378
11524
|
exports.waitUntilDeployed = waitUntilDeployed;
|
|
13379
11525
|
//# sourceMappingURL=index.cjs.map
|
|
13380
11526
|
//# sourceMappingURL=index.cjs.map
|