@novasamatech/host-api 0.7.8 → 0.7.9-1
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/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { Codec, CodecType } from 'scale-ts';
|
|
|
11
11
|
export type { HexString } from '@novasamatech/scale';
|
|
12
12
|
export { assertEnumVariant, enumValue, fromHex, isEnumVariant, resultErr, resultOk, toHex, unwrapResultOrThrow, } from '@novasamatech/scale';
|
|
13
13
|
export { GenericError } from './protocol/commonCodecs.js';
|
|
14
|
-
export { CreateTransactionErr,
|
|
14
|
+
export { CreateTransactionErr, LegacyTransaction, ProductAccountTransaction } from './protocol/v1/createTransaction.js';
|
|
15
15
|
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, RequestCredentialsErr, RingLocation, UserIdentity, } from './protocol/v1/accounts.js';
|
|
16
16
|
export { ChatActionPayload, ChatBotRegistrationErr, ChatBotRegistrationStatus, ChatMessageContent, ChatMessagePostingErr, ChatRoom, ChatRoomRegistrationErr, ChatRoomRegistrationResult, ChatRoomRegistrationStatus, ReceivedChatAction, } from './protocol/v1/chat.js';
|
|
17
17
|
export { DeriveEntropyErr } from './protocol/v1/deriveEntropy.js';
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { hostApiProtocol } from './protocol/impl.js';
|
|
|
6
6
|
export { assertEnumVariant, enumValue, fromHex, isEnumVariant, resultErr, resultOk, toHex, unwrapResultOrThrow, } from '@novasamatech/scale';
|
|
7
7
|
// Codecs
|
|
8
8
|
export { GenericError } from './protocol/commonCodecs.js';
|
|
9
|
-
export { CreateTransactionErr,
|
|
9
|
+
export { CreateTransactionErr, LegacyTransaction, ProductAccountTransaction } from './protocol/v1/createTransaction.js';
|
|
10
10
|
export { AccountConnectionStatus, AccountId, ContextualAlias, CreateProofErr, DerivationIndex, DotNsIdentifier, GetUserIdErr, LegacyAccount, LoginErr, LoginResult, ProductAccount, ProductAccountId, RequestCredentialsErr, RingLocation, UserIdentity, } 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';
|
package/dist/protocol/impl.d.ts
CHANGED
|
@@ -123,12 +123,30 @@ export declare const hostApiProtocol: {
|
|
|
123
123
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
124
124
|
}>;
|
|
125
125
|
readonly host_create_transaction: VersionedProtocolRequest<{
|
|
126
|
-
readonly v1: [Codec<
|
|
126
|
+
readonly v1: [Codec<{
|
|
127
|
+
signer: [string, number];
|
|
128
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
129
|
+
extensions: {
|
|
130
|
+
id: string;
|
|
131
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
132
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
133
|
+
}[];
|
|
134
|
+
txExtVersion: number;
|
|
135
|
+
}>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
127
136
|
reason: string;
|
|
128
137
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
129
138
|
}>;
|
|
130
139
|
readonly host_create_transaction_with_legacy_account: VersionedProtocolRequest<{
|
|
131
|
-
readonly v1: [Codec<
|
|
140
|
+
readonly v1: [Codec<{
|
|
141
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
142
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
143
|
+
extensions: {
|
|
144
|
+
id: string;
|
|
145
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
146
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
147
|
+
}[];
|
|
148
|
+
txExtVersion: number;
|
|
149
|
+
}>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
132
150
|
reason: string;
|
|
133
151
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
134
152
|
}>;
|
|
@@ -129,13 +129,31 @@ export declare const MessagePayload: EnumCodec<Record<"host_handshake_request",
|
|
|
129
129
|
reason: string;
|
|
130
130
|
}, "RequestCredentialsErr::Unknown">>>;
|
|
131
131
|
}>> & Record<"host_create_transaction_request", EnumCodec<{
|
|
132
|
-
readonly v1: Codec<
|
|
132
|
+
readonly v1: Codec<{
|
|
133
|
+
signer: [string, number];
|
|
134
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
135
|
+
extensions: {
|
|
136
|
+
id: string;
|
|
137
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
138
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
139
|
+
}[];
|
|
140
|
+
txExtVersion: number;
|
|
141
|
+
}>;
|
|
133
142
|
}>> & Record<"host_create_transaction_response", EnumCodec<{
|
|
134
143
|
readonly v1: Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
135
144
|
reason: string;
|
|
136
145
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>;
|
|
137
146
|
}>> & Record<"host_create_transaction_with_legacy_account_request", EnumCodec<{
|
|
138
|
-
readonly v1: Codec<
|
|
147
|
+
readonly v1: Codec<{
|
|
148
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
149
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
150
|
+
extensions: {
|
|
151
|
+
id: string;
|
|
152
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
153
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
154
|
+
}[];
|
|
155
|
+
txExtVersion: number;
|
|
156
|
+
}>;
|
|
139
157
|
}>> & Record<"host_create_transaction_with_legacy_account_response", EnumCodec<{
|
|
140
158
|
readonly v1: Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
141
159
|
reason: string;
|
|
@@ -1275,7 +1293,16 @@ export declare const Message: Codec<{
|
|
|
1275
1293
|
tag: "host_create_transaction_request";
|
|
1276
1294
|
value: {
|
|
1277
1295
|
tag: "v1";
|
|
1278
|
-
value:
|
|
1296
|
+
value: {
|
|
1297
|
+
signer: [string, number];
|
|
1298
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
1299
|
+
extensions: {
|
|
1300
|
+
id: string;
|
|
1301
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
1302
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
1303
|
+
}[];
|
|
1304
|
+
txExtVersion: number;
|
|
1305
|
+
};
|
|
1279
1306
|
};
|
|
1280
1307
|
} | {
|
|
1281
1308
|
tag: "host_create_transaction_response";
|
|
@@ -1289,7 +1316,16 @@ export declare const Message: Codec<{
|
|
|
1289
1316
|
tag: "host_create_transaction_with_legacy_account_request";
|
|
1290
1317
|
value: {
|
|
1291
1318
|
tag: "v1";
|
|
1292
|
-
value:
|
|
1319
|
+
value: {
|
|
1320
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
1321
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
1322
|
+
extensions: {
|
|
1323
|
+
id: string;
|
|
1324
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
1325
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
1326
|
+
}[];
|
|
1327
|
+
txExtVersion: number;
|
|
1328
|
+
};
|
|
1293
1329
|
};
|
|
1294
1330
|
} | {
|
|
1295
1331
|
tag: "host_create_transaction_with_legacy_account_response";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Codec } from 'scale-ts';
|
|
2
2
|
/**
|
|
3
3
|
* createTransaction implementation
|
|
4
4
|
* @see https://github.com/polkadot-js/api/issues/6213
|
|
5
|
+
* Since specification is aimed to cover both online and offline signers we dropped some field that are not related
|
|
5
6
|
*/
|
|
6
7
|
export declare const CreateTransactionErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
7
8
|
reason: string;
|
|
@@ -27,121 +28,54 @@ export declare const CreateTransactionErr: [import("scale-ts").Encoder<import("@
|
|
|
27
28
|
reason: string;
|
|
28
29
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">;
|
|
29
30
|
};
|
|
30
|
-
export declare const TxPayloadExtensionV1:
|
|
31
|
+
export declare const TxPayloadExtensionV1: Codec<{
|
|
31
32
|
id: string;
|
|
32
|
-
extra:
|
|
33
|
-
additionalSigned:
|
|
33
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
34
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
34
35
|
}>;
|
|
35
|
-
export declare const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
export declare const ProductAccountTransaction: Codec<{
|
|
37
|
+
signer: [string, number];
|
|
38
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
39
|
+
extensions: {
|
|
40
|
+
id: string;
|
|
41
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
42
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
43
|
+
}[];
|
|
44
|
+
txExtVersion: number;
|
|
40
45
|
}>;
|
|
41
|
-
export declare const
|
|
42
|
-
signer:
|
|
43
|
-
callData:
|
|
46
|
+
export declare const LegacyTransaction: Codec<{
|
|
47
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
48
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
44
49
|
extensions: {
|
|
45
50
|
id: string;
|
|
46
|
-
extra:
|
|
47
|
-
additionalSigned:
|
|
51
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
52
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
48
53
|
}[];
|
|
49
54
|
txExtVersion: number;
|
|
50
|
-
context: {
|
|
51
|
-
metadata: `0x${string}`;
|
|
52
|
-
tokenSymbol: string;
|
|
53
|
-
tokenDecimals: number;
|
|
54
|
-
bestBlockHeight: number;
|
|
55
|
-
};
|
|
56
55
|
}>;
|
|
57
|
-
export declare const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}[];
|
|
67
|
-
txExtVersion: number;
|
|
68
|
-
context: {
|
|
69
|
-
metadata: `0x${string}`;
|
|
70
|
-
tokenSymbol: string;
|
|
71
|
-
tokenDecimals: number;
|
|
72
|
-
bestBlockHeight: number;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
56
|
+
export declare const CreateTransactionV1_request: Codec<{
|
|
57
|
+
signer: [string, number];
|
|
58
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
59
|
+
extensions: {
|
|
60
|
+
id: string;
|
|
61
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
62
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
63
|
+
}[];
|
|
64
|
+
txExtVersion: number;
|
|
75
65
|
}>;
|
|
76
|
-
export declare const
|
|
77
|
-
export declare const CreateTransactionV1_request: import("scale-ts").Codec<[[string, number], TxPayloadV1Public]>;
|
|
78
|
-
export declare const CreateTransactionV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
66
|
+
export declare const CreateTransactionV1_response: Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
79
67
|
reason: string;
|
|
80
68
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>;
|
|
81
|
-
export declare const CreateTransactionWithLegacyAccountV1_request:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export interface TxPayloadV1Public {
|
|
86
|
-
/** Payload version. MUST be 1. */
|
|
87
|
-
version: 1;
|
|
88
|
-
/**
|
|
89
|
-
* Signer selection hint. Allows the implementer to identify which private-key / scheme to use.
|
|
90
|
-
* - Use a wallet-defined handle (e.g., address/SS58, account-name, etc). This identifier
|
|
91
|
-
* was previously made available to the consumer.
|
|
92
|
-
* - Set `null` to let the implementer pick the signer (or if the signer is implied).
|
|
93
|
-
*/
|
|
94
|
-
signer: string | null;
|
|
95
|
-
/**
|
|
96
|
-
* SCALE-encoded Call (module indicator + function indicator + params).
|
|
97
|
-
*/
|
|
98
|
-
callData: HexString;
|
|
99
|
-
/**
|
|
100
|
-
* Transaction extensions supplied by the caller (order irrelevant).
|
|
101
|
-
* The consumer SHOULD provide every extension that is relevant to them.
|
|
102
|
-
* The implementer MAY infer missing ones.
|
|
103
|
-
*/
|
|
104
|
-
extensions: Array<{
|
|
105
|
-
/** Identifier as defined in metadata (e.g., "CheckSpecVersion", "ChargeAssetTxPayment"). */
|
|
69
|
+
export declare const CreateTransactionWithLegacyAccountV1_request: Codec<{
|
|
70
|
+
signer: Uint8Array<ArrayBufferLike>;
|
|
71
|
+
callData: Uint8Array<ArrayBufferLike>;
|
|
72
|
+
extensions: {
|
|
106
73
|
id: string;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
extra: HexString;
|
|
112
|
-
/**
|
|
113
|
-
* "Implicit" data to sign (known by the chain, not included into the extrinsic body).
|
|
114
|
-
* SCALE-encoded per the extension's "additionalSigned" type as defined in the metadata.
|
|
115
|
-
*/
|
|
116
|
-
additionalSigned: HexString;
|
|
117
|
-
}>;
|
|
118
|
-
/**
|
|
119
|
-
* Transaction Extension Version.
|
|
120
|
-
* - For Extrinsic V4 MUST be 0.
|
|
121
|
-
* - For Extrinsic V5, set to any version supported by the runtime.
|
|
122
|
-
* The implementer:
|
|
123
|
-
* - MUST use this field to determine the required extensions for creating the extrinsic.
|
|
124
|
-
* - MAY use this field to infer missing extensions that the implementer could know how to handle.
|
|
125
|
-
*/
|
|
74
|
+
extra: Uint8Array<ArrayBufferLike>;
|
|
75
|
+
additionalSigned: Uint8Array<ArrayBufferLike>;
|
|
76
|
+
}[];
|
|
126
77
|
txExtVersion: number;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* RuntimeMetadataPrefixed blob (SCALE), starting with ASCII "meta" magic (`0x6d657461`),
|
|
133
|
-
* then a metadata version (V14+). For V5+ versioned extensions, MUST provide V16+.
|
|
134
|
-
*/
|
|
135
|
-
metadata: HexString;
|
|
136
|
-
/**
|
|
137
|
-
* Native token display info (used by some implementers), also needed to compute
|
|
138
|
-
* the `CheckMetadataHash` value.
|
|
139
|
-
*/
|
|
140
|
-
tokenSymbol: string;
|
|
141
|
-
tokenDecimals: number;
|
|
142
|
-
/**
|
|
143
|
-
* Highest known block number to aid mortality UX.
|
|
144
|
-
*/
|
|
145
|
-
bestBlockHeight: number;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
78
|
+
}>;
|
|
79
|
+
export declare const CreateTransactionWithLegacyAccountV1_response: Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
80
|
+
reason: string;
|
|
81
|
+
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Bytes, Result, Struct,
|
|
1
|
+
import { ErrEnum } from '@novasamatech/scale';
|
|
2
|
+
import { Bytes, Result, Struct, Vector, _void, str, u8 } from 'scale-ts';
|
|
3
3
|
import { GenericErr } from '../commonCodecs.js';
|
|
4
|
-
import { ProductAccountId } from './accounts.js';
|
|
4
|
+
import { AccountId, ProductAccountId } from './accounts.js';
|
|
5
5
|
/**
|
|
6
6
|
* createTransaction implementation
|
|
7
7
|
* @see https://github.com/polkadot-js/api/issues/6213
|
|
8
|
+
* Since specification is aimed to cover both online and offline signers we dropped some field that are not related
|
|
8
9
|
*/
|
|
9
10
|
export const CreateTransactionErr = ErrEnum('CreateTransactionErr', {
|
|
10
11
|
FailedToDecode: [_void, 'Failed to decode'],
|
|
@@ -16,45 +17,47 @@ export const CreateTransactionErr = ErrEnum('CreateTransactionErr', {
|
|
|
16
17
|
Unknown: [GenericErr, 'Unknown error'],
|
|
17
18
|
});
|
|
18
19
|
export const TxPayloadExtensionV1 = Struct({
|
|
20
|
+
/** Identifier as defined in metadata (e.g., "CheckSpecVersion", "ChargeAssetTxPayment"). */
|
|
19
21
|
id: str,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
signer: Nullable(str),
|
|
31
|
-
callData: Hex(),
|
|
32
|
-
extensions: Vector(TxPayloadExtensionV1),
|
|
33
|
-
txExtVersion: u8,
|
|
34
|
-
context: TxPayloadContextV1,
|
|
35
|
-
});
|
|
36
|
-
export const VersionedTxPayload = Enum({
|
|
37
|
-
v1: TxPayloadV1,
|
|
38
|
-
});
|
|
39
|
-
export const VersionedPublicTxPayload = enhanceCodec(VersionedTxPayload, v => {
|
|
40
|
-
if (v.version !== 1) {
|
|
41
|
-
throw new Error(`Unsupported transaction version: ${v}`);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
tag: 'v1',
|
|
45
|
-
value: v,
|
|
46
|
-
};
|
|
47
|
-
}, v => {
|
|
48
|
-
if (v.tag !== 'v1') {
|
|
49
|
-
throw new Error(`Unsupported transaction version: ${v}`);
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
version: 1,
|
|
53
|
-
...v.value,
|
|
54
|
-
};
|
|
22
|
+
/**
|
|
23
|
+
* Explicit "extra" to sign (goes into the extrinsic body).
|
|
24
|
+
* SCALE-encoded per the extension's "extra" type as defined in the metadata.
|
|
25
|
+
*/
|
|
26
|
+
extra: Bytes(),
|
|
27
|
+
/**
|
|
28
|
+
* "Implicit" data to sign (known by the chain, not included into the extrinsic body).
|
|
29
|
+
* SCALE-encoded per the extension's "additionalSigned" type as defined in the metadata.
|
|
30
|
+
*/
|
|
31
|
+
additionalSigned: Bytes(),
|
|
55
32
|
});
|
|
33
|
+
function GenericTxPayloadV1(signer) {
|
|
34
|
+
return Struct({
|
|
35
|
+
signer,
|
|
36
|
+
/**
|
|
37
|
+
* SCALE-encoded Call (module indicator + function indicator + params).
|
|
38
|
+
*/
|
|
39
|
+
callData: Bytes(),
|
|
40
|
+
/**
|
|
41
|
+
* Transaction extensions supplied by the caller (order irrelevant).
|
|
42
|
+
* The consumer SHOULD provide every extension that is relevant to them.
|
|
43
|
+
* The implementer MAY infer missing ones.
|
|
44
|
+
*/
|
|
45
|
+
extensions: Vector(TxPayloadExtensionV1),
|
|
46
|
+
/**
|
|
47
|
+
* Transaction Extension Version.
|
|
48
|
+
* - For Extrinsic V4 MUST be 0.
|
|
49
|
+
* - For Extrinsic V5, set to any version supported by the runtime.
|
|
50
|
+
* The implementer:
|
|
51
|
+
* - MUST use this field to determine the required extensions for creating the extrinsic.
|
|
52
|
+
* - MAY use this field to infer missing extensions that the implementer could know how to handle.
|
|
53
|
+
*/
|
|
54
|
+
txExtVersion: u8,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
56
57
|
// transaction in the context of a host api account model
|
|
57
|
-
export const
|
|
58
|
+
export const ProductAccountTransaction = GenericTxPayloadV1(ProductAccountId);
|
|
59
|
+
export const LegacyTransaction = GenericTxPayloadV1(AccountId);
|
|
60
|
+
export const CreateTransactionV1_request = ProductAccountTransaction;
|
|
58
61
|
export const CreateTransactionV1_response = Result(Bytes(), CreateTransactionErr);
|
|
59
|
-
export const CreateTransactionWithLegacyAccountV1_request =
|
|
62
|
+
export const CreateTransactionWithLegacyAccountV1_request = LegacyTransaction;
|
|
60
63
|
export const CreateTransactionWithLegacyAccountV1_response = Result(Bytes(), CreateTransactionErr);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.9-1",
|
|
5
5
|
"description": "Host API: transport implementation for host - product integration.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@novasamatech/scale": "0.7.
|
|
25
|
+
"@novasamatech/scale": "0.7.9-1",
|
|
26
26
|
"nanoevents": "9.1.0",
|
|
27
27
|
"nanoid": "5.1.9",
|
|
28
28
|
"neverthrow": "^8.2.0",
|