@getpara/core-sdk 2.0.0-alpha.3 → 2.0.0-alpha.6
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/cjs/ParaCore.js +3028 -0
- package/dist/cjs/PlatformUtils.js +15 -0
- package/dist/cjs/StorageUtils.js +15 -0
- package/dist/cjs/constants.js +84 -0
- package/dist/cjs/cryptography/utils.js +350 -0
- package/dist/cjs/errors.js +51 -0
- package/dist/cjs/external/mpcComputationClient.js +62 -0
- package/dist/cjs/external/userManagementClient.js +106 -0
- package/dist/cjs/index.js +85 -4001
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/shares/KeyContainer.js +89 -0
- package/dist/cjs/shares/recovery.js +127 -0
- package/dist/cjs/shares/shareDistribution.js +104 -0
- package/dist/cjs/transmission/transmissionUtils.js +93 -0
- package/dist/cjs/types/config.js +43 -0
- package/dist/cjs/types/coreApi.js +74 -0
- package/dist/cjs/types/events.js +41 -0
- package/dist/cjs/types/index.js +52 -0
- package/dist/cjs/types/methods.js +15 -0
- package/dist/cjs/types/onRamps.js +33 -0
- package/dist/cjs/types/popup.js +35 -0
- package/dist/cjs/types/recovery.js +34 -0
- package/dist/cjs/types/theme.js +15 -0
- package/dist/cjs/types/wallet.js +31 -0
- package/dist/cjs/utils/autobind.js +41 -0
- package/dist/cjs/utils/events.js +45 -0
- package/dist/cjs/utils/formatting.js +112 -0
- package/dist/cjs/utils/index.js +41 -0
- package/dist/cjs/utils/json.js +37 -0
- package/dist/cjs/utils/listeners.js +71 -0
- package/dist/cjs/utils/onRamps.js +92 -0
- package/dist/cjs/utils/phone.js +73 -0
- package/dist/cjs/utils/polling.js +58 -0
- package/dist/cjs/utils/types.js +29 -0
- package/dist/cjs/utils/url.js +135 -0
- package/dist/cjs/utils/wallet.js +159 -0
- package/dist/esm/ParaCore.js +2990 -0
- package/dist/esm/PlatformUtils.js +0 -0
- package/dist/esm/StorageUtils.js +0 -0
- package/dist/esm/chunk-7B52C2XE.js +70 -0
- package/dist/esm/constants.js +43 -0
- package/dist/esm/cryptography/utils.js +282 -0
- package/dist/esm/errors.js +27 -0
- package/dist/esm/external/mpcComputationClient.js +30 -0
- package/dist/esm/external/userManagementClient.js +71 -0
- package/dist/esm/index.js +58 -3965
- package/dist/esm/package.json +4 -0
- package/dist/esm/shares/KeyContainer.js +57 -0
- package/dist/esm/shares/recovery.js +74 -0
- package/dist/esm/shares/shareDistribution.js +64 -0
- package/dist/esm/transmission/transmissionUtils.js +42 -0
- package/dist/esm/types/config.js +20 -0
- package/dist/esm/types/coreApi.js +52 -0
- package/dist/esm/types/events.js +19 -0
- package/dist/esm/types/index.js +22 -0
- package/dist/esm/types/methods.js +0 -0
- package/dist/esm/types/onRamps.js +11 -0
- package/dist/esm/types/popup.js +13 -0
- package/dist/esm/types/recovery.js +12 -0
- package/dist/esm/types/theme.js +0 -0
- package/dist/esm/types/wallet.js +9 -0
- package/dist/esm/utils/autobind.js +19 -0
- package/dist/esm/utils/events.js +11 -0
- package/dist/esm/utils/formatting.js +74 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/json.js +15 -0
- package/dist/esm/utils/listeners.js +38 -0
- package/dist/esm/utils/onRamps.js +66 -0
- package/dist/esm/utils/phone.js +39 -0
- package/dist/esm/utils/polling.js +18 -0
- package/dist/esm/utils/types.js +7 -0
- package/dist/esm/utils/url.js +90 -0
- package/dist/esm/utils/wallet.js +103 -0
- package/dist/types/ParaCore.d.ts +157 -126
- package/dist/types/PlatformUtils.d.ts +4 -3
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/types/config.d.ts +4 -5
- package/dist/types/types/coreApi.d.ts +47 -9
- package/dist/types/types/events.d.ts +4 -1
- package/dist/types/types/methods.d.ts +9 -4
- package/dist/types/types/onRamps.d.ts +3 -3
- package/dist/types/types/wallet.d.ts +4 -2
- package/dist/types/utils/formatting.d.ts +3 -2
- package/dist/types/utils/onRamps.d.ts +12 -5
- package/dist/types/utils/phone.d.ts +4 -0
- package/dist/types/utils/wallet.d.ts +8 -7
- package/package.json +7 -7
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BackupKitEmailProps, CurrentWalletIds, ExternalWalletInfo, OnRampPurchase, OnRampPurchaseCreateParams, PregenAuth, Setup2faResponse, TelegramAuthResponse, VerifiedAuth, VerifyExternalWalletParams, WalletEntity, WalletParams,
|
|
2
|
-
import { AuthStateLogin, AuthStateVerify, OAuthResponse, AuthStateBaseParams, WithCustomTheme, WithUseShortUrls, Verify2faResponse, AuthStateSignup, AuthStateVerifyOrLogin, OAuthUrlParams, StorageType, PollParams } from './methods.js';
|
|
1
|
+
import { BackupKitEmailProps, CurrentWalletIds, ExternalWalletInfo, OnRampPurchase, OnRampPurchaseCreateParams, PregenAuth, Setup2faResponse, TelegramAuthResponse, VerifiedAuth, VerifyExternalWalletParams, WalletEntity, WalletParams, TWalletType } from '@getpara/user-management-client';
|
|
2
|
+
import { AuthStateLogin, AuthStateVerify, OAuthResponse, AuthStateBaseParams, WithCustomTheme, WithUseShortUrls, Verify2faResponse, AuthStateSignup, AuthStateVerifyOrLogin, OAuthUrlParams, StorageType, PollParams, CoreAuthInfo, GetWalletBalanceParams, GetWalletBalanceResponse } from './methods.js';
|
|
3
3
|
import { ParaCore } from '../ParaCore.js';
|
|
4
4
|
import { FullSignatureRes, Wallet } from './wallet.js';
|
|
5
|
-
export declare const PARA_CORE_METHODS: readonly ["signUpOrLogIn", "verifyNewAccount", "waitForLogin", "waitForSignup", "waitForWalletCreation", "verifyOAuth", "verifyFarcaster", "verifyTelegram", "resendVerificationCode", "loginExternalWallet", "verifyExternalWallet", "setup2fa", "enable2fa", "verify2fa", "logout", "clearStorage", "isSessionActive", "isFullyLoggedIn", "refreshSession", "keepSessionAlive", "exportSession", "importSession", "getVerificationToken", "fetchWallets", "createWallet", "createWalletPerType", "getPregenWallets", "hasPregenWallet", "updatePregenWalletIdentifier", "createPregenWallet", "createPregenWalletPerType", "claimPregenWallets", "distributeNewWalletShare", "getUserShare", "setUserShare", "refreshShare", "signMessage", "signTransaction", "initiateOnRampTransaction"];
|
|
5
|
+
export declare const PARA_CORE_METHODS: readonly ["getAuthInfo", "signUpOrLogIn", "verifyNewAccount", "waitForLogin", "waitForSignup", "waitForWalletCreation", "getOAuthUrl", "verifyOAuth", "getFarcasterConnectUri", "verifyFarcaster", "verifyTelegram", "resendVerificationCode", "loginExternalWallet", "verifyExternalWallet", "setup2fa", "enable2fa", "verify2fa", "logout", "clearStorage", "isSessionActive", "isFullyLoggedIn", "refreshSession", "keepSessionAlive", "exportSession", "importSession", "getVerificationToken", "getWallets", "getWalletsByType", "fetchWallets", "createWallet", "createWalletPerType", "getPregenWallets", "hasPregenWallet", "updatePregenWalletIdentifier", "createPregenWallet", "createPregenWalletPerType", "claimPregenWallets", "createGuestWallets", "distributeNewWalletShare", "getUserShare", "setUserShare", "refreshShare", "signMessage", "signTransaction", "initiateOnRampTransaction", "getWalletBalance"];
|
|
6
6
|
export type CoreMethodName = (typeof PARA_CORE_METHODS)[number];
|
|
7
7
|
export type CoreMethodParams<method extends CoreMethodName & keyof CoreMethods> = CoreMethods[method] extends {
|
|
8
8
|
params: infer P;
|
|
@@ -19,6 +19,11 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
19
19
|
response?: unknown;
|
|
20
20
|
sync?: true;
|
|
21
21
|
}> & {
|
|
22
|
+
getAuthInfo: {
|
|
23
|
+
params: void;
|
|
24
|
+
response: CoreAuthInfo | undefined;
|
|
25
|
+
sync: true;
|
|
26
|
+
};
|
|
22
27
|
signUpOrLogIn: {
|
|
23
28
|
params: WithCustomTheme & WithUseShortUrls & {
|
|
24
29
|
/**
|
|
@@ -86,6 +91,12 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
86
91
|
recoverySecret?: string;
|
|
87
92
|
};
|
|
88
93
|
};
|
|
94
|
+
getOAuthUrl: {
|
|
95
|
+
params: OAuthUrlParams & {
|
|
96
|
+
sessionLookupId?: string;
|
|
97
|
+
};
|
|
98
|
+
response: string;
|
|
99
|
+
};
|
|
89
100
|
verifyOAuth: {
|
|
90
101
|
params: AuthStateBaseParams & OAuthUrlParams & PollParams & {
|
|
91
102
|
/**
|
|
@@ -100,6 +111,10 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
100
111
|
};
|
|
101
112
|
response: OAuthResponse;
|
|
102
113
|
};
|
|
114
|
+
getFarcasterConnectUri: {
|
|
115
|
+
params: void;
|
|
116
|
+
response: string;
|
|
117
|
+
};
|
|
103
118
|
verifyFarcaster: {
|
|
104
119
|
params: AuthStateBaseParams & PollParams & {
|
|
105
120
|
/**
|
|
@@ -110,7 +125,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
110
125
|
* A callback function that will be invoked with the Farcaster Connect URI when it is available.
|
|
111
126
|
* You will need to display the URI as a QR code.
|
|
112
127
|
*/
|
|
113
|
-
onConnectUri
|
|
128
|
+
onConnectUri?: (uri: string) => void;
|
|
114
129
|
};
|
|
115
130
|
response: OAuthResponse;
|
|
116
131
|
};
|
|
@@ -172,7 +187,12 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
172
187
|
response: boolean;
|
|
173
188
|
};
|
|
174
189
|
exportSession: {
|
|
175
|
-
params:
|
|
190
|
+
params: {
|
|
191
|
+
/**
|
|
192
|
+
* Whether to exclude the wallet signers from the exported session.
|
|
193
|
+
*/
|
|
194
|
+
excludeSigners?: boolean;
|
|
195
|
+
};
|
|
176
196
|
response: string;
|
|
177
197
|
sync: true;
|
|
178
198
|
};
|
|
@@ -210,13 +230,23 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
210
230
|
};
|
|
211
231
|
response: Verify2faResponse;
|
|
212
232
|
};
|
|
233
|
+
getWallets: {
|
|
234
|
+
params: void;
|
|
235
|
+
response: Record<string, Wallet>;
|
|
236
|
+
sync: true;
|
|
237
|
+
};
|
|
238
|
+
getWalletsByType: {
|
|
239
|
+
params: TWalletType;
|
|
240
|
+
response: Wallet[];
|
|
241
|
+
sync: true;
|
|
242
|
+
};
|
|
213
243
|
fetchWallets: {
|
|
214
244
|
params: void;
|
|
215
245
|
response: WalletEntity[];
|
|
216
246
|
};
|
|
217
247
|
createWallet: {
|
|
218
248
|
params: {
|
|
219
|
-
type?: Uppercase<
|
|
249
|
+
type?: Uppercase<TWalletType>;
|
|
220
250
|
skipDistribute?: boolean;
|
|
221
251
|
};
|
|
222
252
|
response: [Wallet, string | undefined];
|
|
@@ -226,7 +256,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
226
256
|
/**
|
|
227
257
|
* Array of the wallet types to create
|
|
228
258
|
*/
|
|
229
|
-
types?: Uppercase<
|
|
259
|
+
types?: Uppercase<TWalletType>[];
|
|
230
260
|
/**
|
|
231
261
|
* If `true`, skip distributing the new wallets shares.
|
|
232
262
|
*/
|
|
@@ -283,7 +313,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
283
313
|
/**
|
|
284
314
|
* The type of wallet to create, 'EVM' | 'SOLANA' | 'COSMOS'
|
|
285
315
|
*/
|
|
286
|
-
type:
|
|
316
|
+
type: TWalletType;
|
|
287
317
|
/**
|
|
288
318
|
* The pregen identifier for the wallet, in the form: `{ email: string } | { phone: string } | { telegramUserId: string } | { farcasterUsername: string } | { xUsername: string } | { discordUsername: string } | { customId: string }`
|
|
289
319
|
*/
|
|
@@ -296,7 +326,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
296
326
|
/**
|
|
297
327
|
* The wallet types to create. If not provided, defaults to your application's `supportedWalletTypes` setting.
|
|
298
328
|
*/
|
|
299
|
-
types?:
|
|
329
|
+
types?: TWalletType[];
|
|
300
330
|
/**
|
|
301
331
|
* The pregen identifier for the wallets, in the form: `{ email: string } | { phone: string } | { telegramUserId: string } | { farcasterUsername: string } | { xUsername: string } | { discordUsername: string } | { customId: string }`
|
|
302
332
|
*/
|
|
@@ -313,6 +343,10 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
313
343
|
};
|
|
314
344
|
response: string | undefined;
|
|
315
345
|
};
|
|
346
|
+
createGuestWallets: {
|
|
347
|
+
params: void;
|
|
348
|
+
response: Wallet[];
|
|
349
|
+
};
|
|
316
350
|
distributeNewWalletShare: {
|
|
317
351
|
params: {
|
|
318
352
|
/**
|
|
@@ -431,6 +465,10 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
431
465
|
portalUrl: string;
|
|
432
466
|
};
|
|
433
467
|
};
|
|
468
|
+
getWalletBalance: {
|
|
469
|
+
params: GetWalletBalanceParams;
|
|
470
|
+
response: GetWalletBalanceResponse;
|
|
471
|
+
};
|
|
434
472
|
};
|
|
435
473
|
export type CoreInterface = {
|
|
436
474
|
[key in keyof CoreMethods]: CoreMethod<key>;
|
|
@@ -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,4 @@
|
|
|
1
|
-
import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras,
|
|
1
|
+
import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, TOAuthMethod, TWalletType } from '@getpara/user-management-client';
|
|
2
2
|
import { Theme } from './theme.js';
|
|
3
3
|
import { RecoveryStatus } from './recovery.js';
|
|
4
4
|
import { Wallet } from './wallet.js';
|
|
@@ -6,8 +6,8 @@ type Device = {
|
|
|
6
6
|
sessionId: string;
|
|
7
7
|
encryptionKey: string;
|
|
8
8
|
};
|
|
9
|
-
export type EmbeddedWalletType = Exclude<
|
|
10
|
-
export type ExternalWalletType = Exclude<
|
|
9
|
+
export type EmbeddedWalletType = Exclude<TWalletType, never>;
|
|
10
|
+
export type ExternalWalletType = Exclude<TWalletType, never>;
|
|
11
11
|
export type VerifyExternalWalletV1 = {
|
|
12
12
|
address: string;
|
|
13
13
|
signedMessage: string;
|
|
@@ -72,7 +72,7 @@ export type OAuthUrlParams = {
|
|
|
72
72
|
/**
|
|
73
73
|
* The third-party OAuth service.
|
|
74
74
|
*/
|
|
75
|
-
method: Exclude<
|
|
75
|
+
method: Exclude<TOAuthMethod, 'TELEGRAM' | 'FARCASTER'>;
|
|
76
76
|
/**
|
|
77
77
|
* The deeplink URL to redirect to after OAuth is complete.
|
|
78
78
|
*/
|
|
@@ -140,4 +140,9 @@ export type Verify2faResponse = {
|
|
|
140
140
|
};
|
|
141
141
|
export type CoreAuthInfo = PrimaryAuthInfo & AuthExtras;
|
|
142
142
|
export type StorageType = 'local' | 'session' | 'secure' | 'all';
|
|
143
|
+
export type GetWalletBalanceParams = {
|
|
144
|
+
walletId: string;
|
|
145
|
+
rpcUrl?: string;
|
|
146
|
+
};
|
|
147
|
+
export type GetWalletBalanceResponse = Promise<string | undefined>;
|
|
143
148
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType,
|
|
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<
|
|
4
|
-
export type OnRampAssetInfoRow = [
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { EmbeddedWalletType, ExternalWalletType, PartnerEntity, TPregenIdentifierType,
|
|
1
|
+
import { EmbeddedWalletType, ExternalWalletType, PartnerEntity, TPregenIdentifierType, TWalletScheme } from '@getpara/user-management-client';
|
|
2
2
|
export interface Wallet {
|
|
3
3
|
createdAt?: string;
|
|
4
4
|
id: string;
|
|
@@ -7,7 +7,7 @@ export interface Wallet {
|
|
|
7
7
|
address?: string;
|
|
8
8
|
addressSecondary?: string;
|
|
9
9
|
publicKey?: string;
|
|
10
|
-
scheme?:
|
|
10
|
+
scheme?: TWalletScheme;
|
|
11
11
|
type?: EmbeddedWalletType | ExternalWalletType;
|
|
12
12
|
isPregen?: boolean;
|
|
13
13
|
pregenIdentifier?: string;
|
|
@@ -20,6 +20,8 @@ export interface Wallet {
|
|
|
20
20
|
lastUsedPartnerId?: string;
|
|
21
21
|
isExternal?: boolean;
|
|
22
22
|
isExternalWithParaAuth?: boolean;
|
|
23
|
+
ensName?: string | null;
|
|
24
|
+
ensAvatar?: string | null;
|
|
23
25
|
}
|
|
24
26
|
/** @deprecated */
|
|
25
27
|
export declare enum PregenIdentifierType {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TWalletType } from '@getpara/user-management-client';
|
|
2
2
|
export type Hex = `0x${string}`;
|
|
3
3
|
export interface Signature {
|
|
4
4
|
r: Hex;
|
|
@@ -11,6 +11,7 @@ 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
13
|
export declare function getCosmosAddress(publicKey: string, prefix: string): string;
|
|
14
|
-
export declare function truncateAddress(str: string, addressType:
|
|
14
|
+
export declare function truncateAddress(str: string, addressType: TWalletType, { prefix, targetLength, }?: {
|
|
15
15
|
prefix?: string;
|
|
16
|
+
targetLength?: number;
|
|
16
17
|
}): string;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { Network, OnRampAsset,
|
|
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?:
|
|
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?:
|
|
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;
|
|
@@ -5,3 +5,7 @@ export declare function formatPhoneNumber(phone: string, countryCode: string | u
|
|
|
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
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { CurrentWalletIds, SupportedWalletTypes, TPregenIdentifierType, WalletEntity,
|
|
2
|
-
import { Wallet
|
|
3
|
-
export declare const WalletSchemeTypeMap: Record<
|
|
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:
|
|
6
|
-
export declare function getSchemes(types:
|
|
7
|
-
export declare function getWalletTypes(schemes:
|
|
8
|
-
export declare function getEquivalentTypes(types:
|
|
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
12
|
export declare function mergeCurrentWalletIds(original: CurrentWalletIds, additional: CurrentWalletIds): CurrentWalletIds;
|
|
13
|
+
export declare function newUuid(): string;
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
7
|
"typings": "dist/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@celo/utils": "^8.0.
|
|
10
|
+
"@celo/utils": "^8.0.2",
|
|
11
11
|
"@cosmjs/encoding": "^0.32.4",
|
|
12
|
-
"@
|
|
12
|
+
"@ethereumjs/util": "^9.1.0",
|
|
13
|
+
"@getpara/user-management-client": "2.0.0-alpha.6",
|
|
13
14
|
"@noble/hashes": "^1.5.0",
|
|
14
15
|
"base64url": "^3.0.1",
|
|
15
|
-
"ethereumjs-util": "7.1.5",
|
|
16
16
|
"libphonenumber-js": "1.11.2",
|
|
17
17
|
"node-forge": "^1.3.1",
|
|
18
|
-
"
|
|
18
|
+
"uuid": "^11.1.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types
|
|
21
|
+
"build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
|
|
22
22
|
"old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
|
|
23
23
|
"post-build": "./scripts/set-version.sh",
|
|
24
24
|
"build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"require": "./dist/cjs/index.js"
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d3b01a8fb475c2af9bf255800bc10d05e011b2eb"
|
|
45
45
|
}
|
package/dist/cjs/index.js.br
DELETED
|
Binary file
|
package/dist/cjs/index.js.gz
DELETED
|
Binary file
|
package/dist/esm/index.js.br
DELETED
|
Binary file
|
package/dist/esm/index.js.gz
DELETED
|
Binary file
|