@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.
- package/dist/cjs/ParaCore.js +3378 -0
- package/dist/cjs/PlatformUtils.js +15 -0
- package/dist/cjs/StorageUtils.js +15 -0
- package/dist/cjs/constants.js +87 -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 +102 -4080
- 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/auth.js +33 -0
- package/dist/cjs/types/config.js +43 -0
- package/dist/cjs/types/coreApi.js +89 -0
- package/dist/cjs/types/events.js +41 -0
- package/dist/cjs/types/index.js +54 -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 +116 -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 +3343 -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 +45 -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 +78 -4049
- 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/auth.js +11 -0
- package/dist/esm/types/config.js +20 -0
- package/dist/esm/types/coreApi.js +66 -0
- package/dist/esm/types/events.js +19 -0
- package/dist/esm/types/index.js +23 -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 +76 -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 +140 -367
- package/dist/types/PlatformUtils.d.ts +4 -5
- package/dist/types/constants.d.ts +17 -13
- package/dist/types/index.d.ts +5 -4
- package/dist/types/shares/KeyContainer.d.ts +0 -2
- package/dist/types/types/auth.d.ts +16 -0
- package/dist/types/types/config.d.ts +12 -5
- package/dist/types/types/coreApi.d.ts +531 -0
- package/dist/types/types/events.d.ts +4 -1
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/methods.d.ts +145 -42
- package/dist/types/types/onRamps.d.ts +3 -3
- package/dist/types/types/wallet.d.ts +8 -4
- package/dist/types/utils/formatting.d.ts +5 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/onRamps.d.ts +12 -5
- package/dist/types/utils/phone.d.ts +6 -2
- package/dist/types/utils/types.d.ts +2 -0
- package/dist/types/utils/url.d.ts +2 -1
- package/dist/types/utils/wallet.d.ts +9 -7
- package/package.json +27 -26
- 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,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,80 +1,183 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
newDeviceEncryptionKey?: string;
|
|
25
|
-
partnerId?: string;
|
|
21
|
+
thisDevice?: Device;
|
|
22
|
+
newDevice?: Device;
|
|
26
23
|
sessionId?: string;
|
|
27
|
-
|
|
24
|
+
portalTheme?: Theme;
|
|
28
25
|
pathId?: string;
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
shorten?: boolean;
|
|
27
|
+
isEmbedded?: boolean;
|
|
31
28
|
};
|
|
32
|
-
export type
|
|
29
|
+
export type WithAuthMethod = {
|
|
33
30
|
/**
|
|
34
|
-
*
|
|
31
|
+
* Which authorization method to use for the URL, either `'passkey'` or `'passwprd'`.
|
|
35
32
|
*/
|
|
36
|
-
|
|
33
|
+
authMethod?: Uppercase<AuthMethod>;
|
|
34
|
+
};
|
|
35
|
+
export type WithCustomTheme = {
|
|
37
36
|
/**
|
|
38
|
-
* The
|
|
37
|
+
* The theme to apply to generated URLs, if different from your configured theme.
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
portalTheme?: Theme;
|
|
40
|
+
};
|
|
41
|
+
export type WithUseShortUrls = {
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
+
* Whether to shorten generated URLs. This may correct any issues with generated QR codes. Defaults to `false`.
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
useShortUrls?: boolean;
|
|
45
46
|
};
|
|
46
|
-
export type
|
|
47
|
+
export type WithShorten = {
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
+
* Whether to shorten the generated URL. This may correct any issues with generated QR codes. Defaults to `false`.
|
|
49
50
|
*/
|
|
50
|
-
|
|
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
|
-
*
|
|
97
|
+
* The third-party OAuth service.
|
|
53
98
|
*/
|
|
54
|
-
|
|
99
|
+
method: Exclude<TOAuthMethod, 'TELEGRAM' | 'FARCASTER'>;
|
|
55
100
|
/**
|
|
56
|
-
* The
|
|
101
|
+
* The app scheme to redirect to after OAuth is complete.
|
|
57
102
|
*/
|
|
58
|
-
|
|
103
|
+
appScheme?: string;
|
|
104
|
+
};
|
|
105
|
+
export type OAuthParams = OAuthUrlParams & PollParams & {
|
|
59
106
|
/**
|
|
60
|
-
*
|
|
107
|
+
* A function returning a boolean, indicating whether the OAuth process should be cancelled.
|
|
61
108
|
*/
|
|
62
|
-
|
|
109
|
+
isCanceled?: () => boolean;
|
|
63
110
|
/**
|
|
64
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
122
|
+
passkeyUrl?: string;
|
|
71
123
|
/**
|
|
72
|
-
*
|
|
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
|
-
|
|
126
|
+
passkeyKnownDeviceUrl?: string;
|
|
75
127
|
/**
|
|
76
|
-
*
|
|
128
|
+
* A Para Portal URL for logging in via a password.
|
|
77
129
|
*/
|
|
78
|
-
|
|
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,
|
|
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,5 +1,4 @@
|
|
|
1
|
-
import { PartnerEntity, TPregenIdentifierType,
|
|
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?:
|
|
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 {
|
|
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:
|
|
16
|
+
export declare function truncateAddress(str: string, addressType: TWalletType, { prefix, targetLength, }?: {
|
|
15
17
|
prefix?: string;
|
|
18
|
+
targetLength?: number;
|
|
16
19
|
}): 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;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare function formatPhoneNumber(phone: string
|
|
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
|
|
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
|
+
};
|
|
@@ -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,
|
|
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
|
+
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.
|
|
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.
|
|
5
|
+
"@celo/utils": "^8.0.2",
|
|
11
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
12
|
-
"@
|
|
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
|
-
"
|
|
16
|
-
"libphonenumber-js": "1.11.2",
|
|
11
|
+
"libphonenumber-js": "^1.11.7",
|
|
17
12
|
"node-forge": "^1.3.1",
|
|
18
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
}
|
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
|