@novasamatech/host-api 0.8.12 → 0.9.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.
@@ -1,12 +1,65 @@
1
- export declare const AccountId: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
2
- export declare const PublicKey: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
1
+ import type { CodecType } from 'scale-ts';
2
+ export declare const AccountId: import("@novasamatech/scale").BytesCodec<number>;
3
+ export declare const PublicKey: import("@novasamatech/scale").BytesCodec<undefined>;
3
4
  export declare const DotNsIdentifier: import("scale-ts").Codec<string>;
4
- export declare const DerivationIndex: import("scale-ts").Codec<number>;
5
- export declare const ProductAccountId: import("scale-ts").Codec<[string, number]>;
6
- export declare const RingVrgAlias: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
5
+ /**
6
+ * Raw 32-byte derivation index — the escape hatch for byte-valued selectors.
7
+ * Used directly as the soft-junction chain code of `//product//{productId}/{index}`.
8
+ */
9
+ export declare const RawDerivationIndex: import("@novasamatech/scale").BytesCodec<number>;
10
+ /**
11
+ * Account selector within a product subtree: `Index(u32) | Raw([u8; 32])` (RFC 0022).
12
+ *
13
+ * `Index` is the primary form — plain indices keep a product's accounts
14
+ * enumerable. `Raw` carries a raw 32-byte index. Hosts expand `Index(n)` to
15
+ * the internal 32-byte index (`u32` little-endian ++ index magic) and pass
16
+ * `Raw(bytes)` through unchanged.
17
+ */
18
+ export declare const DerivationIndex: import("scale-ts").Codec<{
19
+ tag: "Index";
20
+ value: number;
21
+ } | {
22
+ tag: "Raw";
23
+ value: Uint8Array<ArrayBufferLike>;
24
+ }>;
25
+ export declare const ProductAccountId: import("scale-ts").Codec<[string, {
26
+ tag: "Index";
27
+ value: number;
28
+ } | {
29
+ tag: "Raw";
30
+ value: Uint8Array<ArrayBufferLike>;
31
+ }]>;
32
+ export declare const RingVrgAlias: import("@novasamatech/scale").BytesCodec<undefined>;
33
+ /**
34
+ * Ergonomic form of an account selector: a plain index or a raw 32-byte index.
35
+ */
36
+ export type AccountSelector = number | Uint8Array;
37
+ /**
38
+ * Normalizes an {@link AccountSelector} into the wire {@link DerivationIndex}:
39
+ * numbers become `Index`, 32-byte arrays become `Raw`.
40
+ */
41
+ export declare function derivationIndexOf(selector: AccountSelector): CodecType<typeof DerivationIndex>;
7
42
  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}`]>;
43
+ /**
44
+ * Selector distinguishing proof contexts within a product (RFC 0004 amended by
45
+ * RFC 0022). Expands to the same 32-byte derivation index as
46
+ * {@link ProductAccountId}'s index, so the alias ↔ account mapping is the
47
+ * identity on it.
48
+ */
49
+ export declare const ProductProofContextSuffix: import("scale-ts").Codec<{
50
+ tag: "Index";
51
+ value: number;
52
+ } | {
53
+ tag: "Raw";
54
+ value: Uint8Array<ArrayBufferLike>;
55
+ }>;
56
+ export declare const ProductProofContext: import("scale-ts").Codec<[string, {
57
+ tag: "Index";
58
+ value: number;
59
+ } | {
60
+ tag: "Raw";
61
+ value: Uint8Array<ArrayBufferLike>;
62
+ }]>;
10
63
  export declare const ProductAccount: import("scale-ts").Codec<{
11
64
  publicKey: Uint8Array<ArrayBufferLike>;
12
65
  }>;
@@ -180,13 +233,25 @@ export declare const GetUserIdV1_response: import("scale-ts").Codec<import("scal
180
233
  }, import("@novasamatech/scale").CodecError<undefined, "GetUserIdErr::NotConnected"> | import("@novasamatech/scale").CodecError<{
181
234
  reason: string;
182
235
  }, "GetUserIdErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "GetUserIdErr::PermissionDenied">>>;
183
- export declare const AccountGetV1_request: import("scale-ts").Codec<[string, number]>;
236
+ export declare const AccountGetV1_request: import("scale-ts").Codec<[string, {
237
+ tag: "Index";
238
+ value: number;
239
+ } | {
240
+ tag: "Raw";
241
+ value: Uint8Array<ArrayBufferLike>;
242
+ }]>;
184
243
  export declare const AccountGetV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
185
244
  publicKey: Uint8Array<ArrayBufferLike>;
186
245
  }, 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<{
187
246
  reason: string;
188
247
  }, "RequestCredentialsErr::Unknown">>>;
189
- export declare const AccountGetAliasV1_request: import("scale-ts").Codec<[[string, `0x${string}`], {
248
+ export declare const AccountGetAliasV1_request: import("scale-ts").Codec<[[string, {
249
+ tag: "Index";
250
+ value: number;
251
+ } | {
252
+ tag: "Raw";
253
+ value: Uint8Array<ArrayBufferLike>;
254
+ }], {
190
255
  chainId: `0x${string}`;
191
256
  junctions: ({
192
257
  tag: "PalletInstance";
@@ -202,7 +267,13 @@ export declare const AccountGetAliasV1_response: import("scale-ts").Codec<import
202
267
  }, import("@novasamatech/scale").CodecError<undefined, "GetAliasErr::Rejected"> | import("@novasamatech/scale").CodecError<{
203
268
  reason: string;
204
269
  }, "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}`], {
270
+ export declare const AccountCreateProofV1_request: import("scale-ts").Codec<[[string, {
271
+ tag: "Index";
272
+ value: number;
273
+ } | {
274
+ tag: "Raw";
275
+ value: Uint8Array<ArrayBufferLike>;
276
+ }], {
206
277
  chainId: `0x${string}`;
207
278
  junctions: ({
208
279
  tag: "PalletInstance";
@@ -229,7 +300,13 @@ export declare const AccountCreateProofV1_response: import("scale-ts").Codec<imp
229
300
  * performs no interpretation of labels or values (RFC-0023).
230
301
  */
231
302
  export declare const AccountSignVrfV1_request: import("scale-ts").Codec<{
232
- account: [string, number];
303
+ account: [string, {
304
+ tag: "Index";
305
+ value: number;
306
+ } | {
307
+ tag: "Raw";
308
+ value: Uint8Array<ArrayBufferLike>;
309
+ }];
233
310
  transcriptLabel: Uint8Array<ArrayBufferLike>;
234
311
  items: {
235
312
  label: Uint8Array<ArrayBufferLike>;
@@ -1,15 +1,50 @@
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';
1
+ import { Bytes, Enum, ErrEnum, Status } from '@novasamatech/scale';
2
+ import { Option, Result, Struct, Tuple, Vector, _void, str, u32, u8 } from 'scale-ts';
3
+ import { GenericErr, GenesisHash } 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
- export const DerivationIndex = u32;
8
+ /**
9
+ * Raw 32-byte derivation index — the escape hatch for byte-valued selectors.
10
+ * Used directly as the soft-junction chain code of `//product//{productId}/{index}`.
11
+ */
12
+ export const RawDerivationIndex = Bytes(32);
13
+ /**
14
+ * Account selector within a product subtree: `Index(u32) | Raw([u8; 32])` (RFC 0022).
15
+ *
16
+ * `Index` is the primary form — plain indices keep a product's accounts
17
+ * enumerable. `Raw` carries a raw 32-byte index. Hosts expand `Index(n)` to
18
+ * the internal 32-byte index (`u32` little-endian ++ index magic) and pass
19
+ * `Raw(bytes)` through unchanged.
20
+ */
21
+ export const DerivationIndex = Enum({
22
+ Index: u32,
23
+ Raw: RawDerivationIndex,
24
+ });
9
25
  export const ProductAccountId = Tuple(DotNsIdentifier, DerivationIndex);
10
26
  export const RingVrgAlias = Bytes();
27
+ /**
28
+ * Normalizes an {@link AccountSelector} into the wire {@link DerivationIndex}:
29
+ * numbers become `Index`, 32-byte arrays become `Raw`.
30
+ */
31
+ export function derivationIndexOf(selector) {
32
+ if (typeof selector === 'number') {
33
+ return { tag: 'Index', value: selector };
34
+ }
35
+ if (selector.length !== RawDerivationIndex.size) {
36
+ throw new Error(`Raw derivation index must be ${RawDerivationIndex.size} bytes, got ${selector.length}`);
37
+ }
38
+ return { tag: 'Raw', value: selector };
39
+ }
11
40
  export const ProductId = DotNsIdentifier;
12
- export const ProductProofContextSuffix = Hex();
41
+ /**
42
+ * Selector distinguishing proof contexts within a product (RFC 0004 amended by
43
+ * RFC 0022). Expands to the same 32-byte derivation index as
44
+ * {@link ProductAccountId}'s index, so the alias ↔ account mapping is the
45
+ * identity on it.
46
+ */
47
+ export const ProductProofContextSuffix = DerivationIndex;
13
48
  export const ProductProofContext = Tuple(ProductId, ProductProofContextSuffix);
14
49
  // structs
15
50
  export const ProductAccount = Struct({
@@ -37,8 +72,7 @@ export const RingLocationJunction = Enum({
37
72
  CollectionId: Bytes(),
38
73
  });
39
74
  export const RingLocation = Struct({
40
- // TODO make GenesisHash fixed size and replace hardcoded codec with it
41
- chainId: Hex(32),
75
+ chainId: GenesisHash,
42
76
  junctions: Vector(RingLocationJunction),
43
77
  });
44
78
  /** One `transcript.append_message(label, value)` call replayed by the host. */
@@ -330,15 +330,15 @@ export declare const ChainHeadStopOperationV1_request: import("scale-ts").Codec<
330
330
  export declare const ChainHeadStopOperationV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
331
331
  reason: string;
332
332
  }, "GenericError">>>;
333
- export declare const ChainSpecGenesisHashV1_request: import("scale-ts").Codec<`0x${string}`>;
333
+ export declare const ChainSpecGenesisHashV1_request: import("@novasamatech/scale").HexCodec<undefined>;
334
334
  export declare const ChainSpecGenesisHashV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
335
335
  reason: string;
336
336
  }, "GenericError">>>;
337
- export declare const ChainSpecChainNameV1_request: import("scale-ts").Codec<`0x${string}`>;
337
+ export declare const ChainSpecChainNameV1_request: import("@novasamatech/scale").HexCodec<undefined>;
338
338
  export declare const ChainSpecChainNameV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<string, import("@novasamatech/scale").CodecError<{
339
339
  reason: string;
340
340
  }, "GenericError">>>;
341
- export declare const ChainSpecPropertiesV1_request: import("scale-ts").Codec<`0x${string}`>;
341
+ export declare const ChainSpecPropertiesV1_request: import("@novasamatech/scale").HexCodec<undefined>;
342
342
  export declare const ChainSpecPropertiesV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<string, import("@novasamatech/scale").CodecError<{
343
343
  reason: string;
344
344
  }, "GenericError">>>;
@@ -1,6 +1,6 @@
1
1
  import { Enum, Hex, Nullable, Status } from '@novasamatech/scale';
2
2
  import { Option, Result, Struct, Tuple, Vector, _void, bool, str, u32 } from 'scale-ts';
3
- import { GenericError, GenesisHash } from '../commonCodecs.js';
3
+ import { GenericError } from '../commonCodecs.js';
4
4
  // === Shared types ===
5
5
  const BlockHash = Hex();
6
6
  const OperationId = str;
@@ -37,7 +37,7 @@ export const OperationStartedResult = Enum({
37
37
  });
38
38
  // === ChainHead Follow ===
39
39
  export const ChainHeadFollowV1_start = Struct({
40
- genesisHash: GenesisHash,
40
+ genesisHash: Hex(),
41
41
  withRuntime: bool,
42
42
  });
43
43
  export const ChainHeadEvent = Enum({
@@ -88,21 +88,21 @@ export const ChainHeadFollowV1_receive = ChainHeadEvent;
88
88
  export const ChainHeadFollowV1_interrupt = _void;
89
89
  // === ChainHead Header ===
90
90
  export const ChainHeadHeaderV1_request = Struct({
91
- genesisHash: GenesisHash,
91
+ genesisHash: Hex(),
92
92
  followSubscriptionId: str,
93
93
  hash: BlockHash,
94
94
  });
95
95
  export const ChainHeadHeaderV1_response = Result(Nullable(Hex()), GenericError);
96
96
  // === ChainHead Body ===
97
97
  export const ChainHeadBodyV1_request = Struct({
98
- genesisHash: GenesisHash,
98
+ genesisHash: Hex(),
99
99
  followSubscriptionId: str,
100
100
  hash: BlockHash,
101
101
  });
102
102
  export const ChainHeadBodyV1_response = Result(OperationStartedResult, GenericError);
103
103
  // === ChainHead Storage ===
104
104
  export const ChainHeadStorageV1_request = Struct({
105
- genesisHash: GenesisHash,
105
+ genesisHash: Hex(),
106
106
  followSubscriptionId: str,
107
107
  hash: BlockHash,
108
108
  items: Vector(StorageQueryItem),
@@ -111,7 +111,7 @@ export const ChainHeadStorageV1_request = Struct({
111
111
  export const ChainHeadStorageV1_response = Result(OperationStartedResult, GenericError);
112
112
  // === ChainHead Call ===
113
113
  export const ChainHeadCallV1_request = Struct({
114
- genesisHash: GenesisHash,
114
+ genesisHash: Hex(),
115
115
  followSubscriptionId: str,
116
116
  hash: BlockHash,
117
117
  function: str,
@@ -120,41 +120,41 @@ export const ChainHeadCallV1_request = Struct({
120
120
  export const ChainHeadCallV1_response = Result(OperationStartedResult, GenericError);
121
121
  // === ChainHead Unpin ===
122
122
  export const ChainHeadUnpinV1_request = Struct({
123
- genesisHash: GenesisHash,
123
+ genesisHash: Hex(),
124
124
  followSubscriptionId: str,
125
125
  hashes: Vector(BlockHash),
126
126
  });
127
127
  export const ChainHeadUnpinV1_response = Result(_void, GenericError);
128
128
  // === ChainHead Continue ===
129
129
  export const ChainHeadContinueV1_request = Struct({
130
- genesisHash: GenesisHash,
130
+ genesisHash: Hex(),
131
131
  followSubscriptionId: str,
132
132
  operationId: OperationId,
133
133
  });
134
134
  export const ChainHeadContinueV1_response = Result(_void, GenericError);
135
135
  // === ChainHead StopOperation ===
136
136
  export const ChainHeadStopOperationV1_request = Struct({
137
- genesisHash: GenesisHash,
137
+ genesisHash: Hex(),
138
138
  followSubscriptionId: str,
139
139
  operationId: OperationId,
140
140
  });
141
141
  export const ChainHeadStopOperationV1_response = Result(_void, GenericError);
142
142
  // === ChainSpec ===
143
- export const ChainSpecGenesisHashV1_request = GenesisHash;
143
+ export const ChainSpecGenesisHashV1_request = Hex();
144
144
  export const ChainSpecGenesisHashV1_response = Result(Hex(), GenericError);
145
- export const ChainSpecChainNameV1_request = GenesisHash;
145
+ export const ChainSpecChainNameV1_request = Hex();
146
146
  export const ChainSpecChainNameV1_response = Result(str, GenericError);
147
- export const ChainSpecPropertiesV1_request = GenesisHash;
147
+ export const ChainSpecPropertiesV1_request = Hex();
148
148
  export const ChainSpecPropertiesV1_response = Result(str, GenericError);
149
149
  // === Transaction Broadcast ===
150
150
  export const TransactionBroadcastV1_request = Struct({
151
- genesisHash: GenesisHash,
151
+ genesisHash: Hex(),
152
152
  transaction: Hex(),
153
153
  });
154
154
  export const TransactionBroadcastV1_response = Result(Nullable(str), GenericError);
155
155
  // === Transaction Stop ===
156
156
  export const TransactionStopV1_request = Struct({
157
- genesisHash: GenesisHash,
157
+ genesisHash: Hex(),
158
158
  operationId: str,
159
159
  });
160
160
  export const TransactionStopV1_response = Result(_void, GenericError);
@@ -1,5 +1,5 @@
1
- import { Enum, ErrEnum, Status } from '@novasamatech/scale';
2
- import { Bytes, Option, Result, Struct, Vector, _void, str, u64 } from 'scale-ts';
1
+ import { Bytes, Enum, ErrEnum, Status } from '@novasamatech/scale';
2
+ import { Option, Result, Struct, Vector, _void, str, u64 } from 'scale-ts';
3
3
  import { GenericErr } from '../commonCodecs.js';
4
4
  import { CustomRendererNode } from './customRenderer.js';
5
5
  // room registration
@@ -34,8 +34,14 @@ export declare const TxPayloadExtensionV1: Codec<{
34
34
  additionalSigned: Uint8Array<ArrayBufferLike>;
35
35
  }>;
36
36
  export declare const ProductAccountTransaction: Codec<{
37
- signer: [string, number];
38
- genesisHash: Uint8Array<ArrayBufferLike>;
37
+ signer: [string, {
38
+ tag: "Index";
39
+ value: number;
40
+ } | {
41
+ tag: "Raw";
42
+ value: Uint8Array<ArrayBufferLike>;
43
+ }];
44
+ genesisHash: `0x${string}`;
39
45
  callData: Uint8Array<ArrayBufferLike>;
40
46
  extensions: {
41
47
  id: string;
@@ -46,7 +52,7 @@ export declare const ProductAccountTransaction: Codec<{
46
52
  }>;
47
53
  export declare const LegacyTransaction: Codec<{
48
54
  signer: Uint8Array<ArrayBufferLike>;
49
- genesisHash: Uint8Array<ArrayBufferLike>;
55
+ genesisHash: `0x${string}`;
50
56
  callData: Uint8Array<ArrayBufferLike>;
51
57
  extensions: {
52
58
  id: string;
@@ -56,8 +62,14 @@ export declare const LegacyTransaction: Codec<{
56
62
  txExtVersion: number;
57
63
  }>;
58
64
  export declare const CreateTransactionV1_request: Codec<{
59
- signer: [string, number];
60
- genesisHash: Uint8Array<ArrayBufferLike>;
65
+ signer: [string, {
66
+ tag: "Index";
67
+ value: number;
68
+ } | {
69
+ tag: "Raw";
70
+ value: Uint8Array<ArrayBufferLike>;
71
+ }];
72
+ genesisHash: `0x${string}`;
61
73
  callData: Uint8Array<ArrayBufferLike>;
62
74
  extensions: {
63
75
  id: string;
@@ -71,7 +83,7 @@ export declare const CreateTransactionV1_response: Codec<import("scale-ts").Resu
71
83
  }, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>;
72
84
  export declare const CreateTransactionWithLegacyAccountV1_request: Codec<{
73
85
  signer: Uint8Array<ArrayBufferLike>;
74
- genesisHash: Uint8Array<ArrayBufferLike>;
86
+ genesisHash: `0x${string}`;
75
87
  callData: Uint8Array<ArrayBufferLike>;
76
88
  extensions: {
77
89
  id: string;
@@ -1,6 +1,6 @@
1
- import { ErrEnum } from '@novasamatech/scale';
2
- import { Bytes, Result, Struct, Vector, _void, str, u8 } from 'scale-ts';
3
- import { GenericErr } from '../commonCodecs.js';
1
+ import { Bytes, ErrEnum } from '@novasamatech/scale';
2
+ import { Result, Struct, Vector, _void, str, u8 } from 'scale-ts';
3
+ import { GenericErr, GenesisHash } from '../commonCodecs.js';
4
4
  import { AccountId, ProductAccountId } from './accounts.js';
5
5
  /**
6
6
  * createTransaction implementation
@@ -36,7 +36,7 @@ function GenericTxPayloadV1(signer) {
36
36
  /**
37
37
  * Chain identifier where transaction will be executed
38
38
  */
39
- genesisHash: Bytes(32),
39
+ genesisHash: GenesisHash,
40
40
  /**
41
41
  * SCALE-encoded Call (module indicator + function indicator + params).
42
42
  */
@@ -18,8 +18,8 @@ export declare const DeriveEntropyErr: [import("scale-ts").Encoder<import("@nova
18
18
  reason: string;
19
19
  }, "DeriveEntropyErr::Unknown">;
20
20
  };
21
- export declare const Entropy: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
22
- export declare const DeriveEntropyV1_request: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
21
+ export declare const Entropy: import("@novasamatech/scale").BytesCodec<number>;
22
+ export declare const DeriveEntropyV1_request: import("@novasamatech/scale").BytesCodec<undefined>;
23
23
  export declare const DeriveEntropyV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<{
24
24
  reason: string;
25
25
  }, "DeriveEntropyErr::Unknown">>>;
@@ -1,5 +1,5 @@
1
- import { ErrEnum } from '@novasamatech/scale';
2
- import { Bytes, Result } from 'scale-ts';
1
+ import { Bytes, ErrEnum } from '@novasamatech/scale';
2
+ import { Result } from 'scale-ts';
3
3
  import { GenericErr } from '../commonCodecs.js';
4
4
  // common structures
5
5
  export const DeriveEntropyErr = ErrEnum('DeriveEntropyErr', {
@@ -1,8 +1,8 @@
1
- import { Enum } from '@novasamatech/scale';
1
+ import { Enum, Hex } from '@novasamatech/scale';
2
2
  import { Result, bool } from 'scale-ts';
3
- import { GenericError, GenesisHash } from '../commonCodecs.js';
3
+ import { GenericError } from '../commonCodecs.js';
4
4
  export const Feature = Enum({
5
- Chain: GenesisHash,
5
+ Chain: Hex(),
6
6
  });
7
7
  export const FeatureV1_request = Feature;
8
8
  export const FeatureV1_response = Result(bool, GenericError);
@@ -20,7 +20,7 @@ export declare const StorageErr: [import("scale-ts").Encoder<import("@novasamate
20
20
  }, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">;
21
21
  };
22
22
  export declare const StorageKey: import("scale-ts").Codec<string>;
23
- export declare const StorageValue: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
23
+ export declare const StorageValue: import("@novasamatech/scale").BytesCodec<undefined>;
24
24
  export declare const StorageReadV1_request: import("scale-ts").Codec<string>;
25
25
  export declare const StorageReadV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike> | undefined, import("@novasamatech/scale").CodecError<{
26
26
  reason: string;
@@ -1,5 +1,5 @@
1
- import { ErrEnum } from '@novasamatech/scale';
2
- import { Bytes, Option, Result, Tuple, _void, str } from 'scale-ts';
1
+ import { Bytes, ErrEnum } from '@novasamatech/scale';
2
+ import { Option, Result, Tuple, _void, str } from 'scale-ts';
3
3
  import { GenericErr } from '../commonCodecs.js';
4
4
  // common structures
5
5
  export const StorageErr = ErrEnum('StorageErr', {
@@ -1,9 +1,15 @@
1
- export declare const Sr25519SecretKey: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
1
+ export declare const Sr25519SecretKey: import("@novasamatech/scale").BytesCodec<number>;
2
2
  export declare const PaymentId: import("scale-ts").Codec<string>;
3
3
  export declare const CoinPaymentPurseId: import("scale-ts").Codec<number>;
4
4
  export declare const PaymentTopUpSource: import("scale-ts").Codec<{
5
5
  tag: "ProductAccount";
6
- value: number;
6
+ value: {
7
+ tag: "Index";
8
+ value: number;
9
+ } | {
10
+ tag: "Raw";
11
+ value: Uint8Array<ArrayBufferLike>;
12
+ };
7
13
  } | {
8
14
  tag: "PrivateKey";
9
15
  value: Uint8Array<ArrayBufferLike>;
@@ -161,7 +167,13 @@ export declare const PaymentTopUpV1_request: import("scale-ts").Codec<{
161
167
  amount: bigint;
162
168
  source: {
163
169
  tag: "ProductAccount";
164
- value: number;
170
+ value: {
171
+ tag: "Index";
172
+ value: number;
173
+ } | {
174
+ tag: "Raw";
175
+ value: Uint8Array<ArrayBufferLike>;
176
+ };
165
177
  } | {
166
178
  tag: "PrivateKey";
167
179
  value: Uint8Array<ArrayBufferLike>;
@@ -1,5 +1,5 @@
1
- import { Enum, ErrEnum } from '@novasamatech/scale';
2
- import { Bytes, Option, Result, Struct, Vector, _void, str, u128, u32 } from 'scale-ts';
1
+ import { Bytes, Enum, ErrEnum } from '@novasamatech/scale';
2
+ import { Option, Result, Struct, Vector, _void, str, u128, u32 } from 'scale-ts';
3
3
  import { GenericErr } from '../commonCodecs.js';
4
4
  import { DerivationIndex } from './accounts.js';
5
5
  // common types
@@ -8,6 +8,7 @@ export const PaymentId = str;
8
8
  // Optional purse selector (RFC 0017). `undefined` (None) targets MAIN_PURSE.
9
9
  export const CoinPaymentPurseId = u32;
10
10
  export const PaymentTopUpSource = Enum({
11
+ // Account of the calling product, addressed by the RFC-0022 selector.
11
12
  ProductAccount: DerivationIndex,
12
13
  PrivateKey: Sr25519SecretKey,
13
14
  Coins: Vector(Sr25519SecretKey),
@@ -1,6 +1,6 @@
1
- export declare const PreimageKey: import("scale-ts").Codec<`0x${string}`>;
2
- export declare const PreimageValue: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
3
- export declare const PreimageLookupSubscribeV1_start: import("scale-ts").Codec<`0x${string}`>;
1
+ export declare const PreimageKey: import("@novasamatech/scale").HexCodec<undefined>;
2
+ export declare const PreimageValue: import("@novasamatech/scale").BytesCodec<undefined>;
3
+ export declare const PreimageLookupSubscribeV1_start: import("@novasamatech/scale").HexCodec<undefined>;
4
4
  export declare const PreimageLookupSubscribeV1_receive: import("scale-ts").Codec<Uint8Array<ArrayBufferLike> | null>;
5
5
  export declare const PreimageLookupSubscribeV1_interrupt: import("scale-ts").Codec<undefined>;
6
6
  export declare const PreimageSubmitErr: [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
@@ -23,7 +23,7 @@ export declare const PreimageSubmitErr: [import("scale-ts").Encoder<import("@nov
23
23
  reason: string;
24
24
  }, "PreimageSubmitErr::Unknown">;
25
25
  };
26
- export declare const PreimageSubmitV1_request: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
26
+ export declare const PreimageSubmitV1_request: import("@novasamatech/scale").BytesCodec<undefined>;
27
27
  export declare const PreimageSubmitV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
28
28
  reason: string;
29
29
  }, "PreimageSubmitErr::Unknown">>>;
@@ -1,5 +1,5 @@
1
- import { ErrEnum, Hex, Nullable } from '@novasamatech/scale';
2
- import { Bytes, Result, _void } from 'scale-ts';
1
+ import { Bytes, ErrEnum, Hex, Nullable } from '@novasamatech/scale';
2
+ import { Result, _void } from 'scale-ts';
3
3
  import { GenericErr } from '../commonCodecs.js';
4
4
  export const PreimageKey = Hex();
5
5
  export const PreimageValue = Bytes();
@@ -6,7 +6,13 @@ export declare const AllocatableResource: import("scale-ts").Codec<{
6
6
  value: undefined;
7
7
  } | {
8
8
  tag: "SmartContractAllowance";
9
- value: number;
9
+ value: {
10
+ tag: "Index";
11
+ value: number;
12
+ } | {
13
+ tag: "Raw";
14
+ value: Uint8Array<ArrayBufferLike>;
15
+ };
10
16
  } | {
11
17
  tag: "AutoSigning";
12
18
  value: undefined;
@@ -49,7 +55,13 @@ export declare const RequestResourceAllocationV1_request: import("scale-ts").Cod
49
55
  value: undefined;
50
56
  } | {
51
57
  tag: "SmartContractAllowance";
52
- value: number;
58
+ value: {
59
+ tag: "Index";
60
+ value: number;
61
+ } | {
62
+ tag: "Raw";
63
+ value: Uint8Array<ArrayBufferLike>;
64
+ };
53
65
  } | {
54
66
  tag: "AutoSigning";
55
67
  value: undefined;
@@ -6,6 +6,7 @@ import { DerivationIndex } from './accounts.js';
6
6
  export const AllocatableResource = Enum({
7
7
  StatementStoreAllowance: _void,
8
8
  BulletinAllowance: _void,
9
+ // Account the allowance is granted for, addressed by the RFC-0022 selector.
9
10
  SmartContractAllowance: DerivationIndex,
10
11
  AutoSigning: _void,
11
12
  });
@@ -33,7 +33,13 @@ export declare const RawPayload: import("scale-ts").Codec<{
33
33
  value: string;
34
34
  }>;
35
35
  export declare const SigningRawPayload: import("scale-ts").Codec<{
36
- account: [string, number];
36
+ account: [string, {
37
+ tag: "Index";
38
+ value: number;
39
+ } | {
40
+ tag: "Raw";
41
+ value: Uint8Array<ArrayBufferLike>;
42
+ }];
37
43
  payload: {
38
44
  tag: "Bytes";
39
45
  value: Uint8Array<ArrayBufferLike>;
@@ -53,7 +59,13 @@ export declare const SigningRawPayloadWithoutAccount: import("scale-ts").Codec<{
53
59
  };
54
60
  }>;
55
61
  export declare const SignRawV1_request: import("scale-ts").Codec<{
56
- account: [string, number];
62
+ account: [string, {
63
+ tag: "Index";
64
+ value: number;
65
+ } | {
66
+ tag: "Raw";
67
+ value: Uint8Array<ArrayBufferLike>;
68
+ }];
57
69
  payload: {
58
70
  tag: "Bytes";
59
71
  value: Uint8Array<ArrayBufferLike>;
@@ -85,7 +97,13 @@ export declare const SignRawWithLegacyAccountV1_response: import("scale-ts").Cod
85
97
  reason: string;
86
98
  }, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>;
87
99
  export declare const SigningPayload: import("scale-ts").Codec<{
88
- account: [string, number];
100
+ account: [string, {
101
+ tag: "Index";
102
+ value: number;
103
+ } | {
104
+ tag: "Raw";
105
+ value: Uint8Array<ArrayBufferLike>;
106
+ }];
89
107
  payload: {
90
108
  blockHash: `0x${string}`;
91
109
  blockNumber: `0x${string}`;
@@ -125,7 +143,13 @@ export declare const SigningPayloadWithoutAccount: import("scale-ts").Codec<{
125
143
  };
126
144
  }>;
127
145
  export declare const SignPayloadV1_request: import("scale-ts").Codec<{
128
- account: [string, number];
146
+ account: [string, {
147
+ tag: "Index";
148
+ value: number;
149
+ } | {
150
+ tag: "Raw";
151
+ value: Uint8Array<ArrayBufferLike>;
152
+ }];
129
153
  payload: {
130
154
  blockHash: `0x${string}`;
131
155
  blockNumber: `0x${string}`;
@@ -1,6 +1,6 @@
1
- import { Enum, ErrEnum, Hex } from '@novasamatech/scale';
2
- import { Bytes, Option, Result, Struct, Vector, _void, bool, str, u32 } from 'scale-ts';
3
- import { GenericErr, GenesisHash } from '../commonCodecs.js';
1
+ import { Bytes, Enum, ErrEnum, Hex } from '@novasamatech/scale';
2
+ import { Option, Result, Struct, Vector, _void, bool, str, u32 } from 'scale-ts';
3
+ import { GenericErr } from '../commonCodecs.js';
4
4
  import { ProductAccountId } from './accounts.js';
5
5
  // common structures
6
6
  export const SigningErr = ErrEnum('SigningErr', {
@@ -35,7 +35,7 @@ const SigningPayloadPayload = Struct({
35
35
  blockHash: Hex(),
36
36
  blockNumber: Hex(),
37
37
  era: Hex(),
38
- genesisHash: GenesisHash,
38
+ genesisHash: Hex(),
39
39
  method: Hex(),
40
40
  nonce: Hex(),
41
41
  specVersion: Hex(),