@medialane/sdk 0.138.0 → 0.139.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.
@@ -967,15 +967,8 @@ interface ApiAdminCollectionClaim extends ApiCollectionClaim {
967
967
  updatedAt: string;
968
968
  }
969
969
  interface ApiBusinessProvisioning {
970
- id: string;
971
- accountId: string;
972
970
  chain: string;
973
971
  walletAddress: string;
974
- recipientScheme: string;
975
- recipientValue: string;
976
- interimOwnerPubkey: string | null;
977
- newOwnerPubkey: string | null;
978
- status: "DEPLOYED" | "REUSED" | "TRANSFERRED";
979
972
  }
980
973
  interface ApiWalletActivity {
981
974
  id: string;
@@ -1403,7 +1396,7 @@ declare class ApiClient {
1403
1396
  }>;
1404
1397
  registerBusinessProvisioning(params: {
1405
1398
  chain?: "STARKNET";
1406
- recipientScheme: string;
1399
+ recipientScheme: "email";
1407
1400
  recipientValue: string;
1408
1401
  }): Promise<ApiResponse<ApiBusinessProvisioning> & {
1409
1402
  reusedExistingWallet?: boolean;
@@ -1455,24 +1448,26 @@ declare class ApiClient {
1455
1448
  }): Promise<ApiUserWallet>;
1456
1449
  checkEmail(email: string): Promise<{
1457
1450
  exists: boolean;
1458
- walletWaiting: boolean;
1459
1451
  }>;
1460
1452
  requestEmailCode(email: string): Promise<void>;
1461
1453
  registerEmailAccount(email: string): Promise<void>;
1462
- verifyEmailCode(email: string, code: string): Promise<{
1463
- waitingWallets: string[];
1464
- }>;
1465
- claimWallet(params: {
1454
+ verifyEmailCode(email: string, code: string): Promise<void>;
1455
+ /**
1456
+ * Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
1457
+ * proof for the wallet. Answers 409 when the wallet is already set up.
1458
+ */
1459
+ setupWalletKey(params: {
1466
1460
  newOwnerPubkey: string;
1467
- proofs: {
1468
- walletAddress: string;
1469
- signature: string[];
1470
- expiration: number;
1471
- }[];
1461
+ signature: string[];
1462
+ expiration: number;
1472
1463
  }): Promise<{
1473
- claimed: string[];
1464
+ walletAddress: string;
1474
1465
  }>;
1475
- getSessionWallet(): Promise<string | null>;
1466
+ /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
1467
+ getSessionWallet(): Promise<{
1468
+ walletAddress: string;
1469
+ needsKeySetup: boolean;
1470
+ } | null>;
1476
1471
  getMyWallet(siwsToken: string): Promise<ApiUserWallet | null>;
1477
1472
  changeMyEmail(email: string, siwsToken: string): Promise<{
1478
1473
  email: string;
@@ -967,15 +967,8 @@ interface ApiAdminCollectionClaim extends ApiCollectionClaim {
967
967
  updatedAt: string;
968
968
  }
969
969
  interface ApiBusinessProvisioning {
970
- id: string;
971
- accountId: string;
972
970
  chain: string;
973
971
  walletAddress: string;
974
- recipientScheme: string;
975
- recipientValue: string;
976
- interimOwnerPubkey: string | null;
977
- newOwnerPubkey: string | null;
978
- status: "DEPLOYED" | "REUSED" | "TRANSFERRED";
979
972
  }
980
973
  interface ApiWalletActivity {
981
974
  id: string;
@@ -1403,7 +1396,7 @@ declare class ApiClient {
1403
1396
  }>;
1404
1397
  registerBusinessProvisioning(params: {
1405
1398
  chain?: "STARKNET";
1406
- recipientScheme: string;
1399
+ recipientScheme: "email";
1407
1400
  recipientValue: string;
1408
1401
  }): Promise<ApiResponse<ApiBusinessProvisioning> & {
1409
1402
  reusedExistingWallet?: boolean;
@@ -1455,24 +1448,26 @@ declare class ApiClient {
1455
1448
  }): Promise<ApiUserWallet>;
1456
1449
  checkEmail(email: string): Promise<{
1457
1450
  exists: boolean;
1458
- walletWaiting: boolean;
1459
1451
  }>;
1460
1452
  requestEmailCode(email: string): Promise<void>;
1461
1453
  registerEmailAccount(email: string): Promise<void>;
1462
- verifyEmailCode(email: string, code: string): Promise<{
1463
- waitingWallets: string[];
1464
- }>;
1465
- claimWallet(params: {
1454
+ verifyEmailCode(email: string, code: string): Promise<void>;
1455
+ /**
1456
+ * Makes the passkey the only owner of the session account's wallet. `signature` is the passkey's owner-alive
1457
+ * proof for the wallet. Answers 409 when the wallet is already set up.
1458
+ */
1459
+ setupWalletKey(params: {
1466
1460
  newOwnerPubkey: string;
1467
- proofs: {
1468
- walletAddress: string;
1469
- signature: string[];
1470
- expiration: number;
1471
- }[];
1461
+ signature: string[];
1462
+ expiration: number;
1472
1463
  }): Promise<{
1473
- claimed: string[];
1464
+ walletAddress: string;
1474
1465
  }>;
1475
- getSessionWallet(): Promise<string | null>;
1466
+ /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
1467
+ getSessionWallet(): Promise<{
1468
+ walletAddress: string;
1469
+ needsKeySetup: boolean;
1470
+ } | null>;
1476
1471
  getMyWallet(siwsToken: string): Promise<ApiUserWallet | null>;
1477
1472
  changeMyEmail(email: string, siwsToken: string): Promise<{
1478
1473
  email: string;
package/dist/index.cjs CHANGED
@@ -772,10 +772,8 @@ var ApiClient = class {
772
772
  });
773
773
  }
774
774
  async checkEmail(email) {
775
- const body = await this.get(
776
- `/v1/auth/email/exists?email=${encodeURIComponent(email)}`
777
- );
778
- return { exists: body.exists, walletWaiting: body.walletWaiting === true };
775
+ const body = await this.get(`/v1/auth/email/exists?email=${encodeURIComponent(email)}`);
776
+ return { exists: body.exists };
779
777
  }
780
778
  async requestEmailCode(email) {
781
779
  await this.post("/v1/auth/email/request-code", { email });
@@ -784,15 +782,19 @@ var ApiClient = class {
784
782
  await this.post("/v1/auth/email/register-account", { email });
785
783
  }
786
784
  async verifyEmailCode(email, code) {
787
- const body = await this.post("/v1/auth/email/verify-code", { email, code });
788
- return { waitingWallets: body.waitingWallets ?? [] };
785
+ await this.post("/v1/auth/email/verify-code", { email, code });
789
786
  }
790
- claimWallet(params) {
791
- return this.post("/v1/users/me/claim-wallet", params);
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
+ setupWalletKey(params) {
792
+ return this.post("/v1/users/me/wallet/key", params);
792
793
  }
794
+ /** The session account's wallet, and whether its passkey still has to be set up (`setupWalletKey`). */
793
795
  async getSessionWallet() {
794
796
  const body = await this.post("/v1/users/me/wallet", {});
795
- return body.walletAddress ?? null;
797
+ return body.walletAddress ? { walletAddress: body.walletAddress, needsKeySetup: body.needsKeySetup === true } : null;
796
798
  }
797
799
  getMyWallet(siwsToken) {
798
800
  return this.request(