@virtonetwork/authenticators-substrate 1.1.3 → 1.1.4
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.cjs +1 -1
- package/dist/cjs/types.cjs +1 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/types.d.ts +4 -7
- package/dist/esm/types.js +1 -2
- package/package.json +6 -7
- package/dist/cjs/package.json +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -38,11 +38,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.SubstrateKey = exports.KREIVO_AUTHORITY_ID = exports.KeyRegistration = exports.KeySignature = exports.SignedMessage = void 0;
|
|
40
40
|
var signer_1 = require("@virtonetwork/signer");
|
|
41
|
+
var polkadot_api_1 = require("polkadot-api");
|
|
41
42
|
var types_ts_1 = require("./types.cjs");
|
|
42
43
|
Object.defineProperty(exports, "KeyRegistration", { enumerable: true, get: function () { return types_ts_1.KeyRegistration; } });
|
|
43
44
|
Object.defineProperty(exports, "KeySignature", { enumerable: true, get: function () { return types_ts_1.KeySignature; } });
|
|
44
45
|
Object.defineProperty(exports, "SignedMessage", { enumerable: true, get: function () { return types_ts_1.SignedMessage; } });
|
|
45
|
-
var polkadot_api_1 = require("polkadot-api");
|
|
46
46
|
exports.KREIVO_AUTHORITY_ID = polkadot_api_1.Binary.fromText("kreivo_p".padEnd(32, "\0"));
|
|
47
47
|
var SubstrateKey = /** @class */ (function () {
|
|
48
48
|
function SubstrateKey(userId, signer, getChallenge, addressGenerator) {
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -7,12 +7,11 @@ exports.MultiSignature = (0, substrate_bindings_1.Variant)({
|
|
|
7
7
|
Ed25519: (0, substrate_bindings_1.Bin)(64),
|
|
8
8
|
Sr25519: (0, substrate_bindings_1.Bin)(64),
|
|
9
9
|
Ecdsa: (0, substrate_bindings_1.Bin)(65),
|
|
10
|
-
Eth: (0, substrate_bindings_1.Bin)(65),
|
|
11
10
|
});
|
|
12
11
|
exports.SignedMessage = (0, scale_ts_1.Struct)({
|
|
13
12
|
context: scale_ts_1.u32,
|
|
14
|
-
challenge: (0, substrate_bindings_1.Bin)(32),
|
|
15
13
|
authority_id: (0, substrate_bindings_1.Bin)(32),
|
|
14
|
+
challenge: (0, substrate_bindings_1.Bin)(32),
|
|
16
15
|
});
|
|
17
16
|
exports.KeyRegistration = (0, scale_ts_1.Struct)({
|
|
18
17
|
message: exports.SignedMessage,
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AddressGenerator, Authenticator, Challenger, TPassAuthenticate } from "@virtonetwork/signer";
|
|
2
|
-
import { KeyRegistration, KeySignature, SignedMessage, SubstrateSigner, TKeyRegistration, TKeySignature, TSignedMessage } from "./types.ts";
|
|
1
|
+
import { type AddressGenerator, type Authenticator, type Challenger, type TPassAuthenticate } from "@virtonetwork/signer";
|
|
3
2
|
import { Binary } from "polkadot-api";
|
|
3
|
+
import { KeyRegistration, KeySignature, SignedMessage, type SubstrateSigner, type TKeyRegistration, type TKeySignature, type TSignedMessage } from "./types.ts";
|
|
4
4
|
export type { SubstrateSigner, TKeyRegistration, TKeySignature, TSignedMessage, };
|
|
5
5
|
export { SignedMessage, KeySignature, KeyRegistration };
|
|
6
6
|
export declare const KREIVO_AUTHORITY_ID: Binary;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { kreivoPassDefaultAddressGenerator, } from "@virtonetwork/signer";
|
|
2
|
-
import { KeyRegistration, KeySignature, SignedMessage, } from "./types.js";
|
|
3
2
|
import { Binary } from "polkadot-api";
|
|
3
|
+
import { KeyRegistration, KeySignature, SignedMessage, } from "./types.js";
|
|
4
4
|
export { SignedMessage, KeySignature, KeyRegistration };
|
|
5
5
|
export const KREIVO_AUTHORITY_ID = Binary.fromText("kreivo_p".padEnd(32, "\0"));
|
|
6
6
|
export class SubstrateKey {
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FixedSizeBinary } from "@polkadot-api/substrate-bindings";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type FixedSizeBinary } from "@polkadot-api/substrate-bindings";
|
|
2
|
+
import type { AuthorityId } from "@virtonetwork/signer";
|
|
3
|
+
import { type Codec } from "scale-ts";
|
|
4
4
|
export type SubstrateSigner = {
|
|
5
5
|
publicKey: Uint8Array;
|
|
6
|
-
signingType: "Ed25519" | "Sr25519" | "Ecdsa"
|
|
6
|
+
signingType: "Ed25519" | "Sr25519" | "Ecdsa";
|
|
7
7
|
sign: (bytes: Uint8Array) => Promise<Uint8Array> | Uint8Array;
|
|
8
8
|
};
|
|
9
9
|
export type TSignedMessage<Cx> = {
|
|
@@ -20,9 +20,6 @@ export type TMutiSignature = {
|
|
|
20
20
|
} | {
|
|
21
21
|
type: "Ecdsa";
|
|
22
22
|
value: FixedSizeBinary<65>;
|
|
23
|
-
} | {
|
|
24
|
-
type: "Eth";
|
|
25
|
-
value: FixedSizeBinary<65>;
|
|
26
23
|
};
|
|
27
24
|
export declare const MultiSignature: Codec<TMutiSignature>;
|
|
28
25
|
export declare const SignedMessage: Codec<TSignedMessage<number>>;
|
package/dist/esm/types.js
CHANGED
|
@@ -4,12 +4,11 @@ export const MultiSignature = Variant({
|
|
|
4
4
|
Ed25519: Bin(64),
|
|
5
5
|
Sr25519: Bin(64),
|
|
6
6
|
Ecdsa: Bin(65),
|
|
7
|
-
Eth: Bin(65),
|
|
8
7
|
});
|
|
9
8
|
export const SignedMessage = Struct({
|
|
10
9
|
context: u32,
|
|
11
|
-
challenge: Bin(32),
|
|
12
10
|
authority_id: Bin(32),
|
|
11
|
+
challenge: Bin(32),
|
|
13
12
|
});
|
|
14
13
|
export const KeyRegistration = Struct({
|
|
15
14
|
message: SignedMessage,
|
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.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"browser": "./dist/esm/index.js",
|
|
21
21
|
"types": "./dist/esm/index.d.ts",
|
|
22
22
|
"scripts": {
|
|
23
|
-
"test": "
|
|
23
|
+
"test": "tsx test/test.ts",
|
|
24
24
|
"build": "tsc && tsc -p tsconfig.cjs.json && node ../../scripts/fix-cjs.js dist/cjs",
|
|
25
25
|
"prepack": "npm run build"
|
|
26
26
|
},
|
|
@@ -36,17 +36,16 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polkadot-labs/hdkd": "0.0.26",
|
|
39
|
-
"@virtonetwork/signer": "^1.2.
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"ts-node": "^10.9.2"
|
|
39
|
+
"@virtonetwork/signer": "^1.2.4"
|
|
43
40
|
},
|
|
41
|
+
"devDependencies": {},
|
|
44
42
|
"repository": {
|
|
45
43
|
"url": "https://github.com/virto-network/papi-signers",
|
|
46
44
|
"directory": "authenticators/substrate"
|
|
47
45
|
},
|
|
48
46
|
"publishConfig": {
|
|
49
47
|
"registry": "https://registry.npmjs.org/",
|
|
50
|
-
"access": "public"
|
|
48
|
+
"access": "public",
|
|
49
|
+
"provenance": true
|
|
51
50
|
}
|
|
52
51
|
}
|
package/dist/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "commonjs"}
|