@novasamatech/host-api 0.8.11 → 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 +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol/impl.d.ts +15 -0
- package/dist/protocol/impl.js +7 -1
- package/dist/protocol/messageCodec.d.ts +40 -0
- package/dist/protocol/v1/accounts.d.ts +51 -0
- package/dist/protocol/v1/accounts.js +27 -0
- 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, GetAliasErr, 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';
|
|
@@ -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, GetAliasErr, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, ProductId, ProductProofContext, ProductProofContextSuffix, RequestCredentialsErr, RingLocation, RingLocationJunction, RingVrfProof, 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, GetAliasErr, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, ProductId, ProductProofContext, ProductProofContextSuffix, RequestCredentialsErr, RingLocation, RingLocationJunction, RingVrfProof, 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
|
@@ -1024,5 +1024,20 @@ export declare const hostApiProtocol: {
|
|
|
1024
1024
|
reason: string;
|
|
1025
1025
|
}, "GenericError">>>];
|
|
1026
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
|
+
}>;
|
|
1027
1042
|
};
|
|
1028
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
|
};
|
|
@@ -1085,6 +1085,22 @@ export declare const MessagePayload: EnumCodec<Record<"host_handshake_request",
|
|
|
1085
1085
|
readonly v1: Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
1086
1086
|
reason: string;
|
|
1087
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">>>;
|
|
1088
1104
|
}>>>;
|
|
1089
1105
|
export declare const Message: Codec<{
|
|
1090
1106
|
requestId: string;
|
|
@@ -2638,6 +2654,30 @@ export declare const Message: Codec<{
|
|
|
2638
2654
|
reason: string;
|
|
2639
2655
|
}, "GenericError">>;
|
|
2640
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
|
+
};
|
|
2641
2681
|
};
|
|
2642
2682
|
}>;
|
|
2643
2683
|
export type MessageAction = MessagePayloadSchema['tag'];
|
|
@@ -47,6 +47,16 @@ export declare const RingLocation: import("scale-ts").Codec<{
|
|
|
47
47
|
value: Uint8Array<ArrayBufferLike>;
|
|
48
48
|
})[];
|
|
49
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>;
|
|
59
|
+
}>;
|
|
50
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<{
|
|
51
61
|
reason: string;
|
|
52
62
|
}, "RequestCredentialsErr::Unknown">>, import("scale-ts").Decoder<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<{
|
|
@@ -138,6 +148,28 @@ export declare const GetUserIdErr: [import("scale-ts").Encoder<import("@novasama
|
|
|
138
148
|
reason: string;
|
|
139
149
|
}, "GetUserIdErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetUserIdErr::PermissionDenied">;
|
|
140
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
|
+
};
|
|
141
173
|
export declare const AccountConnectionStatus: import("scale-ts").Codec<"disconnected" | "connected">;
|
|
142
174
|
export declare const AccountConnectionStatusV1_start: import("scale-ts").Codec<undefined>;
|
|
143
175
|
export declare const AccountConnectionStatusV1_receive: import("scale-ts").Codec<"disconnected" | "connected">;
|
|
@@ -191,6 +223,25 @@ export declare const AccountCreateProofV1_response: import("scale-ts").Codec<imp
|
|
|
191
223
|
}, import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
192
224
|
reason: string;
|
|
193
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<{
|
|
243
|
+
reason: string;
|
|
244
|
+
}, "SignVrfErr::Unknown">>>;
|
|
194
245
|
export declare const GetLegacyAccountsV1_request: import("scale-ts").Codec<undefined>;
|
|
195
246
|
export declare const GetLegacyAccountsV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
196
247
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
@@ -41,6 +41,16 @@ export const RingLocation = Struct({
|
|
|
41
41
|
chainId: Hex(32),
|
|
42
42
|
junctions: Vector(RingLocationJunction),
|
|
43
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),
|
|
53
|
+
});
|
|
44
54
|
// errors
|
|
45
55
|
export const RequestCredentialsErr = ErrEnum('RequestCredentialsErr', {
|
|
46
56
|
NotConnected: [_void, 'RequestCredentials: not connected'],
|
|
@@ -65,6 +75,11 @@ export const GetUserIdErr = ErrEnum('GetUserIdErr', {
|
|
|
65
75
|
NotConnected: [_void, 'GetUserId: not connected'],
|
|
66
76
|
Unknown: [GenericErr, 'GetUserId: unknown error'],
|
|
67
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
|
+
});
|
|
68
83
|
// account connection status
|
|
69
84
|
export const AccountConnectionStatus = Status('disconnected', 'connected');
|
|
70
85
|
export const AccountConnectionStatusV1_start = _void;
|
|
@@ -82,6 +97,18 @@ export const AccountGetAliasV1_response = Result(ContextualAlias, GetAliasErr);
|
|
|
82
97
|
// account_create_proof
|
|
83
98
|
export const AccountCreateProofV1_request = Tuple(ProductProofContext, RingLocation, Bytes());
|
|
84
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);
|
|
85
112
|
// get_legacy_accounts
|
|
86
113
|
export const GetLegacyAccountsV1_request = _void;
|
|
87
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
|
},
|