@getpara/core-sdk 2.0.0-alpha.71 → 2.0.0-alpha.73
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 +12 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/shares/enclave.js +21 -0
- package/dist/esm/ParaCore.js +12 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/shares/enclave.js +21 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shares/enclave.d.ts +2 -0
- package/package.json +3 -3
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -1644,6 +1644,17 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
1644
1644
|
"uri"
|
|
1645
1645
|
]);
|
|
1646
1646
|
const externalWallets = Array.isArray(externalWallet) ? externalWallet : [externalWallet];
|
|
1647
|
+
try {
|
|
1648
|
+
yield this.ctx.client.trackExternalWalletConnections({
|
|
1649
|
+
wallets: externalWallets.map((wallet) => ({
|
|
1650
|
+
address: wallet.address,
|
|
1651
|
+
type: wallet.type,
|
|
1652
|
+
provider: wallet.provider
|
|
1653
|
+
}))
|
|
1654
|
+
});
|
|
1655
|
+
} catch (err) {
|
|
1656
|
+
console.error("Error tracking external wallet connections:", err);
|
|
1657
|
+
}
|
|
1647
1658
|
if (this.externalWalletConnectionOnly || externalWallets.every((wallet) => wallet.isConnectionOnly)) {
|
|
1648
1659
|
yield this.addExternalWallets(
|
|
1649
1660
|
externalWallets.map((wallet) => __spreadProps(__spreadValues({}, wallet), {
|
|
@@ -3578,7 +3589,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3578
3589
|
return __async(this, arguments, function* ({ config, refetch = false } = {}) {
|
|
3579
3590
|
const { balance } = yield this.ctx.client.getProfileBalance({
|
|
3580
3591
|
config,
|
|
3581
|
-
wallets: this.availableWallets.map(({ type, address }) => ({ type, address })),
|
|
3592
|
+
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS").map(({ type, address }) => ({ type, address })),
|
|
3582
3593
|
refetch
|
|
3583
3594
|
});
|
|
3584
3595
|
return balance;
|
package/dist/cjs/constants.js
CHANGED
|
@@ -43,7 +43,7 @@ __export(constants_exports, {
|
|
|
43
43
|
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
44
44
|
});
|
|
45
45
|
module.exports = __toCommonJS(constants_exports);
|
|
46
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
46
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.73";
|
|
47
47
|
const PREFIX = "@CAPSULE/";
|
|
48
48
|
const PARA_PREFIX = "@PARA/";
|
|
49
49
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -247,6 +247,20 @@ ${exportedAsBase64}
|
|
|
247
247
|
return decryptedData.shares;
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
+
deleteShares() {
|
|
251
|
+
return __async(this, null, function* () {
|
|
252
|
+
yield this.issueEnclaveJwt();
|
|
253
|
+
const frontendKeyPair = yield this.generateFrontendKeyPair();
|
|
254
|
+
const responsePublicKeyPEM = yield this.exportPublicKeyToPEM(frontendKeyPair.publicKey);
|
|
255
|
+
const payload = {
|
|
256
|
+
responsePublicKey: responsePublicKeyPEM,
|
|
257
|
+
jwt: this.retrieveJwt()
|
|
258
|
+
};
|
|
259
|
+
const encryptedPayload = yield this.encryptForEnclave(JSON.stringify(payload));
|
|
260
|
+
const encryptedPayloadStr = JSON.stringify(encryptedPayload);
|
|
261
|
+
yield this.userManagementClient.deleteEnclaveShares(encryptedPayloadStr);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
250
264
|
retrieveSharesWithRetry(query) {
|
|
251
265
|
return __async(this, null, function* () {
|
|
252
266
|
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
@@ -259,6 +273,13 @@ ${exportedAsBase64}
|
|
|
259
273
|
return yield this.persistShares(shares);
|
|
260
274
|
});
|
|
261
275
|
}
|
|
276
|
+
deleteSharesWithRetry() {
|
|
277
|
+
return __async(this, null, function* () {
|
|
278
|
+
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
279
|
+
return this.deleteShares();
|
|
280
|
+
}));
|
|
281
|
+
});
|
|
282
|
+
}
|
|
262
283
|
}
|
|
263
284
|
// Annotate the CommonJS export names for ESM import in node:
|
|
264
285
|
0 && (module.exports = {
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -1610,6 +1610,17 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
1610
1610
|
"uri"
|
|
1611
1611
|
]);
|
|
1612
1612
|
const externalWallets = Array.isArray(externalWallet) ? externalWallet : [externalWallet];
|
|
1613
|
+
try {
|
|
1614
|
+
yield this.ctx.client.trackExternalWalletConnections({
|
|
1615
|
+
wallets: externalWallets.map((wallet) => ({
|
|
1616
|
+
address: wallet.address,
|
|
1617
|
+
type: wallet.type,
|
|
1618
|
+
provider: wallet.provider
|
|
1619
|
+
}))
|
|
1620
|
+
});
|
|
1621
|
+
} catch (err) {
|
|
1622
|
+
console.error("Error tracking external wallet connections:", err);
|
|
1623
|
+
}
|
|
1613
1624
|
if (this.externalWalletConnectionOnly || externalWallets.every((wallet) => wallet.isConnectionOnly)) {
|
|
1614
1625
|
yield this.addExternalWallets(
|
|
1615
1626
|
externalWallets.map((wallet) => __spreadProps(__spreadValues({}, wallet), {
|
|
@@ -3544,7 +3555,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3544
3555
|
return __async(this, arguments, function* ({ config, refetch = false } = {}) {
|
|
3545
3556
|
const { balance } = yield this.ctx.client.getProfileBalance({
|
|
3546
3557
|
config,
|
|
3547
|
-
wallets: this.availableWallets.map(({ type, address }) => ({ type, address })),
|
|
3558
|
+
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS").map(({ type, address }) => ({ type, address })),
|
|
3548
3559
|
refetch
|
|
3549
3560
|
});
|
|
3550
3561
|
return balance;
|
package/dist/esm/constants.js
CHANGED
|
@@ -208,6 +208,20 @@ ${exportedAsBase64}
|
|
|
208
208
|
return decryptedData.shares;
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
+
deleteShares() {
|
|
212
|
+
return __async(this, null, function* () {
|
|
213
|
+
yield this.issueEnclaveJwt();
|
|
214
|
+
const frontendKeyPair = yield this.generateFrontendKeyPair();
|
|
215
|
+
const responsePublicKeyPEM = yield this.exportPublicKeyToPEM(frontendKeyPair.publicKey);
|
|
216
|
+
const payload = {
|
|
217
|
+
responsePublicKey: responsePublicKeyPEM,
|
|
218
|
+
jwt: this.retrieveJwt()
|
|
219
|
+
};
|
|
220
|
+
const encryptedPayload = yield this.encryptForEnclave(JSON.stringify(payload));
|
|
221
|
+
const encryptedPayloadStr = JSON.stringify(encryptedPayload);
|
|
222
|
+
yield this.userManagementClient.deleteEnclaveShares(encryptedPayloadStr);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
211
225
|
retrieveSharesWithRetry(query) {
|
|
212
226
|
return __async(this, null, function* () {
|
|
213
227
|
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
@@ -220,6 +234,13 @@ ${exportedAsBase64}
|
|
|
220
234
|
return yield this.persistShares(shares);
|
|
221
235
|
});
|
|
222
236
|
}
|
|
237
|
+
deleteSharesWithRetry() {
|
|
238
|
+
return __async(this, null, function* () {
|
|
239
|
+
return yield this.withJwtRefreshRetry(() => __async(this, null, function* () {
|
|
240
|
+
return this.deleteShares();
|
|
241
|
+
}));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
223
244
|
}
|
|
224
245
|
export {
|
|
225
246
|
EnclaveClient
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ParaCore } from './ParaCore.js';
|
|
2
|
-
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type TAuthMethod, AuthMethodStatus, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type WalletEntity, Network, type TNetwork, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, type TOnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type OnRampAssets, type OnRampPurchase, type OnRampAssetInfo, type ProviderAssetInfo, OnRampMethod, type Theme, OAuthMethod, type TOAuthMethod, type TLinkedAccountType, type SupportedAccountLinks, type SupportedWalletTypes, type TPregenIdentifierType, type PregenIds, type LinkedAccount, type LinkedAccounts, type TExternalWallet, type ExternalWalletInfo, type PregenAuth, type Setup2faResponse, type TelegramAuthResponse, type VerifyExternalWalletParams, type AssetMetadata, type AssetMetadataIndexed, type AssetValue, type BalancesConfig, type WalletBalance, type ProfileBalance, type OfframpDepositRequest, type WalletWithMetadata, RecoveryStatus, ThemeMode, NON_ED25519, PREGEN_IDENTIFIER_TYPES, WALLET_TYPES, WALLET_SCHEMES, OAUTH_METHODS, LINKED_ACCOUNT_TYPES, EXTERNAL_WALLET_TYPES, EVM_WALLETS, SOLANA_WALLETS, COSMOS_WALLETS, formatAssetQuantity, formatCurrency, } from '@getpara/user-management-client';
|
|
2
|
+
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type TAuthMethod, AuthMethodStatus, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type WalletEntity, Network, type TNetwork, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, type TOnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type OnRampAssets, type OnRampPurchase, type OnRampAssetInfo, type ProviderAssetInfo, OnRampMethod, type Theme, OAuthMethod, type TOAuthMethod, type TLinkedAccountType, type SupportedAccountLinks, type SupportedWalletTypes, type TPregenIdentifierType, type PregenIds, type LinkedAccount, type LinkedAccounts, type TExternalWallet, type ExternalWalletInfo, type PregenAuth, type Setup2faResponse, type TelegramAuthResponse, type VerifyExternalWalletParams, type AssetMetadata, type AssetMetadataIndexed, type AssetValue, type BalancesConfig, type WalletBalance, type ProfileBalance, type OfframpDepositRequest, type WalletWithMetadata, RecoveryStatus, ThemeMode, NON_ED25519, PREGEN_IDENTIFIER_TYPES, WALLET_TYPES, WALLET_SCHEMES, OAUTH_METHODS, LINKED_ACCOUNT_TYPES, EXTERNAL_WALLET_TYPES, EVM_WALLETS, SOLANA_WALLETS, COSMOS_WALLETS, formatAssetQuantity, formatCurrency, type EstimateTransactionOpts, type EstimateTransactionResult, type BroadcastTransactionOpts, type BroadcastTransactionResult, } from '@getpara/user-management-client';
|
|
3
3
|
export { PopupType, PregenIdentifierType, type AuthStateSignup, type AuthStateVerify, type AuthStateLogin, type AuthState, type OAuthResponse, type CoreAuthInfo, type SignatureRes, type FullSignatureRes, type SuccessfulSignatureRes, type DeniedSignatureRes, type DeniedSignatureResWithUrl, type Wallet, type AvailableWallet, type GetWalletBalanceParams, type AccountLinkInProgress, AccountLinkError, type InternalInterface, } from './types/index.js';
|
|
4
4
|
export * from './types/coreApi.js';
|
|
5
5
|
export * from './types/events.js';
|
|
@@ -76,6 +76,8 @@ export declare class EnclaveClient {
|
|
|
76
76
|
* @param query Query parameters for finding shares (single query or array of queries)
|
|
77
77
|
*/
|
|
78
78
|
private retrieveShares;
|
|
79
|
+
deleteShares(): Promise<void>;
|
|
79
80
|
retrieveSharesWithRetry(query: ShareQuery[]): Promise<ShareData[]>;
|
|
80
81
|
persistSharesWithRetry(shares: ShareData[]): Promise<any>;
|
|
82
|
+
deleteSharesWithRetry(): Promise<void>;
|
|
81
83
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.73",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@celo/utils": "^8.0.2",
|
|
6
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
7
7
|
"@ethereumjs/util": "^9.1.0",
|
|
8
|
-
"@getpara/user-management-client": "2.0.0-alpha.
|
|
8
|
+
"@getpara/user-management-client": "2.0.0-alpha.73",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"base64url": "^3.0.1",
|
|
11
11
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist",
|
|
28
28
|
"package.json"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "52a9fc31810d56e792e23f68b73e1d4efbf6b96b",
|
|
31
31
|
"main": "dist/cjs/index.js",
|
|
32
32
|
"module": "dist/esm/index.js",
|
|
33
33
|
"scripts": {
|