@getpara/core-sdk 2.0.0-dev.0 → 2.0.0-dev.2

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.
Files changed (100) hide show
  1. package/dist/cjs/ParaCore.js +3378 -0
  2. package/dist/cjs/PlatformUtils.js +15 -0
  3. package/dist/cjs/StorageUtils.js +15 -0
  4. package/dist/cjs/constants.js +87 -0
  5. package/dist/cjs/cryptography/utils.js +350 -0
  6. package/dist/cjs/errors.js +51 -0
  7. package/dist/cjs/external/mpcComputationClient.js +62 -0
  8. package/dist/cjs/external/userManagementClient.js +106 -0
  9. package/dist/cjs/index.js +102 -4080
  10. package/dist/cjs/package.json +3 -0
  11. package/dist/cjs/shares/KeyContainer.js +89 -0
  12. package/dist/cjs/shares/recovery.js +127 -0
  13. package/dist/cjs/shares/shareDistribution.js +104 -0
  14. package/dist/cjs/transmission/transmissionUtils.js +93 -0
  15. package/dist/cjs/types/auth.js +33 -0
  16. package/dist/cjs/types/config.js +43 -0
  17. package/dist/cjs/types/coreApi.js +89 -0
  18. package/dist/cjs/types/events.js +41 -0
  19. package/dist/cjs/types/index.js +54 -0
  20. package/dist/cjs/types/methods.js +15 -0
  21. package/dist/cjs/types/onRamps.js +33 -0
  22. package/dist/cjs/types/popup.js +35 -0
  23. package/dist/cjs/types/recovery.js +34 -0
  24. package/dist/cjs/types/theme.js +15 -0
  25. package/dist/cjs/types/wallet.js +31 -0
  26. package/dist/cjs/utils/autobind.js +41 -0
  27. package/dist/cjs/utils/events.js +45 -0
  28. package/dist/cjs/utils/formatting.js +116 -0
  29. package/dist/cjs/utils/index.js +41 -0
  30. package/dist/cjs/utils/json.js +37 -0
  31. package/dist/cjs/utils/listeners.js +71 -0
  32. package/dist/cjs/utils/onRamps.js +92 -0
  33. package/dist/cjs/utils/phone.js +73 -0
  34. package/dist/cjs/utils/polling.js +58 -0
  35. package/dist/cjs/utils/types.js +29 -0
  36. package/dist/cjs/utils/url.js +135 -0
  37. package/dist/cjs/utils/wallet.js +159 -0
  38. package/dist/esm/ParaCore.js +3343 -0
  39. package/dist/esm/PlatformUtils.js +0 -0
  40. package/dist/esm/StorageUtils.js +0 -0
  41. package/dist/esm/chunk-7B52C2XE.js +70 -0
  42. package/dist/esm/constants.js +45 -0
  43. package/dist/esm/cryptography/utils.js +282 -0
  44. package/dist/esm/errors.js +27 -0
  45. package/dist/esm/external/mpcComputationClient.js +30 -0
  46. package/dist/esm/external/userManagementClient.js +71 -0
  47. package/dist/esm/index.js +78 -4049
  48. package/dist/esm/package.json +4 -0
  49. package/dist/esm/shares/KeyContainer.js +57 -0
  50. package/dist/esm/shares/recovery.js +74 -0
  51. package/dist/esm/shares/shareDistribution.js +64 -0
  52. package/dist/esm/transmission/transmissionUtils.js +42 -0
  53. package/dist/esm/types/auth.js +11 -0
  54. package/dist/esm/types/config.js +20 -0
  55. package/dist/esm/types/coreApi.js +66 -0
  56. package/dist/esm/types/events.js +19 -0
  57. package/dist/esm/types/index.js +23 -0
  58. package/dist/esm/types/methods.js +0 -0
  59. package/dist/esm/types/onRamps.js +11 -0
  60. package/dist/esm/types/popup.js +13 -0
  61. package/dist/esm/types/recovery.js +12 -0
  62. package/dist/esm/types/theme.js +0 -0
  63. package/dist/esm/types/wallet.js +9 -0
  64. package/dist/esm/utils/autobind.js +19 -0
  65. package/dist/esm/utils/events.js +11 -0
  66. package/dist/esm/utils/formatting.js +76 -0
  67. package/dist/esm/utils/index.js +11 -0
  68. package/dist/esm/utils/json.js +15 -0
  69. package/dist/esm/utils/listeners.js +38 -0
  70. package/dist/esm/utils/onRamps.js +66 -0
  71. package/dist/esm/utils/phone.js +39 -0
  72. package/dist/esm/utils/polling.js +18 -0
  73. package/dist/esm/utils/types.js +7 -0
  74. package/dist/esm/utils/url.js +90 -0
  75. package/dist/esm/utils/wallet.js +103 -0
  76. package/dist/types/ParaCore.d.ts +140 -367
  77. package/dist/types/PlatformUtils.d.ts +4 -5
  78. package/dist/types/constants.d.ts +17 -13
  79. package/dist/types/index.d.ts +5 -4
  80. package/dist/types/shares/KeyContainer.d.ts +0 -2
  81. package/dist/types/types/auth.d.ts +16 -0
  82. package/dist/types/types/config.d.ts +12 -5
  83. package/dist/types/types/coreApi.d.ts +531 -0
  84. package/dist/types/types/events.d.ts +4 -1
  85. package/dist/types/types/index.d.ts +2 -0
  86. package/dist/types/types/methods.d.ts +145 -42
  87. package/dist/types/types/onRamps.d.ts +3 -3
  88. package/dist/types/types/wallet.d.ts +8 -4
  89. package/dist/types/utils/formatting.d.ts +5 -2
  90. package/dist/types/utils/index.d.ts +1 -0
  91. package/dist/types/utils/onRamps.d.ts +12 -5
  92. package/dist/types/utils/phone.d.ts +6 -2
  93. package/dist/types/utils/types.d.ts +2 -0
  94. package/dist/types/utils/url.d.ts +2 -1
  95. package/dist/types/utils/wallet.d.ts +9 -7
  96. package/package.json +27 -26
  97. package/dist/cjs/index.js.br +0 -0
  98. package/dist/cjs/index.js.gz +0 -0
  99. package/dist/esm/index.js.br +0 -0
  100. package/dist/esm/index.js.gz +0 -0
@@ -1,6 +1,7 @@
1
1
  import { CurrentWalletIds } from '@getpara/user-management-client';
2
2
  import { FullSignatureRes } from './wallet.js';
3
3
  import { Wallet } from './wallet.js';
4
+ import { CoreMethodResponse } from './coreApi.js';
4
5
  export declare enum ParaEvent {
5
6
  LOGIN_EVENT = "paraLogin",
6
7
  ACCOUNT_CREATION_EVENT = "paraAccountCreation",
@@ -11,7 +12,8 @@ export declare enum ParaEvent {
11
12
  EXTERNAL_WALLET_CHANGE_EVENT = "paraExternalWalletChange",
12
13
  WALLETS_CHANGE_EVENT = "paraWalletsChange",
13
14
  WALLET_CREATED = "paraWalletCreated",
14
- PREGEN_WALLET_CLAIMED = "paraPregenWalletClaimed"
15
+ PREGEN_WALLET_CLAIMED = "paraPregenWalletClaimed",
16
+ GUEST_WALLETS_CREATED = "paraGuestWalletsCreated"
15
17
  }
16
18
  export type BaseEvent<T> = {
17
19
  data: T;
@@ -45,3 +47,4 @@ export type PregenWalletClaimedResponse = {
45
47
  recoverySecret?: string;
46
48
  };
47
49
  export type PregenWalletClaimedEvent = CustomEventInit<BaseEvent<WalletCreatedResponse>>;
50
+ export type GuestWalletsCreatedEvent = CustomEventInit<BaseEvent<CoreMethodResponse<'createGuestWallets'>>>;
@@ -1,4 +1,6 @@
1
+ export * from './auth.js';
1
2
  export * from './config.js';
3
+ export * from './coreApi.js';
2
4
  export * from './wallet.js';
3
5
  export * from './methods.js';
4
6
  export * from './theme.js';
@@ -1,80 +1,183 @@
1
- import { AuthType, PrimaryAuthInfo, WalletType } from '@getpara/user-management-client';
1
+ import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, TOAuthMethod, TWalletType, TelegramAuthResponse } from '@getpara/user-management-client';
2
2
  import { Theme } from './theme.js';
3
- export type EmbeddedWalletType = Exclude<WalletType, never>;
4
- export type ExternalWalletType = Exclude<WalletType, never>;
5
- export type ExternalWalletInfo = {
6
- address: string;
7
- type: ExternalWalletType;
8
- provider?: string;
9
- addressBech32?: string;
10
- withFullParaAuth?: boolean;
3
+ import { RecoveryStatus } from './recovery.js';
4
+ import { Wallet } from './wallet.js';
5
+ type Device = {
6
+ sessionId: string;
7
+ encryptionKey: string;
11
8
  };
12
- export type VerifyExternalWallet = {
9
+ export type EmbeddedWalletType = Exclude<TWalletType, never>;
10
+ export type ExternalWalletType = Exclude<TWalletType, never>;
11
+ export type VerifyExternalWalletV1 = {
13
12
  address: string;
14
13
  signedMessage: string;
15
14
  cosmosPublicKeyHex?: string;
16
15
  cosmosSigner?: string;
17
16
  };
17
+ export type PortalUrlType = 'createAuth' | 'createPassword' | 'loginAuth' | 'loginPassword' | 'txReview' | 'onRamp' | 'telegramLogin';
18
18
  export type PortalUrlOptions = {
19
19
  params?: Record<string, string | undefined | null>;
20
- authType?: AuthType;
21
20
  isForNewDevice?: boolean;
22
- loginEncryptionPublicKey?: string;
23
- newDeviceSessionId?: string;
24
- newDeviceEncryptionKey?: string;
25
- partnerId?: string;
21
+ thisDevice?: Device;
22
+ newDevice?: Device;
26
23
  sessionId?: string;
27
- theme?: Theme;
24
+ portalTheme?: Theme;
28
25
  pathId?: string;
29
- displayName?: string;
30
- pfpUrl?: string;
26
+ shorten?: boolean;
27
+ isEmbedded?: boolean;
31
28
  };
32
- export type AuthExtras = {
29
+ export type WithAuthMethod = {
33
30
  /**
34
- * The current user's third-party username.
31
+ * Which authorization method to use for the URL, either `'passkey'` or `'passwprd'`.
35
32
  */
36
- username?: string;
33
+ authMethod?: Uppercase<AuthMethod>;
34
+ };
35
+ export type WithCustomTheme = {
37
36
  /**
38
- * The current user's third-party display name.
37
+ * The theme to apply to generated URLs, if different from your configured theme.
39
38
  */
40
- displayName?: string;
39
+ portalTheme?: Theme;
40
+ };
41
+ export type WithUseShortUrls = {
41
42
  /**
42
- * The current user's third-party profile picture URL.
43
+ * Whether to shorten generated URLs. This may correct any issues with generated QR codes. Defaults to `false`.
43
44
  */
44
- pfpUrl?: string;
45
+ useShortUrls?: boolean;
45
46
  };
46
- export type GetWebAuthUrlForLoginParams = {
47
+ export type WithShorten = {
47
48
  /**
48
- * The session ID for the URL.
49
+ * Whether to shorten the generated URL. This may correct any issues with generated QR codes. Defaults to `false`.
49
50
  */
50
- sessionId: string;
51
+ shorten?: boolean;
52
+ };
53
+ export type WithIsPasskeySupported = {
54
+ /**
55
+ * Whether the current device supports WebAuth passkeys.
56
+ */
57
+ isPasskeySupported: boolean;
58
+ };
59
+ export type PollParams = {
60
+ /**
61
+ * A callback function that will be invoked on each method poll.
62
+ */
63
+ onPoll?: () => void;
64
+ /**
65
+ * A callback function that will be invoked if the method call is canceled.
66
+ */
67
+ onCancel?: () => void;
68
+ };
69
+ export type FarcasterParams = PollParams & {
70
+ /**
71
+ * A function returning a boolean, indicating whether the Farcaster login process should be cancelled.
72
+ */
73
+ isCanceled?: () => boolean;
74
+ /**
75
+ * A callback function that will be invoked with the Farcaster Connect URI when it is available.
76
+ * You will need to display the URI as a QR code.
77
+ */
78
+ onConnectUri?: (uri: string) => void;
79
+ };
80
+ export type TelegramParams = {
81
+ /**
82
+ * The response received from the Telegram login bot.
83
+ */
84
+ telegramAuthResponse: TelegramAuthResponse;
85
+ };
86
+ export type LoginUrlParams = WithAuthMethod & WithCustomTheme & WithShorten & {
87
+ sessionId?: string;
88
+ };
89
+ export type NewCredentialUrlParams = WithAuthMethod & WithCustomTheme & WithShorten & {
90
+ /**
91
+ * Whether the URL is meant to add a passkey for a previous user on a new device. Defaults to `false`.
92
+ */
93
+ isForNewDevice?: boolean;
94
+ };
95
+ export type OAuthUrlParams = {
51
96
  /**
52
- * Either 'email' | 'phone' | 'farcaster' | 'telegram'
97
+ * The third-party OAuth service.
53
98
  */
54
- authType?: AuthType;
99
+ method: Exclude<TOAuthMethod, 'TELEGRAM' | 'FARCASTER'>;
55
100
  /**
56
- * The public key to use for encrypting the login encryption key.
101
+ * The app scheme to redirect to after OAuth is complete.
57
102
  */
58
- loginEncryptionPublicKey: string;
103
+ appScheme?: string;
104
+ };
105
+ export type OAuthParams = OAuthUrlParams & PollParams & {
59
106
  /**
60
- * The partner ID for the URL.
107
+ * A function returning a boolean, indicating whether the OAuth process should be cancelled.
61
108
  */
62
- partnerId?: string;
109
+ isCanceled?: () => boolean;
63
110
  /**
64
- * The session ID for the new device being registered.
111
+ * A callback function that will be invoked with the OAuth URL when it is available.
112
+ * For example, you can use this to open the URL in a new window or tab.
65
113
  */
66
- newDeviceSessionId?: string;
114
+ onOAuthUrl?: (url: string) => void;
115
+ };
116
+ export type AuthStateBaseParams = WithCustomTheme & WithUseShortUrls;
117
+ export type AuthStateVerify = ServerAuthStateVerify;
118
+ export type AuthStateLogin = Omit<ServerAuthStateLogin, 'loginAuthMethods'> & WithIsPasskeySupported & {
67
119
  /**
68
- * The public key for the new device being registered.
120
+ * A Para Portal URL for logging in via a WebAuth passkey. For best compatibility, you should open this URL in a new window or tab.
69
121
  */
70
- newDeviceEncryptionKey?: string;
122
+ passkeyUrl?: string;
71
123
  /**
72
- * The Telegram or Farcaster display name for the user.
124
+ * A Para Portal URL for authorizing a new device using a WebAuth passkey located elsewhere, to be visited using that other device.
73
125
  */
74
- displayName?: string;
126
+ passkeyKnownDeviceUrl?: string;
75
127
  /**
76
- * The Telegram or Farcaster URL for the user's profile picture.
128
+ * A Para Portal URL for logging in via a password.
77
129
  */
78
- pfpUrl?: string;
130
+ passwordUrl?: string;
131
+ };
132
+ export type AuthStateSignup = Omit<ServerAuthStateSignup, 'signupAuthMethods'> & WithIsPasskeySupported & {
133
+ /**
134
+ * A Para Portal URL for creating a new WebAuth passkey.
135
+ */
136
+ passkeyUrl?: string;
137
+ /**
138
+ * A Para Portal URL for creating a new user password.
139
+ */
140
+ passwordUrl?: string;
141
+ /**
142
+ * The Para system ID for the newly generated passkey.
143
+ */
144
+ passkeyId?: string;
145
+ /**
146
+ * The Para system ID for the newly generated password.
147
+ */
148
+ passwordId?: string;
149
+ };
150
+ export type AuthStateVerifyOrLogin = AuthStateVerify | AuthStateLogin;
151
+ export type AuthStateSignupOrLogin = AuthStateSignup | AuthStateLogin;
152
+ export type OAuthResponse = AuthStateSignupOrLogin;
153
+ export type AuthState = AuthStateVerify | AuthStateLogin | AuthStateSignup;
154
+ export type Verify2faParams = {
155
+ auth: VerifiedAuth;
156
+ verificationCode: string;
157
+ };
158
+ export type Verify2faResponse = {
159
+ /**
160
+ * When the 2FA verification code was sent.
161
+ */
162
+ initiatedAt?: Date;
163
+ /**
164
+ * The status for the 2FA process.
165
+ */
166
+ status?: RecoveryStatus;
167
+ /**
168
+ * The matched user ID.
169
+ */
170
+ userId: string;
171
+ /**
172
+ * The wallets protected by this 2FA instance.
173
+ */
174
+ wallets: Pick<Wallet, 'address' | 'id'>[];
79
175
  };
80
176
  export type CoreAuthInfo = PrimaryAuthInfo & AuthExtras;
177
+ export type StorageType = 'local' | 'session' | 'secure' | 'all';
178
+ export type GetWalletBalanceParams = {
179
+ walletId: string;
180
+ rpcUrl?: string;
181
+ };
182
+ export type GetWalletBalanceResponse = Promise<string | undefined>;
183
+ export {};
@@ -1,7 +1,7 @@
1
- import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, WalletType } from '@getpara/user-management-client';
1
+ import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
2
  export type ProviderAssetInfo = [string, Partial<Record<OnRampPurchaseType, boolean>>];
3
- export type OnRampAssetInfo = Record<WalletType, Partial<Record<Network, Partial<Record<OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>>>>>>;
4
- export type OnRampAssetInfoRow = [WalletType, Network, OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>];
3
+ export type OnRampAssetInfo = Record<TWalletType, Partial<Record<Network, Partial<Record<OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>>>>>>;
4
+ export type OnRampAssetInfoRow = [TWalletType, Network, OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>];
5
5
  export declare enum OnRampMethod {
6
6
  ACH = "ACH",
7
7
  DEBIT = "Debit",
@@ -1,5 +1,4 @@
1
- import { PartnerEntity, TPregenIdentifierType, WalletScheme } from '@getpara/user-management-client';
2
- import { EmbeddedWalletType, ExternalWalletType } from './methods.js';
1
+ import { EmbeddedWalletType, ExternalWalletType, PartnerEntity, TExternalWallet, TPregenIdentifierType, TWalletScheme } from '@getpara/user-management-client';
3
2
  export interface Wallet {
4
3
  createdAt?: string;
5
4
  id: string;
@@ -8,7 +7,7 @@ export interface Wallet {
8
7
  address?: string;
9
8
  addressSecondary?: string;
10
9
  publicKey?: string;
11
- scheme?: WalletScheme;
10
+ scheme?: TWalletScheme;
12
11
  type?: EmbeddedWalletType | ExternalWalletType;
13
12
  isPregen?: boolean;
14
13
  pregenIdentifier?: string;
@@ -21,6 +20,11 @@ export interface Wallet {
21
20
  lastUsedPartnerId?: string;
22
21
  isExternal?: boolean;
23
22
  isExternalWithParaAuth?: boolean;
23
+ externalProviderId?: TExternalWallet;
24
+ isExternalWithVerification?: boolean;
25
+ isExternalConnectionOnly?: boolean;
26
+ ensName?: string | null;
27
+ ensAvatar?: string | null;
24
28
  }
25
29
  /** @deprecated */
26
30
  export declare enum PregenIdentifierType {
@@ -38,4 +42,4 @@ export interface DeniedSignatureResWithUrl extends DeniedSignatureRes {
38
42
  }
39
43
  export type SignatureRes = SuccessfulSignatureRes | DeniedSignatureRes;
40
44
  export type FullSignatureRes = SuccessfulSignatureRes | DeniedSignatureResWithUrl;
41
- export type ExternalWalletConnectionType = 'NONE' | 'CONNECTION_ONLY' | 'AUTHENTICATED';
45
+ export type ExternalWalletConnectionType = 'NONE' | 'CONNECTION_ONLY' | 'AUTHENTICATED' | 'VERIFICATION';
@@ -1,4 +1,4 @@
1
- import { WalletTypeProp } from '../types/index.js';
1
+ import { TWalletType } from '@getpara/user-management-client';
2
2
  export type Hex = `0x${string}`;
3
3
  export interface Signature {
4
4
  r: Hex;
@@ -10,7 +10,10 @@ export declare function hexToSignature(hexSig: string): Signature;
10
10
  export declare function hexToUint8Array(hex: string): Uint8Array;
11
11
  export declare function hexToDecimal(hex: string): string;
12
12
  export declare function decimalToHex(decimal: string): Hex;
13
+ export declare function compressPubkey(pubkey: Uint8Array): Uint8Array;
14
+ export declare function rawSecp256k1PubkeyToRawAddress(pubkeyData: Uint8Array): Uint8Array;
13
15
  export declare function getCosmosAddress(publicKey: string, prefix: string): string;
14
- export declare function truncateAddress(str: string, addressType: WalletTypeProp, { prefix }?: {
16
+ export declare function truncateAddress(str: string, addressType: TWalletType, { prefix, targetLength, }?: {
15
17
  prefix?: string;
18
+ targetLength?: number;
16
19
  }): string;
@@ -6,5 +6,6 @@ export * from './listeners.js';
6
6
  export * from './onRamps.js';
7
7
  export * from './phone.js';
8
8
  export * from './polling.js';
9
+ export * from './types.js';
9
10
  export * from './url.js';
10
11
  export * from './wallet.js';
@@ -1,12 +1,19 @@
1
- import { Network, OnRampAsset, WalletType } from '@getpara/user-management-client';
1
+ import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
2
  import { OnRampAssetInfoRow, OnRampAssetInfo } from '../types/index.js';
3
3
  export declare function toAssetInfoArray(data: OnRampAssetInfo): OnRampAssetInfoRow[];
4
- export declare function getOnRampNetworks(data: OnRampAssetInfo, { walletType, allowed }?: {
5
- walletType?: WalletType;
4
+ export declare function getOnRampNetworks(data: OnRampAssetInfo, { walletType, allowed, assets, providers, action, }?: {
5
+ walletType?: TWalletType;
6
6
  allowed?: Network[];
7
+ assets?: OnRampAsset[];
8
+ providers?: OnRampProvider[];
9
+ action?: OnRampPurchaseType;
7
10
  }): Network[];
8
- export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, }?: {
9
- walletType?: WalletType;
11
+ export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, providers, action, }?: {
12
+ walletType?: TWalletType;
10
13
  network?: Network;
11
14
  allowed?: OnRampAsset[];
15
+ providers?: OnRampProvider[];
16
+ action?: OnRampPurchaseType;
12
17
  }): OnRampAsset[];
18
+ export declare const NETWORK_PREFIXES: Partial<Record<Network, string>>;
19
+ export declare function getNetworkPrefix(network: Network): string | undefined;
@@ -1,7 +1,11 @@
1
- export declare function formatPhoneNumber(phone: string | undefined, countryCode?: string | undefined, opts?: {
1
+ export declare function formatPhoneNumber(phone: string, countryCode?: string | undefined, opts?: {
2
2
  forDisplay: undefined | false;
3
3
  }): `+${number}` | null;
4
- export declare function formatPhoneNumber(phone: string | undefined, countryCode: string | undefined, opts: {
4
+ export declare function formatPhoneNumber(phone: string, countryCode: string | undefined, opts: {
5
5
  forDisplay: true;
6
6
  }): string | null;
7
7
  export declare function displayPhoneNumber(phone: string, countryCode?: string): string;
8
+ export declare function splitPhoneNumber(phone: `+${number}`): {
9
+ phone: string;
10
+ countryCode: string;
11
+ };
@@ -0,0 +1,2 @@
1
+ import { ServerAuthState } from '@getpara/user-management-client';
2
+ export declare function isServerAuthState(obj: ServerAuthState | Record<string, never>): obj is ServerAuthState;
@@ -1,4 +1,4 @@
1
- import { Environment } from '../types/index.js';
1
+ import { Ctx, Environment } from '../types/index.js';
2
2
  export declare function getPortalDomain(env: Environment, isE2E?: boolean): "localhost" | "app.sandbox.usecapsule.com" | "app.beta.usecapsule.com" | "app.usecapsule.com";
3
3
  export declare function getPortalBaseURL({ env, isE2E }: {
4
4
  env: Environment;
@@ -13,3 +13,4 @@ export declare function constructUrl({ base, path, params, }: {
13
13
  path: string;
14
14
  params?: Record<string, string | undefined | null>;
15
15
  }): string;
16
+ export declare function shortenUrl(ctx: Ctx, url: string): Promise<string>;
@@ -1,11 +1,13 @@
1
- import { SupportedWalletTypes, TPregenIdentifierType, WalletEntity, WalletScheme, WalletType } from '@getpara/user-management-client';
2
- import { Wallet, WalletTypeProp } from '../types/index.js';
3
- export declare const WalletSchemeTypeMap: Record<WalletScheme, Partial<Record<WalletType, true>>>;
1
+ import { CurrentWalletIds, SupportedWalletTypes, TPregenIdentifierType, WalletEntity, TWalletScheme, TWalletType } from '@getpara/user-management-client';
2
+ import { Wallet } from '../types/index.js';
3
+ export declare const WalletSchemeTypeMap: Record<TWalletScheme, Partial<Record<TWalletType, true>>>;
4
4
  export declare function isPregenIdentifierMatch(a: string | null | undefined, b: string | null | undefined, type: TPregenIdentifierType): boolean;
5
- export declare function isWalletSupported(types: WalletType[], wallet: Omit<Wallet, 'signer'>): boolean;
6
- export declare function getSchemes(types: WalletTypeProp[] | SupportedWalletTypes): WalletScheme[];
7
- export declare function getWalletTypes(schemes: WalletScheme[]): WalletType[];
8
- export declare function getEquivalentTypes(types: WalletTypeProp[] | WalletTypeProp): WalletType[];
5
+ export declare function isWalletSupported(types: TWalletType[], wallet: Omit<Wallet, 'signer'>): boolean;
6
+ export declare function getSchemes(types: TWalletType[] | SupportedWalletTypes): TWalletScheme[];
7
+ export declare function getWalletTypes(schemes: TWalletScheme[]): TWalletType[];
8
+ export declare function getEquivalentTypes(types: TWalletType[] | TWalletType): TWalletType[];
9
9
  export declare function entityToWallet(w: WalletEntity): Omit<Wallet, 'signer'>;
10
10
  export declare function migrateWallet(obj: Record<string, unknown>): Wallet;
11
11
  export declare function supportedWalletTypesEq(a: SupportedWalletTypes, b: SupportedWalletTypes): boolean;
12
+ export declare function mergeCurrentWalletIds(original: CurrentWalletIds, additional: CurrentWalletIds): CurrentWalletIds;
13
+ export declare function newUuid(): string;
package/package.json CHANGED
@@ -1,38 +1,21 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-dev.0",
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-dev.2",
9
4
  "dependencies": {
10
- "@celo/utils": "^8.0.0",
5
+ "@celo/utils": "^8.0.2",
11
6
  "@cosmjs/encoding": "^0.32.4",
12
- "@getpara/user-management-client": "2.0.0-dev.0",
7
+ "@ethereumjs/util": "^9.1.0",
8
+ "@getpara/user-management-client": "2.0.0-dev.2",
13
9
  "@noble/hashes": "^1.5.0",
14
10
  "base64url": "^3.0.1",
15
- "ethereumjs-util": "7.1.5",
16
- "libphonenumber-js": "1.11.2",
11
+ "libphonenumber-js": "^1.11.7",
17
12
  "node-forge": "^1.3.1",
18
- "qs": "^6.12.0"
19
- },
20
- "scripts": {
21
- "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types && yarn post-build",
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"
13
+ "uuid": "^11.1.0"
28
14
  },
29
15
  "devDependencies": {
30
- "typescript": "5.1.6"
16
+ "@faker-js/faker": "^9.5.1",
17
+ "typescript": "^5.8.3"
31
18
  },
32
- "files": [
33
- "dist",
34
- "package.json"
35
- ],
36
19
  "exports": {
37
20
  ".": {
38
21
  "types": "./dist/types/index.d.ts",
@@ -40,5 +23,23 @@
40
23
  "require": "./dist/cjs/index.js"
41
24
  }
42
25
  },
43
- "gitHead": "f94ef031ef0e1894f5f0800e55f6ca2904641780"
26
+ "files": [
27
+ "dist",
28
+ "package.json"
29
+ ],
30
+ "gitHead": "77d818539daa181c839a40f0ad5362af4058844e",
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"
44
45
  }
Binary file
Binary file
Binary file
Binary file