@getpara/core-sdk 2.0.0-alpha.25 → 2.0.0-alpha.27

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.
@@ -1056,6 +1056,7 @@ const _ParaCore = class _ParaCore {
1056
1056
  /**
1057
1057
  * Fetches the most recent OAuth account metadata for the signed-in user.
1058
1058
  * If applicable, this will include the user's most recent metadata from their Google, Apple, Facebook, X, Discord, Farcaster, or Telegram account, the last time they signed in to your app.
1059
+ * @deprecated use `para.getLinkedAccounts({ withMetadata: true })` instead.
1059
1060
  * @returns {Promise<AccountMetadata>} the user's account metadata.
1060
1061
  */
1061
1062
  getAccountMetadata() {
@@ -2918,9 +2919,11 @@ const _ParaCore = class _ParaCore {
2918
2919
  });
2919
2920
  }
2920
2921
  getLinkedAccounts() {
2921
- return __async(this, null, function* () {
2922
+ return __async(this, arguments, function* ({
2923
+ withMetadata = false
2924
+ } = {}) {
2922
2925
  const userId = this.assertUserId();
2923
- const { accounts } = yield this.ctx.client.getLinkedAccounts({ userId });
2926
+ const { accounts } = yield this.ctx.client.getLinkedAccounts({ userId, withMetadata });
2924
2927
  return __spreadValues({
2925
2928
  userId
2926
2929
  }, accounts);
@@ -40,7 +40,7 @@ __export(constants_exports, {
40
40
  SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
41
41
  });
42
42
  module.exports = __toCommonJS(constants_exports);
43
- const PARA_CORE_VERSION = "2.0.0-alpha.24";
43
+ const PARA_CORE_VERSION = "2.0.0-alpha.27";
44
44
  const PREFIX = "@CAPSULE/";
45
45
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
46
46
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
@@ -1022,6 +1022,7 @@ const _ParaCore = class _ParaCore {
1022
1022
  /**
1023
1023
  * Fetches the most recent OAuth account metadata for the signed-in user.
1024
1024
  * If applicable, this will include the user's most recent metadata from their Google, Apple, Facebook, X, Discord, Farcaster, or Telegram account, the last time they signed in to your app.
1025
+ * @deprecated use `para.getLinkedAccounts({ withMetadata: true })` instead.
1025
1026
  * @returns {Promise<AccountMetadata>} the user's account metadata.
1026
1027
  */
1027
1028
  getAccountMetadata() {
@@ -2884,9 +2885,11 @@ const _ParaCore = class _ParaCore {
2884
2885
  });
2885
2886
  }
2886
2887
  getLinkedAccounts() {
2887
- return __async(this, null, function* () {
2888
+ return __async(this, arguments, function* ({
2889
+ withMetadata = false
2890
+ } = {}) {
2888
2891
  const userId = this.assertUserId();
2889
- const { accounts } = yield this.ctx.client.getLinkedAccounts({ userId });
2892
+ const { accounts } = yield this.ctx.client.getLinkedAccounts({ userId, withMetadata });
2890
2893
  return __spreadValues({
2891
2894
  userId
2892
2895
  }, accounts);
@@ -1,5 +1,5 @@
1
1
  import "./chunk-7B52C2XE.js";
2
- const PARA_CORE_VERSION = "2.0.0-alpha.24";
2
+ const PARA_CORE_VERSION = "2.0.0-alpha.27";
3
3
  const PREFIX = "@CAPSULE/";
4
4
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
5
5
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
@@ -140,7 +140,7 @@ export declare abstract class ParaCore implements CoreInterface {
140
140
  * Remove all local storage and prefixed session storage.
141
141
  * @param {'local' | 'session' | 'secure' | 'all'} type - Type of storage to clear. Defaults to 'all'.
142
142
  */
143
- clearStorage: (type?: CoreMethodParams<'clearStorage'>) => CoreMethodResponse<'clearStorage'>;
143
+ clearStorage: (type?: CoreMethodParams<"clearStorage">) => CoreMethodResponse<"clearStorage">;
144
144
  private convertBigInt;
145
145
  private convertEncryptionKeyPair;
146
146
  private isPortal;
@@ -287,6 +287,7 @@ export declare abstract class ParaCore implements CoreInterface {
287
287
  /**
288
288
  * Fetches the most recent OAuth account metadata for the signed-in user.
289
289
  * If applicable, this will include the user's most recent metadata from their Google, Apple, Facebook, X, Discord, Farcaster, or Telegram account, the last time they signed in to your app.
290
+ * @deprecated use `para.getLinkedAccounts({ withMetadata: true })` instead.
290
291
  * @returns {Promise<AccountMetadata>} the user's account metadata.
291
292
  */
292
293
  getAccountMetadata(): Promise<AccountMetadata>;
@@ -497,7 +498,7 @@ export declare abstract class ParaCore implements CoreInterface {
497
498
  *
498
499
  * @deprecated alias for `createWalletPerType`
499
500
  **/
500
- createWalletPerMissingType: ({ skipDistribute, types, }?: CoreMethodParams<'createWalletPerType'>) => CoreMethodResponse<'createWalletPerType'>;
501
+ createWalletPerMissingType: ({ skipDistribute, types, }?: CoreMethodParams<"createWalletPerType">) => CoreMethodResponse<"createWalletPerType">;
501
502
  /**
502
503
  * Creates several new wallets with the desired types. If no types are provided, this method
503
504
  * will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
@@ -589,7 +590,7 @@ export declare abstract class ParaCore implements CoreInterface {
589
590
  setUserShare(base64Wallets: CoreMethodParams<'setUserShare'>): CoreMethodResponse<'setUserShare'>;
590
591
  private getTransactionReviewUrl;
591
592
  private getOnRampTransactionUrl;
592
- getWalletBalance: ({ walletId, rpcUrl, }: CoreMethodParams<'getWalletBalance'>) => CoreMethodResponse<'getWalletBalance'>;
593
+ getWalletBalance: ({ walletId, rpcUrl, }: CoreMethodParams<"getWalletBalance">) => CoreMethodResponse<"getWalletBalance">;
593
594
  /**
594
595
  * Signs a message using one of the current wallets.
595
596
  *
@@ -672,7 +673,7 @@ export declare abstract class ParaCore implements CoreInterface {
672
673
  protected getLoginUrl({ authMethod, shorten, portalTheme, sessionId, }: LoginUrlParams): Promise<string>;
673
674
  signUpOrLogIn({ auth, ...urlOptions }: CoreMethodParams<'signUpOrLogIn'>): CoreMethodResponse<'signUpOrLogIn'>;
674
675
  verifyNewAccount({ verificationCode, ...urlOptions }: CoreMethodParams<'verifyNewAccount'>): CoreMethodResponse<'verifyNewAccount'>;
675
- getLinkedAccounts(): CoreMethodResponse<'getLinkedAccounts'>;
676
+ getLinkedAccounts({ withMetadata, }?: CoreMethodParams<'getLinkedAccounts'>): CoreMethodResponse<'getLinkedAccounts'>;
676
677
  protected linkAccount(opts: InternalMethodParams<'linkAccount'>): InternalMethodResponse<'linkAccount'>;
677
678
  protected unlinkAccount({ linkedAccountId, }: InternalMethodParams<'unlinkAccount'>): InternalMethodResponse<'unlinkAccount'>;
678
679
  protected verifyLink({ accountLinkInProgress, ...opts }?: {
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { BackupKitEmailProps, TPregenIdentifierType, TWalletType, SDKType } from '@getpara/user-management-client';
4
2
  import { Ctx, PopupType, SignatureRes } from './types/index.js';
5
3
  import { StorageUtils } from './StorageUtils.js';
@@ -1,19 +1,19 @@
1
1
  export declare const PARA_CORE_VERSION: string;
2
2
  export declare const PREFIX = "@CAPSULE/";
3
- export declare const LOCAL_STORAGE_AUTH_INFO: string;
4
- export declare const LOCAL_STORAGE_EMAIL: string;
5
- export declare const LOCAL_STORAGE_PHONE: string;
6
- export declare const LOCAL_STORAGE_COUNTRY_CODE: string;
7
- export declare const LOCAL_STORAGE_FARCASTER_USERNAME: string;
8
- export declare const LOCAL_STORAGE_TELEGRAM_USER_ID: string;
9
- export declare const LOCAL_STORAGE_EXTERNAL_WALLET_USER_ID: string;
10
- export declare const LOCAL_STORAGE_USER_ID: string;
11
- export declare const LOCAL_STORAGE_ED25519_WALLETS: string;
12
- export declare const LOCAL_STORAGE_WALLETS: string;
13
- export declare const LOCAL_STORAGE_EXTERNAL_WALLETS: string;
14
- export declare const LOCAL_STORAGE_CURRENT_WALLET_IDS: string;
15
- export declare const LOCAL_STORAGE_SESSION_COOKIE: string;
16
- export declare const SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR: string;
3
+ export declare const LOCAL_STORAGE_AUTH_INFO = "@CAPSULE/authInfo";
4
+ export declare const LOCAL_STORAGE_EMAIL = "@CAPSULE/e-mail";
5
+ export declare const LOCAL_STORAGE_PHONE = "@CAPSULE/phone";
6
+ export declare const LOCAL_STORAGE_COUNTRY_CODE = "@CAPSULE/countryCode";
7
+ export declare const LOCAL_STORAGE_FARCASTER_USERNAME = "@CAPSULE/farcasterUsername";
8
+ export declare const LOCAL_STORAGE_TELEGRAM_USER_ID = "@CAPSULE/telegramUserId";
9
+ export declare const LOCAL_STORAGE_EXTERNAL_WALLET_USER_ID = "@CAPSULE/externalWalletUserId";
10
+ export declare const LOCAL_STORAGE_USER_ID = "@CAPSULE/userId";
11
+ export declare const LOCAL_STORAGE_ED25519_WALLETS = "@CAPSULE/ed25519Wallets";
12
+ export declare const LOCAL_STORAGE_WALLETS = "@CAPSULE/wallets";
13
+ export declare const LOCAL_STORAGE_EXTERNAL_WALLETS = "@CAPSULE/externalWallets";
14
+ export declare const LOCAL_STORAGE_CURRENT_WALLET_IDS = "@CAPSULE/currentWalletIds";
15
+ export declare const LOCAL_STORAGE_SESSION_COOKIE = "@CAPSULE/sessionCookie";
16
+ export declare const SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR = "@CAPSULE/loginEncryptionKeyPair";
17
17
  export declare const POLLING_INTERVAL_MS = 2000;
18
18
  export declare const SHORT_POLLING_INTERVAL_MS = 1000;
19
19
  export declare const POLLING_TIMEOUT_MS = 300000;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  export declare class KeyContainer {
4
2
  walletId: string;
5
3
  keyshare: string;
@@ -475,8 +475,12 @@ export type CoreMethods = Record<CoreMethodName, {
475
475
  response: IssueJwtResponse;
476
476
  };
477
477
  getLinkedAccounts: {
478
- params: void;
479
- response: LinkedAccounts;
478
+ params: {
479
+ withMetadata?: boolean;
480
+ };
481
+ response: LinkedAccounts & {
482
+ userId: string;
483
+ };
480
484
  };
481
485
  };
482
486
  export type InternalMethods = {
package/package.json CHANGED
@@ -1,39 +1,21 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-alpha.25",
4
- "main": "dist/cjs/index.js",
5
- "module": "dist/esm/index.js",
6
- "types": "dist/types/index.d.ts",
7
- "typings": "dist/types/index.d.ts",
8
- "sideEffects": false,
3
+ "version": "2.0.0-alpha.27",
9
4
  "dependencies": {
10
5
  "@celo/utils": "^8.0.2",
11
6
  "@cosmjs/encoding": "^0.32.4",
12
7
  "@ethereumjs/util": "^9.1.0",
13
- "@getpara/user-management-client": "2.0.0-alpha.25",
8
+ "@getpara/user-management-client": "2.0.0-alpha.27",
14
9
  "@noble/hashes": "^1.5.0",
15
10
  "base64url": "^3.0.1",
16
- "libphonenumber-js": "1.11.2",
11
+ "libphonenumber-js": "^1.11.7",
17
12
  "node-forge": "^1.3.1",
18
13
  "uuid": "^11.1.0"
19
14
  },
20
- "scripts": {
21
- "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
22
- "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
23
- "post-build": "./scripts/set-version.sh",
24
- "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
25
- "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
26
- "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
27
- "test": "vitest run --coverage"
28
- },
29
15
  "devDependencies": {
30
16
  "@faker-js/faker": "^9.5.1",
31
- "typescript": "5.1.6"
17
+ "typescript": "^5.8.3"
32
18
  },
33
- "files": [
34
- "dist",
35
- "package.json"
36
- ],
37
19
  "exports": {
38
20
  ".": {
39
21
  "types": "./dist/types/index.d.ts",
@@ -41,5 +23,23 @@
41
23
  "require": "./dist/cjs/index.js"
42
24
  }
43
25
  },
44
- "gitHead": "51f576cb7d3f0d55fdd5508f7445b2c7b48d0696"
26
+ "files": [
27
+ "dist",
28
+ "package.json"
29
+ ],
30
+ "gitHead": "a54f63445995abd13220eda3d63809728e4b5f7e",
31
+ "main": "dist/cjs/index.js",
32
+ "module": "dist/esm/index.js",
33
+ "scripts": {
34
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
35
+ "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
36
+ "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
37
+ "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
38
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
39
+ "post-build": "./scripts/set-version.sh",
40
+ "test": "vitest run --coverage"
41
+ },
42
+ "sideEffects": false,
43
+ "types": "dist/types/index.d.ts",
44
+ "typings": "dist/types/index.d.ts"
45
45
  }