@virtonetwork/authenticators-substrate 1.1.0 → 1.1.2
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 +4 -1
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types.js +7 -2
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/types.d.ts +3 -2
- package/dist/esm/types.js +6 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -36,9 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.SubstrateKey = exports.KREIVO_AUTHORITY_ID = void 0;
|
|
39
|
+
exports.SubstrateKey = exports.KREIVO_AUTHORITY_ID = exports.KeyRegistration = exports.KeySignature = exports.SignedMessage = void 0;
|
|
40
40
|
var signer_1 = require("@virtonetwork/signer");
|
|
41
41
|
var types_ts_1 = require("./types.js");
|
|
42
|
+
Object.defineProperty(exports, "KeyRegistration", { enumerable: true, get: function () { return types_ts_1.KeyRegistration; } });
|
|
43
|
+
Object.defineProperty(exports, "KeySignature", { enumerable: true, get: function () { return types_ts_1.KeySignature; } });
|
|
44
|
+
Object.defineProperty(exports, "SignedMessage", { enumerable: true, get: function () { return types_ts_1.SignedMessage; } });
|
|
42
45
|
var polkadot_api_1 = require("polkadot-api");
|
|
43
46
|
exports.KREIVO_AUTHORITY_ID = polkadot_api_1.Binary.fromText("kreivo_p".padEnd(32, "\0"));
|
|
44
47
|
var SubstrateKey = /** @class */ (function () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "commonjs"}
|
package/dist/cjs/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeySignature = exports.SignedMessage = exports.MultiSignature = void 0;
|
|
3
|
+
exports.KeySignature = exports.KeyRegistration = exports.SignedMessage = exports.MultiSignature = void 0;
|
|
4
4
|
var substrate_bindings_1 = require("@polkadot-api/substrate-bindings");
|
|
5
5
|
var scale_ts_1 = require("scale-ts");
|
|
6
6
|
exports.MultiSignature = (0, substrate_bindings_1.Variant)({
|
|
@@ -11,9 +11,14 @@ exports.MultiSignature = (0, substrate_bindings_1.Variant)({
|
|
|
11
11
|
});
|
|
12
12
|
exports.SignedMessage = (0, scale_ts_1.Struct)({
|
|
13
13
|
context: scale_ts_1.u32,
|
|
14
|
-
challenge: (0, substrate_bindings_1.Bin)(),
|
|
14
|
+
challenge: (0, substrate_bindings_1.Bin)(32),
|
|
15
15
|
authority_id: (0, substrate_bindings_1.Bin)(32),
|
|
16
16
|
});
|
|
17
|
+
exports.KeyRegistration = (0, scale_ts_1.Struct)({
|
|
18
|
+
message: exports.SignedMessage,
|
|
19
|
+
public: (0, substrate_bindings_1.Bin)(32),
|
|
20
|
+
signature: exports.MultiSignature,
|
|
21
|
+
});
|
|
17
22
|
exports.KeySignature = (0, scale_ts_1.Struct)({
|
|
18
23
|
message: exports.SignedMessage,
|
|
19
24
|
signature: exports.MultiSignature,
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AddressGenerator, Authenticator, Challenger, TPassAuthenticate } from "@virtonetwork/signer";
|
|
2
|
-
import { SubstrateSigner, TKeyRegistration } from "./types.ts";
|
|
2
|
+
import { KeyRegistration, KeySignature, SignedMessage, SubstrateSigner, TKeyRegistration, TKeySignature, TSignedMessage } from "./types.ts";
|
|
3
3
|
import { Binary } from "polkadot-api";
|
|
4
|
+
export type { SubstrateSigner, TKeyRegistration, TKeySignature, TSignedMessage, };
|
|
5
|
+
export { SignedMessage, KeySignature, KeyRegistration };
|
|
4
6
|
export declare const KREIVO_AUTHORITY_ID: Binary;
|
|
5
7
|
export declare class SubstrateKey implements Authenticator<number> {
|
|
6
8
|
readonly userId: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { kreivoPassDefaultAddressGenerator, } from "@virtonetwork/signer";
|
|
2
|
-
import { KeySignature, SignedMessage, } from "./types.js";
|
|
2
|
+
import { KeyRegistration, KeySignature, SignedMessage, } from "./types.js";
|
|
3
3
|
import { Binary } from "polkadot-api";
|
|
4
|
+
export { SignedMessage, KeySignature, KeyRegistration };
|
|
4
5
|
export const KREIVO_AUTHORITY_ID = Binary.fromText("kreivo_p".padEnd(32, "\0"));
|
|
5
6
|
export class SubstrateKey {
|
|
6
7
|
userId;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FixedSizeBinary } from "@polkadot-api/substrate-bindings";
|
|
2
2
|
import { Codec } from "scale-ts";
|
|
3
3
|
import { AuthorityId } from "@virtonetwork/signer";
|
|
4
4
|
export type SubstrateSigner = {
|
|
@@ -8,7 +8,7 @@ export type SubstrateSigner = {
|
|
|
8
8
|
};
|
|
9
9
|
export type TSignedMessage<Cx> = {
|
|
10
10
|
context: Cx;
|
|
11
|
-
challenge:
|
|
11
|
+
challenge: FixedSizeBinary<32>;
|
|
12
12
|
authority_id: AuthorityId;
|
|
13
13
|
};
|
|
14
14
|
export type TMutiSignature = {
|
|
@@ -31,6 +31,7 @@ export type TKeyRegistration<Cx> = {
|
|
|
31
31
|
public: FixedSizeBinary<32>;
|
|
32
32
|
signature: TMutiSignature;
|
|
33
33
|
};
|
|
34
|
+
export declare const KeyRegistration: Codec<TKeyRegistration<number>>;
|
|
34
35
|
export type TKeySignature<Cx> = {
|
|
35
36
|
message: TSignedMessage<Cx>;
|
|
36
37
|
signature: TMutiSignature;
|
package/dist/esm/types.js
CHANGED
|
@@ -8,9 +8,14 @@ export const MultiSignature = Variant({
|
|
|
8
8
|
});
|
|
9
9
|
export const SignedMessage = Struct({
|
|
10
10
|
context: u32,
|
|
11
|
-
challenge: Bin(),
|
|
11
|
+
challenge: Bin(32),
|
|
12
12
|
authority_id: Bin(32),
|
|
13
13
|
});
|
|
14
|
+
export const KeyRegistration = Struct({
|
|
15
|
+
message: SignedMessage,
|
|
16
|
+
public: Bin(32),
|
|
17
|
+
signature: MultiSignature,
|
|
18
|
+
});
|
|
14
19
|
export const KeySignature = Struct({
|
|
15
20
|
message: SignedMessage,
|
|
16
21
|
signature: MultiSignature,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virtonetwork/authenticators-substrate",
|
|
3
3
|
"description": "An Authenticator compatible with KreivoPassSigner that uses substrate-style signatures",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"types": "./dist/esm/index.d.ts",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"test": "node --loader ts-node/esm test/test.ts",
|
|
24
|
-
"build": "tsc && tsc -p tsconfig.cjs.json",
|
|
24
|
+
"build": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
25
25
|
"prepack": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"author": "Virto Network <contact@virto.networks>",
|