@portal-hq/utils 4.0.1 → 4.0.3
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/lib/commonjs/events/index.js +1 -0
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/version/index.js +13 -0
- package/lib/commonjs/version/version.json +1 -0
- package/lib/esm/events/index.js +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/version/index.js +6 -0
- package/lib/esm/version/version.json +1 -0
- package/package.json +2 -2
- package/src/definitions/index.ts +1 -0
- package/src/events/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/version/index.ts +7 -0
- package/src/version/version.json +1 -0
- package/types.d.ts +1 -27
|
@@ -22,5 +22,6 @@ var Events;
|
|
|
22
22
|
Events["StoredClientBackupShare"] = "Stored Client Backup Share";
|
|
23
23
|
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key";
|
|
24
24
|
Events["StoredClientSigningShare"] = "Stored Client Signing Share";
|
|
25
|
+
Events["EjectClient"] = "Eject Client";
|
|
25
26
|
})(Events || (Events = {}));
|
|
26
27
|
exports.default = Events;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HttpRequester = exports.PortalRequests = exports.HttpRequest = exports.parseRequest = exports.numberToHexString = exports.Events = exports.RpcErrorCodes = exports.ProviderRpcError = exports.PortalMpcError = exports.PortalErrorCodeTypes = exports.PortalErrorCodes = exports.NoAddressError = exports.MpcSigningError = exports.MissingOptionError = exports.InvalidGatewayConfigError = exports.InvalidChainIdError = exports.InvalidApiKeyError = exports.HttpError = exports.CloudStorageReadError = exports.Storage = exports.MpcStatuses = exports.KeychainAdapter = exports.convert = exports.convertCryptoToLocal = exports.convertLocalToCrypto = exports.getChainNameForId = exports.getChainIdForName = exports.chainNameToId = exports.chainIdToName = void 0;
|
|
6
|
+
exports.HttpRequester = exports.PortalRequests = exports.HttpRequest = exports.parseRequest = exports.numberToHexString = exports.getClientPlatformVersion = exports.Events = exports.RpcErrorCodes = exports.ProviderRpcError = exports.PortalMpcError = exports.PortalErrorCodeTypes = exports.PortalErrorCodes = exports.NoAddressError = exports.MpcSigningError = exports.MissingOptionError = exports.InvalidGatewayConfigError = exports.InvalidChainIdError = exports.InvalidApiKeyError = exports.HttpError = exports.CloudStorageReadError = exports.Storage = exports.MpcStatuses = exports.KeychainAdapter = exports.convert = exports.convertCryptoToLocal = exports.convertLocalToCrypto = exports.getChainNameForId = exports.getChainIdForName = exports.chainNameToId = exports.chainIdToName = void 0;
|
|
7
7
|
var chains_1 = require("./chains");
|
|
8
8
|
Object.defineProperty(exports, "chainIdToName", { enumerable: true, get: function () { return chains_1.chainIdToName; } });
|
|
9
9
|
Object.defineProperty(exports, "chainNameToId", { enumerable: true, get: function () { return chains_1.chainNameToId; } });
|
|
@@ -33,6 +33,8 @@ Object.defineProperty(exports, "ProviderRpcError", { enumerable: true, get: func
|
|
|
33
33
|
Object.defineProperty(exports, "RpcErrorCodes", { enumerable: true, get: function () { return errors_1.RpcErrorCodes; } });
|
|
34
34
|
var events_1 = require("./events");
|
|
35
35
|
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return __importDefault(events_1).default; } });
|
|
36
|
+
var version_1 = require("./version");
|
|
37
|
+
Object.defineProperty(exports, "getClientPlatformVersion", { enumerable: true, get: function () { return version_1.getClientPlatformVersion; } });
|
|
36
38
|
var eth_requests_1 = require("./eth-requests");
|
|
37
39
|
Object.defineProperty(exports, "numberToHexString", { enumerable: true, get: function () { return eth_requests_1.numberToHexString; } });
|
|
38
40
|
Object.defineProperty(exports, "parseRequest", { enumerable: true, get: function () { return eth_requests_1.parseRequest; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getClientPlatformVersion = void 0;
|
|
7
|
+
const version_json_1 = __importDefault(require("./version.json"));
|
|
8
|
+
const getClientPlatformVersion = () => {
|
|
9
|
+
if (!(version_json_1.default === null || version_json_1.default === void 0 ? void 0 : version_json_1.default.version))
|
|
10
|
+
return '';
|
|
11
|
+
return version_json_1.default.version;
|
|
12
|
+
};
|
|
13
|
+
exports.getClientPlatformVersion = getClientPlatformVersion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "version": "4.0.3" }
|
package/lib/esm/events/index.js
CHANGED
|
@@ -20,5 +20,6 @@ var Events;
|
|
|
20
20
|
Events["StoredClientBackupShare"] = "Stored Client Backup Share";
|
|
21
21
|
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key";
|
|
22
22
|
Events["StoredClientSigningShare"] = "Stored Client Signing Share";
|
|
23
|
+
Events["EjectClient"] = "Eject Client";
|
|
23
24
|
})(Events || (Events = {}));
|
|
24
25
|
export default Events;
|
package/lib/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { convertLocalToCrypto, convertCryptoToLocal, convert } from './currency'
|
|
|
3
3
|
export { KeychainAdapter, MpcStatuses, Storage, } from './definitions';
|
|
4
4
|
export { CloudStorageReadError, HttpError, InvalidApiKeyError, InvalidChainIdError, InvalidGatewayConfigError, MissingOptionError, MpcSigningError, NoAddressError, PortalErrorCodes, PortalErrorCodeTypes, PortalMpcError, ProviderRpcError, RpcErrorCodes, } from './errors';
|
|
5
5
|
export { default as Events } from './events';
|
|
6
|
+
export { getClientPlatformVersion } from './version';
|
|
6
7
|
export { numberToHexString, parseRequest } from './eth-requests';
|
|
7
8
|
export { default as HttpRequest } from './http-request';
|
|
8
9
|
export { default as PortalRequests } from './PortalRequests';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "version": "4.0.3" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"main": "lib/commonjs/index",
|
|
5
5
|
"module": "lib/esm/index",
|
|
6
6
|
"source": "src/index",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"ts-jest": "^29.0.3",
|
|
27
27
|
"typescript": "^4.8.4"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f5873ba2108f0f75ac2121d42506c48bc23ef773"
|
|
30
30
|
}
|
package/src/definitions/index.ts
CHANGED
package/src/events/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ enum Events {
|
|
|
20
20
|
StoredClientBackupShare = 'Stored Client Backup Share',
|
|
21
21
|
StoredClientBackupShareKey = 'Stored Client Backup Share Key',
|
|
22
22
|
StoredClientSigningShare = 'Stored Client Signing Share',
|
|
23
|
+
EjectClient = 'Eject Client',
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export default Events
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "version": "4.0.3" }
|
package/types.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { MpcStatuses } from './src/definitions'
|
|
9
9
|
|
|
10
|
-
export type MpcMember = 'client' | 'server'
|
|
11
|
-
|
|
12
10
|
export type OutgoingRequestData = MessageData | SignableTransactionData
|
|
13
11
|
|
|
14
12
|
export type ProgressCallback = (status: MpcStatus) => void | Promise<void>
|
|
@@ -22,11 +20,6 @@ export type ValidHttpRequestMethods =
|
|
|
22
20
|
|
|
23
21
|
export type ValidRpcErrorCodes = 4001 | 4100 | 4200 | 4900 | 4901
|
|
24
22
|
|
|
25
|
-
export interface Bk {
|
|
26
|
-
X: string
|
|
27
|
-
Rank: number
|
|
28
|
-
}
|
|
29
|
-
|
|
30
23
|
interface ClientResponse {
|
|
31
24
|
id: string
|
|
32
25
|
custodian: ClientResponseCustodian
|
|
@@ -183,23 +176,9 @@ export interface PortalKeychainMetadata {
|
|
|
183
176
|
}
|
|
184
177
|
|
|
185
178
|
export interface DkgData {
|
|
186
|
-
|
|
187
|
-
bks: { [key: MpcMember]: Bk }
|
|
188
|
-
p: string
|
|
189
|
-
partialPubkey: { [key: MpcMember]: Pubkey }
|
|
190
|
-
pederson: { [key: MpcMember]: PedersonParams }
|
|
191
|
-
pubkey: Pubkey
|
|
192
|
-
q: string
|
|
179
|
+
backupSharePairId?: string
|
|
193
180
|
share: string
|
|
194
181
|
signingSharePairId?: string
|
|
195
|
-
backupSharePairId?: string
|
|
196
|
-
ssid: string
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface PedersonParams {
|
|
200
|
-
n: string
|
|
201
|
-
s: string
|
|
202
|
-
t: string
|
|
203
182
|
}
|
|
204
183
|
|
|
205
184
|
export interface HttpErrorOptions {
|
|
@@ -249,11 +228,6 @@ export interface OutgoingRequest {
|
|
|
249
228
|
data: OutgoingRequestData
|
|
250
229
|
}
|
|
251
230
|
|
|
252
|
-
export interface Pubkey {
|
|
253
|
-
X: string
|
|
254
|
-
Y: string
|
|
255
|
-
}
|
|
256
|
-
|
|
257
231
|
export interface QuoteArgs {
|
|
258
232
|
affiliateAddress?: string
|
|
259
233
|
buyAmount?: number
|