@getpara/core-sdk 1.4.5-dev.0 → 1.5.0-dev.0
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/index.js +1 -26
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/esm/index.js +1 -26
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/types/ParaCore.d.ts +0 -6
- package/dist/types/constants.d.ts +0 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1104,7 +1104,7 @@ var TransactionReviewTimeout = class extends Error {
|
|
|
1104
1104
|
};
|
|
1105
1105
|
|
|
1106
1106
|
// src/constants.ts
|
|
1107
|
-
var PARA_CORE_VERSION = '1.
|
|
1107
|
+
var PARA_CORE_VERSION = '1.5.0';
|
|
1108
1108
|
var PREFIX = "@CAPSULE/";
|
|
1109
1109
|
var LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
|
|
1110
1110
|
var LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
|
|
@@ -1116,7 +1116,6 @@ var LOCAL_STORAGE_ED25519_WALLETS = `${PREFIX}ed25519Wallets`;
|
|
|
1116
1116
|
var LOCAL_STORAGE_WALLETS = `${PREFIX}wallets`;
|
|
1117
1117
|
var LOCAL_STORAGE_EXTERNAL_WALLETS = `${PREFIX}externalWallets`;
|
|
1118
1118
|
var LOCAL_STORAGE_CURRENT_WALLET_IDS = `${PREFIX}currentWalletIds`;
|
|
1119
|
-
var LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES = `${PREFIX}currentExternalWalletAddresses`;
|
|
1120
1119
|
var LOCAL_STORAGE_SESSION_COOKIE = `${PREFIX}sessionCookie`;
|
|
1121
1120
|
var SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR = `${PREFIX}loginEncryptionKeyPair`;
|
|
1122
1121
|
var POLLING_INTERVAL_MS = 2e3;
|
|
@@ -1127,9 +1126,6 @@ function storageListener(e) {
|
|
|
1127
1126
|
if (!e.url.includes(window.location.origin)) {
|
|
1128
1127
|
return;
|
|
1129
1128
|
}
|
|
1130
|
-
if (e.key === LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES) {
|
|
1131
|
-
this.updateCurrentExternalWalletAddressesFromStorage();
|
|
1132
|
-
}
|
|
1133
1129
|
if (e.key === LOCAL_STORAGE_EXTERNAL_WALLETS) {
|
|
1134
1130
|
this.updateExternalWalletsFromStorage();
|
|
1135
1131
|
}
|
|
@@ -1240,7 +1236,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1240
1236
|
this.updateSessionCookieFromStorage();
|
|
1241
1237
|
this.updateLoginEncryptionKeyPairFromStorage();
|
|
1242
1238
|
this.updateExternalWalletsFromStorage();
|
|
1243
|
-
this.updateCurrentExternalWalletAddressesFromStorage();
|
|
1244
1239
|
};
|
|
1245
1240
|
this.updateTelegramUserIdFromStorage = () => {
|
|
1246
1241
|
this.telegramUserId = this.localStorageGetItem(LOCAL_STORAGE_TELEGRAM_USER_ID) || void 0;
|
|
@@ -1314,10 +1309,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1314
1309
|
const _externalWallets = JSON.parse(stringExternalWallets || "{}");
|
|
1315
1310
|
this.setExternalWallets(_externalWallets);
|
|
1316
1311
|
};
|
|
1317
|
-
this.updateCurrentExternalWalletAddressesFromStorage = () => {
|
|
1318
|
-
const _currentExternalWalletAddresses = this.localStorageGetItem(LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES) || void 0;
|
|
1319
|
-
this.currentExternalWalletAddresses = _currentExternalWalletAddresses ? JSON.parse(_currentExternalWalletAddresses) : void 0;
|
|
1320
|
-
};
|
|
1321
1312
|
/**
|
|
1322
1313
|
* Creates several new wallets with the desired types. If no types are provided, this method
|
|
1323
1314
|
* will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
|
|
@@ -1767,8 +1758,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1767
1758
|
const stringExternalWallets = yield this.localStorageGetItem(LOCAL_STORAGE_EXTERNAL_WALLETS);
|
|
1768
1759
|
const _externalWallets = JSON.parse(stringExternalWallets || "{}");
|
|
1769
1760
|
yield this.setExternalWallets(_externalWallets);
|
|
1770
|
-
const _currentExternalWalletAddresses = (yield this.localStorageGetItem(LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES)) || void 0;
|
|
1771
|
-
this.currentExternalWalletAddresses = _currentExternalWalletAddresses ? JSON.parse(_currentExternalWalletAddresses) : void 0;
|
|
1772
1761
|
setupListeners.bind(this)();
|
|
1773
1762
|
yield this.touchSession();
|
|
1774
1763
|
});
|
|
@@ -1833,8 +1822,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1833
1822
|
signer: ""
|
|
1834
1823
|
}
|
|
1835
1824
|
};
|
|
1836
|
-
this.currentExternalWalletAddresses = [address];
|
|
1837
|
-
this.setCurrentExternalWalletAddresses(this.currentExternalWalletAddresses);
|
|
1838
1825
|
this.setExternalWallets(this.externalWallets);
|
|
1839
1826
|
dispatchEvent(ParaEvent.EXTERNAL_WALLET_CHANGE_EVENT, null);
|
|
1840
1827
|
});
|
|
@@ -1873,15 +1860,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1873
1860
|
yield this.localStorageSetItem(LOCAL_STORAGE_EXTERNAL_WALLETS, JSON.stringify(externalWallets));
|
|
1874
1861
|
});
|
|
1875
1862
|
}
|
|
1876
|
-
setCurrentExternalWalletAddresses(currentExternalWalletAddresses) {
|
|
1877
|
-
return __async(this, null, function* () {
|
|
1878
|
-
this.currentExternalWalletAddresses = currentExternalWalletAddresses;
|
|
1879
|
-
yield this.localStorageSetItem(
|
|
1880
|
-
LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES,
|
|
1881
|
-
JSON.stringify(currentExternalWalletAddresses)
|
|
1882
|
-
);
|
|
1883
|
-
});
|
|
1884
|
-
}
|
|
1885
1863
|
/**
|
|
1886
1864
|
* Sets the login encryption key pair associated with the `ParaCore` instance.
|
|
1887
1865
|
* @param keyPair - Encryption key pair generated from loginEncryptionKey.
|
|
@@ -2713,7 +2691,6 @@ var _ParaCore = class _ParaCore {
|
|
|
2713
2691
|
waitForAccountCreation() {
|
|
2714
2692
|
return __async(this, arguments, function* ({ popupWindow } = {}) {
|
|
2715
2693
|
yield this.touchSession();
|
|
2716
|
-
this.currentExternalWalletAddresses = void 0;
|
|
2717
2694
|
this.externalWallets = {};
|
|
2718
2695
|
this.isAwaitingAccountCreation = true;
|
|
2719
2696
|
while (this.isAwaitingAccountCreation) {
|
|
@@ -2882,7 +2859,6 @@ var _ParaCore = class _ParaCore {
|
|
|
2882
2859
|
skipSessionRefresh = false
|
|
2883
2860
|
} = {}) {
|
|
2884
2861
|
var _a;
|
|
2885
|
-
this.currentExternalWalletAddresses = void 0;
|
|
2886
2862
|
this.externalWallets = {};
|
|
2887
2863
|
this.isAwaitingLogin = true;
|
|
2888
2864
|
while (this.isAwaitingLogin) {
|
|
@@ -3904,7 +3880,6 @@ var _ParaCore = class _ParaCore {
|
|
|
3904
3880
|
this.wallets = {};
|
|
3905
3881
|
}
|
|
3906
3882
|
this.currentWalletIds = {};
|
|
3907
|
-
this.currentExternalWalletAddresses = void 0;
|
|
3908
3883
|
this.externalWallets = {};
|
|
3909
3884
|
this.loginEncryptionKeyPair = void 0;
|
|
3910
3885
|
this.email = void 0;
|
package/dist/cjs/index.js.br
CHANGED
|
Binary file
|
package/dist/cjs/index.js.gz
CHANGED
|
Binary file
|
package/dist/esm/index.js
CHANGED
|
@@ -1021,7 +1021,7 @@ var TransactionReviewTimeout = class extends Error {
|
|
|
1021
1021
|
};
|
|
1022
1022
|
|
|
1023
1023
|
// src/constants.ts
|
|
1024
|
-
var PARA_CORE_VERSION = '1.
|
|
1024
|
+
var PARA_CORE_VERSION = '1.5.0';
|
|
1025
1025
|
var PREFIX = "@CAPSULE/";
|
|
1026
1026
|
var LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
|
|
1027
1027
|
var LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
|
|
@@ -1033,7 +1033,6 @@ var LOCAL_STORAGE_ED25519_WALLETS = `${PREFIX}ed25519Wallets`;
|
|
|
1033
1033
|
var LOCAL_STORAGE_WALLETS = `${PREFIX}wallets`;
|
|
1034
1034
|
var LOCAL_STORAGE_EXTERNAL_WALLETS = `${PREFIX}externalWallets`;
|
|
1035
1035
|
var LOCAL_STORAGE_CURRENT_WALLET_IDS = `${PREFIX}currentWalletIds`;
|
|
1036
|
-
var LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES = `${PREFIX}currentExternalWalletAddresses`;
|
|
1037
1036
|
var LOCAL_STORAGE_SESSION_COOKIE = `${PREFIX}sessionCookie`;
|
|
1038
1037
|
var SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR = `${PREFIX}loginEncryptionKeyPair`;
|
|
1039
1038
|
var POLLING_INTERVAL_MS = 2e3;
|
|
@@ -1044,9 +1043,6 @@ function storageListener(e) {
|
|
|
1044
1043
|
if (!e.url.includes(window.location.origin)) {
|
|
1045
1044
|
return;
|
|
1046
1045
|
}
|
|
1047
|
-
if (e.key === LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES) {
|
|
1048
|
-
this.updateCurrentExternalWalletAddressesFromStorage();
|
|
1049
|
-
}
|
|
1050
1046
|
if (e.key === LOCAL_STORAGE_EXTERNAL_WALLETS) {
|
|
1051
1047
|
this.updateExternalWalletsFromStorage();
|
|
1052
1048
|
}
|
|
@@ -1157,7 +1153,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1157
1153
|
this.updateSessionCookieFromStorage();
|
|
1158
1154
|
this.updateLoginEncryptionKeyPairFromStorage();
|
|
1159
1155
|
this.updateExternalWalletsFromStorage();
|
|
1160
|
-
this.updateCurrentExternalWalletAddressesFromStorage();
|
|
1161
1156
|
};
|
|
1162
1157
|
this.updateTelegramUserIdFromStorage = () => {
|
|
1163
1158
|
this.telegramUserId = this.localStorageGetItem(LOCAL_STORAGE_TELEGRAM_USER_ID) || void 0;
|
|
@@ -1231,10 +1226,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1231
1226
|
const _externalWallets = JSON.parse(stringExternalWallets || "{}");
|
|
1232
1227
|
this.setExternalWallets(_externalWallets);
|
|
1233
1228
|
};
|
|
1234
|
-
this.updateCurrentExternalWalletAddressesFromStorage = () => {
|
|
1235
|
-
const _currentExternalWalletAddresses = this.localStorageGetItem(LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES) || void 0;
|
|
1236
|
-
this.currentExternalWalletAddresses = _currentExternalWalletAddresses ? JSON.parse(_currentExternalWalletAddresses) : void 0;
|
|
1237
|
-
};
|
|
1238
1229
|
/**
|
|
1239
1230
|
* Creates several new wallets with the desired types. If no types are provided, this method
|
|
1240
1231
|
* will create one for each of the non-optional types specified in the instance's `supportedWalletTypes`
|
|
@@ -1684,8 +1675,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1684
1675
|
const stringExternalWallets = yield this.localStorageGetItem(LOCAL_STORAGE_EXTERNAL_WALLETS);
|
|
1685
1676
|
const _externalWallets = JSON.parse(stringExternalWallets || "{}");
|
|
1686
1677
|
yield this.setExternalWallets(_externalWallets);
|
|
1687
|
-
const _currentExternalWalletAddresses = (yield this.localStorageGetItem(LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES)) || void 0;
|
|
1688
|
-
this.currentExternalWalletAddresses = _currentExternalWalletAddresses ? JSON.parse(_currentExternalWalletAddresses) : void 0;
|
|
1689
1678
|
setupListeners.bind(this)();
|
|
1690
1679
|
yield this.touchSession();
|
|
1691
1680
|
});
|
|
@@ -1750,8 +1739,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1750
1739
|
signer: ""
|
|
1751
1740
|
}
|
|
1752
1741
|
};
|
|
1753
|
-
this.currentExternalWalletAddresses = [address];
|
|
1754
|
-
this.setCurrentExternalWalletAddresses(this.currentExternalWalletAddresses);
|
|
1755
1742
|
this.setExternalWallets(this.externalWallets);
|
|
1756
1743
|
dispatchEvent(ParaEvent.EXTERNAL_WALLET_CHANGE_EVENT, null);
|
|
1757
1744
|
});
|
|
@@ -1790,15 +1777,6 @@ var _ParaCore = class _ParaCore {
|
|
|
1790
1777
|
yield this.localStorageSetItem(LOCAL_STORAGE_EXTERNAL_WALLETS, JSON.stringify(externalWallets));
|
|
1791
1778
|
});
|
|
1792
1779
|
}
|
|
1793
|
-
setCurrentExternalWalletAddresses(currentExternalWalletAddresses) {
|
|
1794
|
-
return __async(this, null, function* () {
|
|
1795
|
-
this.currentExternalWalletAddresses = currentExternalWalletAddresses;
|
|
1796
|
-
yield this.localStorageSetItem(
|
|
1797
|
-
LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES,
|
|
1798
|
-
JSON.stringify(currentExternalWalletAddresses)
|
|
1799
|
-
);
|
|
1800
|
-
});
|
|
1801
|
-
}
|
|
1802
1780
|
/**
|
|
1803
1781
|
* Sets the login encryption key pair associated with the `ParaCore` instance.
|
|
1804
1782
|
* @param keyPair - Encryption key pair generated from loginEncryptionKey.
|
|
@@ -2630,7 +2608,6 @@ var _ParaCore = class _ParaCore {
|
|
|
2630
2608
|
waitForAccountCreation() {
|
|
2631
2609
|
return __async(this, arguments, function* ({ popupWindow } = {}) {
|
|
2632
2610
|
yield this.touchSession();
|
|
2633
|
-
this.currentExternalWalletAddresses = void 0;
|
|
2634
2611
|
this.externalWallets = {};
|
|
2635
2612
|
this.isAwaitingAccountCreation = true;
|
|
2636
2613
|
while (this.isAwaitingAccountCreation) {
|
|
@@ -2799,7 +2776,6 @@ var _ParaCore = class _ParaCore {
|
|
|
2799
2776
|
skipSessionRefresh = false
|
|
2800
2777
|
} = {}) {
|
|
2801
2778
|
var _a;
|
|
2802
|
-
this.currentExternalWalletAddresses = void 0;
|
|
2803
2779
|
this.externalWallets = {};
|
|
2804
2780
|
this.isAwaitingLogin = true;
|
|
2805
2781
|
while (this.isAwaitingLogin) {
|
|
@@ -3821,7 +3797,6 @@ var _ParaCore = class _ParaCore {
|
|
|
3821
3797
|
this.wallets = {};
|
|
3822
3798
|
}
|
|
3823
3799
|
this.currentWalletIds = {};
|
|
3824
|
-
this.currentExternalWalletAddresses = void 0;
|
|
3825
3800
|
this.externalWallets = {};
|
|
3826
3801
|
this.loginEncryptionKeyPair = void 0;
|
|
3827
3802
|
this.email = void 0;
|
package/dist/esm/index.js.br
CHANGED
|
Binary file
|
package/dist/esm/index.js.gz
CHANGED
|
Binary file
|
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -32,10 +32,6 @@ export declare abstract class ParaCore {
|
|
|
32
32
|
* Wallets associated with the `ParaCore` instance. Retrieve a particular wallet using `para.wallets[walletId]`.
|
|
33
33
|
*/
|
|
34
34
|
wallets: Record<string, Wallet>;
|
|
35
|
-
/**
|
|
36
|
-
* The addresses of the currently active external wallets.
|
|
37
|
-
*/
|
|
38
|
-
currentExternalWalletAddresses?: string[];
|
|
39
35
|
/**
|
|
40
36
|
* Wallets associated with the `ParaCore` instance.
|
|
41
37
|
*/
|
|
@@ -182,7 +178,6 @@ export declare abstract class ParaCore {
|
|
|
182
178
|
private updateSessionCookieFromStorage;
|
|
183
179
|
private updateLoginEncryptionKeyPairFromStorage;
|
|
184
180
|
private updateExternalWalletsFromStorage;
|
|
185
|
-
private updateCurrentExternalWalletAddressesFromStorage;
|
|
186
181
|
touchSession(regenerate?: boolean): Promise<Awaited<ReturnType<Client['touchSession']>>>;
|
|
187
182
|
private setSupportedWalletTypes;
|
|
188
183
|
private getVerificationEmailProps;
|
|
@@ -235,7 +230,6 @@ export declare abstract class ParaCore {
|
|
|
235
230
|
* @param externalWallets - External wallets to set.
|
|
236
231
|
*/
|
|
237
232
|
setExternalWallets(externalWallets: Record<string, Wallet>): Promise<void>;
|
|
238
|
-
setCurrentExternalWalletAddresses(currentExternalWalletAddresses: string[]): Promise<void>;
|
|
239
233
|
/**
|
|
240
234
|
* Sets the login encryption key pair associated with the `ParaCore` instance.
|
|
241
235
|
* @param keyPair - Encryption key pair generated from loginEncryptionKey.
|
|
@@ -10,7 +10,6 @@ export declare const LOCAL_STORAGE_ED25519_WALLETS: string;
|
|
|
10
10
|
export declare const LOCAL_STORAGE_WALLETS: string;
|
|
11
11
|
export declare const LOCAL_STORAGE_EXTERNAL_WALLETS: string;
|
|
12
12
|
export declare const LOCAL_STORAGE_CURRENT_WALLET_IDS: string;
|
|
13
|
-
export declare const LOCAL_STORAGE_CURRENT_EXTERNAL_WALLET_ADDRESSES: string;
|
|
14
13
|
export declare const LOCAL_STORAGE_SESSION_COOKIE: string;
|
|
15
14
|
export declare const SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR: string;
|
|
16
15
|
export declare const POLLING_INTERVAL_MS = 2000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-dev.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@celo/utils": "^8.0.0",
|
|
11
11
|
"@cosmjs/encoding": "^0.32.4",
|
|
12
|
-
"@getpara/user-management-client": "1.
|
|
12
|
+
"@getpara/user-management-client": "1.5.0",
|
|
13
13
|
"@noble/hashes": "^1.5.0",
|
|
14
14
|
"base64url": "^3.0.1",
|
|
15
15
|
"ethereumjs-util": "7.1.5",
|