@novasamatech/host-api 0.5.2 → 0.5.4-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/README.md +3 -3
- package/dist/helpers.d.ts +0 -29
- package/dist/helpers.js +0 -30
- package/dist/hostApi.d.ts +3 -2
- package/dist/hostApi.js +65 -42
- package/dist/index.d.ts +8 -7
- package/dist/index.js +5 -5
- package/dist/protocol/commonCodecs.d.ts +3 -38
- package/dist/protocol/commonCodecs.js +2 -59
- package/dist/protocol/impl.d.ts +22 -14
- package/dist/protocol/impl.js +23 -15
- package/dist/protocol/messageCodec.d.ts +554 -668
- package/dist/protocol/messageCodec.js +3 -3
- package/dist/protocol/v1/accounts.d.ts +37 -209
- package/dist/protocol/v1/accounts.js +2 -1
- package/dist/protocol/v1/chat.d.ts +224 -149
- package/dist/protocol/v1/chat.js +51 -12
- package/dist/protocol/v1/createTransaction.d.ts +21 -116
- package/dist/protocol/v1/createTransaction.js +7 -5
- package/dist/protocol/v1/feature.d.ts +3 -7
- package/dist/protocol/v1/feature.js +2 -1
- package/dist/protocol/v1/handshake.d.ts +15 -75
- package/dist/protocol/v1/handshake.js +2 -1
- package/dist/protocol/v1/jsonRpc.d.ts +3 -7
- package/dist/protocol/v1/permission.d.ts +14 -54
- package/dist/protocol/v1/permission.js +2 -1
- package/dist/protocol/v1/sign.d.ts +19 -90
- package/dist/protocol/v1/sign.js +6 -4
- package/dist/protocol/v1/statementStore.d.ts +153 -74
- package/dist/protocol/v1/statementStore.js +18 -1
- package/dist/protocol/v1/storage.d.ts +24 -80
- package/dist/protocol/v1/storage.js +5 -4
- package/dist/transport.js +5 -4
- package/dist/types.d.ts +6 -4
- package/package.json +2 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { Enum, ErrEnum, Hex, Nullable } from '@novasamatech/scale';
|
|
1
2
|
import { Bytes, Result, Struct, Tuple, Vector, _void, enhanceCodec, str, u32, u8 } from 'scale-ts';
|
|
2
|
-
import {
|
|
3
|
+
import { GenericErr } from '../commonCodecs.js';
|
|
3
4
|
import { ProductAccountId } from './accounts.js';
|
|
4
5
|
/**
|
|
5
6
|
* createTransaction implementation
|
|
6
7
|
* @see https://github.com/polkadot-js/api/issues/6213
|
|
7
8
|
*/
|
|
8
9
|
export const CreateTransactionErr = ErrEnum('CreateTransactionErr', {
|
|
9
|
-
FailedToDecode: [_void, '
|
|
10
|
-
Rejected: [_void, '
|
|
10
|
+
FailedToDecode: [_void, 'Failed to decode'],
|
|
11
|
+
Rejected: [_void, 'Rejected'],
|
|
11
12
|
// Unsupported payload version
|
|
12
13
|
// Failed to infer missing extensions, some extension is unsupported, etc.
|
|
13
|
-
NotSupported: [str, '
|
|
14
|
-
|
|
14
|
+
NotSupported: [str, 'Not Supported'],
|
|
15
|
+
PermissionDenied: [_void, 'Permission denied'],
|
|
16
|
+
Unknown: [GenericErr, 'Unknown error'],
|
|
15
17
|
});
|
|
16
18
|
export const TxPayloadExtensionV1 = Struct({
|
|
17
19
|
id: str,
|
|
@@ -6,10 +6,6 @@ export declare const FeatureV1_request: import("scale-ts").Codec<{
|
|
|
6
6
|
tag: "Chain";
|
|
7
7
|
value: `0x${string}`;
|
|
8
8
|
}>;
|
|
9
|
-
export declare const FeatureV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<boolean,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
payload: {
|
|
13
|
-
reason: string;
|
|
14
|
-
};
|
|
15
|
-
}>>;
|
|
9
|
+
export declare const FeatureV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
10
|
+
reason: string;
|
|
11
|
+
}, "GenericError">>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Enum } from '@novasamatech/scale';
|
|
1
2
|
import { Result, bool } from 'scale-ts';
|
|
2
|
-
import {
|
|
3
|
+
import { GenericError, GenesisHash } from '../commonCodecs.js';
|
|
3
4
|
export const Feature = Enum({
|
|
4
5
|
Chain: GenesisHash,
|
|
5
6
|
});
|
|
@@ -1,66 +1,18 @@
|
|
|
1
|
-
export declare const HandshakeErr: [import("scale-ts").Encoder<(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const HandshakeErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
2
|
+
reason: string;
|
|
3
|
+
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
4
|
+
reason: string;
|
|
5
|
+
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>] & {
|
|
6
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
5
7
|
reason: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
name: "HandshakeErr::Timeout";
|
|
9
|
-
className: string;
|
|
10
|
-
payload: undefined;
|
|
11
|
-
}) | (Error & {
|
|
12
|
-
name: "HandshakeErr::UnsupportedProtocolVersion";
|
|
13
|
-
className: string;
|
|
14
|
-
payload: undefined;
|
|
15
|
-
})>, import("scale-ts").Decoder<(Error & {
|
|
16
|
-
name: "HandshakeErr::Unknown";
|
|
17
|
-
className: string;
|
|
18
|
-
payload: {
|
|
8
|
+
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>;
|
|
9
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
19
10
|
reason: string;
|
|
20
|
-
}
|
|
21
|
-
}) | (Error & {
|
|
22
|
-
name: "HandshakeErr::Timeout";
|
|
23
|
-
className: string;
|
|
24
|
-
payload: undefined;
|
|
25
|
-
}) | (Error & {
|
|
26
|
-
name: "HandshakeErr::UnsupportedProtocolVersion";
|
|
27
|
-
className: string;
|
|
28
|
-
payload: undefined;
|
|
29
|
-
})>] & {
|
|
30
|
-
enc: import("scale-ts").Encoder<(Error & {
|
|
31
|
-
name: "HandshakeErr::Unknown";
|
|
32
|
-
className: string;
|
|
33
|
-
payload: {
|
|
34
|
-
reason: string;
|
|
35
|
-
};
|
|
36
|
-
}) | (Error & {
|
|
37
|
-
name: "HandshakeErr::Timeout";
|
|
38
|
-
className: string;
|
|
39
|
-
payload: undefined;
|
|
40
|
-
}) | (Error & {
|
|
41
|
-
name: "HandshakeErr::UnsupportedProtocolVersion";
|
|
42
|
-
className: string;
|
|
43
|
-
payload: undefined;
|
|
44
|
-
})>;
|
|
45
|
-
dec: import("scale-ts").Decoder<(Error & {
|
|
46
|
-
name: "HandshakeErr::Unknown";
|
|
47
|
-
className: string;
|
|
48
|
-
payload: {
|
|
49
|
-
reason: string;
|
|
50
|
-
};
|
|
51
|
-
}) | (Error & {
|
|
52
|
-
name: "HandshakeErr::Timeout";
|
|
53
|
-
className: string;
|
|
54
|
-
payload: undefined;
|
|
55
|
-
}) | (Error & {
|
|
56
|
-
name: "HandshakeErr::UnsupportedProtocolVersion";
|
|
57
|
-
className: string;
|
|
58
|
-
payload: undefined;
|
|
59
|
-
})>;
|
|
11
|
+
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>;
|
|
60
12
|
} & {
|
|
61
|
-
readonly Timeout: import("
|
|
62
|
-
readonly UnsupportedProtocolVersion: import("
|
|
63
|
-
readonly Unknown: import("
|
|
13
|
+
readonly Timeout: import("@novasamatech/scale").ErrCodec<undefined, "HandshakeErr::Timeout">;
|
|
14
|
+
readonly UnsupportedProtocolVersion: import("@novasamatech/scale").ErrCodec<undefined, "HandshakeErr::UnsupportedProtocolVersion">;
|
|
15
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
64
16
|
reason: string;
|
|
65
17
|
}, "HandshakeErr::Unknown">;
|
|
66
18
|
};
|
|
@@ -68,18 +20,6 @@ export declare const HandshakeErr: [import("scale-ts").Encoder<(Error & {
|
|
|
68
20
|
* HandshakeV1_request = 1 - JAM codec
|
|
69
21
|
*/
|
|
70
22
|
export declare const HandshakeV1_request: import("scale-ts").Codec<number>;
|
|
71
|
-
export declare const HandshakeV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
payload: {
|
|
75
|
-
reason: string;
|
|
76
|
-
};
|
|
77
|
-
}) | (Error & {
|
|
78
|
-
name: "HandshakeErr::Timeout";
|
|
79
|
-
className: string;
|
|
80
|
-
payload: undefined;
|
|
81
|
-
}) | (Error & {
|
|
82
|
-
name: "HandshakeErr::UnsupportedProtocolVersion";
|
|
83
|
-
className: string;
|
|
84
|
-
payload: undefined;
|
|
85
|
-
})>>;
|
|
23
|
+
export declare const HandshakeV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
24
|
+
reason: string;
|
|
25
|
+
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ErrEnum } from '@novasamatech/scale';
|
|
1
2
|
import { Result, _void, u8 } from 'scale-ts';
|
|
2
|
-
import {
|
|
3
|
+
import { GenericErr } from '../commonCodecs.js';
|
|
3
4
|
export const HandshakeErr = ErrEnum('HandshakeErr', {
|
|
4
5
|
Timeout: [_void, 'Handshake: timeout'],
|
|
5
6
|
UnsupportedProtocolVersion: [_void, 'Handshake: unsupported protocol version'],
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export declare const JsonRpcMessageSendV1_request: import("scale-ts").Codec<[`0x${string}`, string]>;
|
|
2
|
-
export declare const JsonRpcMessageSendV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
payload: {
|
|
6
|
-
reason: string;
|
|
7
|
-
};
|
|
8
|
-
}>>;
|
|
2
|
+
export declare const JsonRpcMessageSendV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, import("packages/scale/dist/err.js").CodecError<{
|
|
3
|
+
reason: string;
|
|
4
|
+
}, "GenericError">>>;
|
|
9
5
|
export declare const JsonRpcMessageSubscribeV1_start: import("scale-ts").Codec<`0x${string}`>;
|
|
10
6
|
export declare const JsonRpcMessageSubscribeV1_receive: import("scale-ts").Codec<string>;
|
|
@@ -1,49 +1,17 @@
|
|
|
1
|
-
export declare const PermissionErr: [import("scale-ts").Encoder<(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
className: string;
|
|
8
|
-
payload: {
|
|
1
|
+
export declare const PermissionErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "PermissionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
2
|
+
reason: string;
|
|
3
|
+
}, "PermissionErr::Unknown">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "PermissionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
4
|
+
reason: string;
|
|
5
|
+
}, "PermissionErr::Unknown">>] & {
|
|
6
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "PermissionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
9
7
|
reason: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
name: "PermissionErr::Rejected";
|
|
13
|
-
className: string;
|
|
14
|
-
payload: undefined;
|
|
15
|
-
}) | (Error & {
|
|
16
|
-
name: "PermissionErr::Unknown";
|
|
17
|
-
className: string;
|
|
18
|
-
payload: {
|
|
8
|
+
}, "PermissionErr::Unknown">>;
|
|
9
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "PermissionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
19
10
|
reason: string;
|
|
20
|
-
}
|
|
21
|
-
})>] & {
|
|
22
|
-
enc: import("scale-ts").Encoder<(Error & {
|
|
23
|
-
name: "PermissionErr::Rejected";
|
|
24
|
-
className: string;
|
|
25
|
-
payload: undefined;
|
|
26
|
-
}) | (Error & {
|
|
27
|
-
name: "PermissionErr::Unknown";
|
|
28
|
-
className: string;
|
|
29
|
-
payload: {
|
|
30
|
-
reason: string;
|
|
31
|
-
};
|
|
32
|
-
})>;
|
|
33
|
-
dec: import("scale-ts").Decoder<(Error & {
|
|
34
|
-
name: "PermissionErr::Rejected";
|
|
35
|
-
className: string;
|
|
36
|
-
payload: undefined;
|
|
37
|
-
}) | (Error & {
|
|
38
|
-
name: "PermissionErr::Unknown";
|
|
39
|
-
className: string;
|
|
40
|
-
payload: {
|
|
41
|
-
reason: string;
|
|
42
|
-
};
|
|
43
|
-
})>;
|
|
11
|
+
}, "PermissionErr::Unknown">>;
|
|
44
12
|
} & {
|
|
45
|
-
readonly Rejected: import("
|
|
46
|
-
readonly Unknown: import("
|
|
13
|
+
readonly Rejected: import("@novasamatech/scale").ErrCodec<undefined, "PermissionErr::Rejected">;
|
|
14
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
47
15
|
reason: string;
|
|
48
16
|
}, "PermissionErr::Unknown">;
|
|
49
17
|
};
|
|
@@ -77,14 +45,6 @@ export declare const PermissionRequestV1_request: import("scale-ts").Codec<{
|
|
|
77
45
|
tag: "NetworkRequest";
|
|
78
46
|
value: string[];
|
|
79
47
|
}>;
|
|
80
|
-
export declare const PermissionRequestV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
payload: undefined;
|
|
84
|
-
}) | (Error & {
|
|
85
|
-
name: "PermissionErr::Unknown";
|
|
86
|
-
className: string;
|
|
87
|
-
payload: {
|
|
88
|
-
reason: string;
|
|
89
|
-
};
|
|
90
|
-
})>>;
|
|
48
|
+
export declare const PermissionRequestV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<undefined, "PermissionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
49
|
+
reason: string;
|
|
50
|
+
}, "PermissionErr::Unknown">>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Enum, ErrEnum } from '@novasamatech/scale';
|
|
1
2
|
import { Result, Struct, Vector, _void, str } from 'scale-ts';
|
|
2
|
-
import {
|
|
3
|
+
import { GenericErr, GenesisHash } from '../commonCodecs.js';
|
|
3
4
|
export const PermissionErr = ErrEnum('PermissionErr', {
|
|
4
5
|
Rejected: [_void, 'Permission: rejected'],
|
|
5
6
|
Unknown: [GenericErr, 'Permission: unknown error'],
|
|
@@ -1,66 +1,19 @@
|
|
|
1
|
-
export declare const SigningErr: [import("scale-ts").Encoder<(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}) | (
|
|
6
|
-
|
|
7
|
-
className: string;
|
|
8
|
-
payload: {
|
|
1
|
+
export declare const SigningErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
2
|
+
reason: string;
|
|
3
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
4
|
+
reason: string;
|
|
5
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>] & {
|
|
6
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
9
7
|
reason: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
name: "SigningErr::FailedToDecode";
|
|
13
|
-
className: string;
|
|
14
|
-
payload: undefined;
|
|
15
|
-
})>, import("scale-ts").Decoder<(Error & {
|
|
16
|
-
name: "SigningErr::Rejected";
|
|
17
|
-
className: string;
|
|
18
|
-
payload: undefined;
|
|
19
|
-
}) | (Error & {
|
|
20
|
-
name: "SigningErr::Unknown";
|
|
21
|
-
className: string;
|
|
22
|
-
payload: {
|
|
8
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>;
|
|
9
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
23
10
|
reason: string;
|
|
24
|
-
}
|
|
25
|
-
}) | (Error & {
|
|
26
|
-
name: "SigningErr::FailedToDecode";
|
|
27
|
-
className: string;
|
|
28
|
-
payload: undefined;
|
|
29
|
-
})>] & {
|
|
30
|
-
enc: import("scale-ts").Encoder<(Error & {
|
|
31
|
-
name: "SigningErr::Rejected";
|
|
32
|
-
className: string;
|
|
33
|
-
payload: undefined;
|
|
34
|
-
}) | (Error & {
|
|
35
|
-
name: "SigningErr::Unknown";
|
|
36
|
-
className: string;
|
|
37
|
-
payload: {
|
|
38
|
-
reason: string;
|
|
39
|
-
};
|
|
40
|
-
}) | (Error & {
|
|
41
|
-
name: "SigningErr::FailedToDecode";
|
|
42
|
-
className: string;
|
|
43
|
-
payload: undefined;
|
|
44
|
-
})>;
|
|
45
|
-
dec: import("scale-ts").Decoder<(Error & {
|
|
46
|
-
name: "SigningErr::Rejected";
|
|
47
|
-
className: string;
|
|
48
|
-
payload: undefined;
|
|
49
|
-
}) | (Error & {
|
|
50
|
-
name: "SigningErr::Unknown";
|
|
51
|
-
className: string;
|
|
52
|
-
payload: {
|
|
53
|
-
reason: string;
|
|
54
|
-
};
|
|
55
|
-
}) | (Error & {
|
|
56
|
-
name: "SigningErr::FailedToDecode";
|
|
57
|
-
className: string;
|
|
58
|
-
payload: undefined;
|
|
59
|
-
})>;
|
|
11
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>;
|
|
60
12
|
} & {
|
|
61
|
-
readonly FailedToDecode: import("
|
|
62
|
-
readonly Rejected: import("
|
|
63
|
-
readonly
|
|
13
|
+
readonly FailedToDecode: import("@novasamatech/scale").ErrCodec<undefined, "SigningErr::FailedToDecode">;
|
|
14
|
+
readonly Rejected: import("@novasamatech/scale").ErrCodec<undefined, "SigningErr::Rejected">;
|
|
15
|
+
readonly PermissionDenied: import("@novasamatech/scale").ErrCodec<undefined, "SigningErr::PermissionDenied">;
|
|
16
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
64
17
|
reason: string;
|
|
65
18
|
}, "SigningErr::Unknown">;
|
|
66
19
|
};
|
|
@@ -81,21 +34,9 @@ export declare const SignRawV1_request: import("scale-ts").Codec<{
|
|
|
81
34
|
export declare const SignRawV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
82
35
|
signature: `0x${string}`;
|
|
83
36
|
signedTransaction: `0x${string}` | undefined;
|
|
84
|
-
}, (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
payload: undefined;
|
|
88
|
-
}) | (Error & {
|
|
89
|
-
name: "SigningErr::Unknown";
|
|
90
|
-
className: string;
|
|
91
|
-
payload: {
|
|
92
|
-
reason: string;
|
|
93
|
-
};
|
|
94
|
-
}) | (Error & {
|
|
95
|
-
name: "SigningErr::FailedToDecode";
|
|
96
|
-
className: string;
|
|
97
|
-
payload: undefined;
|
|
98
|
-
})>>;
|
|
37
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
38
|
+
reason: string;
|
|
39
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>;
|
|
99
40
|
export declare const SigningPayload: import("scale-ts").Codec<{
|
|
100
41
|
address: string;
|
|
101
42
|
blockHash: `0x${string}`;
|
|
@@ -135,18 +76,6 @@ export declare const SignPayloadV1_request: import("scale-ts").Codec<{
|
|
|
135
76
|
export declare const SignPayloadV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
136
77
|
signature: `0x${string}`;
|
|
137
78
|
signedTransaction: `0x${string}` | undefined;
|
|
138
|
-
}, (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
payload: undefined;
|
|
142
|
-
}) | (Error & {
|
|
143
|
-
name: "SigningErr::Unknown";
|
|
144
|
-
className: string;
|
|
145
|
-
payload: {
|
|
146
|
-
reason: string;
|
|
147
|
-
};
|
|
148
|
-
}) | (Error & {
|
|
149
|
-
name: "SigningErr::FailedToDecode";
|
|
150
|
-
className: string;
|
|
151
|
-
payload: undefined;
|
|
152
|
-
})>>;
|
|
79
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
80
|
+
reason: string;
|
|
81
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>;
|
package/dist/protocol/v1/sign.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { Enum, ErrEnum, Hex } from '@novasamatech/scale';
|
|
1
2
|
import { Bytes, Option, Result, Struct, Vector, _void, bool, str, u32 } from 'scale-ts';
|
|
2
|
-
import {
|
|
3
|
+
import { GenericErr, GenesisHash } from '../commonCodecs.js';
|
|
3
4
|
// common structures
|
|
4
5
|
export const SigningErr = ErrEnum('SigningErr', {
|
|
5
|
-
FailedToDecode: [_void, '
|
|
6
|
-
Rejected: [_void, '
|
|
7
|
-
|
|
6
|
+
FailedToDecode: [_void, 'Failed to decode'],
|
|
7
|
+
Rejected: [_void, 'Rejected'],
|
|
8
|
+
PermissionDenied: [_void, 'Permission denied'],
|
|
9
|
+
Unknown: [GenericErr, 'Unknown error'],
|
|
8
10
|
});
|
|
9
11
|
export const SigningResult = Struct({
|
|
10
12
|
signature: Hex(),
|
|
@@ -34,69 +34,124 @@ export declare const Statement: import("scale-ts").Codec<{
|
|
|
34
34
|
topics: Uint8Array<ArrayBufferLike>[];
|
|
35
35
|
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
36
36
|
}>;
|
|
37
|
-
export declare const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
export declare const SignedStatement: import("scale-ts").Codec<{
|
|
38
|
+
proof: {
|
|
39
|
+
tag: "Sr25519";
|
|
40
|
+
value: {
|
|
41
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
42
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
tag: "Ed25519";
|
|
46
|
+
value: {
|
|
47
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
48
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
tag: "Ecdsa";
|
|
52
|
+
value: {
|
|
53
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
54
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
tag: "OnChain";
|
|
58
|
+
value: {
|
|
59
|
+
who: Uint8Array<ArrayBufferLike>;
|
|
60
|
+
blockHash: Uint8Array<ArrayBufferLike>;
|
|
61
|
+
event: bigint;
|
|
62
|
+
};
|
|
42
63
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
|
|
65
|
+
priority: number | undefined;
|
|
66
|
+
channel: Uint8Array<ArrayBufferLike> | undefined;
|
|
67
|
+
topics: Uint8Array<ArrayBufferLike>[];
|
|
68
|
+
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const StatementStoreQueryV1_request: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>[]>;
|
|
71
|
+
export declare const StatementStoreQueryV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
72
|
+
proof: {
|
|
73
|
+
tag: "Sr25519";
|
|
74
|
+
value: {
|
|
75
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
76
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
tag: "Ed25519";
|
|
80
|
+
value: {
|
|
81
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
82
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
tag: "Ecdsa";
|
|
86
|
+
value: {
|
|
87
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
88
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
89
|
+
};
|
|
90
|
+
} | {
|
|
91
|
+
tag: "OnChain";
|
|
92
|
+
value: {
|
|
93
|
+
who: Uint8Array<ArrayBufferLike>;
|
|
94
|
+
blockHash: Uint8Array<ArrayBufferLike>;
|
|
95
|
+
event: bigint;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
|
|
99
|
+
priority: number | undefined;
|
|
100
|
+
channel: Uint8Array<ArrayBufferLike> | undefined;
|
|
101
|
+
topics: Uint8Array<ArrayBufferLike>[];
|
|
102
|
+
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
103
|
+
}[], import("@novasamatech/scale").CodecError<{
|
|
104
|
+
reason: string;
|
|
105
|
+
}, "GenericError">>>;
|
|
106
|
+
export declare const StatementStoreSubscribeV1_start: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>[]>;
|
|
107
|
+
export declare const StatementStoreSubscribeV1_receive: import("scale-ts").Codec<{
|
|
108
|
+
proof: {
|
|
109
|
+
tag: "Sr25519";
|
|
110
|
+
value: {
|
|
111
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
112
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
tag: "Ed25519";
|
|
116
|
+
value: {
|
|
117
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
118
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
119
|
+
};
|
|
120
|
+
} | {
|
|
121
|
+
tag: "Ecdsa";
|
|
122
|
+
value: {
|
|
123
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
124
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
tag: "OnChain";
|
|
128
|
+
value: {
|
|
129
|
+
who: Uint8Array<ArrayBufferLike>;
|
|
130
|
+
blockHash: Uint8Array<ArrayBufferLike>;
|
|
131
|
+
event: bigint;
|
|
132
|
+
};
|
|
56
133
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
className: string;
|
|
75
|
-
payload: undefined;
|
|
76
|
-
}) | (Error & {
|
|
77
|
-
name: "StatementProofErr::UnknownAccount";
|
|
78
|
-
className: string;
|
|
79
|
-
payload: undefined;
|
|
80
|
-
})>;
|
|
81
|
-
dec: import("scale-ts").Decoder<(Error & {
|
|
82
|
-
name: "StatementProofErr::Unknown";
|
|
83
|
-
className: string;
|
|
84
|
-
payload: {
|
|
85
|
-
reason: string;
|
|
86
|
-
};
|
|
87
|
-
}) | (Error & {
|
|
88
|
-
name: "StatementProofErr::UnableToSign";
|
|
89
|
-
className: string;
|
|
90
|
-
payload: undefined;
|
|
91
|
-
}) | (Error & {
|
|
92
|
-
name: "StatementProofErr::UnknownAccount";
|
|
93
|
-
className: string;
|
|
94
|
-
payload: undefined;
|
|
95
|
-
})>;
|
|
134
|
+
decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
|
|
135
|
+
priority: number | undefined;
|
|
136
|
+
channel: Uint8Array<ArrayBufferLike> | undefined;
|
|
137
|
+
topics: Uint8Array<ArrayBufferLike>[];
|
|
138
|
+
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
139
|
+
}[]>;
|
|
140
|
+
export declare const StatementProofErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
141
|
+
reason: string;
|
|
142
|
+
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
143
|
+
reason: string;
|
|
144
|
+
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>] & {
|
|
145
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
146
|
+
reason: string;
|
|
147
|
+
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>;
|
|
148
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
149
|
+
reason: string;
|
|
150
|
+
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>;
|
|
96
151
|
} & {
|
|
97
|
-
readonly UnableToSign: import("
|
|
98
|
-
readonly UnknownAccount: import("
|
|
99
|
-
readonly Unknown: import("
|
|
152
|
+
readonly UnableToSign: import("@novasamatech/scale").ErrCodec<undefined, "StatementProofErr::UnableToSign">;
|
|
153
|
+
readonly UnknownAccount: import("@novasamatech/scale").ErrCodec<undefined, "StatementProofErr::UnknownAccount">;
|
|
154
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
100
155
|
reason: string;
|
|
101
156
|
}, "StatementProofErr::Unknown">;
|
|
102
157
|
};
|
|
@@ -158,18 +213,42 @@ export declare const StatementStoreCreateProofV1_response: import("scale-ts").Co
|
|
|
158
213
|
blockHash: Uint8Array<ArrayBufferLike>;
|
|
159
214
|
event: bigint;
|
|
160
215
|
};
|
|
161
|
-
}, (
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
216
|
+
}, import("@novasamatech/scale").CodecError<{
|
|
217
|
+
reason: string;
|
|
218
|
+
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>>;
|
|
219
|
+
export declare const StatementStoreSubmitV1_request: import("scale-ts").Codec<{
|
|
220
|
+
proof: {
|
|
221
|
+
tag: "Sr25519";
|
|
222
|
+
value: {
|
|
223
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
224
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
225
|
+
};
|
|
226
|
+
} | {
|
|
227
|
+
tag: "Ed25519";
|
|
228
|
+
value: {
|
|
229
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
230
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
tag: "Ecdsa";
|
|
234
|
+
value: {
|
|
235
|
+
signature: Uint8Array<ArrayBufferLike>;
|
|
236
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
237
|
+
};
|
|
238
|
+
} | {
|
|
239
|
+
tag: "OnChain";
|
|
240
|
+
value: {
|
|
241
|
+
who: Uint8Array<ArrayBufferLike>;
|
|
242
|
+
blockHash: Uint8Array<ArrayBufferLike>;
|
|
243
|
+
event: bigint;
|
|
244
|
+
};
|
|
166
245
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
246
|
+
decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
|
|
247
|
+
priority: number | undefined;
|
|
248
|
+
channel: Uint8Array<ArrayBufferLike> | undefined;
|
|
249
|
+
topics: Uint8Array<ArrayBufferLike>[];
|
|
250
|
+
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
export declare const StatementStoreSubmitV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
253
|
+
reason: string;
|
|
254
|
+
}, "GenericError">>>;
|