@medialane/sdk 0.145.0 → 0.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{errors-SGwgtvtF.d.cts → errors-BU-LJRp3.d.cts} +1 -16
- package/dist/{errors-DUiebYFo.d.ts → errors-CTfk25XX.d.ts} +1 -16
- package/dist/index.cjs +0 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +0 -9
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +63 -80
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +17 -23
- package/dist/starknet/index.d.ts +17 -23
- package/dist/starknet/index.js +62 -78
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -600,7 +600,6 @@ interface EmissionParams {
|
|
|
600
600
|
chain?: "STARKNET";
|
|
601
601
|
service: string;
|
|
602
602
|
owner: string;
|
|
603
|
-
/** Recipient emails. */
|
|
604
603
|
recipients: string[];
|
|
605
604
|
tokenUri?: string;
|
|
606
605
|
collectionId?: string;
|
|
@@ -1095,7 +1094,6 @@ interface ApiDropState {
|
|
|
1095
1094
|
allowlistEnabled: boolean;
|
|
1096
1095
|
paused: boolean;
|
|
1097
1096
|
}
|
|
1098
|
-
/** An IP Ticket or IP Club membership tier, as read from its contract. Amounts are decimal strings. */
|
|
1099
1097
|
interface ApiTierOnchain {
|
|
1100
1098
|
maxSupply: string;
|
|
1101
1099
|
minted: string;
|
|
@@ -1126,7 +1124,6 @@ interface ApiUsernameClaim {
|
|
|
1126
1124
|
createdAt: string;
|
|
1127
1125
|
}
|
|
1128
1126
|
type ApiReportTargetType = "COLLECTION" | "TOKEN" | "CREATOR" | "COMMENT";
|
|
1129
|
-
/** `targetKey` is built from the target fields. */
|
|
1130
1127
|
interface ApiSubmitReport {
|
|
1131
1128
|
targetType: ApiReportTargetType;
|
|
1132
1129
|
targetContract?: string;
|
|
@@ -1281,7 +1278,6 @@ declare class ApiClient {
|
|
|
1281
1278
|
getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
|
|
1282
1279
|
getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
|
|
1283
1280
|
getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
|
|
1284
|
-
/** Offers others made on the address's assets. */
|
|
1285
1281
|
getReceivedOffers(address: string, opts?: {
|
|
1286
1282
|
page?: number;
|
|
1287
1283
|
limit?: number;
|
|
@@ -1331,7 +1327,6 @@ declare class ApiClient {
|
|
|
1331
1327
|
getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
|
|
1332
1328
|
getMetadataSignedUrl(kind?: "image" | "document" | "media"): Promise<ApiResponse<ApiMetadataSignedUrl>>;
|
|
1333
1329
|
uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
|
|
1334
|
-
/** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
|
|
1335
1330
|
uploadMetadataDirectory(files: {
|
|
1336
1331
|
name: string;
|
|
1337
1332
|
content: unknown;
|
|
@@ -1352,7 +1347,6 @@ declare class ApiClient {
|
|
|
1352
1347
|
}>>;
|
|
1353
1348
|
getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
|
|
1354
1349
|
getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
|
|
1355
|
-
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
1356
1350
|
checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1357
1351
|
deposits: number;
|
|
1358
1352
|
}>>;
|
|
@@ -1451,18 +1445,12 @@ declare class ApiClient {
|
|
|
1451
1445
|
requestEmailCode(email: string): Promise<void>;
|
|
1452
1446
|
registerEmailAccount(email: string): Promise<void>;
|
|
1453
1447
|
verifyEmailCode(email: string, code: string): Promise<void>;
|
|
1454
|
-
/**
|
|
1455
|
-
* Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
|
|
1456
|
-
* proof for the wallet. Answers 409 when the wallet is already set up.
|
|
1457
|
-
*/
|
|
1458
1448
|
setupWalletKey(params: {
|
|
1459
1449
|
newOwnerPubkey: string;
|
|
1460
|
-
signature: string[];
|
|
1461
|
-
expiration: number;
|
|
1462
1450
|
}): Promise<{
|
|
1463
1451
|
walletAddress: string;
|
|
1452
|
+
removeOwnerGuid: string | null;
|
|
1464
1453
|
}>;
|
|
1465
|
-
/** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
|
|
1466
1454
|
getSessionWallet(): Promise<{
|
|
1467
1455
|
walletAddress: string;
|
|
1468
1456
|
needsKeySetup: boolean;
|
|
@@ -1575,9 +1563,7 @@ interface RecoveryKey {
|
|
|
1575
1563
|
walletAddress: string;
|
|
1576
1564
|
privateKey: string;
|
|
1577
1565
|
}
|
|
1578
|
-
/** The recovery key a user saves: a wallet address and one of its owner keys, in one string. */
|
|
1579
1566
|
declare function encodeRecoveryKey(key: RecoveryKey): string;
|
|
1580
|
-
/** Reads a saved recovery key. A bare private key, saved before v1, restores the wallet that key first deployed. */
|
|
1581
1567
|
declare function parseRecoveryKey(input: string): RecoveryKey;
|
|
1582
1568
|
|
|
1583
1569
|
declare class PasskeyCancelledError extends Error {
|
|
@@ -1601,7 +1587,6 @@ interface CreatedOwner {
|
|
|
1601
1587
|
interface PasskeyOwner {
|
|
1602
1588
|
createOwnerKey(): Promise<CreatedOwner>;
|
|
1603
1589
|
unlockOwnerKey(sealed: SealedOwner): Promise<string>;
|
|
1604
|
-
/** Seals an owner key restored from a recovery key, for the wallet it owns. */
|
|
1605
1590
|
sealImportedOwnerKey(recovery: RecoveryKey): Promise<SealedOwner>;
|
|
1606
1591
|
}
|
|
1607
1592
|
declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
|
|
@@ -600,7 +600,6 @@ interface EmissionParams {
|
|
|
600
600
|
chain?: "STARKNET";
|
|
601
601
|
service: string;
|
|
602
602
|
owner: string;
|
|
603
|
-
/** Recipient emails. */
|
|
604
603
|
recipients: string[];
|
|
605
604
|
tokenUri?: string;
|
|
606
605
|
collectionId?: string;
|
|
@@ -1095,7 +1094,6 @@ interface ApiDropState {
|
|
|
1095
1094
|
allowlistEnabled: boolean;
|
|
1096
1095
|
paused: boolean;
|
|
1097
1096
|
}
|
|
1098
|
-
/** An IP Ticket or IP Club membership tier, as read from its contract. Amounts are decimal strings. */
|
|
1099
1097
|
interface ApiTierOnchain {
|
|
1100
1098
|
maxSupply: string;
|
|
1101
1099
|
minted: string;
|
|
@@ -1126,7 +1124,6 @@ interface ApiUsernameClaim {
|
|
|
1126
1124
|
createdAt: string;
|
|
1127
1125
|
}
|
|
1128
1126
|
type ApiReportTargetType = "COLLECTION" | "TOKEN" | "CREATOR" | "COMMENT";
|
|
1129
|
-
/** `targetKey` is built from the target fields. */
|
|
1130
1127
|
interface ApiSubmitReport {
|
|
1131
1128
|
targetType: ApiReportTargetType;
|
|
1132
1129
|
targetContract?: string;
|
|
@@ -1281,7 +1278,6 @@ declare class ApiClient {
|
|
|
1281
1278
|
getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
|
|
1282
1279
|
getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
|
|
1283
1280
|
getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
|
|
1284
|
-
/** Offers others made on the address's assets. */
|
|
1285
1281
|
getReceivedOffers(address: string, opts?: {
|
|
1286
1282
|
page?: number;
|
|
1287
1283
|
limit?: number;
|
|
@@ -1331,7 +1327,6 @@ declare class ApiClient {
|
|
|
1331
1327
|
getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
|
|
1332
1328
|
getMetadataSignedUrl(kind?: "image" | "document" | "media"): Promise<ApiResponse<ApiMetadataSignedUrl>>;
|
|
1333
1329
|
uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
|
|
1334
|
-
/** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
|
|
1335
1330
|
uploadMetadataDirectory(files: {
|
|
1336
1331
|
name: string;
|
|
1337
1332
|
content: unknown;
|
|
@@ -1352,7 +1347,6 @@ declare class ApiClient {
|
|
|
1352
1347
|
}>>;
|
|
1353
1348
|
getCreditHistory(siwsToken?: string): Promise<ApiResponse<ApiCreditPayment[]>>;
|
|
1354
1349
|
getSpend(siwsToken?: string): Promise<ApiResponse<ApiPortalSpend>>;
|
|
1355
|
-
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
1356
1350
|
checkDeposit(txHash: string, siwsToken?: string): Promise<ApiResponse<{
|
|
1357
1351
|
deposits: number;
|
|
1358
1352
|
}>>;
|
|
@@ -1451,18 +1445,12 @@ declare class ApiClient {
|
|
|
1451
1445
|
requestEmailCode(email: string): Promise<void>;
|
|
1452
1446
|
registerEmailAccount(email: string): Promise<void>;
|
|
1453
1447
|
verifyEmailCode(email: string, code: string): Promise<void>;
|
|
1454
|
-
/**
|
|
1455
|
-
* Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
|
|
1456
|
-
* proof for the wallet. Answers 409 when the wallet is already set up.
|
|
1457
|
-
*/
|
|
1458
1448
|
setupWalletKey(params: {
|
|
1459
1449
|
newOwnerPubkey: string;
|
|
1460
|
-
signature: string[];
|
|
1461
|
-
expiration: number;
|
|
1462
1450
|
}): Promise<{
|
|
1463
1451
|
walletAddress: string;
|
|
1452
|
+
removeOwnerGuid: string | null;
|
|
1464
1453
|
}>;
|
|
1465
|
-
/** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
|
|
1466
1454
|
getSessionWallet(): Promise<{
|
|
1467
1455
|
walletAddress: string;
|
|
1468
1456
|
needsKeySetup: boolean;
|
|
@@ -1575,9 +1563,7 @@ interface RecoveryKey {
|
|
|
1575
1563
|
walletAddress: string;
|
|
1576
1564
|
privateKey: string;
|
|
1577
1565
|
}
|
|
1578
|
-
/** The recovery key a user saves: a wallet address and one of its owner keys, in one string. */
|
|
1579
1566
|
declare function encodeRecoveryKey(key: RecoveryKey): string;
|
|
1580
|
-
/** Reads a saved recovery key. A bare private key, saved before v1, restores the wallet that key first deployed. */
|
|
1581
1567
|
declare function parseRecoveryKey(input: string): RecoveryKey;
|
|
1582
1568
|
|
|
1583
1569
|
declare class PasskeyCancelledError extends Error {
|
|
@@ -1601,7 +1587,6 @@ interface CreatedOwner {
|
|
|
1601
1587
|
interface PasskeyOwner {
|
|
1602
1588
|
createOwnerKey(): Promise<CreatedOwner>;
|
|
1603
1589
|
unlockOwnerKey(sealed: SealedOwner): Promise<string>;
|
|
1604
|
-
/** Seals an owner key restored from a recovery key, for the wallet it owns. */
|
|
1605
1590
|
sealImportedOwnerKey(recovery: RecoveryKey): Promise<SealedOwner>;
|
|
1606
1591
|
}
|
|
1607
1592
|
declare function createPasskeyOwner(config: PasskeyConfig): PasskeyOwner;
|
package/dist/index.cjs
CHANGED
|
@@ -379,7 +379,6 @@ var ApiClient = class {
|
|
|
379
379
|
getActiveOrdersForToken(contract, tokenId) {
|
|
380
380
|
return this.get(`/v1/orders/token/${this.addr(contract)}/${tokenId}`);
|
|
381
381
|
}
|
|
382
|
-
/** Offers others made on the address's assets. */
|
|
383
382
|
getReceivedOffers(address, opts = {}) {
|
|
384
383
|
const params = new URLSearchParams({ page: String(opts.page ?? 1), limit: String(opts.limit ?? 50) });
|
|
385
384
|
return this.get(`/v1/orders/received/${this.addr(address)}?${params}`);
|
|
@@ -538,7 +537,6 @@ var ApiClient = class {
|
|
|
538
537
|
uploadMetadata(metadata) {
|
|
539
538
|
return this.post("/v1/metadata/upload", metadata);
|
|
540
539
|
}
|
|
541
|
-
/** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
|
|
542
540
|
async uploadMetadataDirectory(files) {
|
|
543
541
|
const res = await this.post("/v1/metadata/upload-directory", { files });
|
|
544
542
|
return res.data;
|
|
@@ -592,7 +590,6 @@ var ApiClient = class {
|
|
|
592
590
|
headers: this.asSubject(siwsToken)
|
|
593
591
|
});
|
|
594
592
|
}
|
|
595
|
-
/** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
|
|
596
593
|
checkDeposit(txHash, siwsToken) {
|
|
597
594
|
return this.request("/v1/portal/credits/check", {
|
|
598
595
|
method: "POST",
|
|
@@ -784,14 +781,9 @@ var ApiClient = class {
|
|
|
784
781
|
async verifyEmailCode(email, code) {
|
|
785
782
|
await this.post("/v1/auth/email/verify-code", { email, code });
|
|
786
783
|
}
|
|
787
|
-
/**
|
|
788
|
-
* Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
|
|
789
|
-
* proof for the wallet. Answers 409 when the wallet is already set up.
|
|
790
|
-
*/
|
|
791
784
|
setupWalletKey(params) {
|
|
792
785
|
return this.post("/v1/users/me/wallet/key", params);
|
|
793
786
|
}
|
|
794
|
-
/** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
|
|
795
787
|
async getSessionWallet() {
|
|
796
788
|
const body = await this.post("/v1/users/me/wallet", {});
|
|
797
789
|
return body.walletAddress ? { walletAddress: body.walletAddress, needsKeySetup: body.needsKeySetup === true } : null;
|
|
@@ -1166,7 +1158,6 @@ function createLaunchpadRunsClient({ baseUrl, getToken, fetchImpl = fetch }) {
|
|
|
1166
1158
|
uploadUrl: async (id, name) => (await post(`${runBase(id)}/files/upload-url`, { name })).data.url,
|
|
1167
1159
|
uploaded: async (id, name, cid) => (await post(`${runBase(id)}/files/uploaded`, { name, cid })).data,
|
|
1168
1160
|
metadata: async (id, userAddress) => (await post(`${runBase(id)}/metadata`, { userAddress })).data,
|
|
1169
|
-
/** Guests who still need a wallet deployed; the ones who already have one are recorded on the run. */
|
|
1170
1161
|
resolveWallets: async (id) => (await post(`${runBase(id)}/wallets/resolve`)).data.pending,
|
|
1171
1162
|
registerWallet: async (id, request) => (await post(`${runBase(id)}/wallets`, request)).data,
|
|
1172
1163
|
confirmCollection: (id) => confirm(`${runCollectionBase(id)}/confirm`),
|