@novasamatech/host-papp 0.10.1 → 0.11.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/package.json +5 -5
- package/dist/identity/index.d.ts +0 -2
- package/dist/identity/index.js +0 -1
- package/dist/sso/auth/attestationService.d.ts +0 -19
- package/dist/sso/auth/attestationService.js +0 -181
- package/dist/sso/auth/scale/handshake.d.ts +0 -23
- package/dist/sso/auth/scale/handshake.js +0 -22
- package/dist/sso/sessionManager/scale/signingRequest.d.ts +0 -65
- package/dist/sso/sessionManager/scale/signingRequest.js +0 -32
- package/dist/sso/sessionManager/scale/signingResponse.d.ts +0 -14
- package/dist/sso/sessionManager/scale/signingResponse.js +0 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-papp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"description": "Polkadot app integration",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@noble/ciphers": "2.4.0",
|
|
39
39
|
"@noble/curves": "2.4.0",
|
|
40
40
|
"@noble/hashes": "2.4.0",
|
|
41
|
-
"@novasamatech/host-api": "0.
|
|
42
|
-
"@novasamatech/scale": "0.
|
|
43
|
-
"@novasamatech/statement-store": "0.
|
|
44
|
-
"@novasamatech/storage-adapter": "0.
|
|
41
|
+
"@novasamatech/host-api": "0.11.0",
|
|
42
|
+
"@novasamatech/scale": "0.11.0",
|
|
43
|
+
"@novasamatech/statement-store": "0.11.0",
|
|
44
|
+
"@novasamatech/storage-adapter": "0.11.0",
|
|
45
45
|
"@polkadot-api/utils": "^0.4.0",
|
|
46
46
|
"@polkadot-labs/hdkd-helpers": "^0.0.33",
|
|
47
47
|
"nanoevents": "10.0.0",
|
package/dist/identity/index.d.ts
DELETED
package/dist/identity/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createIdentityRpcAdapter } from './rpcAdapter.js';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { LazyClient } from '@novasamatech/statement-store';
|
|
2
|
-
import type { ResultAsync } from 'neverthrow';
|
|
3
|
-
import type { DerivedSr25519Account } from '../../crypto.js';
|
|
4
|
-
export declare function createSudoAliceVerifier(): DerivedSr25519Account;
|
|
5
|
-
export declare function withRetry<T>(fn: () => Promise<T>, maxRetries?: number): Promise<T>;
|
|
6
|
-
export declare const createAttestationService: (lazyClient: LazyClient) => {
|
|
7
|
-
claimUsername(): string;
|
|
8
|
-
grantVerifierAllowance(verifier: DerivedSr25519Account): ResultAsync<void, Error>;
|
|
9
|
-
getRingRfKey(candidate: DerivedSr25519Account): Uint8Array<ArrayBufferLike>;
|
|
10
|
-
getProofMessage(candidate: DerivedSr25519Account, ringVrfKey: Uint8Array): Uint8Array<ArrayBufferLike>;
|
|
11
|
-
deriveAttestationParams(username: string, candidate: DerivedSr25519Account, verifier: DerivedSr25519Account): ResultAsync<{
|
|
12
|
-
candidateSignature: Uint8Array<ArrayBufferLike>;
|
|
13
|
-
ringVrfKey: Uint8Array<ArrayBufferLike>;
|
|
14
|
-
proofOfOwnership: Uint8Array<ArrayBufferLike>;
|
|
15
|
-
identifierKey: import("../../crypto.js").EncrPublicKey;
|
|
16
|
-
consumerRegistrationSignature: Uint8Array<ArrayBufferLike>;
|
|
17
|
-
}, never>;
|
|
18
|
-
registerLitePerson(username: string, candidate: DerivedSr25519Account, verifier: DerivedSr25519Account): ResultAsync<void, Error>;
|
|
19
|
-
};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { toHex } from '@novasamatech/scale';
|
|
2
|
-
import { createAccountId } from '@novasamatech/statement-store';
|
|
3
|
-
import { blake2b256 } from '@polkadot-labs/hdkd-helpers';
|
|
4
|
-
import { customAlphabet } from 'nanoid';
|
|
5
|
-
import { errAsync, fromAsyncThrowable, fromPromise, okAsync } from 'neverthrow';
|
|
6
|
-
import { AccountId, Binary } from 'polkadot-api';
|
|
7
|
-
import { getPolkadotSigner } from 'polkadot-api/signer';
|
|
8
|
-
import { mergeUint8 } from 'polkadot-api/utils';
|
|
9
|
-
import { Bytes, Option, Tuple, str } from 'scale-ts';
|
|
10
|
-
import { member_from_entropy, sign } from 'verifiablejs/bundler';
|
|
11
|
-
import { deriveSr25519Account, getEncrPub, stringToBytes } from '../../crypto.js';
|
|
12
|
-
import { toError } from '../../helpers/utils.js';
|
|
13
|
-
const accountId = AccountId();
|
|
14
|
-
export function createSudoAliceVerifier() {
|
|
15
|
-
return deriveSr25519Account('bottom drive obey lake curtain smoke basket hold race lonely fit walk', '//Alice');
|
|
16
|
-
}
|
|
17
|
-
export function withRetry(fn, maxRetries = 1) {
|
|
18
|
-
return fn().catch(error => {
|
|
19
|
-
if (maxRetries > 0) {
|
|
20
|
-
return withRetry(fn, maxRetries - 1);
|
|
21
|
-
}
|
|
22
|
-
throw error;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export const createAttestationService = (lazyClient) => {
|
|
26
|
-
const service = {
|
|
27
|
-
claimUsername() {
|
|
28
|
-
const nameSuffixFactory = customAlphabet('abcdefghijklmnopqrstuvwxyz', 4);
|
|
29
|
-
return `guest${nameSuffixFactory()}.${createNumericSuffix(4)}`;
|
|
30
|
-
},
|
|
31
|
-
grantVerifierAllowance(verifier) {
|
|
32
|
-
const client = lazyClient.getClient();
|
|
33
|
-
const api = client.getUnsafeApi();
|
|
34
|
-
const verifierAddress = accountId.dec(verifier.publicKey);
|
|
35
|
-
if (!api.query.PeopleLite || !api.query.PeopleLite.AttestationAllowance) {
|
|
36
|
-
return errAsync(new Error('Query PeopleLite.AttestationAllowance not found.'));
|
|
37
|
-
}
|
|
38
|
-
const verifierAllowance = fromPromise(api.query.PeopleLite.AttestationAllowance.getValue(verifierAddress), toError);
|
|
39
|
-
const getAllowance = fromAsyncThrowable(async () => {
|
|
40
|
-
const increaseAllowanceCall = api.tx.PeopleLite.increase_attestation_allowance({
|
|
41
|
-
account: verifierAddress,
|
|
42
|
-
count: 10,
|
|
43
|
-
});
|
|
44
|
-
const sudoCall = api.tx.Sudo.sudo({
|
|
45
|
-
call: increaseAllowanceCall.decodedCall,
|
|
46
|
-
});
|
|
47
|
-
return withRetry(() => sudoCall.signAndSubmit(createPeopleSigner(verifier)).then(() => undefined));
|
|
48
|
-
}, toError);
|
|
49
|
-
return verifierAllowance.andThen(verifierAllowance => (verifierAllowance > 0 ? okAsync() : getAllowance()));
|
|
50
|
-
},
|
|
51
|
-
getRingRfKey(candidate) {
|
|
52
|
-
const verifiableEntropy = blake2b256(candidate.entropy);
|
|
53
|
-
return member_from_entropy(verifiableEntropy);
|
|
54
|
-
},
|
|
55
|
-
getProofMessage(candidate, ringVrfKey) {
|
|
56
|
-
return mergeUint8([stringToBytes('pop:people-lite:register using'), candidate.publicKey, ringVrfKey]);
|
|
57
|
-
},
|
|
58
|
-
deriveAttestationParams(username, candidate, verifier) {
|
|
59
|
-
const verifiableEntropy = blake2b256(candidate.entropy);
|
|
60
|
-
const ringVrfKey = service.getRingRfKey(candidate);
|
|
61
|
-
const identifierKey = getEncrPub(blake2b256(candidate.secret));
|
|
62
|
-
const message = service.getProofMessage(candidate, ringVrfKey);
|
|
63
|
-
// Extract username without the `.` separator and any following digits
|
|
64
|
-
// For lite person usernames like "ceainnhgidpj.39642086", we only use "ceainnhgidpj"
|
|
65
|
-
const usernameWithoutDigits = username.split('.')[0] ?? username;
|
|
66
|
-
const candidateSignature = candidate.sign(message);
|
|
67
|
-
const proofOfOwnership = sign(verifiableEntropy, message);
|
|
68
|
-
const ResourceSignatureCodec = Tuple(
|
|
69
|
-
// candidate PublicKey (32 bytes)
|
|
70
|
-
Bytes(32),
|
|
71
|
-
// verifier AccountId (32 bytes)
|
|
72
|
-
Bytes(32),
|
|
73
|
-
// identifierKey
|
|
74
|
-
Bytes(65),
|
|
75
|
-
// username without digits
|
|
76
|
-
str,
|
|
77
|
-
// reserved_username
|
|
78
|
-
Option(Bytes()));
|
|
79
|
-
const resourcesSignatureData = ResourceSignatureCodec.enc([
|
|
80
|
-
candidate.publicKey,
|
|
81
|
-
createAccountId(verifier.publicKey),
|
|
82
|
-
identifierKey,
|
|
83
|
-
usernameWithoutDigits,
|
|
84
|
-
undefined,
|
|
85
|
-
]);
|
|
86
|
-
const consumerRegistrationSignature = candidate.sign(resourcesSignatureData);
|
|
87
|
-
return okAsync({
|
|
88
|
-
candidateSignature: candidateSignature,
|
|
89
|
-
ringVrfKey,
|
|
90
|
-
proofOfOwnership,
|
|
91
|
-
identifierKey,
|
|
92
|
-
consumerRegistrationSignature,
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
registerLitePerson(username, candidate, verifier) {
|
|
96
|
-
const client = lazyClient.getClient();
|
|
97
|
-
const api = client.getUnsafeApi();
|
|
98
|
-
return service
|
|
99
|
-
.deriveAttestationParams(username, candidate, verifier)
|
|
100
|
-
.andThen(params => {
|
|
101
|
-
const attestCall = api.tx.PeopleLite.attest({
|
|
102
|
-
candidate: accountId.dec(candidate.publicKey),
|
|
103
|
-
candidate_signature: {
|
|
104
|
-
type: 'Sr25519',
|
|
105
|
-
value: toHex(params.candidateSignature),
|
|
106
|
-
},
|
|
107
|
-
ring_vrf_key: toHex(params.ringVrfKey),
|
|
108
|
-
proof_of_ownership: toHex(params.proofOfOwnership),
|
|
109
|
-
consumer_registration: {
|
|
110
|
-
signature: {
|
|
111
|
-
type: 'Sr25519',
|
|
112
|
-
value: toHex(params.consumerRegistrationSignature),
|
|
113
|
-
},
|
|
114
|
-
account: accountId.dec(candidate.publicKey),
|
|
115
|
-
identifier_key: toHex(params.identifierKey),
|
|
116
|
-
username: Binary.fromText(username),
|
|
117
|
-
reserved_username: undefined,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
const submitAttestation = () => new Promise((resolve, reject) => {
|
|
121
|
-
const subscription = attestCall.signSubmitAndWatch(createPeopleSigner(verifier)).subscribe({
|
|
122
|
-
next(event) {
|
|
123
|
-
if ((event.type === 'txBestBlocksState' && event.found) || event.type === 'finalized') {
|
|
124
|
-
subscription.unsubscribe();
|
|
125
|
-
if (event.ok) {
|
|
126
|
-
resolve();
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
let errorMessage = 'Transaction failed';
|
|
130
|
-
if (event.dispatchError?.type === 'Module') {
|
|
131
|
-
const moduleError = event.dispatchError.value;
|
|
132
|
-
errorMessage = `${moduleError.type}.${moduleError.value?.type ?? 'Unknown'}`;
|
|
133
|
-
}
|
|
134
|
-
reject(new Error(errorMessage));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
error: reject,
|
|
139
|
-
complete: () => reject(new Error('Transaction observable completed without best block confirmation')),
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
return fromPromise(withRetry(submitAttestation), toError).map(() => undefined);
|
|
143
|
-
})
|
|
144
|
-
.andTee(() => console.log(`Attestation for ${accountId.dec(candidate.publicKey)} successfully passed.`));
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
return service;
|
|
148
|
-
};
|
|
149
|
-
function createNumericSuffix(length) {
|
|
150
|
-
let suffix = '';
|
|
151
|
-
for (let i = 0; i < length; i++) {
|
|
152
|
-
suffix += (Math.random() * 9).toFixed();
|
|
153
|
-
}
|
|
154
|
-
return suffix;
|
|
155
|
-
}
|
|
156
|
-
function createPeopleSigner(verifier) {
|
|
157
|
-
const baseSigner = getPolkadotSigner(verifier.publicKey, 'Sr25519', verifier.sign);
|
|
158
|
-
return {
|
|
159
|
-
publicKey: baseSigner.publicKey,
|
|
160
|
-
signBytes: baseSigner.signBytes,
|
|
161
|
-
signTx: async (callData, signedExtensions, metadata, atBlockNumber, hasher) => {
|
|
162
|
-
// polkadot-api auto-derives all signed extensions whose default state is encodable as
|
|
163
|
-
// a zero byte (Option::None, struct(Option<_>) = None, etc.). The People runtime's
|
|
164
|
-
// `pallet_verify_signature::VerifySignature` ({ Disabled, Signed }) extension uses
|
|
165
|
-
// identifier "VerifyMultiSignature" but has no built-in handler in polkadot-api, so it
|
|
166
|
-
// must be supplied manually. Value 0x00 = `Disabled` (passthrough — the standard
|
|
167
|
-
// extrinsic signature authenticates the call). Variant tag order was flipped in
|
|
168
|
-
// polkadot-sdk#11897 specifically so generic signers can encode the passthrough state
|
|
169
|
-
// as a single zero byte.
|
|
170
|
-
const extensionsWithCustom = {
|
|
171
|
-
...signedExtensions,
|
|
172
|
-
VerifyMultiSignature: {
|
|
173
|
-
identifier: 'VerifyMultiSignature',
|
|
174
|
-
value: new Uint8Array([0]),
|
|
175
|
-
additionalSigned: new Uint8Array([]),
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
return baseSigner.signTx(callData, extensionsWithCustom, metadata, atBlockNumber, hasher);
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const HandshakeData: import("scale-ts").Codec<{
|
|
2
|
-
tag: "v1";
|
|
3
|
-
value: {
|
|
4
|
-
ssPublicKey: import("../../../crypto.js").SsPublicKey;
|
|
5
|
-
encrPublicKey: import("../../../crypto.js").EncrPublicKey;
|
|
6
|
-
metadata: string;
|
|
7
|
-
hostVersion: string | undefined;
|
|
8
|
-
osType: string | undefined;
|
|
9
|
-
osVersion: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
}>;
|
|
12
|
-
export declare const HandshakeResponsePayload: import("scale-ts").Codec<{
|
|
13
|
-
tag: "v1";
|
|
14
|
-
value: {
|
|
15
|
-
encrypted: Uint8Array<ArrayBufferLike>;
|
|
16
|
-
tmpKey: Uint8Array<ArrayBufferLike>;
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
19
|
-
export declare const HandshakeResponseSensitiveData: import("scale-ts").Codec<{
|
|
20
|
-
sharedSecretDerivationKey: Uint8Array<ArrayBufferLike>;
|
|
21
|
-
rootUserAccountId: Uint8Array<ArrayBufferLike>;
|
|
22
|
-
identityAccountId: Uint8Array<ArrayBufferLike>;
|
|
23
|
-
}>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Enum } from '@novasamatech/scale';
|
|
2
|
-
import { Bytes, Option, Struct, str } from 'scale-ts';
|
|
3
|
-
import { EncrPubKey, SsPubKey } from '../../../crypto.js';
|
|
4
|
-
const optStr = Option(str);
|
|
5
|
-
export const HandshakeData = Enum({
|
|
6
|
-
v1: Struct({
|
|
7
|
-
ssPublicKey: SsPubKey,
|
|
8
|
-
encrPublicKey: EncrPubKey,
|
|
9
|
-
metadata: str,
|
|
10
|
-
hostVersion: optStr,
|
|
11
|
-
osType: optStr,
|
|
12
|
-
osVersion: optStr,
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
export const HandshakeResponsePayload = Enum({
|
|
16
|
-
v1: Struct({ encrypted: Bytes(), tmpKey: Bytes(65) }),
|
|
17
|
-
});
|
|
18
|
-
export const HandshakeResponseSensitiveData = Struct({
|
|
19
|
-
sharedSecretDerivationKey: Bytes(65),
|
|
20
|
-
rootUserAccountId: Bytes(32),
|
|
21
|
-
identityAccountId: Bytes(32),
|
|
22
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { CodecType } from 'scale-ts';
|
|
2
|
-
export type SigningPayloadRequest = CodecType<typeof SigningPayloadRequestCodec>;
|
|
3
|
-
export declare const SigningPayloadRequestCodec: import("scale-ts").Codec<{
|
|
4
|
-
productAccountId: [string, number];
|
|
5
|
-
blockHash: `0x${string}`;
|
|
6
|
-
blockNumber: `0x${string}`;
|
|
7
|
-
era: `0x${string}`;
|
|
8
|
-
genesisHash: `0x${string}`;
|
|
9
|
-
method: `0x${string}`;
|
|
10
|
-
nonce: `0x${string}`;
|
|
11
|
-
specVersion: `0x${string}`;
|
|
12
|
-
tip: `0x${string}`;
|
|
13
|
-
transactionVersion: `0x${string}`;
|
|
14
|
-
signedExtensions: string[];
|
|
15
|
-
version: number;
|
|
16
|
-
assetId: `0x${string}` | undefined;
|
|
17
|
-
metadataHash: `0x${string}` | undefined;
|
|
18
|
-
mode: number | undefined;
|
|
19
|
-
withSignedTransaction: boolean | void;
|
|
20
|
-
}>;
|
|
21
|
-
export type SigningRawRequest = CodecType<typeof SigningRawRequestCodec>;
|
|
22
|
-
export declare const SigningRawRequestCodec: import("scale-ts").Codec<{
|
|
23
|
-
productAccountId: [string, number];
|
|
24
|
-
data: {
|
|
25
|
-
tag: "Bytes";
|
|
26
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
27
|
-
} | {
|
|
28
|
-
tag: "Payload";
|
|
29
|
-
value: string;
|
|
30
|
-
};
|
|
31
|
-
}>;
|
|
32
|
-
export type SigningRequest = CodecType<typeof SigningRequestCodec>;
|
|
33
|
-
export declare const SigningRequestCodec: import("scale-ts").Codec<{
|
|
34
|
-
tag: "Payload";
|
|
35
|
-
value: {
|
|
36
|
-
productAccountId: [string, number];
|
|
37
|
-
blockHash: `0x${string}`;
|
|
38
|
-
blockNumber: `0x${string}`;
|
|
39
|
-
era: `0x${string}`;
|
|
40
|
-
genesisHash: `0x${string}`;
|
|
41
|
-
method: `0x${string}`;
|
|
42
|
-
nonce: `0x${string}`;
|
|
43
|
-
specVersion: `0x${string}`;
|
|
44
|
-
tip: `0x${string}`;
|
|
45
|
-
transactionVersion: `0x${string}`;
|
|
46
|
-
signedExtensions: string[];
|
|
47
|
-
version: number;
|
|
48
|
-
assetId: `0x${string}` | undefined;
|
|
49
|
-
metadataHash: `0x${string}` | undefined;
|
|
50
|
-
mode: number | undefined;
|
|
51
|
-
withSignedTransaction: boolean | void;
|
|
52
|
-
};
|
|
53
|
-
} | {
|
|
54
|
-
tag: "Raw";
|
|
55
|
-
value: {
|
|
56
|
-
productAccountId: [string, number];
|
|
57
|
-
data: {
|
|
58
|
-
tag: "Bytes";
|
|
59
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
60
|
-
} | {
|
|
61
|
-
tag: "Payload";
|
|
62
|
-
value: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ProductAccountId } from '@novasamatech/host-api';
|
|
2
|
-
import { Enum, Hex, OptionBool } from '@novasamatech/scale';
|
|
3
|
-
import { Bytes, Option, Struct, Vector, str, u32 } from 'scale-ts';
|
|
4
|
-
export const SigningPayloadRequestCodec = Struct({
|
|
5
|
-
productAccountId: ProductAccountId,
|
|
6
|
-
blockHash: Hex(),
|
|
7
|
-
blockNumber: Hex(),
|
|
8
|
-
era: Hex(),
|
|
9
|
-
genesisHash: Hex(),
|
|
10
|
-
method: Hex(),
|
|
11
|
-
nonce: Hex(),
|
|
12
|
-
specVersion: Hex(),
|
|
13
|
-
tip: Hex(),
|
|
14
|
-
transactionVersion: Hex(),
|
|
15
|
-
signedExtensions: Vector(str),
|
|
16
|
-
version: u32,
|
|
17
|
-
assetId: Option(Hex()),
|
|
18
|
-
metadataHash: Option(Hex()),
|
|
19
|
-
mode: Option(u32),
|
|
20
|
-
withSignedTransaction: OptionBool,
|
|
21
|
-
});
|
|
22
|
-
export const SigningRawRequestCodec = Struct({
|
|
23
|
-
productAccountId: ProductAccountId,
|
|
24
|
-
data: Enum({
|
|
25
|
-
Bytes: Bytes(),
|
|
26
|
-
Payload: str,
|
|
27
|
-
}),
|
|
28
|
-
});
|
|
29
|
-
export const SigningRequestCodec = Enum({
|
|
30
|
-
Payload: SigningPayloadRequestCodec,
|
|
31
|
-
Raw: SigningRawRequestCodec,
|
|
32
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CodecType } from 'scale-ts';
|
|
2
|
-
export type SigningPayloadResponseData = CodecType<typeof SigningPayloadResponseDataCodec>;
|
|
3
|
-
export declare const SigningPayloadResponseDataCodec: import("scale-ts").Codec<{
|
|
4
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
5
|
-
signedTransaction: Uint8Array<ArrayBufferLike> | undefined;
|
|
6
|
-
}>;
|
|
7
|
-
export type SigningPayloadResponse = CodecType<typeof SigningResponseCodec>;
|
|
8
|
-
export declare const SigningResponseCodec: import("scale-ts").Codec<{
|
|
9
|
-
respondingTo: string;
|
|
10
|
-
payload: import("scale-ts").ResultPayload<{
|
|
11
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
12
|
-
signedTransaction: Uint8Array<ArrayBufferLike> | undefined;
|
|
13
|
-
}, string>;
|
|
14
|
-
}>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Bytes, Option, Result, Struct, str } from 'scale-ts';
|
|
2
|
-
export const SigningPayloadResponseDataCodec = Struct({
|
|
3
|
-
signature: Bytes(),
|
|
4
|
-
signedTransaction: Option(Bytes()),
|
|
5
|
-
});
|
|
6
|
-
export const SigningResponseCodec = Struct({
|
|
7
|
-
// referencing to RemoteMessage.messageId
|
|
8
|
-
respondingTo: str,
|
|
9
|
-
payload: Result(SigningPayloadResponseDataCodec, str),
|
|
10
|
-
});
|