@xyo-network/account-model 2.79.4 → 2.79.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/node/index.cjs +38 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +2 -30
- package/dist/node/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/node/index.mjs +0 -10
- package/dist/node/index.mjs.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ethMessagePrefix: () => ethMessagePrefix,
|
|
24
|
+
isAccountInstance: () => isAccountInstance
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// src/Account.ts
|
|
29
|
+
var ethMessagePrefix = "Ethereum Signed Message:\n";
|
|
30
|
+
var isAccountInstance = (account) => {
|
|
31
|
+
return typeof account === "object" && typeof account["address"] === "string";
|
|
32
|
+
};
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
ethMessagePrefix,
|
|
36
|
+
isAccountInstance
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Account.ts"],"sourcesContent":["export * from './Account'\n","import { Data, DataLike } from '@xyo-network/core'\nimport { KeyPairInstance } from '@xyo-network/key-model'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\n\nexport const ethMessagePrefix = '\\x19Ethereum Signed Message:\\n'\n\nexport interface PhraseInitializationConfig {\n phrase: string\n}\nexport interface PrivateKeyInitializationConfig {\n privateKey: DataLike\n}\nexport interface MnemonicInitializationConfig {\n mnemonic: string\n path?: string\n}\nexport interface AccountOptions {\n previousHash?: Uint8Array | string\n}\n\nexport type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig\n\nexport type AccountConfig = InitializationConfig & AccountOptions\n\nexport interface AccountInstance extends KeyPairInstance {\n address: string\n addressBytes: Data | undefined\n previousHash: string | undefined\n previousHashBytes: Data | undefined\n sign: (hash: DataLike, previousHash: DataLike | undefined) => Uint8Array | Promise<Uint8Array>\n verify: (msg: DataLike, signature: DataLike) => boolean | Promise<boolean>\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isAccountInstance = (account: any): account is AccountInstance => {\n return typeof account === 'object' && typeof account['address'] === 'string'\n}\n\nexport interface AccountStatic<T extends AccountInstance = AccountInstance> {\n previousHashStore?: PreviousHashStore\n new (key: unknown, params?: AccountConfig): T\n create(opts?: AccountConfig): Promise<T>\n fromMnemonic(mnemonic: string, path?: string): Promise<T>\n fromPhrase(phrase: string): Promise<AccountInstance>\n fromPrivateKey(key: DataLike): Promise<AccountInstance>\n is(value: unknown): T | undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,mBAAmB;AA8BzB,IAAM,oBAAoB,CAAC,YAA6C;AAC7E,SAAO,OAAO,YAAY,YAAY,OAAO,QAAQ,SAAS,MAAM;AACtE;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
ethMessagePrefix: () => ethMessagePrefix,
|
|
24
|
-
isAccountInstance: () => isAccountInstance
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(src_exports);
|
|
27
|
-
|
|
28
1
|
// src/Account.ts
|
|
29
2
|
var ethMessagePrefix = "Ethereum Signed Message:\n";
|
|
30
3
|
var isAccountInstance = (account) => {
|
|
31
4
|
return typeof account === "object" && typeof account["address"] === "string";
|
|
32
5
|
};
|
|
33
|
-
|
|
34
|
-
0 && (module.exports = {
|
|
6
|
+
export {
|
|
35
7
|
ethMessagePrefix,
|
|
36
8
|
isAccountInstance
|
|
37
|
-
}
|
|
9
|
+
};
|
|
38
10
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/Account.ts"],"sourcesContent":["import { Data, DataLike } from '@xyo-network/core'\nimport { KeyPairInstance } from '@xyo-network/key-model'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\n\nexport const ethMessagePrefix = '\\x19Ethereum Signed Message:\\n'\n\nexport interface PhraseInitializationConfig {\n phrase: string\n}\nexport interface PrivateKeyInitializationConfig {\n privateKey: DataLike\n}\nexport interface MnemonicInitializationConfig {\n mnemonic: string\n path?: string\n}\nexport interface AccountOptions {\n previousHash?: Uint8Array | string\n}\n\nexport type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig\n\nexport type AccountConfig = InitializationConfig & AccountOptions\n\nexport interface AccountInstance extends KeyPairInstance {\n address: string\n addressBytes: Data | undefined\n previousHash: string | undefined\n previousHashBytes: Data | undefined\n sign: (hash: DataLike, previousHash: DataLike | undefined) => Uint8Array | Promise<Uint8Array>\n verify: (msg: DataLike, signature: DataLike) => boolean | Promise<boolean>\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isAccountInstance = (account: any): account is AccountInstance => {\n return typeof account === 'object' && typeof account['address'] === 'string'\n}\n\nexport interface AccountStatic<T extends AccountInstance = AccountInstance> {\n previousHashStore?: PreviousHashStore\n new (key: unknown, params?: AccountConfig): T\n create(opts?: AccountConfig): Promise<T>\n fromMnemonic(mnemonic: string, path?: string): Promise<T>\n fromPhrase(phrase: string): Promise<AccountInstance>\n fromPrivateKey(key: DataLike): Promise<AccountInstance>\n is(value: unknown): T | undefined\n}\n"],"mappings":";AAIO,IAAM,mBAAmB;AA8BzB,IAAM,oBAAoB,CAAC,YAA6C;AAC7E,SAAO,OAAO,YAAY,YAAY,OAAO,QAAQ,SAAS,MAAM;AACtE;","names":[]}
|
package/package.json
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/core": "~2.79.
|
|
14
|
-
"@xyo-network/key-model": "~2.79.
|
|
15
|
-
"@xyo-network/previous-hash-store-model": "~2.79.
|
|
13
|
+
"@xyo-network/core": "~2.79.6",
|
|
14
|
+
"@xyo-network/key-model": "~2.79.6",
|
|
15
|
+
"@xyo-network/previous-hash-store-model": "~2.79.6"
|
|
16
16
|
},
|
|
17
17
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
18
18
|
"devDependencies": {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"@xylabs/tsconfig": "^3.1.21",
|
|
21
21
|
"typescript": "^5.2.2"
|
|
22
22
|
},
|
|
23
|
-
"docs": "dist/docs.json",
|
|
24
23
|
"exports": {
|
|
25
24
|
".": {
|
|
26
25
|
"browser": {
|
|
@@ -35,19 +34,21 @@
|
|
|
35
34
|
},
|
|
36
35
|
"node": {
|
|
37
36
|
"require": {
|
|
38
|
-
"types": "./dist/node/index.d.
|
|
39
|
-
"default": "./dist/node/index.
|
|
37
|
+
"types": "./dist/node/index.d.cts",
|
|
38
|
+
"default": "./dist/node/index.cjs"
|
|
40
39
|
},
|
|
41
40
|
"import": {
|
|
42
41
|
"types": "./dist/node/index.d.mts",
|
|
43
|
-
"default": "./dist/node/index.
|
|
42
|
+
"default": "./dist/node/index.js"
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
46
|
"./package.json": "./package.json"
|
|
48
47
|
},
|
|
49
|
-
"main": "dist/node/index.
|
|
50
|
-
"module": "dist/node/index.
|
|
48
|
+
"main": "dist/node/index.cjs",
|
|
49
|
+
"module": "dist/node/index.js",
|
|
50
|
+
"types": "dist/node/index.d.mts",
|
|
51
|
+
"type": "module",
|
|
51
52
|
"homepage": "https://xyo.network",
|
|
52
53
|
"license": "LGPL-3.0-only",
|
|
53
54
|
"publishConfig": {
|
|
@@ -58,6 +59,5 @@
|
|
|
58
59
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
59
60
|
},
|
|
60
61
|
"sideEffects": false,
|
|
61
|
-
"
|
|
62
|
-
"version": "2.79.4"
|
|
62
|
+
"version": "2.79.6"
|
|
63
63
|
}
|
package/dist/node/index.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/Account.ts
|
|
2
|
-
var ethMessagePrefix = "Ethereum Signed Message:\n";
|
|
3
|
-
var isAccountInstance = (account) => {
|
|
4
|
-
return typeof account === "object" && typeof account["address"] === "string";
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
ethMessagePrefix,
|
|
8
|
-
isAccountInstance
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Account.ts"],"sourcesContent":["import { Data, DataLike } from '@xyo-network/core'\nimport { KeyPairInstance } from '@xyo-network/key-model'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\n\nexport const ethMessagePrefix = '\\x19Ethereum Signed Message:\\n'\n\nexport interface PhraseInitializationConfig {\n phrase: string\n}\nexport interface PrivateKeyInitializationConfig {\n privateKey: DataLike\n}\nexport interface MnemonicInitializationConfig {\n mnemonic: string\n path?: string\n}\nexport interface AccountOptions {\n previousHash?: Uint8Array | string\n}\n\nexport type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig\n\nexport type AccountConfig = InitializationConfig & AccountOptions\n\nexport interface AccountInstance extends KeyPairInstance {\n address: string\n addressBytes: Data | undefined\n previousHash: string | undefined\n previousHashBytes: Data | undefined\n sign: (hash: DataLike, previousHash: DataLike | undefined) => Uint8Array | Promise<Uint8Array>\n verify: (msg: DataLike, signature: DataLike) => boolean | Promise<boolean>\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isAccountInstance = (account: any): account is AccountInstance => {\n return typeof account === 'object' && typeof account['address'] === 'string'\n}\n\nexport interface AccountStatic<T extends AccountInstance = AccountInstance> {\n previousHashStore?: PreviousHashStore\n new (key: unknown, params?: AccountConfig): T\n create(opts?: AccountConfig): Promise<T>\n fromMnemonic(mnemonic: string, path?: string): Promise<T>\n fromPhrase(phrase: string): Promise<AccountInstance>\n fromPrivateKey(key: DataLike): Promise<AccountInstance>\n is(value: unknown): T | undefined\n}\n"],"mappings":";AAIO,IAAM,mBAAmB;AA8BzB,IAAM,oBAAoB,CAAC,YAA6C;AAC7E,SAAO,OAAO,YAAY,YAAY,OAAO,QAAQ,SAAS,MAAM;AACtE;","names":[]}
|