@novasamatech/host-api 0.8.10 → 0.8.12
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/hostApi.js +8 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol/impl.d.ts +46 -11
- package/dist/protocol/impl.js +7 -1
- package/dist/protocol/messageCodec.d.ts +102 -22
- package/dist/protocol/v1/accounts.d.ts +137 -24
- package/dist/protocol/v1/accounts.js +55 -12
- package/package.json +4 -4
package/dist/hostApi.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { errAsync, fromPromise, okAsync } from 'neverthrow';
|
|
2
2
|
import { extractErrorMessage } from './helpers.js';
|
|
3
3
|
import { GenericError } from './protocol/commonCodecs.js';
|
|
4
|
-
import { CreateProofErr, GetUserIdErr, LoginErr, RequestCredentialsErr } from './protocol/v1/accounts.js';
|
|
4
|
+
import { CreateProofErr, GetAliasErr, GetUserIdErr, LoginErr, RequestCredentialsErr, SignVrfErr, } from './protocol/v1/accounts.js';
|
|
5
5
|
import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr } from './protocol/v1/chat.js';
|
|
6
6
|
import { CreateTransactionErr } from './protocol/v1/createTransaction.js';
|
|
7
7
|
import { DeriveEntropyErr } from './protocol/v1/deriveEntropy.js';
|
|
@@ -109,7 +109,7 @@ export function createHostApi(transport) {
|
|
|
109
109
|
accountGetAlias(payload) {
|
|
110
110
|
return makeRequest(transport.request('host_account_get_alias', payload), reason => ({
|
|
111
111
|
tag: payload.tag,
|
|
112
|
-
value: new
|
|
112
|
+
value: new GetAliasErr.Unknown({ reason }),
|
|
113
113
|
}));
|
|
114
114
|
},
|
|
115
115
|
accountCreateProof(payload) {
|
|
@@ -118,6 +118,12 @@ export function createHostApi(transport) {
|
|
|
118
118
|
value: new CreateProofErr.Unknown({ reason }),
|
|
119
119
|
}));
|
|
120
120
|
},
|
|
121
|
+
accountSignVrf(payload) {
|
|
122
|
+
return makeRequest(transport.request('host_account_sign_vrf', payload), reason => ({
|
|
123
|
+
tag: payload.tag,
|
|
124
|
+
value: new SignVrfErr.Unknown({ reason }),
|
|
125
|
+
}));
|
|
126
|
+
},
|
|
121
127
|
getLegacyAccounts(payload) {
|
|
122
128
|
return makeRequest(transport.request('host_get_legacy_accounts', payload), reason => ({
|
|
123
129
|
tag: payload.tag,
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { HexString } from '@novasamatech/scale';
|
|
|
13
13
|
export { assertEnumVariant, enumValue, fromHex, isEnumVariant, resultErr, resultOk, toHex, unwrapResultOrThrow, } from '@novasamatech/scale';
|
|
14
14
|
export { GenericError } from './protocol/commonCodecs.js';
|
|
15
15
|
export { CreateTransactionErr, LegacyTransaction, ProductAccountTransaction } from './protocol/v1/createTransaction.js';
|
|
16
|
-
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, RequestCredentialsErr, RingLocation, UserIdentity, } from './protocol/v1/accounts.js';
|
|
16
|
+
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetAliasErr, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, ProductId, ProductProofContext, ProductProofContextSuffix, RequestCredentialsErr, RingLocation, RingLocationJunction, RingVrfProof, SignVrfErr, UserIdentity, VrfSignature, VrfTranscriptItem, } from './protocol/v1/accounts.js';
|
|
17
17
|
export { ChatActionPayload, ChatBotRegistrationErr, ChatBotRegistrationStatus, ChatMessageContent, ChatMessagePostingErr, ChatRoom, ChatRoomRegistrationErr, ChatRoomRegistrationResult, ChatRoomRegistrationStatus, ReceivedChatAction, } from './protocol/v1/chat.js';
|
|
18
18
|
export { DeriveEntropyErr } from './protocol/v1/deriveEntropy.js';
|
|
19
19
|
export { HandshakeErr } from './protocol/v1/handshake.js';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { assertEnumVariant, enumValue, fromHex, isEnumVariant, resultErr, result
|
|
|
7
7
|
// Codecs
|
|
8
8
|
export { GenericError } from './protocol/commonCodecs.js';
|
|
9
9
|
export { CreateTransactionErr, LegacyTransaction, ProductAccountTransaction } from './protocol/v1/createTransaction.js';
|
|
10
|
-
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, RequestCredentialsErr, RingLocation, UserIdentity, } from './protocol/v1/accounts.js';
|
|
10
|
+
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetAliasErr, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, ProductId, ProductProofContext, ProductProofContextSuffix, RequestCredentialsErr, RingLocation, RingLocationJunction, RingVrfProof, SignVrfErr, UserIdentity, VrfSignature, VrfTranscriptItem, } from './protocol/v1/accounts.js';
|
|
11
11
|
export { ChatActionPayload, ChatBotRegistrationErr, ChatBotRegistrationStatus, ChatMessageContent, ChatMessagePostingErr, ChatRoom, ChatRoomRegistrationErr, ChatRoomRegistrationResult, ChatRoomRegistrationStatus, ReceivedChatAction, } from './protocol/v1/chat.js';
|
|
12
12
|
export { DeriveEntropyErr } from './protocol/v1/deriveEntropy.js';
|
|
13
13
|
export { HandshakeErr } from './protocol/v1/handshake.js';
|
package/dist/protocol/impl.d.ts
CHANGED
|
@@ -101,23 +101,43 @@ export declare const hostApiProtocol: {
|
|
|
101
101
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
102
102
|
}>;
|
|
103
103
|
readonly host_account_get_alias: VersionedProtocolRequest<{
|
|
104
|
-
readonly v1: [Codec<[string,
|
|
104
|
+
readonly v1: [Codec<[[string, `0x${string}`], {
|
|
105
|
+
chainId: `0x${string}`;
|
|
106
|
+
junctions: ({
|
|
107
|
+
tag: "PalletInstance";
|
|
108
|
+
value: number;
|
|
109
|
+
} | {
|
|
110
|
+
tag: "CollectionId";
|
|
111
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
112
|
+
})[];
|
|
113
|
+
}]>, Codec<import("scale-ts").ResultPayload<{
|
|
105
114
|
context: Uint8Array<ArrayBufferLike>;
|
|
106
115
|
alias: Uint8Array<ArrayBufferLike>;
|
|
107
|
-
}, import("@novasamatech/scale").CodecError<undefined, "
|
|
116
|
+
}, import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
108
117
|
reason: string;
|
|
109
|
-
}, "
|
|
118
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>>];
|
|
110
119
|
}>;
|
|
111
120
|
readonly host_account_create_proof: VersionedProtocolRequest<{
|
|
112
|
-
readonly v1: [Codec<[[string,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} |
|
|
118
|
-
|
|
121
|
+
readonly v1: [Codec<[[string, `0x${string}`], {
|
|
122
|
+
chainId: `0x${string}`;
|
|
123
|
+
junctions: ({
|
|
124
|
+
tag: "PalletInstance";
|
|
125
|
+
value: number;
|
|
126
|
+
} | {
|
|
127
|
+
tag: "CollectionId";
|
|
128
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
129
|
+
})[];
|
|
130
|
+
}, Uint8Array<ArrayBufferLike>]>, Codec<import("scale-ts").ResultPayload<{
|
|
131
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
132
|
+
contextualAlias: {
|
|
133
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
134
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
135
|
+
};
|
|
136
|
+
ringIndex: number;
|
|
137
|
+
ringRevision: number;
|
|
138
|
+
}, import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
119
139
|
reason: string;
|
|
120
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>>];
|
|
140
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>>];
|
|
121
141
|
}>;
|
|
122
142
|
readonly host_get_legacy_accounts: VersionedProtocolRequest<{
|
|
123
143
|
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
@@ -1004,5 +1024,20 @@ export declare const hostApiProtocol: {
|
|
|
1004
1024
|
reason: string;
|
|
1005
1025
|
}, "GenericError">>>];
|
|
1006
1026
|
}>;
|
|
1027
|
+
readonly host_account_sign_vrf: VersionedProtocolRequest<{
|
|
1028
|
+
readonly v1: [Codec<{
|
|
1029
|
+
account: [string, number];
|
|
1030
|
+
transcriptLabel: Uint8Array<ArrayBufferLike>;
|
|
1031
|
+
items: {
|
|
1032
|
+
label: Uint8Array<ArrayBufferLike>;
|
|
1033
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
1034
|
+
}[];
|
|
1035
|
+
}>, Codec<import("scale-ts").ResultPayload<{
|
|
1036
|
+
preOutput: Uint8Array<ArrayBufferLike>;
|
|
1037
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
1038
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
1039
|
+
reason: string;
|
|
1040
|
+
}, "SignVrfErr::Unknown">>>];
|
|
1041
|
+
}>;
|
|
1007
1042
|
};
|
|
1008
1043
|
export {};
|
package/dist/protocol/impl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Enum } from '@novasamatech/scale';
|
|
2
|
-
import { AccountConnectionStatusV1_interrupt, AccountConnectionStatusV1_receive, AccountConnectionStatusV1_start, AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetV1_request, AccountGetV1_response, GetLegacyAccountsV1_request, GetLegacyAccountsV1_response, GetUserIdV1_request, GetUserIdV1_response, RequestLoginV1_request, RequestLoginV1_response, } from './v1/accounts.js';
|
|
2
|
+
import { AccountConnectionStatusV1_interrupt, AccountConnectionStatusV1_receive, AccountConnectionStatusV1_start, AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetV1_request, AccountGetV1_response, AccountSignVrfV1_request, AccountSignVrfV1_response, GetLegacyAccountsV1_request, GetLegacyAccountsV1_response, GetUserIdV1_request, GetUserIdV1_response, RequestLoginV1_request, RequestLoginV1_response, } from './v1/accounts.js';
|
|
3
3
|
import { ChainHeadBodyV1_request, ChainHeadBodyV1_response, ChainHeadCallV1_request, ChainHeadCallV1_response, ChainHeadContinueV1_request, ChainHeadContinueV1_response, ChainHeadFollowV1_interrupt, ChainHeadFollowV1_receive, ChainHeadFollowV1_start, ChainHeadHeaderV1_request, ChainHeadHeaderV1_response, ChainHeadStopOperationV1_request, ChainHeadStopOperationV1_response, ChainHeadStorageV1_request, ChainHeadStorageV1_response, ChainHeadUnpinV1_request, ChainHeadUnpinV1_response, ChainSpecChainNameV1_request, ChainSpecChainNameV1_response, ChainSpecGenesisHashV1_request, ChainSpecGenesisHashV1_response, ChainSpecPropertiesV1_request, ChainSpecPropertiesV1_response, TransactionBroadcastV1_request, TransactionBroadcastV1_response, TransactionStopV1_request, TransactionStopV1_response, } from './v1/chainInteraction.js';
|
|
4
4
|
import { ChatActionSubscribeV1_interrupt, ChatActionSubscribeV1_receive, ChatActionSubscribeV1_start, ChatCreateRoomV1_request, ChatCreateRoomV1_response, ChatCustomMessageRenderingV1_interrupt, ChatCustomMessageRenderingV1_receive, ChatCustomMessageRenderingV1_start, ChatListSubscribeV1_interrupt, ChatListSubscribeV1_receive, ChatListSubscribeV1_start, ChatPostMessageV1_request, ChatPostMessageV1_response, ChatRegisterBotV1_request, ChatRegisterBotV1_response, } from './v1/chat.js';
|
|
5
5
|
import { CreateTransactionV1_request, CreateTransactionV1_response, CreateTransactionWithLegacyAccountV1_request, CreateTransactionWithLegacyAccountV1_response, } from './v1/createTransaction.js';
|
|
@@ -223,4 +223,10 @@ export const hostApiProtocol = {
|
|
|
223
223
|
host_push_notification_cancel: versionedRequest(indexer.request(), {
|
|
224
224
|
v1: [PushNotificationCancelV1_request, PushNotificationCancelV1_response],
|
|
225
225
|
}),
|
|
226
|
+
// Prefix 28 skips indices 136-163, reserved upstream by the truapi coin-payment
|
|
227
|
+
// methods this SDK does not implement, so `sign_vrf` lands on its specified
|
|
228
|
+
// `request_id = 164` (RFC-0023).
|
|
229
|
+
host_account_sign_vrf: versionedRequest(indexer.request(28), {
|
|
230
|
+
v1: [AccountSignVrfV1_request, AccountSignVrfV1_response],
|
|
231
|
+
}),
|
|
226
232
|
};
|
|
@@ -100,26 +100,46 @@ export declare const MessagePayload: EnumCodec<Record<"host_handshake_request",
|
|
|
100
100
|
reason: string;
|
|
101
101
|
}, "RequestCredentialsErr::Unknown">>>;
|
|
102
102
|
}>> & Record<"host_account_get_alias_request", EnumCodec<{
|
|
103
|
-
readonly v1: Codec<[string,
|
|
103
|
+
readonly v1: Codec<[[string, `0x${string}`], {
|
|
104
|
+
chainId: `0x${string}`;
|
|
105
|
+
junctions: ({
|
|
106
|
+
tag: "PalletInstance";
|
|
107
|
+
value: number;
|
|
108
|
+
} | {
|
|
109
|
+
tag: "CollectionId";
|
|
110
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
111
|
+
})[];
|
|
112
|
+
}]>;
|
|
104
113
|
}>> & Record<"host_account_get_alias_response", EnumCodec<{
|
|
105
114
|
readonly v1: Codec<import("scale-ts").ResultPayload<{
|
|
106
115
|
context: Uint8Array<ArrayBufferLike>;
|
|
107
116
|
alias: Uint8Array<ArrayBufferLike>;
|
|
108
|
-
}, import("@novasamatech/scale").CodecError<undefined, "
|
|
117
|
+
}, import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
109
118
|
reason: string;
|
|
110
|
-
}, "
|
|
119
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>>;
|
|
111
120
|
}>> & Record<"host_account_create_proof_request", EnumCodec<{
|
|
112
|
-
readonly v1: Codec<[[string,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} |
|
|
121
|
+
readonly v1: Codec<[[string, `0x${string}`], {
|
|
122
|
+
chainId: `0x${string}`;
|
|
123
|
+
junctions: ({
|
|
124
|
+
tag: "PalletInstance";
|
|
125
|
+
value: number;
|
|
126
|
+
} | {
|
|
127
|
+
tag: "CollectionId";
|
|
128
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
129
|
+
})[];
|
|
118
130
|
}, Uint8Array<ArrayBufferLike>]>;
|
|
119
131
|
}>> & Record<"host_account_create_proof_response", EnumCodec<{
|
|
120
|
-
readonly v1: Codec<import("scale-ts").ResultPayload<
|
|
132
|
+
readonly v1: Codec<import("scale-ts").ResultPayload<{
|
|
133
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
134
|
+
contextualAlias: {
|
|
135
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
136
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
137
|
+
};
|
|
138
|
+
ringIndex: number;
|
|
139
|
+
ringRevision: number;
|
|
140
|
+
}, import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
121
141
|
reason: string;
|
|
122
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>>;
|
|
142
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>>;
|
|
123
143
|
}>> & Record<"host_get_legacy_accounts_request", EnumCodec<{
|
|
124
144
|
readonly v1: Codec<undefined>;
|
|
125
145
|
}>> & Record<"host_get_legacy_accounts_response", EnumCodec<{
|
|
@@ -1065,6 +1085,22 @@ export declare const MessagePayload: EnumCodec<Record<"host_handshake_request",
|
|
|
1065
1085
|
readonly v1: Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
1066
1086
|
reason: string;
|
|
1067
1087
|
}, "GenericError">>>;
|
|
1088
|
+
}>> & Record<"host_account_sign_vrf_request", EnumCodec<{
|
|
1089
|
+
readonly v1: Codec<{
|
|
1090
|
+
account: [string, number];
|
|
1091
|
+
transcriptLabel: Uint8Array<ArrayBufferLike>;
|
|
1092
|
+
items: {
|
|
1093
|
+
label: Uint8Array<ArrayBufferLike>;
|
|
1094
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
1095
|
+
}[];
|
|
1096
|
+
}>;
|
|
1097
|
+
}>> & Record<"host_account_sign_vrf_response", EnumCodec<{
|
|
1098
|
+
readonly v1: Codec<import("scale-ts").ResultPayload<{
|
|
1099
|
+
preOutput: Uint8Array<ArrayBufferLike>;
|
|
1100
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
1101
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
1102
|
+
reason: string;
|
|
1103
|
+
}, "SignVrfErr::Unknown">>>;
|
|
1068
1104
|
}>>>;
|
|
1069
1105
|
export declare const Message: Codec<{
|
|
1070
1106
|
requestId: string;
|
|
@@ -1257,7 +1293,16 @@ export declare const Message: Codec<{
|
|
|
1257
1293
|
tag: "host_account_get_alias_request";
|
|
1258
1294
|
value: {
|
|
1259
1295
|
tag: "v1";
|
|
1260
|
-
value: [string,
|
|
1296
|
+
value: [[string, `0x${string}`], {
|
|
1297
|
+
chainId: `0x${string}`;
|
|
1298
|
+
junctions: ({
|
|
1299
|
+
tag: "PalletInstance";
|
|
1300
|
+
value: number;
|
|
1301
|
+
} | {
|
|
1302
|
+
tag: "CollectionId";
|
|
1303
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
1304
|
+
})[];
|
|
1305
|
+
}];
|
|
1261
1306
|
};
|
|
1262
1307
|
} | {
|
|
1263
1308
|
tag: "host_account_get_alias_response";
|
|
@@ -1266,29 +1311,40 @@ export declare const Message: Codec<{
|
|
|
1266
1311
|
value: import("scale-ts").ResultPayload<{
|
|
1267
1312
|
context: Uint8Array<ArrayBufferLike>;
|
|
1268
1313
|
alias: Uint8Array<ArrayBufferLike>;
|
|
1269
|
-
}, import("@novasamatech/scale").CodecError<undefined, "
|
|
1314
|
+
}, import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
1270
1315
|
reason: string;
|
|
1271
|
-
}, "
|
|
1316
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>;
|
|
1272
1317
|
};
|
|
1273
1318
|
} | {
|
|
1274
1319
|
tag: "host_account_create_proof_request";
|
|
1275
1320
|
value: {
|
|
1276
1321
|
tag: "v1";
|
|
1277
|
-
value: [[string,
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
} |
|
|
1322
|
+
value: [[string, `0x${string}`], {
|
|
1323
|
+
chainId: `0x${string}`;
|
|
1324
|
+
junctions: ({
|
|
1325
|
+
tag: "PalletInstance";
|
|
1326
|
+
value: number;
|
|
1327
|
+
} | {
|
|
1328
|
+
tag: "CollectionId";
|
|
1329
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
1330
|
+
})[];
|
|
1283
1331
|
}, Uint8Array<ArrayBufferLike>];
|
|
1284
1332
|
};
|
|
1285
1333
|
} | {
|
|
1286
1334
|
tag: "host_account_create_proof_response";
|
|
1287
1335
|
value: {
|
|
1288
1336
|
tag: "v1";
|
|
1289
|
-
value: import("scale-ts").ResultPayload<
|
|
1337
|
+
value: import("scale-ts").ResultPayload<{
|
|
1338
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
1339
|
+
contextualAlias: {
|
|
1340
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
1341
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
1342
|
+
};
|
|
1343
|
+
ringIndex: number;
|
|
1344
|
+
ringRevision: number;
|
|
1345
|
+
}, import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
1290
1346
|
reason: string;
|
|
1291
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>;
|
|
1347
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>;
|
|
1292
1348
|
};
|
|
1293
1349
|
} | {
|
|
1294
1350
|
tag: "host_get_legacy_accounts_request";
|
|
@@ -2598,6 +2654,30 @@ export declare const Message: Codec<{
|
|
|
2598
2654
|
reason: string;
|
|
2599
2655
|
}, "GenericError">>;
|
|
2600
2656
|
};
|
|
2657
|
+
} | {
|
|
2658
|
+
tag: "host_account_sign_vrf_request";
|
|
2659
|
+
value: {
|
|
2660
|
+
tag: "v1";
|
|
2661
|
+
value: {
|
|
2662
|
+
account: [string, number];
|
|
2663
|
+
transcriptLabel: Uint8Array<ArrayBufferLike>;
|
|
2664
|
+
items: {
|
|
2665
|
+
label: Uint8Array<ArrayBufferLike>;
|
|
2666
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
2667
|
+
}[];
|
|
2668
|
+
};
|
|
2669
|
+
};
|
|
2670
|
+
} | {
|
|
2671
|
+
tag: "host_account_sign_vrf_response";
|
|
2672
|
+
value: {
|
|
2673
|
+
tag: "v1";
|
|
2674
|
+
value: import("scale-ts").ResultPayload<{
|
|
2675
|
+
preOutput: Uint8Array<ArrayBufferLike>;
|
|
2676
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
2677
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
2678
|
+
reason: string;
|
|
2679
|
+
}, "SignVrfErr::Unknown">>;
|
|
2680
|
+
};
|
|
2601
2681
|
};
|
|
2602
2682
|
}>;
|
|
2603
2683
|
export type MessageAction = MessagePayloadSchema['tag'];
|
|
@@ -3,8 +3,10 @@ export declare const PublicKey: import("scale-ts").Codec<Uint8Array<ArrayBufferL
|
|
|
3
3
|
export declare const DotNsIdentifier: import("scale-ts").Codec<string>;
|
|
4
4
|
export declare const DerivationIndex: import("scale-ts").Codec<number>;
|
|
5
5
|
export declare const ProductAccountId: import("scale-ts").Codec<[string, number]>;
|
|
6
|
-
export declare const RingVrfProof: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
7
6
|
export declare const RingVrgAlias: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
7
|
+
export declare const ProductId: import("scale-ts").Codec<string>;
|
|
8
|
+
export declare const ProductProofContextSuffix: import("scale-ts").Codec<`0x${string}`>;
|
|
9
|
+
export declare const ProductProofContext: import("scale-ts").Codec<[string, `0x${string}`]>;
|
|
8
10
|
export declare const ProductAccount: import("scale-ts").Codec<{
|
|
9
11
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
10
12
|
}>;
|
|
@@ -19,15 +21,41 @@ export declare const ContextualAlias: import("scale-ts").Codec<{
|
|
|
19
21
|
context: Uint8Array<ArrayBufferLike>;
|
|
20
22
|
alias: Uint8Array<ArrayBufferLike>;
|
|
21
23
|
}>;
|
|
22
|
-
export declare const
|
|
23
|
-
|
|
24
|
+
export declare const RingVrfProof: import("scale-ts").Codec<{
|
|
25
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
26
|
+
contextualAlias: {
|
|
27
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
28
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
29
|
+
};
|
|
30
|
+
ringIndex: number;
|
|
31
|
+
ringRevision: number;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const RingLocationJunction: import("scale-ts").Codec<{
|
|
34
|
+
tag: "PalletInstance";
|
|
35
|
+
value: number;
|
|
36
|
+
} | {
|
|
37
|
+
tag: "CollectionId";
|
|
38
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
24
39
|
}>;
|
|
25
40
|
export declare const RingLocation: import("scale-ts").Codec<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} |
|
|
41
|
+
chainId: `0x${string}`;
|
|
42
|
+
junctions: ({
|
|
43
|
+
tag: "PalletInstance";
|
|
44
|
+
value: number;
|
|
45
|
+
} | {
|
|
46
|
+
tag: "CollectionId";
|
|
47
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
48
|
+
})[];
|
|
49
|
+
}>;
|
|
50
|
+
/** One `transcript.append_message(label, value)` call replayed by the host. */
|
|
51
|
+
export declare const VrfTranscriptItem: import("scale-ts").Codec<{
|
|
52
|
+
label: Uint8Array<ArrayBufferLike>;
|
|
53
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
54
|
+
}>;
|
|
55
|
+
/** schnorrkel VRF output: a 32-byte `VRFPreOut` and a 64-byte `VRFProof`. */
|
|
56
|
+
export declare const VrfSignature: import("scale-ts").Codec<{
|
|
57
|
+
preOutput: Uint8Array<ArrayBufferLike>;
|
|
58
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
31
59
|
}>;
|
|
32
60
|
export declare const RequestCredentialsErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::Rejected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::DomainNotValid"> | import("@novasamatech/scale").CodecError<{
|
|
33
61
|
reason: string;
|
|
@@ -54,17 +82,18 @@ export declare const RequestCredentialsErr: [import("scale-ts").Encoder<import("
|
|
|
54
82
|
};
|
|
55
83
|
export declare const CreateProofErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
56
84
|
reason: string;
|
|
57
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
85
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
58
86
|
reason: string;
|
|
59
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>] & {
|
|
87
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>] & {
|
|
60
88
|
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
61
89
|
reason: string;
|
|
62
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>;
|
|
90
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>;
|
|
63
91
|
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
64
92
|
reason: string;
|
|
65
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>;
|
|
93
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>;
|
|
66
94
|
} & {
|
|
67
95
|
readonly RingNotFound: import("@novasamatech/scale").ErrCodec<undefined, "CreateProofErr::RingNotFound">;
|
|
96
|
+
readonly NotMember: import("@novasamatech/scale").ErrCodec<undefined, "CreateProofErr::NotMember">;
|
|
68
97
|
readonly Rejected: import("@novasamatech/scale").ErrCodec<undefined, "CreateProofErr::Rejected">;
|
|
69
98
|
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
70
99
|
reason: string;
|
|
@@ -72,7 +101,30 @@ export declare const CreateProofErr: [import("scale-ts").Encoder<import("@novasa
|
|
|
72
101
|
} & {
|
|
73
102
|
[Symbol.hasInstance](v: unknown): v is import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
74
103
|
reason: string;
|
|
75
|
-
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">;
|
|
104
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">;
|
|
105
|
+
};
|
|
106
|
+
export declare const GetAliasErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
107
|
+
reason: string;
|
|
108
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
109
|
+
reason: string;
|
|
110
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>] & {
|
|
111
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
112
|
+
reason: string;
|
|
113
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>;
|
|
114
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
115
|
+
reason: string;
|
|
116
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>;
|
|
117
|
+
} & {
|
|
118
|
+
readonly RingNotFound: import("@novasamatech/scale").ErrCodec<undefined, "GetAliasErr::RingNotFound">;
|
|
119
|
+
readonly NotMember: import("@novasamatech/scale").ErrCodec<undefined, "GetAliasErr::NotMember">;
|
|
120
|
+
readonly Rejected: import("@novasamatech/scale").ErrCodec<undefined, "GetAliasErr::Rejected">;
|
|
121
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
122
|
+
reason: string;
|
|
123
|
+
}, "GetAliasErr::Unknown">;
|
|
124
|
+
} & {
|
|
125
|
+
[Symbol.hasInstance](v: unknown): v is import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
126
|
+
reason: string;
|
|
127
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">;
|
|
76
128
|
};
|
|
77
129
|
export declare const GetUserIdErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "GetUserIdErr::NotConnected"> | import("@novasamatech/scale").CodecError<{
|
|
78
130
|
reason: string;
|
|
@@ -96,6 +148,28 @@ export declare const GetUserIdErr: [import("scale-ts").Encoder<import("@novasama
|
|
|
96
148
|
reason: string;
|
|
97
149
|
}, "GetUserIdErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetUserIdErr::PermissionDenied">;
|
|
98
150
|
};
|
|
151
|
+
export declare const SignVrfErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
152
|
+
reason: string;
|
|
153
|
+
}, "SignVrfErr::Unknown">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
154
|
+
reason: string;
|
|
155
|
+
}, "SignVrfErr::Unknown">>] & {
|
|
156
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
157
|
+
reason: string;
|
|
158
|
+
}, "SignVrfErr::Unknown">>;
|
|
159
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
160
|
+
reason: string;
|
|
161
|
+
}, "SignVrfErr::Unknown">>;
|
|
162
|
+
} & {
|
|
163
|
+
readonly NotConnected: import("@novasamatech/scale").ErrCodec<undefined, "SignVrfErr::NotConnected">;
|
|
164
|
+
readonly Rejected: import("@novasamatech/scale").ErrCodec<undefined, "SignVrfErr::Rejected">;
|
|
165
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
166
|
+
reason: string;
|
|
167
|
+
}, "SignVrfErr::Unknown">;
|
|
168
|
+
} & {
|
|
169
|
+
[Symbol.hasInstance](v: unknown): v is import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
170
|
+
reason: string;
|
|
171
|
+
}, "SignVrfErr::Unknown">;
|
|
172
|
+
};
|
|
99
173
|
export declare const AccountConnectionStatus: import("scale-ts").Codec<"disconnected" | "connected">;
|
|
100
174
|
export declare const AccountConnectionStatusV1_start: import("scale-ts").Codec<undefined>;
|
|
101
175
|
export declare const AccountConnectionStatusV1_receive: import("scale-ts").Codec<"disconnected" | "connected">;
|
|
@@ -112,23 +186,62 @@ export declare const AccountGetV1_response: import("scale-ts").Codec<import("sca
|
|
|
112
186
|
}, import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::Rejected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::DomainNotValid"> | import("@novasamatech/scale").CodecError<{
|
|
113
187
|
reason: string;
|
|
114
188
|
}, "RequestCredentialsErr::Unknown">>>;
|
|
115
|
-
export declare const AccountGetAliasV1_request: import("scale-ts").Codec<[string,
|
|
189
|
+
export declare const AccountGetAliasV1_request: import("scale-ts").Codec<[[string, `0x${string}`], {
|
|
190
|
+
chainId: `0x${string}`;
|
|
191
|
+
junctions: ({
|
|
192
|
+
tag: "PalletInstance";
|
|
193
|
+
value: number;
|
|
194
|
+
} | {
|
|
195
|
+
tag: "CollectionId";
|
|
196
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
197
|
+
})[];
|
|
198
|
+
}]>;
|
|
116
199
|
export declare const AccountGetAliasV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
117
200
|
context: Uint8Array<ArrayBufferLike>;
|
|
118
201
|
alias: Uint8Array<ArrayBufferLike>;
|
|
119
|
-
}, import("@novasamatech/scale").CodecError<undefined, "
|
|
202
|
+
}, import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
120
203
|
reason: string;
|
|
121
|
-
}, "
|
|
122
|
-
export declare const AccountCreateProofV1_request: import("scale-ts").Codec<[[string,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} |
|
|
204
|
+
}, "GetAliasErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::NotMember">>>;
|
|
205
|
+
export declare const AccountCreateProofV1_request: import("scale-ts").Codec<[[string, `0x${string}`], {
|
|
206
|
+
chainId: `0x${string}`;
|
|
207
|
+
junctions: ({
|
|
208
|
+
tag: "PalletInstance";
|
|
209
|
+
value: number;
|
|
210
|
+
} | {
|
|
211
|
+
tag: "CollectionId";
|
|
212
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
213
|
+
})[];
|
|
128
214
|
}, Uint8Array<ArrayBufferLike>]>;
|
|
129
|
-
export declare const AccountCreateProofV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<
|
|
215
|
+
export declare const AccountCreateProofV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
216
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
217
|
+
contextualAlias: {
|
|
218
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
219
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
220
|
+
};
|
|
221
|
+
ringIndex: number;
|
|
222
|
+
ringRevision: number;
|
|
223
|
+
}, import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
224
|
+
reason: string;
|
|
225
|
+
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::NotMember">>>;
|
|
226
|
+
/**
|
|
227
|
+
* The host replays the transcript verbatim — `Transcript::new(transcriptLabel)`
|
|
228
|
+
* followed by `append_message(item.label, item.value)` per item, in order — and
|
|
229
|
+
* performs no interpretation of labels or values (RFC-0023).
|
|
230
|
+
*/
|
|
231
|
+
export declare const AccountSignVrfV1_request: import("scale-ts").Codec<{
|
|
232
|
+
account: [string, number];
|
|
233
|
+
transcriptLabel: Uint8Array<ArrayBufferLike>;
|
|
234
|
+
items: {
|
|
235
|
+
label: Uint8Array<ArrayBufferLike>;
|
|
236
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
237
|
+
}[];
|
|
238
|
+
}>;
|
|
239
|
+
export declare const AccountSignVrfV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
240
|
+
preOutput: Uint8Array<ArrayBufferLike>;
|
|
241
|
+
proof: Uint8Array<ArrayBufferLike>;
|
|
242
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "SignVrfErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
130
243
|
reason: string;
|
|
131
|
-
}, "
|
|
244
|
+
}, "SignVrfErr::Unknown">>>;
|
|
132
245
|
export declare const GetLegacyAccountsV1_request: import("scale-ts").Codec<undefined>;
|
|
133
246
|
export declare const GetLegacyAccountsV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
134
247
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { ErrEnum, Hex, Status } from '@novasamatech/scale';
|
|
2
|
-
import { Bytes, Option, Result, Struct, Tuple, Vector, _void, str, u32 } from 'scale-ts';
|
|
3
|
-
import { GenericErr
|
|
1
|
+
import { Enum, ErrEnum, Hex, Status } from '@novasamatech/scale';
|
|
2
|
+
import { Bytes, Option, Result, Struct, Tuple, Vector, _void, str, u32, u8 } from 'scale-ts';
|
|
3
|
+
import { GenericErr } from '../commonCodecs.js';
|
|
4
4
|
// common types
|
|
5
5
|
export const AccountId = Bytes(32);
|
|
6
6
|
export const PublicKey = Bytes();
|
|
7
7
|
export const DotNsIdentifier = str;
|
|
8
8
|
export const DerivationIndex = u32;
|
|
9
9
|
export const ProductAccountId = Tuple(DotNsIdentifier, DerivationIndex);
|
|
10
|
-
export const RingVrfProof = Bytes();
|
|
11
10
|
export const RingVrgAlias = Bytes();
|
|
11
|
+
export const ProductId = DotNsIdentifier;
|
|
12
|
+
export const ProductProofContextSuffix = Hex();
|
|
13
|
+
export const ProductProofContext = Tuple(ProductId, ProductProofContextSuffix);
|
|
12
14
|
// structs
|
|
13
15
|
export const ProductAccount = Struct({
|
|
14
16
|
publicKey: PublicKey,
|
|
@@ -24,13 +26,30 @@ export const ContextualAlias = Struct({
|
|
|
24
26
|
context: Bytes(32),
|
|
25
27
|
alias: RingVrgAlias,
|
|
26
28
|
});
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
+
export const RingVrfProof = Struct({
|
|
30
|
+
proof: Bytes(),
|
|
31
|
+
contextualAlias: ContextualAlias,
|
|
32
|
+
ringIndex: u32,
|
|
33
|
+
ringRevision: u32,
|
|
34
|
+
});
|
|
35
|
+
export const RingLocationJunction = Enum({
|
|
36
|
+
PalletInstance: u8,
|
|
37
|
+
CollectionId: Bytes(),
|
|
29
38
|
});
|
|
30
39
|
export const RingLocation = Struct({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
// TODO make GenesisHash fixed size and replace hardcoded codec with it
|
|
41
|
+
chainId: Hex(32),
|
|
42
|
+
junctions: Vector(RingLocationJunction),
|
|
43
|
+
});
|
|
44
|
+
/** One `transcript.append_message(label, value)` call replayed by the host. */
|
|
45
|
+
export const VrfTranscriptItem = Struct({
|
|
46
|
+
label: Bytes(),
|
|
47
|
+
value: Bytes(),
|
|
48
|
+
});
|
|
49
|
+
/** schnorrkel VRF output: a 32-byte `VRFPreOut` and a 64-byte `VRFProof`. */
|
|
50
|
+
export const VrfSignature = Struct({
|
|
51
|
+
preOutput: Bytes(32),
|
|
52
|
+
proof: Bytes(64),
|
|
34
53
|
});
|
|
35
54
|
// errors
|
|
36
55
|
export const RequestCredentialsErr = ErrEnum('RequestCredentialsErr', {
|
|
@@ -41,14 +60,26 @@ export const RequestCredentialsErr = ErrEnum('RequestCredentialsErr', {
|
|
|
41
60
|
});
|
|
42
61
|
export const CreateProofErr = ErrEnum('CreateProofErr', {
|
|
43
62
|
RingNotFound: [_void, 'CreateProof: ring not found'],
|
|
63
|
+
NotMember: [_void, 'CreateProof: selected member key is not a member of the ring'],
|
|
44
64
|
Rejected: [_void, 'CreateProof: rejected'],
|
|
45
65
|
Unknown: [GenericErr, 'CreateProof: unknown error'],
|
|
46
66
|
});
|
|
67
|
+
export const GetAliasErr = ErrEnum('GetAliasErr', {
|
|
68
|
+
RingNotFound: [_void, 'GetAlias: ring not found'],
|
|
69
|
+
NotMember: [_void, 'GetAlias: selected member key is not a member of the ring'],
|
|
70
|
+
Rejected: [_void, 'GetAlias: rejected'],
|
|
71
|
+
Unknown: [GenericErr, 'GetAlias: unknown error'],
|
|
72
|
+
});
|
|
47
73
|
export const GetUserIdErr = ErrEnum('GetUserIdErr', {
|
|
48
74
|
PermissionDenied: [_void, 'GetUserId: permission denied'],
|
|
49
75
|
NotConnected: [_void, 'GetUserId: not connected'],
|
|
50
76
|
Unknown: [GenericErr, 'GetUserId: unknown error'],
|
|
51
77
|
});
|
|
78
|
+
export const SignVrfErr = ErrEnum('SignVrfErr', {
|
|
79
|
+
NotConnected: [_void, 'SignVrf: not connected'],
|
|
80
|
+
Rejected: [_void, 'SignVrf: rejected'],
|
|
81
|
+
Unknown: [GenericErr, 'SignVrf: unknown error'],
|
|
82
|
+
});
|
|
52
83
|
// account connection status
|
|
53
84
|
export const AccountConnectionStatus = Status('disconnected', 'connected');
|
|
54
85
|
export const AccountConnectionStatusV1_start = _void;
|
|
@@ -61,11 +92,23 @@ export const GetUserIdV1_response = Result(UserIdentity, GetUserIdErr);
|
|
|
61
92
|
export const AccountGetV1_request = ProductAccountId;
|
|
62
93
|
export const AccountGetV1_response = Result(ProductAccount, RequestCredentialsErr);
|
|
63
94
|
// account_get_alias
|
|
64
|
-
export const AccountGetAliasV1_request =
|
|
65
|
-
export const AccountGetAliasV1_response = Result(ContextualAlias,
|
|
95
|
+
export const AccountGetAliasV1_request = Tuple(ProductProofContext, RingLocation);
|
|
96
|
+
export const AccountGetAliasV1_response = Result(ContextualAlias, GetAliasErr);
|
|
66
97
|
// account_create_proof
|
|
67
|
-
export const AccountCreateProofV1_request = Tuple(
|
|
98
|
+
export const AccountCreateProofV1_request = Tuple(ProductProofContext, RingLocation, Bytes());
|
|
68
99
|
export const AccountCreateProofV1_response = Result(RingVrfProof, CreateProofErr);
|
|
100
|
+
// account_sign_vrf
|
|
101
|
+
/**
|
|
102
|
+
* The host replays the transcript verbatim — `Transcript::new(transcriptLabel)`
|
|
103
|
+
* followed by `append_message(item.label, item.value)` per item, in order — and
|
|
104
|
+
* performs no interpretation of labels or values (RFC-0023).
|
|
105
|
+
*/
|
|
106
|
+
export const AccountSignVrfV1_request = Struct({
|
|
107
|
+
account: ProductAccountId,
|
|
108
|
+
transcriptLabel: Bytes(),
|
|
109
|
+
items: Vector(VrfTranscriptItem),
|
|
110
|
+
});
|
|
111
|
+
export const AccountSignVrfV1_response = Result(VrfSignature, SignVrfErr);
|
|
69
112
|
// get_legacy_accounts
|
|
70
113
|
export const GetLegacyAccountsV1_request = _void;
|
|
71
114
|
export const GetLegacyAccountsV1_response = Result(Vector(LegacyAccount), RequestCredentialsErr);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.12",
|
|
5
5
|
"description": "Host API: transport implementation for host - product integration.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@novasamatech/scale": "0.8.
|
|
26
|
-
"nanoevents": "
|
|
27
|
-
"nanoid": "
|
|
25
|
+
"@novasamatech/scale": "0.8.12",
|
|
26
|
+
"nanoevents": "10.0.0",
|
|
27
|
+
"nanoid": "6.0.0",
|
|
28
28
|
"neverthrow": "^8.2.0",
|
|
29
29
|
"scale-ts": "1.6.1"
|
|
30
30
|
},
|