@medialane/sdk 0.155.0 → 0.156.1
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 +334 -2212
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +167 -302
- package/dist/starknet/index.d.ts +167 -302
- package/dist/starknet/index.js +231 -2133
- 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;
|
|
@@ -9453,8 +8249,8 @@ var IPSponsorshipABI = [
|
|
|
9453
8249
|
var IPGenesisABI = [
|
|
9454
8250
|
{
|
|
9455
8251
|
"type": "impl",
|
|
9456
|
-
"name": "
|
|
9457
|
-
"interface_name": "
|
|
8252
|
+
"name": "ERC721MetadataImpl",
|
|
8253
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
|
|
9458
8254
|
},
|
|
9459
8255
|
{
|
|
9460
8256
|
"type": "struct",
|
|
@@ -9470,7 +8266,7 @@ var IPGenesisABI = [
|
|
|
9470
8266
|
},
|
|
9471
8267
|
{
|
|
9472
8268
|
"name": "pending_word_len",
|
|
9473
|
-
"type": "core::
|
|
8269
|
+
"type": "core::integer::u32"
|
|
9474
8270
|
}
|
|
9475
8271
|
]
|
|
9476
8272
|
},
|
|
@@ -9490,70 +8286,195 @@ var IPGenesisABI = [
|
|
|
9490
8286
|
},
|
|
9491
8287
|
{
|
|
9492
8288
|
"type": "interface",
|
|
9493
|
-
"name": "
|
|
8289
|
+
"name": "openzeppelin_token::erc721::interface::IERC721Metadata",
|
|
9494
8290
|
"items": [
|
|
9495
8291
|
{
|
|
9496
8292
|
"type": "function",
|
|
9497
|
-
"name": "
|
|
9498
|
-
"inputs": [
|
|
8293
|
+
"name": "name",
|
|
8294
|
+
"inputs": [],
|
|
8295
|
+
"outputs": [
|
|
9499
8296
|
{
|
|
9500
|
-
"
|
|
9501
|
-
|
|
9502
|
-
|
|
8297
|
+
"type": "core::byte_array::ByteArray"
|
|
8298
|
+
}
|
|
8299
|
+
],
|
|
8300
|
+
"state_mutability": "view"
|
|
8301
|
+
},
|
|
8302
|
+
{
|
|
8303
|
+
"type": "function",
|
|
8304
|
+
"name": "symbol",
|
|
8305
|
+
"inputs": [],
|
|
8306
|
+
"outputs": [
|
|
9503
8307
|
{
|
|
9504
|
-
"name": "uri",
|
|
9505
8308
|
"type": "core::byte_array::ByteArray"
|
|
9506
8309
|
}
|
|
9507
8310
|
],
|
|
8311
|
+
"state_mutability": "view"
|
|
8312
|
+
},
|
|
8313
|
+
{
|
|
8314
|
+
"type": "function",
|
|
8315
|
+
"name": "token_uri",
|
|
8316
|
+
"inputs": [
|
|
8317
|
+
{
|
|
8318
|
+
"name": "token_id",
|
|
8319
|
+
"type": "core::integer::u256"
|
|
8320
|
+
}
|
|
8321
|
+
],
|
|
9508
8322
|
"outputs": [
|
|
9509
8323
|
{
|
|
8324
|
+
"type": "core::byte_array::ByteArray"
|
|
8325
|
+
}
|
|
8326
|
+
],
|
|
8327
|
+
"state_mutability": "view"
|
|
8328
|
+
}
|
|
8329
|
+
]
|
|
8330
|
+
},
|
|
8331
|
+
{
|
|
8332
|
+
"type": "impl",
|
|
8333
|
+
"name": "ERC721MetadataCamelOnlyImpl",
|
|
8334
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
|
|
8335
|
+
},
|
|
8336
|
+
{
|
|
8337
|
+
"type": "interface",
|
|
8338
|
+
"name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
|
|
8339
|
+
"items": [
|
|
8340
|
+
{
|
|
8341
|
+
"type": "function",
|
|
8342
|
+
"name": "tokenURI",
|
|
8343
|
+
"inputs": [
|
|
8344
|
+
{
|
|
8345
|
+
"name": "tokenId",
|
|
9510
8346
|
"type": "core::integer::u256"
|
|
9511
8347
|
}
|
|
9512
8348
|
],
|
|
9513
|
-
"
|
|
8349
|
+
"outputs": [
|
|
8350
|
+
{
|
|
8351
|
+
"type": "core::byte_array::ByteArray"
|
|
8352
|
+
}
|
|
8353
|
+
],
|
|
8354
|
+
"state_mutability": "view"
|
|
9514
8355
|
}
|
|
9515
8356
|
]
|
|
9516
8357
|
},
|
|
9517
8358
|
{
|
|
9518
8359
|
"type": "impl",
|
|
9519
|
-
"name": "
|
|
9520
|
-
"interface_name": "
|
|
8360
|
+
"name": "IPCollectionImpl",
|
|
8361
|
+
"interface_name": "ip_programmable_erc_721::interfaces::IIPCollection::IIPCollection"
|
|
8362
|
+
},
|
|
8363
|
+
{
|
|
8364
|
+
"type": "struct",
|
|
8365
|
+
"name": "ip_programmable_erc_721::types::TokenData",
|
|
8366
|
+
"members": [
|
|
8367
|
+
{
|
|
8368
|
+
"name": "token_id",
|
|
8369
|
+
"type": "core::integer::u256"
|
|
8370
|
+
},
|
|
8371
|
+
{
|
|
8372
|
+
"name": "owner",
|
|
8373
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8374
|
+
},
|
|
8375
|
+
{
|
|
8376
|
+
"name": "metadata_uri",
|
|
8377
|
+
"type": "core::byte_array::ByteArray"
|
|
8378
|
+
},
|
|
8379
|
+
{
|
|
8380
|
+
"name": "original_creator",
|
|
8381
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8382
|
+
},
|
|
8383
|
+
{
|
|
8384
|
+
"name": "registered_at",
|
|
8385
|
+
"type": "core::integer::u64"
|
|
8386
|
+
}
|
|
8387
|
+
]
|
|
9521
8388
|
},
|
|
9522
8389
|
{
|
|
9523
8390
|
"type": "interface",
|
|
9524
|
-
"name": "
|
|
8391
|
+
"name": "ip_programmable_erc_721::interfaces::IIPCollection::IIPCollection",
|
|
9525
8392
|
"items": [
|
|
9526
8393
|
{
|
|
9527
8394
|
"type": "function",
|
|
9528
|
-
"name": "
|
|
8395
|
+
"name": "mint_item",
|
|
8396
|
+
"inputs": [
|
|
8397
|
+
{
|
|
8398
|
+
"name": "recipient",
|
|
8399
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8400
|
+
},
|
|
8401
|
+
{
|
|
8402
|
+
"name": "token_uri",
|
|
8403
|
+
"type": "core::byte_array::ByteArray"
|
|
8404
|
+
}
|
|
8405
|
+
],
|
|
8406
|
+
"outputs": [
|
|
8407
|
+
{
|
|
8408
|
+
"type": "core::integer::u256"
|
|
8409
|
+
}
|
|
8410
|
+
],
|
|
8411
|
+
"state_mutability": "external"
|
|
8412
|
+
},
|
|
8413
|
+
{
|
|
8414
|
+
"type": "function",
|
|
8415
|
+
"name": "get_collection_creator",
|
|
9529
8416
|
"inputs": [],
|
|
9530
8417
|
"outputs": [
|
|
9531
8418
|
{
|
|
8419
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8420
|
+
}
|
|
8421
|
+
],
|
|
8422
|
+
"state_mutability": "view"
|
|
8423
|
+
},
|
|
8424
|
+
{
|
|
8425
|
+
"type": "function",
|
|
8426
|
+
"name": "get_token_creator",
|
|
8427
|
+
"inputs": [
|
|
8428
|
+
{
|
|
8429
|
+
"name": "token_id",
|
|
9532
8430
|
"type": "core::integer::u256"
|
|
9533
8431
|
}
|
|
9534
8432
|
],
|
|
8433
|
+
"outputs": [
|
|
8434
|
+
{
|
|
8435
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8436
|
+
}
|
|
8437
|
+
],
|
|
9535
8438
|
"state_mutability": "view"
|
|
9536
8439
|
},
|
|
9537
8440
|
{
|
|
9538
8441
|
"type": "function",
|
|
9539
|
-
"name": "
|
|
9540
|
-
"inputs": [
|
|
9541
|
-
|
|
9542
|
-
|
|
8442
|
+
"name": "get_token_registered_at",
|
|
8443
|
+
"inputs": [
|
|
8444
|
+
{
|
|
8445
|
+
"name": "token_id",
|
|
8446
|
+
"type": "core::integer::u256"
|
|
8447
|
+
}
|
|
8448
|
+
],
|
|
8449
|
+
"outputs": [
|
|
8450
|
+
{
|
|
8451
|
+
"type": "core::integer::u64"
|
|
8452
|
+
}
|
|
8453
|
+
],
|
|
8454
|
+
"state_mutability": "view"
|
|
9543
8455
|
},
|
|
9544
8456
|
{
|
|
9545
8457
|
"type": "function",
|
|
9546
|
-
"name": "
|
|
9547
|
-
"inputs": [
|
|
9548
|
-
|
|
9549
|
-
|
|
8458
|
+
"name": "get_token_data",
|
|
8459
|
+
"inputs": [
|
|
8460
|
+
{
|
|
8461
|
+
"name": "token_id",
|
|
8462
|
+
"type": "core::integer::u256"
|
|
8463
|
+
}
|
|
8464
|
+
],
|
|
8465
|
+
"outputs": [
|
|
8466
|
+
{
|
|
8467
|
+
"type": "ip_programmable_erc_721::types::TokenData"
|
|
8468
|
+
}
|
|
8469
|
+
],
|
|
8470
|
+
"state_mutability": "view"
|
|
9550
8471
|
}
|
|
9551
8472
|
]
|
|
9552
8473
|
},
|
|
9553
8474
|
{
|
|
9554
8475
|
"type": "impl",
|
|
9555
|
-
"name": "
|
|
9556
|
-
"interface_name": "openzeppelin_token::erc721::interface::
|
|
8476
|
+
"name": "ERC721Impl",
|
|
8477
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721"
|
|
9557
8478
|
},
|
|
9558
8479
|
{
|
|
9559
8480
|
"type": "struct",
|
|
@@ -9581,7 +8502,7 @@ var IPGenesisABI = [
|
|
|
9581
8502
|
},
|
|
9582
8503
|
{
|
|
9583
8504
|
"type": "interface",
|
|
9584
|
-
"name": "openzeppelin_token::erc721::interface::
|
|
8505
|
+
"name": "openzeppelin_token::erc721::interface::IERC721",
|
|
9585
8506
|
"items": [
|
|
9586
8507
|
{
|
|
9587
8508
|
"type": "function",
|
|
@@ -9726,61 +8647,18 @@ var IPGenesisABI = [
|
|
|
9726
8647
|
}
|
|
9727
8648
|
],
|
|
9728
8649
|
"state_mutability": "view"
|
|
9729
|
-
}
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
"type": "core::bool"
|
|
9742
|
-
}
|
|
9743
|
-
],
|
|
9744
|
-
"state_mutability": "view"
|
|
9745
|
-
},
|
|
9746
|
-
{
|
|
9747
|
-
"type": "function",
|
|
9748
|
-
"name": "name",
|
|
9749
|
-
"inputs": [],
|
|
9750
|
-
"outputs": [
|
|
9751
|
-
{
|
|
9752
|
-
"type": "core::byte_array::ByteArray"
|
|
9753
|
-
}
|
|
9754
|
-
],
|
|
9755
|
-
"state_mutability": "view"
|
|
9756
|
-
},
|
|
9757
|
-
{
|
|
9758
|
-
"type": "function",
|
|
9759
|
-
"name": "symbol",
|
|
9760
|
-
"inputs": [],
|
|
9761
|
-
"outputs": [
|
|
9762
|
-
{
|
|
9763
|
-
"type": "core::byte_array::ByteArray"
|
|
9764
|
-
}
|
|
9765
|
-
],
|
|
9766
|
-
"state_mutability": "view"
|
|
9767
|
-
},
|
|
9768
|
-
{
|
|
9769
|
-
"type": "function",
|
|
9770
|
-
"name": "token_uri",
|
|
9771
|
-
"inputs": [
|
|
9772
|
-
{
|
|
9773
|
-
"name": "token_id",
|
|
9774
|
-
"type": "core::integer::u256"
|
|
9775
|
-
}
|
|
9776
|
-
],
|
|
9777
|
-
"outputs": [
|
|
9778
|
-
{
|
|
9779
|
-
"type": "core::byte_array::ByteArray"
|
|
9780
|
-
}
|
|
9781
|
-
],
|
|
9782
|
-
"state_mutability": "view"
|
|
9783
|
-
},
|
|
8650
|
+
}
|
|
8651
|
+
]
|
|
8652
|
+
},
|
|
8653
|
+
{
|
|
8654
|
+
"type": "impl",
|
|
8655
|
+
"name": "ERC721CamelOnly",
|
|
8656
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721CamelOnly"
|
|
8657
|
+
},
|
|
8658
|
+
{
|
|
8659
|
+
"type": "interface",
|
|
8660
|
+
"name": "openzeppelin_token::erc721::interface::IERC721CamelOnly",
|
|
8661
|
+
"items": [
|
|
9784
8662
|
{
|
|
9785
8663
|
"type": "function",
|
|
9786
8664
|
"name": "balanceOf",
|
|
@@ -9908,82 +8786,6 @@ var IPGenesisABI = [
|
|
|
9908
8786
|
}
|
|
9909
8787
|
],
|
|
9910
8788
|
"state_mutability": "view"
|
|
9911
|
-
},
|
|
9912
|
-
{
|
|
9913
|
-
"type": "function",
|
|
9914
|
-
"name": "tokenURI",
|
|
9915
|
-
"inputs": [
|
|
9916
|
-
{
|
|
9917
|
-
"name": "tokenId",
|
|
9918
|
-
"type": "core::integer::u256"
|
|
9919
|
-
}
|
|
9920
|
-
],
|
|
9921
|
-
"outputs": [
|
|
9922
|
-
{
|
|
9923
|
-
"type": "core::byte_array::ByteArray"
|
|
9924
|
-
}
|
|
9925
|
-
],
|
|
9926
|
-
"state_mutability": "view"
|
|
9927
|
-
}
|
|
9928
|
-
]
|
|
9929
|
-
},
|
|
9930
|
-
{
|
|
9931
|
-
"type": "impl",
|
|
9932
|
-
"name": "OwnableMixinImpl",
|
|
9933
|
-
"interface_name": "openzeppelin_access::ownable::interface::OwnableABI"
|
|
9934
|
-
},
|
|
9935
|
-
{
|
|
9936
|
-
"type": "interface",
|
|
9937
|
-
"name": "openzeppelin_access::ownable::interface::OwnableABI",
|
|
9938
|
-
"items": [
|
|
9939
|
-
{
|
|
9940
|
-
"type": "function",
|
|
9941
|
-
"name": "owner",
|
|
9942
|
-
"inputs": [],
|
|
9943
|
-
"outputs": [
|
|
9944
|
-
{
|
|
9945
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
9946
|
-
}
|
|
9947
|
-
],
|
|
9948
|
-
"state_mutability": "view"
|
|
9949
|
-
},
|
|
9950
|
-
{
|
|
9951
|
-
"type": "function",
|
|
9952
|
-
"name": "transfer_ownership",
|
|
9953
|
-
"inputs": [
|
|
9954
|
-
{
|
|
9955
|
-
"name": "new_owner",
|
|
9956
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
9957
|
-
}
|
|
9958
|
-
],
|
|
9959
|
-
"outputs": [],
|
|
9960
|
-
"state_mutability": "external"
|
|
9961
|
-
},
|
|
9962
|
-
{
|
|
9963
|
-
"type": "function",
|
|
9964
|
-
"name": "renounce_ownership",
|
|
9965
|
-
"inputs": [],
|
|
9966
|
-
"outputs": [],
|
|
9967
|
-
"state_mutability": "external"
|
|
9968
|
-
},
|
|
9969
|
-
{
|
|
9970
|
-
"type": "function",
|
|
9971
|
-
"name": "transferOwnership",
|
|
9972
|
-
"inputs": [
|
|
9973
|
-
{
|
|
9974
|
-
"name": "newOwner",
|
|
9975
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
9976
|
-
}
|
|
9977
|
-
],
|
|
9978
|
-
"outputs": [],
|
|
9979
|
-
"state_mutability": "external"
|
|
9980
|
-
},
|
|
9981
|
-
{
|
|
9982
|
-
"type": "function",
|
|
9983
|
-
"name": "renounceOwnership",
|
|
9984
|
-
"inputs": [],
|
|
9985
|
-
"outputs": [],
|
|
9986
|
-
"state_mutability": "external"
|
|
9987
8789
|
}
|
|
9988
8790
|
]
|
|
9989
8791
|
},
|
|
@@ -10038,7 +8840,34 @@ var IPGenesisABI = [
|
|
|
10038
8840
|
],
|
|
10039
8841
|
"outputs": [
|
|
10040
8842
|
{
|
|
10041
|
-
"type": "core::integer::u256"
|
|
8843
|
+
"type": "core::integer::u256"
|
|
8844
|
+
}
|
|
8845
|
+
],
|
|
8846
|
+
"state_mutability": "view"
|
|
8847
|
+
}
|
|
8848
|
+
]
|
|
8849
|
+
},
|
|
8850
|
+
{
|
|
8851
|
+
"type": "impl",
|
|
8852
|
+
"name": "SRC5Impl",
|
|
8853
|
+
"interface_name": "openzeppelin_introspection::interface::ISRC5"
|
|
8854
|
+
},
|
|
8855
|
+
{
|
|
8856
|
+
"type": "interface",
|
|
8857
|
+
"name": "openzeppelin_introspection::interface::ISRC5",
|
|
8858
|
+
"items": [
|
|
8859
|
+
{
|
|
8860
|
+
"type": "function",
|
|
8861
|
+
"name": "supports_interface",
|
|
8862
|
+
"inputs": [
|
|
8863
|
+
{
|
|
8864
|
+
"name": "interface_id",
|
|
8865
|
+
"type": "core::felt252"
|
|
8866
|
+
}
|
|
8867
|
+
],
|
|
8868
|
+
"outputs": [
|
|
8869
|
+
{
|
|
8870
|
+
"type": "core::bool"
|
|
10042
8871
|
}
|
|
10043
8872
|
],
|
|
10044
8873
|
"state_mutability": "view"
|
|
@@ -10049,6 +8878,14 @@ var IPGenesisABI = [
|
|
|
10049
8878
|
"type": "constructor",
|
|
10050
8879
|
"name": "constructor",
|
|
10051
8880
|
"inputs": [
|
|
8881
|
+
{
|
|
8882
|
+
"name": "name",
|
|
8883
|
+
"type": "core::byte_array::ByteArray"
|
|
8884
|
+
},
|
|
8885
|
+
{
|
|
8886
|
+
"name": "symbol",
|
|
8887
|
+
"type": "core::byte_array::ByteArray"
|
|
8888
|
+
},
|
|
10052
8889
|
{
|
|
10053
8890
|
"name": "owner",
|
|
10054
8891
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
@@ -10143,57 +8980,6 @@ var IPGenesisABI = [
|
|
|
10143
8980
|
}
|
|
10144
8981
|
]
|
|
10145
8982
|
},
|
|
10146
|
-
{
|
|
10147
|
-
"type": "event",
|
|
10148
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
|
|
10149
|
-
"kind": "struct",
|
|
10150
|
-
"members": [
|
|
10151
|
-
{
|
|
10152
|
-
"name": "previous_owner",
|
|
10153
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
10154
|
-
"kind": "key"
|
|
10155
|
-
},
|
|
10156
|
-
{
|
|
10157
|
-
"name": "new_owner",
|
|
10158
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
10159
|
-
"kind": "key"
|
|
10160
|
-
}
|
|
10161
|
-
]
|
|
10162
|
-
},
|
|
10163
|
-
{
|
|
10164
|
-
"type": "event",
|
|
10165
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
|
|
10166
|
-
"kind": "struct",
|
|
10167
|
-
"members": [
|
|
10168
|
-
{
|
|
10169
|
-
"name": "previous_owner",
|
|
10170
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
10171
|
-
"kind": "key"
|
|
10172
|
-
},
|
|
10173
|
-
{
|
|
10174
|
-
"name": "new_owner",
|
|
10175
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
10176
|
-
"kind": "key"
|
|
10177
|
-
}
|
|
10178
|
-
]
|
|
10179
|
-
},
|
|
10180
|
-
{
|
|
10181
|
-
"type": "event",
|
|
10182
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
|
|
10183
|
-
"kind": "enum",
|
|
10184
|
-
"variants": [
|
|
10185
|
-
{
|
|
10186
|
-
"name": "OwnershipTransferred",
|
|
10187
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
|
|
10188
|
-
"kind": "nested"
|
|
10189
|
-
},
|
|
10190
|
-
{
|
|
10191
|
-
"name": "OwnershipTransferStarted",
|
|
10192
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
|
|
10193
|
-
"kind": "nested"
|
|
10194
|
-
}
|
|
10195
|
-
]
|
|
10196
|
-
},
|
|
10197
8983
|
{
|
|
10198
8984
|
"type": "event",
|
|
10199
8985
|
"name": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
@@ -10208,48 +8994,39 @@ var IPGenesisABI = [
|
|
|
10208
8994
|
},
|
|
10209
8995
|
{
|
|
10210
8996
|
"type": "event",
|
|
10211
|
-
"name": "
|
|
8997
|
+
"name": "ip_programmable_erc_721::IPCollection::IPCollection::IPMinted",
|
|
10212
8998
|
"kind": "struct",
|
|
10213
8999
|
"members": [
|
|
10214
9000
|
{
|
|
10215
|
-
"name": "
|
|
9001
|
+
"name": "token_id",
|
|
10216
9002
|
"type": "core::integer::u256",
|
|
10217
|
-
"kind": "
|
|
10218
|
-
}
|
|
10219
|
-
]
|
|
10220
|
-
},
|
|
10221
|
-
{
|
|
10222
|
-
"type": "event",
|
|
10223
|
-
"name": "mip::mip::MIP::CounterComponent::CounterDecremented",
|
|
10224
|
-
"kind": "struct",
|
|
10225
|
-
"members": [
|
|
9003
|
+
"kind": "key"
|
|
9004
|
+
},
|
|
10226
9005
|
{
|
|
10227
|
-
"name": "
|
|
10228
|
-
"type": "core::
|
|
9006
|
+
"name": "recipient",
|
|
9007
|
+
"type": "core::starknet::contract_address::ContractAddress",
|
|
9008
|
+
"kind": "key"
|
|
9009
|
+
},
|
|
9010
|
+
{
|
|
9011
|
+
"name": "uri",
|
|
9012
|
+
"type": "core::byte_array::ByteArray",
|
|
10229
9013
|
"kind": "data"
|
|
10230
|
-
}
|
|
10231
|
-
]
|
|
10232
|
-
},
|
|
10233
|
-
{
|
|
10234
|
-
"type": "event",
|
|
10235
|
-
"name": "mip::mip::MIP::CounterComponent::Event",
|
|
10236
|
-
"kind": "enum",
|
|
10237
|
-
"variants": [
|
|
9014
|
+
},
|
|
10238
9015
|
{
|
|
10239
|
-
"name": "
|
|
10240
|
-
"type": "
|
|
10241
|
-
"kind": "
|
|
9016
|
+
"name": "creator",
|
|
9017
|
+
"type": "core::starknet::contract_address::ContractAddress",
|
|
9018
|
+
"kind": "data"
|
|
10242
9019
|
},
|
|
10243
9020
|
{
|
|
10244
|
-
"name": "
|
|
10245
|
-
"type": "
|
|
10246
|
-
"kind": "
|
|
9021
|
+
"name": "registered_at",
|
|
9022
|
+
"type": "core::integer::u64",
|
|
9023
|
+
"kind": "data"
|
|
10247
9024
|
}
|
|
10248
9025
|
]
|
|
10249
9026
|
},
|
|
10250
9027
|
{
|
|
10251
9028
|
"type": "event",
|
|
10252
|
-
"name": "
|
|
9029
|
+
"name": "ip_programmable_erc_721::IPCollection::IPCollection::Event",
|
|
10253
9030
|
"kind": "enum",
|
|
10254
9031
|
"variants": [
|
|
10255
9032
|
{
|
|
@@ -10257,11 +9034,6 @@ var IPGenesisABI = [
|
|
|
10257
9034
|
"type": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
|
|
10258
9035
|
"kind": "flat"
|
|
10259
9036
|
},
|
|
10260
|
-
{
|
|
10261
|
-
"name": "OwnableEvent",
|
|
10262
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
|
|
10263
|
-
"kind": "flat"
|
|
10264
|
-
},
|
|
10265
9037
|
{
|
|
10266
9038
|
"name": "SRC5Event",
|
|
10267
9039
|
"type": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
@@ -10273,9 +9045,9 @@ var IPGenesisABI = [
|
|
|
10273
9045
|
"kind": "flat"
|
|
10274
9046
|
},
|
|
10275
9047
|
{
|
|
10276
|
-
"name": "
|
|
10277
|
-
"type": "
|
|
10278
|
-
"kind": "
|
|
9048
|
+
"name": "IPMinted",
|
|
9049
|
+
"type": "ip_programmable_erc_721::IPCollection::IPCollection::IPMinted",
|
|
9050
|
+
"kind": "nested"
|
|
10279
9051
|
}
|
|
10280
9052
|
]
|
|
10281
9053
|
}
|
|
@@ -10284,10 +9056,10 @@ var IPGenesisABI = [
|
|
|
10284
9056
|
// src/starknet/services/pop.ts
|
|
10285
9057
|
var PopService = class {
|
|
10286
9058
|
constructor(config) {
|
|
10287
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).popFactory;
|
|
9059
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).popFactory;
|
|
10288
9060
|
}
|
|
10289
9061
|
_collection(address, account) {
|
|
10290
|
-
return newContract(POPCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9062
|
+
return newContract(POPCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10291
9063
|
}
|
|
10292
9064
|
async claim(account, collectionAddress) {
|
|
10293
9065
|
const call = this._collection(collectionAddress, account).populate("claim", []);
|
|
@@ -10374,11 +9146,11 @@ function toContractConditions(c) {
|
|
|
10374
9146
|
}
|
|
10375
9147
|
var DropService = class {
|
|
10376
9148
|
constructor(config) {
|
|
10377
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).dropFactory;
|
|
9149
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).dropFactory;
|
|
10378
9150
|
this.config = config;
|
|
10379
9151
|
}
|
|
10380
9152
|
_collection(address, account) {
|
|
10381
|
-
return newContract(DropCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9153
|
+
return newContract(DropCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10382
9154
|
}
|
|
10383
9155
|
async claim(account, collectionAddress, quantity = 1) {
|
|
10384
9156
|
const collection = this._collection(collectionAddress, account);
|
|
@@ -10458,19 +9230,19 @@ var DropService = class {
|
|
|
10458
9230
|
// src/starknet/services/erc1155collection.ts
|
|
10459
9231
|
var ERC1155CollectionService = class {
|
|
10460
9232
|
constructor(config) {
|
|
10461
|
-
this.factoryAddress = config.collection1155Contract ?? getStarknetCoordinates(config.chain).collection1155;
|
|
9233
|
+
this.factoryAddress = config.collection1155Contract ?? chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).collection1155;
|
|
10462
9234
|
}
|
|
10463
9235
|
_factory(account) {
|
|
10464
9236
|
return newContract(
|
|
10465
9237
|
IPCollection1155FactoryABI,
|
|
10466
|
-
normalizeAddress("STARKNET", this.factoryAddress),
|
|
9238
|
+
chunkZFRHADHR_cjs.normalizeAddress("STARKNET", this.factoryAddress),
|
|
10467
9239
|
account
|
|
10468
9240
|
);
|
|
10469
9241
|
}
|
|
10470
9242
|
_collection(address, account) {
|
|
10471
9243
|
return newContract(
|
|
10472
9244
|
IPCollection1155ABI,
|
|
10473
|
-
normalizeAddress("STARKNET", address),
|
|
9245
|
+
chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address),
|
|
10474
9246
|
account
|
|
10475
9247
|
);
|
|
10476
9248
|
}
|
|
@@ -10653,7 +9425,7 @@ function factoryContract() {
|
|
|
10653
9425
|
if (!_factoryContract) {
|
|
10654
9426
|
_factoryContract = newContract(
|
|
10655
9427
|
CreatorCoinFactoryABI,
|
|
10656
|
-
getStarknetCoordinates("STARKNET").creatorCoinFactory
|
|
9428
|
+
chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory
|
|
10657
9429
|
);
|
|
10658
9430
|
}
|
|
10659
9431
|
return _factoryContract;
|
|
@@ -10690,7 +9462,7 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
10690
9462
|
calls.push({
|
|
10691
9463
|
contractAddress: params.quoteToken,
|
|
10692
9464
|
entrypoint: "transfer",
|
|
10693
|
-
calldata: [getStarknetCoordinates("STARKNET").creatorCoinFactory, amt.low, amt.high]
|
|
9465
|
+
calldata: [chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory, amt.low, amt.high]
|
|
10694
9466
|
});
|
|
10695
9467
|
}
|
|
10696
9468
|
calls.push(factoryContract().populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
|
|
@@ -10698,26 +9470,26 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
10698
9470
|
}
|
|
10699
9471
|
var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
|
|
10700
9472
|
function parseCreatorCoinCreated(receipt) {
|
|
10701
|
-
const factory = normalizeAddress("STARKNET", getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
9473
|
+
const factory = chunkZFRHADHR_cjs.normalizeAddress("STARKNET", chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
10702
9474
|
for (const ev of receipt?.events ?? []) {
|
|
10703
9475
|
let from;
|
|
10704
9476
|
try {
|
|
10705
|
-
from = normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
9477
|
+
from = chunkZFRHADHR_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
10706
9478
|
} catch {
|
|
10707
9479
|
continue;
|
|
10708
9480
|
}
|
|
10709
9481
|
if (from !== factory) continue;
|
|
10710
9482
|
const k0 = ev.keys?.[0];
|
|
10711
|
-
if (!k0 || normalizeAddress("STARKNET", k0) !== normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
9483
|
+
if (!k0 || chunkZFRHADHR_cjs.normalizeAddress("STARKNET", k0) !== chunkZFRHADHR_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
10712
9484
|
const data = ev.data ?? [];
|
|
10713
9485
|
if (data.length < 1) continue;
|
|
10714
|
-
return normalizeAddress("STARKNET", data[data.length - 1]);
|
|
9486
|
+
return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
|
|
10715
9487
|
}
|
|
10716
9488
|
throw new Error("Coin deployed but the coin address could not be read from the receipt");
|
|
10717
9489
|
}
|
|
10718
9490
|
var CreatorCoinService = class {
|
|
10719
9491
|
constructor(config) {
|
|
10720
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).creatorCoinFactory;
|
|
9492
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).creatorCoinFactory;
|
|
10721
9493
|
this.config = config;
|
|
10722
9494
|
}
|
|
10723
9495
|
_factory(account) {
|
|
@@ -10742,19 +9514,19 @@ var CreatorCoinService = class {
|
|
|
10742
9514
|
var TicketService = class {
|
|
10743
9515
|
constructor(config) {
|
|
10744
9516
|
this.config = config;
|
|
10745
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).ipTicketsFactory;
|
|
9517
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipTicketsFactory;
|
|
10746
9518
|
}
|
|
10747
9519
|
_factory(account, factoryAddress) {
|
|
10748
9520
|
const address = factoryAddress ?? this.factoryAddress;
|
|
10749
9521
|
if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
|
|
10750
|
-
return newContract(IPTicketCollectionFactoryABI, normalizeAddress("STARKNET", address), account);
|
|
9522
|
+
return newContract(IPTicketCollectionFactoryABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10751
9523
|
}
|
|
10752
9524
|
_collection(address, account) {
|
|
10753
|
-
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9525
|
+
return newContract(IPTicketCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10754
9526
|
}
|
|
10755
9527
|
_collectionRead(address) {
|
|
10756
9528
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10757
|
-
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
9529
|
+
return newContract(IPTicketCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), provider);
|
|
10758
9530
|
}
|
|
10759
9531
|
async deployCollection(account, params) {
|
|
10760
9532
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -10815,19 +9587,19 @@ var TicketService = class {
|
|
|
10815
9587
|
var ClubService = class {
|
|
10816
9588
|
constructor(config) {
|
|
10817
9589
|
this.config = config;
|
|
10818
|
-
this.factoryAddress = getStarknetCoordinates(config.chain).ipClubFactory;
|
|
9590
|
+
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipClubFactory;
|
|
10819
9591
|
}
|
|
10820
9592
|
_factory(account, factoryAddress) {
|
|
10821
9593
|
const address = factoryAddress ?? this.factoryAddress;
|
|
10822
9594
|
if (!address) throw new Error("IP-Club factory address not configured for this chain");
|
|
10823
|
-
return newContract(IPClubFactoryABI, normalizeAddress("STARKNET", address), account);
|
|
9595
|
+
return newContract(IPClubFactoryABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10824
9596
|
}
|
|
10825
9597
|
_collection(address, account) {
|
|
10826
|
-
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), account);
|
|
9598
|
+
return newContract(IPClubCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), account);
|
|
10827
9599
|
}
|
|
10828
9600
|
_collectionRead(address) {
|
|
10829
9601
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10830
|
-
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
9602
|
+
return newContract(IPClubCollectionABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address), provider);
|
|
10831
9603
|
}
|
|
10832
9604
|
async deployCollection(account, params) {
|
|
10833
9605
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -10890,14 +9662,14 @@ var ClubService = class {
|
|
|
10890
9662
|
var SponsorshipService = class {
|
|
10891
9663
|
constructor(config) {
|
|
10892
9664
|
this.config = config;
|
|
10893
|
-
this.sponsorshipAddress = getStarknetCoordinates(config.chain).ipSponsorship;
|
|
9665
|
+
this.sponsorshipAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).ipSponsorship;
|
|
10894
9666
|
}
|
|
10895
9667
|
_contract(account, address) {
|
|
10896
9668
|
const resolved = address ?? this.sponsorshipAddress;
|
|
10897
9669
|
if (!resolved) {
|
|
10898
9670
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
10899
9671
|
}
|
|
10900
|
-
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), account);
|
|
9672
|
+
return newContract(IPSponsorshipABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", resolved), account);
|
|
10901
9673
|
}
|
|
10902
9674
|
_contractRead(address) {
|
|
10903
9675
|
const resolved = address ?? this.sponsorshipAddress;
|
|
@@ -10905,7 +9677,7 @@ var SponsorshipService = class {
|
|
|
10905
9677
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
10906
9678
|
}
|
|
10907
9679
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10908
|
-
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
|
|
9680
|
+
return newContract(IPSponsorshipABI, chunkZFRHADHR_cjs.normalizeAddress("STARKNET", resolved), provider);
|
|
10909
9681
|
}
|
|
10910
9682
|
async createOffer(account, params) {
|
|
10911
9683
|
const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
@@ -10940,7 +9712,7 @@ var SponsorshipService = class {
|
|
|
10940
9712
|
const approveCall = {
|
|
10941
9713
|
contractAddress: params.paymentToken,
|
|
10942
9714
|
entrypoint: "approve",
|
|
10943
|
-
calldata: [normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
9715
|
+
calldata: [chunkZFRHADHR_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
10944
9716
|
};
|
|
10945
9717
|
const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
|
|
10946
9718
|
starknet.cairo.uint256(params.offerId),
|
|
@@ -11067,7 +9839,7 @@ var SponsorshipService = class {
|
|
|
11067
9839
|
// src/starknet/client.ts
|
|
11068
9840
|
var MedialaneClient = class {
|
|
11069
9841
|
constructor(rawConfig = {}) {
|
|
11070
|
-
this.config = resolveConfig(rawConfig);
|
|
9842
|
+
this.config = chunkZFRHADHR_cjs.resolveConfig(rawConfig);
|
|
11071
9843
|
this.services = {
|
|
11072
9844
|
pop: new PopService(this.config),
|
|
11073
9845
|
drop: new DropService(this.config),
|
|
@@ -11078,9 +9850,9 @@ var MedialaneClient = class {
|
|
|
11078
9850
|
sponsorship: new SponsorshipService(this.config)
|
|
11079
9851
|
};
|
|
11080
9852
|
if (!this.config.backendUrl) {
|
|
11081
|
-
const sentinel = new ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
9853
|
+
const sentinel = new chunkZFRHADHR_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
11082
9854
|
const apiMethodNames = new Set(
|
|
11083
|
-
Object.getOwnPropertyNames(ApiClient.prototype).filter(
|
|
9855
|
+
Object.getOwnPropertyNames(chunkZFRHADHR_cjs.ApiClient.prototype).filter(
|
|
11084
9856
|
(k) => k !== "constructor" && typeof sentinel[k] === "function"
|
|
11085
9857
|
)
|
|
11086
9858
|
);
|
|
@@ -11097,7 +9869,7 @@ var MedialaneClient = class {
|
|
|
11097
9869
|
}
|
|
11098
9870
|
});
|
|
11099
9871
|
} else {
|
|
11100
|
-
this.api = new ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
9872
|
+
this.api = new chunkZFRHADHR_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
11101
9873
|
}
|
|
11102
9874
|
}
|
|
11103
9875
|
get chain() {
|
|
@@ -11152,25 +9924,6 @@ async function getCounter1155(address, config) {
|
|
|
11152
9924
|
const contract = getContract(config);
|
|
11153
9925
|
return BigInt((await contract.get_counter(address)).toString());
|
|
11154
9926
|
}
|
|
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
9927
|
var STARKNET_DOMAIN = [
|
|
11175
9928
|
{ name: "name", type: "shortstring" },
|
|
11176
9929
|
{ name: "version", type: "shortstring" },
|
|
@@ -11288,7 +10041,7 @@ function buildListingOrder(i, cfg) {
|
|
|
11288
10041
|
salt: i.salt,
|
|
11289
10042
|
counter: i.counter
|
|
11290
10043
|
};
|
|
11291
|
-
const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10044
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
11292
10045
|
return { orderParams, typedData };
|
|
11293
10046
|
}
|
|
11294
10047
|
function buildOfferOrder(i, cfg) {
|
|
@@ -11309,11 +10062,11 @@ function buildOfferOrder(i, cfg) {
|
|
|
11309
10062
|
salt: i.salt,
|
|
11310
10063
|
counter: i.counter
|
|
11311
10064
|
};
|
|
11312
|
-
const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10065
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
11313
10066
|
return { orderParams, typedData };
|
|
11314
10067
|
}
|
|
11315
10068
|
function registerPayload(orderParams, signature) {
|
|
11316
|
-
return stringifyBigInts({
|
|
10069
|
+
return chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11317
10070
|
parameters: {
|
|
11318
10071
|
...orderParams,
|
|
11319
10072
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -11344,14 +10097,14 @@ function buildFulfillCalls(a, cfg) {
|
|
|
11344
10097
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
11345
10098
|
}
|
|
11346
10099
|
function buildCancelCalls(a, cfg) {
|
|
11347
|
-
const cancelRequest = stringifyBigInts({
|
|
10100
|
+
const cancelRequest = chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11348
10101
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
11349
10102
|
signature: a.signature
|
|
11350
10103
|
});
|
|
11351
10104
|
return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
|
|
11352
10105
|
}
|
|
11353
10106
|
function buildCancelTypedData(orderHash, offerer, cfg) {
|
|
11354
|
-
return stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
10107
|
+
return chunkZFRHADHR_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
11355
10108
|
}
|
|
11356
10109
|
function contractFor2(cfg) {
|
|
11357
10110
|
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
@@ -11374,7 +10127,7 @@ function buildListing1155Order(i, cfg) {
|
|
|
11374
10127
|
salt: i.salt,
|
|
11375
10128
|
counter: i.counter
|
|
11376
10129
|
};
|
|
11377
|
-
const typedData = stringifyBigInts(
|
|
10130
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11378
10131
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
11379
10132
|
);
|
|
11380
10133
|
return { orderParams, typedData };
|
|
@@ -11397,13 +10150,13 @@ function buildOffer1155Order(i, cfg) {
|
|
|
11397
10150
|
salt: i.salt,
|
|
11398
10151
|
counter: i.counter
|
|
11399
10152
|
};
|
|
11400
|
-
const typedData = stringifyBigInts(
|
|
10153
|
+
const typedData = chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11401
10154
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
11402
10155
|
);
|
|
11403
10156
|
return { orderParams, typedData };
|
|
11404
10157
|
}
|
|
11405
10158
|
function registerPayload2(orderParams, signature) {
|
|
11406
|
-
return stringifyBigInts({
|
|
10159
|
+
return chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11407
10160
|
parameters: {
|
|
11408
10161
|
...orderParams,
|
|
11409
10162
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -11434,14 +10187,14 @@ function buildFulfill1155Calls(a, cfg) {
|
|
|
11434
10187
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
11435
10188
|
}
|
|
11436
10189
|
function buildCancel1155Calls(a, cfg) {
|
|
11437
|
-
const cancelPayload = stringifyBigInts({
|
|
10190
|
+
const cancelPayload = chunkZFRHADHR_cjs.stringifyBigInts({
|
|
11438
10191
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
11439
10192
|
signature: a.signature
|
|
11440
10193
|
});
|
|
11441
10194
|
return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
|
|
11442
10195
|
}
|
|
11443
10196
|
function buildCancel1155TypedData(orderHash, offerer, cfg) {
|
|
11444
|
-
return stringifyBigInts(
|
|
10197
|
+
return chunkZFRHADHR_cjs.stringifyBigInts(
|
|
11445
10198
|
build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
|
|
11446
10199
|
);
|
|
11447
10200
|
}
|
|
@@ -11602,135 +10355,6 @@ var StarknetVenue = class {
|
|
|
11602
10355
|
}
|
|
11603
10356
|
};
|
|
11604
10357
|
|
|
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
10358
|
// src/starknet/siws/client.ts
|
|
11735
10359
|
var STORAGE_PREFIX = "ml_siws_";
|
|
11736
10360
|
function decodeBase64url(str) {
|
|
@@ -11849,7 +10473,7 @@ function buildFundingTransferCall(instructions) {
|
|
|
11849
10473
|
async function fundWithChainTransfer(api, wallet, options) {
|
|
11850
10474
|
const step = options.onStep ?? (() => {
|
|
11851
10475
|
});
|
|
11852
|
-
const
|
|
10476
|
+
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
11853
10477
|
const pollMs = options.pollMs ?? 3e3;
|
|
11854
10478
|
const maxPolls = options.maxPolls ?? 20;
|
|
11855
10479
|
step("creating");
|
|
@@ -11879,19 +10503,11 @@ async function fundWithChainTransfer(api, wallet, options) {
|
|
|
11879
10503
|
return { status: "SETTLED", intentId: intent.id, credited: res.data.credited };
|
|
11880
10504
|
}
|
|
11881
10505
|
reason = res.data.reason;
|
|
11882
|
-
await
|
|
10506
|
+
await sleep(pollMs);
|
|
11883
10507
|
}
|
|
11884
10508
|
return { status: "PENDING", intentId: intent.id, reason };
|
|
11885
10509
|
}
|
|
11886
10510
|
|
|
11887
|
-
// src/errors.ts
|
|
11888
|
-
var UserFacingError = class extends Error {
|
|
11889
|
-
constructor(message) {
|
|
11890
|
-
super(message);
|
|
11891
|
-
this.name = "UserFacingError";
|
|
11892
|
-
}
|
|
11893
|
-
};
|
|
11894
|
-
|
|
11895
10511
|
// src/starknet/services/executeIntent.ts
|
|
11896
10512
|
async function confirmIntentBestEffort(client, intentId, txHash) {
|
|
11897
10513
|
await client.api.confirmIntent(intentId, txHash).catch(() => {
|
|
@@ -11921,14 +10537,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
11921
10537
|
const receipt = await provider.getTransactionReceipt(txHash);
|
|
11922
10538
|
const status = receipt.execution_status ?? receipt.status;
|
|
11923
10539
|
if (status === "REVERTED" || status === "REJECTED") {
|
|
11924
|
-
throw new UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
10540
|
+
throw new chunkZFRHADHR_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
11925
10541
|
}
|
|
11926
10542
|
if (status) return receipt;
|
|
11927
10543
|
} catch (err) {
|
|
11928
10544
|
if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
|
|
11929
10545
|
}
|
|
11930
10546
|
}
|
|
11931
|
-
throw new UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
10547
|
+
throw new chunkZFRHADHR_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
11932
10548
|
}
|
|
11933
10549
|
async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
11934
10550
|
let calls;
|
|
@@ -11960,323 +10576,6 @@ async function executeIntents(provider, signer, client, intents, opts = {}) {
|
|
|
11960
10576
|
]);
|
|
11961
10577
|
return { txHash, receipt };
|
|
11962
10578
|
}
|
|
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
10579
|
var DEPLOY_EVENTS = {
|
|
12281
10580
|
"mip-erc1155": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
|
|
12282
10581
|
"ip-tickets": { event: "CollectionDeployed", address: (e) => e.keys?.[1] },
|
|
@@ -12298,14 +10597,14 @@ function u2562(low, high) {
|
|
|
12298
10597
|
return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
|
|
12299
10598
|
}
|
|
12300
10599
|
function deployedCollectionFromReceipt(receipt, service) {
|
|
12301
|
-
const factory = getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
10600
|
+
const factory = chunkZFRHADHR_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
12302
10601
|
const { event, address } = DEPLOY_EVENTS[service];
|
|
12303
10602
|
const selector = BigInt(starknet.hash.getSelectorFromName(event));
|
|
12304
10603
|
for (const e of receipt.events ?? []) {
|
|
12305
10604
|
if (factory && !sameFelt(e.from_address, factory)) continue;
|
|
12306
10605
|
if (!sameFelt(e.keys?.[0], selector)) continue;
|
|
12307
10606
|
const value = address(e);
|
|
12308
|
-
if (value) return normalizeAddress("STARKNET", value);
|
|
10607
|
+
if (value) return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", value);
|
|
12309
10608
|
}
|
|
12310
10609
|
return null;
|
|
12311
10610
|
}
|
|
@@ -12396,17 +10695,6 @@ function deriveOwnerKeyPair(secret, recipientId) {
|
|
|
12396
10695
|
const publicKey = starknet.ec.starkCurve.getStarkKey(privateKey);
|
|
12397
10696
|
return { privateKey, publicKey };
|
|
12398
10697
|
}
|
|
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
10698
|
var STARKNET_SIGNER_TYPE = "0x537461726b6e6574205369676e6572";
|
|
12411
10699
|
var OPTION_NONE = "0x1";
|
|
12412
10700
|
var SIGNER_STARKNET = "0x0";
|
|
@@ -12437,13 +10725,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
|
|
|
12437
10725
|
}
|
|
12438
10726
|
function buildDeployAccountParams(ownerPubkey, salt = 0) {
|
|
12439
10727
|
return {
|
|
12440
|
-
classHash: STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
12441
|
-
constructorCalldata: ownerConstructorCalldata(ownerPubkey),
|
|
10728
|
+
classHash: chunkZFRHADHR_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
10729
|
+
constructorCalldata: chunkZFRHADHR_cjs.ownerConstructorCalldata(ownerPubkey),
|
|
12442
10730
|
addressSalt: starknet.num.toHex(salt),
|
|
12443
|
-
contractAddress: computeAccountAddress(ownerPubkey, salt)
|
|
10731
|
+
contractAddress: chunkZFRHADHR_cjs.computeAccountAddress(ownerPubkey, salt)
|
|
12444
10732
|
};
|
|
12445
10733
|
}
|
|
12446
|
-
var norm = (address) => normalizeAddress("STARKNET", address);
|
|
10734
|
+
var norm = (address) => chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address);
|
|
12447
10735
|
var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
|
|
12448
10736
|
function encodeFeltArray(items) {
|
|
12449
10737
|
return [starknet.num.toHex(items.length), ...items];
|
|
@@ -12529,53 +10817,6 @@ async function getEscapeSecurityPeriod(provider, address) {
|
|
|
12529
10817
|
});
|
|
12530
10818
|
return Number(res[0]);
|
|
12531
10819
|
}
|
|
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
10820
|
|
|
12580
10821
|
// src/wallet/store.ts
|
|
12581
10822
|
function createOwnerStore(config) {
|
|
@@ -12683,7 +10924,7 @@ var InvalidRecoveryKeyError = class extends Error {
|
|
|
12683
10924
|
var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
|
|
12684
10925
|
function keyPair(privateKey) {
|
|
12685
10926
|
try {
|
|
12686
|
-
return starkKeyPairFromPrivateKey(privateKey);
|
|
10927
|
+
return chunkZFRHADHR_cjs.starkKeyPairFromPrivateKey(privateKey);
|
|
12687
10928
|
} catch {
|
|
12688
10929
|
throw new InvalidRecoveryKeyError();
|
|
12689
10930
|
}
|
|
@@ -12696,7 +10937,7 @@ function parseRecoveryKey(input) {
|
|
|
12696
10937
|
const trimmed = input.trim();
|
|
12697
10938
|
if (!trimmed.startsWith(PREFIX)) {
|
|
12698
10939
|
const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
|
|
12699
|
-
return { walletAddress: computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
10940
|
+
return { walletAddress: chunkZFRHADHR_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
12700
10941
|
}
|
|
12701
10942
|
const parts = trimmed.slice(PREFIX.length).split(":");
|
|
12702
10943
|
const [walletAddress, privateKey] = parts;
|
|
@@ -12718,7 +10959,7 @@ function describeRecoveryAction(escape) {
|
|
|
12718
10959
|
return "none";
|
|
12719
10960
|
}
|
|
12720
10961
|
function normalizeWalletAddress(address) {
|
|
12721
|
-
return normalizeAddress("STARKNET", address);
|
|
10962
|
+
return chunkZFRHADHR_cjs.normalizeAddress("STARKNET", address);
|
|
12722
10963
|
}
|
|
12723
10964
|
function isValidStarknetAddress(address) {
|
|
12724
10965
|
try {
|
|
@@ -12753,150 +10994,6 @@ function createSelfFundConsent(estimateFee) {
|
|
|
12753
10994
|
}
|
|
12754
10995
|
};
|
|
12755
10996
|
}
|
|
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
10997
|
function accountFor(provider, address, privateKeyHex) {
|
|
12901
10998
|
return new starknet.Account({ provider, address, signer: privateKeyHex, cairoVersion: "1" });
|
|
12902
10999
|
}
|
|
@@ -12907,7 +11004,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
|
|
|
12907
11004
|
return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
|
|
12908
11005
|
}
|
|
12909
11006
|
async function feeTokenBalance(provider, address, unit) {
|
|
12910
|
-
const token = getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
11007
|
+
const token = chunkZFRHADHR_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
12911
11008
|
if (!token) throw new Error(`No fee token for unit ${unit}`);
|
|
12912
11009
|
const [low = "0x0", high = "0x0"] = await provider.callContract({
|
|
12913
11010
|
contractAddress: token.address,
|
|
@@ -12934,7 +11031,7 @@ function sponsoredExecutor(deps) {
|
|
|
12934
11031
|
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
12935
11032
|
{
|
|
12936
11033
|
address: userAddress,
|
|
12937
|
-
signTypedData: async (data) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
11034
|
+
signTypedData: async (data) => chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
12938
11035
|
},
|
|
12939
11036
|
calls
|
|
12940
11037
|
);
|
|
@@ -12984,7 +11081,7 @@ async function deploySponsored(input) {
|
|
|
12984
11081
|
return { transactionHash };
|
|
12985
11082
|
}
|
|
12986
11083
|
async function deploySelfFunded(input) {
|
|
12987
|
-
const classHash = getCoordinates("STARKNET").mediaWalletClassHash;
|
|
11084
|
+
const classHash = chunkOUPVVMLK_cjs.getCoordinates("STARKNET").mediaWalletClassHash;
|
|
12988
11085
|
if (!classHash) throw new Error("Media Wallet class hash is not configured");
|
|
12989
11086
|
const account = new starknet.Account({
|
|
12990
11087
|
provider: input.provider,
|
|
@@ -12994,13 +11091,13 @@ async function deploySelfFunded(input) {
|
|
|
12994
11091
|
});
|
|
12995
11092
|
const { transaction_hash } = await account.deployAccount({
|
|
12996
11093
|
classHash,
|
|
12997
|
-
constructorCalldata: ownerConstructorCalldata(input.ownerPubKey),
|
|
11094
|
+
constructorCalldata: chunkZFRHADHR_cjs.ownerConstructorCalldata(input.ownerPubKey),
|
|
12998
11095
|
addressSalt: 0,
|
|
12999
11096
|
contractAddress: input.ownerAddress
|
|
13000
11097
|
});
|
|
13001
11098
|
return { transactionHash: transaction_hash };
|
|
13002
11099
|
}
|
|
13003
|
-
async function waitUntilDeployed(provider, address, timeoutMs = 9e4,
|
|
11100
|
+
async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
|
|
13004
11101
|
const deadline = Date.now() + timeoutMs;
|
|
13005
11102
|
let wait = 1e3;
|
|
13006
11103
|
for (; ; ) {
|
|
@@ -13010,7 +11107,7 @@ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep2 = (m
|
|
|
13010
11107
|
"Your wallet was submitted but has not appeared on Starknet yet. Please try again in a moment."
|
|
13011
11108
|
);
|
|
13012
11109
|
}
|
|
13013
|
-
await
|
|
11110
|
+
await sleep(wait);
|
|
13014
11111
|
wait = Math.min(Math.round(wait * 1.5), 5e3);
|
|
13015
11112
|
}
|
|
13016
11113
|
}
|
|
@@ -13057,7 +11154,7 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
13057
11154
|
backendUrl: deps.backendUrl,
|
|
13058
11155
|
walletAddress: address,
|
|
13059
11156
|
signer: {
|
|
13060
|
-
signMessage: async (td) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
11157
|
+
signMessage: async (td) => chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
13061
11158
|
}
|
|
13062
11159
|
});
|
|
13063
11160
|
deps.store.notifyChange();
|
|
@@ -13162,7 +11259,7 @@ function createMediaWallet(config) {
|
|
|
13162
11259
|
address: sealed.address,
|
|
13163
11260
|
signTypedData: async (data) => {
|
|
13164
11261
|
const privateKeyHex = await unlockOnce(sealed);
|
|
13165
|
-
return signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
11262
|
+
return chunkZFRHADHR_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
13166
11263
|
},
|
|
13167
11264
|
execute: async (calls) => {
|
|
13168
11265
|
const { transactionHash } = await run(sealed, calls);
|
|
@@ -13232,8 +11329,54 @@ async function claimSessionWallet(api, walletAddress, deps) {
|
|
|
13232
11329
|
if (removeOwnerGuid) await deps.removeOwner(sealed, removeOwnerGuid);
|
|
13233
11330
|
}
|
|
13234
11331
|
|
|
13235
|
-
exports
|
|
13236
|
-
|
|
11332
|
+
Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
|
|
11333
|
+
enumerable: true,
|
|
11334
|
+
get: function () { return chunkZFRHADHR_cjs.InvalidStarkPrivateKeyError; }
|
|
11335
|
+
});
|
|
11336
|
+
Object.defineProperty(exports, "PasskeyCancelledError", {
|
|
11337
|
+
enumerable: true,
|
|
11338
|
+
get: function () { return chunkZFRHADHR_cjs.PasskeyCancelledError; }
|
|
11339
|
+
});
|
|
11340
|
+
Object.defineProperty(exports, "UserFacingError", {
|
|
11341
|
+
enumerable: true,
|
|
11342
|
+
get: function () { return chunkZFRHADHR_cjs.UserFacingError; }
|
|
11343
|
+
});
|
|
11344
|
+
Object.defineProperty(exports, "computeAccountAddress", {
|
|
11345
|
+
enumerable: true,
|
|
11346
|
+
get: function () { return chunkZFRHADHR_cjs.computeAccountAddress; }
|
|
11347
|
+
});
|
|
11348
|
+
Object.defineProperty(exports, "createPasskeyOwner", {
|
|
11349
|
+
enumerable: true,
|
|
11350
|
+
get: function () { return chunkZFRHADHR_cjs.createPasskeyOwner; }
|
|
11351
|
+
});
|
|
11352
|
+
Object.defineProperty(exports, "deriveAesKey", {
|
|
11353
|
+
enumerable: true,
|
|
11354
|
+
get: function () { return chunkZFRHADHR_cjs.deriveAesKey; }
|
|
11355
|
+
});
|
|
11356
|
+
Object.defineProperty(exports, "generateStarkKeyPair", {
|
|
11357
|
+
enumerable: true,
|
|
11358
|
+
get: function () { return chunkZFRHADHR_cjs.generateStarkKeyPair; }
|
|
11359
|
+
});
|
|
11360
|
+
Object.defineProperty(exports, "ownerConstructorCalldata", {
|
|
11361
|
+
enumerable: true,
|
|
11362
|
+
get: function () { return chunkZFRHADHR_cjs.ownerConstructorCalldata; }
|
|
11363
|
+
});
|
|
11364
|
+
Object.defineProperty(exports, "sealPrivateKey", {
|
|
11365
|
+
enumerable: true,
|
|
11366
|
+
get: function () { return chunkZFRHADHR_cjs.sealPrivateKey; }
|
|
11367
|
+
});
|
|
11368
|
+
Object.defineProperty(exports, "signWithPrivateKey", {
|
|
11369
|
+
enumerable: true,
|
|
11370
|
+
get: function () { return chunkZFRHADHR_cjs.signWithPrivateKey; }
|
|
11371
|
+
});
|
|
11372
|
+
Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
|
|
11373
|
+
enumerable: true,
|
|
11374
|
+
get: function () { return chunkZFRHADHR_cjs.starkKeyPairFromPrivateKey; }
|
|
11375
|
+
});
|
|
11376
|
+
Object.defineProperty(exports, "unsealPrivateKey", {
|
|
11377
|
+
enumerable: true,
|
|
11378
|
+
get: function () { return chunkZFRHADHR_cjs.unsealPrivateKey; }
|
|
11379
|
+
});
|
|
13237
11380
|
exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
|
|
13238
11381
|
exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
|
|
13239
11382
|
exports.ClubService = ClubService;
|
|
@@ -13257,7 +11400,6 @@ exports.IPTicketCollectionABI = IPTicketCollectionABI;
|
|
|
13257
11400
|
exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
|
|
13258
11401
|
exports.InvalidPairingPayloadError = InvalidPairingPayloadError;
|
|
13259
11402
|
exports.InvalidRecoveryKeyError = InvalidRecoveryKeyError;
|
|
13260
|
-
exports.InvalidStarkPrivateKeyError = InvalidStarkPrivateKeyError;
|
|
13261
11403
|
exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
|
|
13262
11404
|
exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
|
|
13263
11405
|
exports.Medialane1155ABI = Medialane1155ABI;
|
|
@@ -13265,24 +11407,20 @@ exports.MedialaneClient = MedialaneClient;
|
|
|
13265
11407
|
exports.MedialaneError = MedialaneError;
|
|
13266
11408
|
exports.POPCollectionABI = POPCollectionABI;
|
|
13267
11409
|
exports.POPFactoryABI = POPFactoryABI;
|
|
13268
|
-
exports.PasskeyCancelledError = PasskeyCancelledError;
|
|
13269
11410
|
exports.PopService = PopService;
|
|
13270
11411
|
exports.SUGGESTED_DEFAULT_PRICE = SUGGESTED_DEFAULT_PRICE;
|
|
13271
11412
|
exports.SponsoredCallRejectedError = SponsoredCallRejectedError;
|
|
13272
11413
|
exports.SponsorshipService = SponsorshipService;
|
|
13273
11414
|
exports.StarknetVenue = StarknetVenue;
|
|
13274
11415
|
exports.TicketService = TicketService;
|
|
13275
|
-
exports.UserFacingError = UserFacingError;
|
|
13276
11416
|
exports.VALIDATED_EKUBO_PARAMS = VALIDATED_EKUBO_PARAMS;
|
|
13277
11417
|
exports.accountFor = accountFor;
|
|
13278
|
-
exports.adminRequestDigest = adminRequestDigest;
|
|
13279
11418
|
exports.adoptSessionWallet = adoptSessionWallet;
|
|
13280
11419
|
exports.allowsFallbackFunding = allowsFallbackFunding;
|
|
13281
11420
|
exports.assertTransactionSucceeded = assertTransactionSucceeded;
|
|
13282
11421
|
exports.build1155CancellationTypedData = build1155CancellationTypedData;
|
|
13283
11422
|
exports.build1155OrderTypedData = build1155OrderTypedData;
|
|
13284
11423
|
exports.buildAddOwnerCall = buildAddOwnerCall;
|
|
13285
|
-
exports.buildAdminSessionTypedData = buildAdminSessionTypedData;
|
|
13286
11424
|
exports.buildCancelEscapeCall = buildCancelEscapeCall;
|
|
13287
11425
|
exports.buildCancellationTypedData = buildCancellationTypedData;
|
|
13288
11426
|
exports.buildCompleteEscapeOwnerCall = buildCompleteEscapeOwnerCall;
|
|
@@ -13301,26 +11439,21 @@ exports.canRemoveDevice = canRemoveDevice;
|
|
|
13301
11439
|
exports.claimSessionWallet = claimSessionWallet;
|
|
13302
11440
|
exports.coinToRaw = toRaw;
|
|
13303
11441
|
exports.completeDeployment = completeDeployment;
|
|
13304
|
-
exports.computeAccountAddress = computeAccountAddress;
|
|
13305
11442
|
exports.computeOwnerGuid = computeOwnerGuid;
|
|
13306
11443
|
exports.confirmIntentBestEffort = confirmIntentBestEffort;
|
|
13307
|
-
exports.createAdminSessionGrant = createAdminSessionGrant;
|
|
13308
11444
|
exports.createDeploymentCoordinator = createDeploymentCoordinator;
|
|
13309
11445
|
exports.createMediaWallet = createMediaWallet;
|
|
13310
11446
|
exports.createOwnerStore = createOwnerStore;
|
|
13311
|
-
exports.createPasskeyOwner = createPasskeyOwner;
|
|
13312
11447
|
exports.createSelfFundConsent = createSelfFundConsent;
|
|
13313
11448
|
exports.decodeEscapeAndStatus = decodeEscapeAndStatus;
|
|
13314
11449
|
exports.decodeGuardiansInfo = decodeGuardiansInfo;
|
|
13315
11450
|
exports.deploySelfFunded = deploySelfFunded;
|
|
13316
11451
|
exports.deploySponsored = deploySponsored;
|
|
13317
11452
|
exports.deployedCollectionFromReceipt = deployedCollectionFromReceipt;
|
|
13318
|
-
exports.deriveAesKey = deriveAesKey;
|
|
13319
11453
|
exports.deriveOwnerKeyPair = deriveOwnerKeyPair;
|
|
13320
11454
|
exports.describeDevices = describeDevices;
|
|
13321
11455
|
exports.describeGuardianStatus = describeGuardianStatus;
|
|
13322
11456
|
exports.describeRecoveryAction = describeRecoveryAction;
|
|
13323
|
-
exports.encodeAdminHeaders = encodeAdminHeaders;
|
|
13324
11457
|
exports.encodeByteArray = encodeByteArray;
|
|
13325
11458
|
exports.encodePairingPayload = encodePairingPayload;
|
|
13326
11459
|
exports.encodeRecoveryKey = encodeRecoveryKey;
|
|
@@ -13331,7 +11464,6 @@ exports.executeSponsored = executeSponsored;
|
|
|
13331
11464
|
exports.fdvHuman = fdvHuman;
|
|
13332
11465
|
exports.fundWithChainTransfer = fundWithChainTransfer;
|
|
13333
11466
|
exports.fundingApiFor = fundingApiFor;
|
|
13334
|
-
exports.generateStarkKeyPair = generateStarkKeyPair;
|
|
13335
11467
|
exports.getCounter = getCounter;
|
|
13336
11468
|
exports.getCounter1155 = getCounter1155;
|
|
13337
11469
|
exports.getCreatorCoinGuarantees = getCreatorCoinGuarantees;
|
|
@@ -13349,32 +11481,22 @@ exports.isValidStarknetAddress = isValidStarknetAddress;
|
|
|
13349
11481
|
exports.mintedTokenIdFromReceipt = mintedTokenIdFromReceipt;
|
|
13350
11482
|
exports.normalizeSiwsSignature = normalizeSiwsSignature;
|
|
13351
11483
|
exports.normalizeWalletAddress = normalizeWalletAddress;
|
|
13352
|
-
exports.ownerConstructorCalldata = ownerConstructorCalldata;
|
|
13353
11484
|
exports.parseAccountAddress = parseAccountAddress;
|
|
13354
|
-
exports.parseAdminHeaders = parseAdminHeaders;
|
|
13355
11485
|
exports.parseCreatorCoinCreated = parseCreatorCoinCreated;
|
|
13356
11486
|
exports.parsePairingPayload = parsePairingPayload;
|
|
13357
11487
|
exports.parseRecoveryKey = parseRecoveryKey;
|
|
13358
11488
|
exports.priceToEkuboParams = priceToEkuboParams;
|
|
13359
|
-
exports.randomNonce = randomNonce;
|
|
13360
11489
|
exports.requestSiwsToken = requestSiwsToken;
|
|
13361
|
-
exports.sealPrivateKey = sealPrivateKey;
|
|
13362
11490
|
exports.selfFundedExecutor = selfFundedExecutor;
|
|
13363
|
-
exports.sessionKeyHashOf = sessionKeyHashOf;
|
|
13364
|
-
exports.signAdminRequest = signAdminRequest;
|
|
13365
|
-
exports.signWithPrivateKey = signWithPrivateKey;
|
|
13366
11491
|
exports.sponsoredExecutor = sponsoredExecutor;
|
|
13367
|
-
exports.starkKeyPairFromPrivateKey = starkKeyPairFromPrivateKey;
|
|
13368
11492
|
exports.storeSiwsToken = storeSiwsToken;
|
|
13369
11493
|
exports.syncTransactionBestEffort = syncTransactionBestEffort;
|
|
13370
11494
|
exports.teamCoinsRaw = teamCoinsRaw;
|
|
13371
11495
|
exports.toDropContractConditions = toContractConditions;
|
|
13372
|
-
exports.unsealPrivateKey = unsealPrivateKey;
|
|
13373
11496
|
exports.validateCoinName = validateName;
|
|
13374
11497
|
exports.validateCoinSupply = validateSupply;
|
|
13375
11498
|
exports.validateCoinSymbol = validateSymbol;
|
|
13376
11499
|
exports.validatePrice = validatePrice;
|
|
13377
|
-
exports.verifyAdminRequestSig = verifyAdminRequestSig;
|
|
13378
11500
|
exports.waitUntilDeployed = waitUntilDeployed;
|
|
13379
11501
|
//# sourceMappingURL=index.cjs.map
|
|
13380
11502
|
//# sourceMappingURL=index.cjs.map
|