@xyo-network/key-model 2.72.8 → 2.73.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/index.d.mts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +29 -16
- package/tsup.config.ts +16 -0
- package/dist/cjs/Key/AddressValue.js +0 -3
- package/dist/cjs/Key/AddressValue.js.map +0 -1
- package/dist/cjs/Key/EllipticKey.js +0 -3
- package/dist/cjs/Key/EllipticKey.js.map +0 -1
- package/dist/cjs/Key/KeyPair.js +0 -3
- package/dist/cjs/Key/KeyPair.js.map +0 -1
- package/dist/cjs/Key/PrivateKey.js +0 -3
- package/dist/cjs/Key/PrivateKey.js.map +0 -1
- package/dist/cjs/Key/PublicKey.js +0 -3
- package/dist/cjs/Key/PublicKey.js.map +0 -1
- package/dist/cjs/Key/index.js +0 -8
- package/dist/cjs/Key/index.js.map +0 -1
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/index.js.map +0 -1
- package/dist/docs.json +0 -2875
- package/dist/esm/Key/AddressValue.js +0 -2
- package/dist/esm/Key/AddressValue.js.map +0 -1
- package/dist/esm/Key/EllipticKey.js +0 -2
- package/dist/esm/Key/EllipticKey.js.map +0 -1
- package/dist/esm/Key/KeyPair.js +0 -2
- package/dist/esm/Key/KeyPair.js.map +0 -1
- package/dist/esm/Key/PrivateKey.js +0 -2
- package/dist/esm/Key/PrivateKey.js.map +0 -1
- package/dist/esm/Key/PublicKey.js +0 -2
- package/dist/esm/Key/PublicKey.js.map +0 -1
- package/dist/esm/Key/index.js +0 -5
- package/dist/esm/Key/index.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/types/Key/AddressValue.d.ts +0 -13
- package/dist/types/Key/AddressValue.d.ts.map +0 -1
- package/dist/types/Key/EllipticKey.d.ts +0 -4
- package/dist/types/Key/EllipticKey.d.ts.map +0 -1
- package/dist/types/Key/KeyPair.d.ts +0 -12
- package/dist/types/Key/KeyPair.d.ts.map +0 -1
- package/dist/types/Key/PrivateKey.d.ts +0 -13
- package/dist/types/Key/PrivateKey.d.ts.map +0 -1
- package/dist/types/Key/PublicKey.d.ts +0 -12
- package/dist/types/Key/PublicKey.d.ts.map +0 -1
- package/dist/types/Key/index.d.ts +0 -5
- package/dist/types/Key/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Data, DataLike } from '@xyo-network/core';
|
|
2
|
+
|
|
3
|
+
interface EllipticKeyInstance extends Data {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface AddressValueInstance extends EllipticKeyInstance {
|
|
7
|
+
verify(msg: DataLike, signature: DataLike): boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AddressValueStatic {
|
|
10
|
+
new (address: DataLike): AddressValueInstance;
|
|
11
|
+
addressFromAddressOrPublicKey(bytes: DataLike): Uint8Array | string;
|
|
12
|
+
addressFromPublicKey(key: DataLike): string;
|
|
13
|
+
isAddress(value: unknown): boolean;
|
|
14
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string, address: DataLike): boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface PublicKeyInstance extends EllipticKeyInstance {
|
|
18
|
+
get address(): AddressValueInstance;
|
|
19
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean | Promise<boolean>;
|
|
20
|
+
}
|
|
21
|
+
interface PublicKeyStatic {
|
|
22
|
+
new (bytes: DataLike): PublicKeyInstance;
|
|
23
|
+
isPublicKey(value: unknown): boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface PrivateKeyInstance extends EllipticKeyInstance {
|
|
27
|
+
get public(): PublicKeyInstance;
|
|
28
|
+
sign(hash: DataLike): Uint8Array | Promise<Uint8Array>;
|
|
29
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean | Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
interface PrivateKeyStatic {
|
|
32
|
+
new (value?: DataLike): PrivateKeyInstance;
|
|
33
|
+
isPrivateKey(value: unknown): boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface KeyPairInstance {
|
|
37
|
+
get private(): PrivateKeyInstance;
|
|
38
|
+
get public(): PublicKeyInstance;
|
|
39
|
+
}
|
|
40
|
+
interface KeyPairStatic {
|
|
41
|
+
new (privateKeyData?: DataLike): KeyPairInstance;
|
|
42
|
+
isXyoKeyPair(value: unknown): boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { AddressValueInstance, AddressValueStatic, KeyPairInstance, KeyPairStatic, PrivateKeyInstance, PrivateKeyStatic, PublicKeyInstance, PublicKeyStatic };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Data, DataLike } from '@xyo-network/core';
|
|
2
|
+
|
|
3
|
+
interface EllipticKeyInstance extends Data {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface AddressValueInstance extends EllipticKeyInstance {
|
|
7
|
+
verify(msg: DataLike, signature: DataLike): boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AddressValueStatic {
|
|
10
|
+
new (address: DataLike): AddressValueInstance;
|
|
11
|
+
addressFromAddressOrPublicKey(bytes: DataLike): Uint8Array | string;
|
|
12
|
+
addressFromPublicKey(key: DataLike): string;
|
|
13
|
+
isAddress(value: unknown): boolean;
|
|
14
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string, address: DataLike): boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface PublicKeyInstance extends EllipticKeyInstance {
|
|
18
|
+
get address(): AddressValueInstance;
|
|
19
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean | Promise<boolean>;
|
|
20
|
+
}
|
|
21
|
+
interface PublicKeyStatic {
|
|
22
|
+
new (bytes: DataLike): PublicKeyInstance;
|
|
23
|
+
isPublicKey(value: unknown): boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface PrivateKeyInstance extends EllipticKeyInstance {
|
|
27
|
+
get public(): PublicKeyInstance;
|
|
28
|
+
sign(hash: DataLike): Uint8Array | Promise<Uint8Array>;
|
|
29
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean | Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
interface PrivateKeyStatic {
|
|
32
|
+
new (value?: DataLike): PrivateKeyInstance;
|
|
33
|
+
isPrivateKey(value: unknown): boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface KeyPairInstance {
|
|
37
|
+
get private(): PrivateKeyInstance;
|
|
38
|
+
get public(): PublicKeyInstance;
|
|
39
|
+
}
|
|
40
|
+
interface KeyPairStatic {
|
|
41
|
+
new (privateKeyData?: DataLike): KeyPairInstance;
|
|
42
|
+
isXyoKeyPair(value: unknown): boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { AddressValueInstance, AddressValueStatic, KeyPairInstance, KeyPairStatic, PrivateKeyInstance, PrivateKeyStatic, PublicKeyInstance, PublicKeyStatic };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var src_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(src_exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './Key'\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -10,45 +10,58 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/core": "~2.
|
|
13
|
+
"@xyo-network/core": "~2.73.0"
|
|
14
14
|
},
|
|
15
15
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@xylabs/ts-scripts-yarn3": "^2.19.
|
|
18
|
-
"@xylabs/tsconfig": "^2.19.
|
|
17
|
+
"@xylabs/ts-scripts-yarn3": "^2.19.5",
|
|
18
|
+
"@xylabs/tsconfig": "^2.19.5",
|
|
19
|
+
"publint": "^0.2.2",
|
|
20
|
+
"tsup": "^7.2.0",
|
|
19
21
|
"typescript": "^5.2.2"
|
|
20
22
|
},
|
|
21
|
-
"browser": "dist/esm/index.js",
|
|
22
|
-
"main": "dist/cjs/index.js",
|
|
23
|
-
"module": "dist/esm/index.js",
|
|
24
23
|
"docs": "dist/docs.json",
|
|
25
24
|
"exports": {
|
|
26
25
|
".": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
30
29
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
}
|
|
35
|
-
"default": "./dist/esm/index.js"
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/index.d.mts",
|
|
32
|
+
"default": "./dist/index.mjs"
|
|
33
|
+
}
|
|
36
34
|
},
|
|
37
35
|
"./dist/docs.json": {
|
|
38
36
|
"default": "./dist/docs.json"
|
|
39
37
|
},
|
|
38
|
+
"./cjs": {
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./docs": {
|
|
42
|
+
"default": "./dist/docs.json"
|
|
43
|
+
},
|
|
44
|
+
"./esm": {
|
|
45
|
+
"default": "./dist/index.mjs"
|
|
46
|
+
},
|
|
40
47
|
"./package.json": "./package.json"
|
|
41
48
|
},
|
|
49
|
+
"main": "dist/index.js",
|
|
50
|
+
"module": "dist/index.mjs",
|
|
42
51
|
"homepage": "https://xyo.network",
|
|
43
52
|
"license": "LGPL-3.0",
|
|
44
53
|
"publishConfig": {
|
|
45
54
|
"access": "public"
|
|
46
55
|
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"package-compile": "tsup && publint",
|
|
58
|
+
"package-recompile": "tsup && publint"
|
|
59
|
+
},
|
|
47
60
|
"repository": {
|
|
48
61
|
"type": "git",
|
|
49
62
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
50
63
|
},
|
|
51
64
|
"sideEffects": false,
|
|
52
|
-
"types": "dist/
|
|
53
|
-
"version": "2.
|
|
65
|
+
"types": "dist/index.d.ts",
|
|
66
|
+
"version": "2.73.0"
|
|
54
67
|
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/no-default-export
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
bundle: true,
|
|
6
|
+
cjsInterop: true,
|
|
7
|
+
clean: true,
|
|
8
|
+
dts: {
|
|
9
|
+
entry: ['src/index.ts'],
|
|
10
|
+
},
|
|
11
|
+
entry: ['src/index.ts'],
|
|
12
|
+
format: ['cjs', 'esm'],
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
splitting: false,
|
|
15
|
+
tsconfig: 'tsconfig.json',
|
|
16
|
+
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddressValue.js","sourceRoot":"","sources":["../../../src/Key/AddressValue.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EllipticKey.js","sourceRoot":"","sources":["../../../src/Key/EllipticKey.ts"],"names":[],"mappings":""}
|
package/dist/cjs/Key/KeyPair.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeyPair.js","sourceRoot":"","sources":["../../../src/Key/KeyPair.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateKey.js","sourceRoot":"","sources":["../../../src/Key/PrivateKey.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PublicKey.js","sourceRoot":"","sources":["../../../src/Key/PublicKey.ts"],"names":[],"mappings":""}
|
package/dist/cjs/Key/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./AddressValue"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./KeyPair"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./PrivateKey"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./PublicKey"), exports);
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Key/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,oDAAyB;AACzB,uDAA4B;AAC5B,sDAA2B"}
|
package/dist/cjs/index.js
DELETED
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAqB"}
|