@novasamatech/host-api 0.5.0-16 → 0.5.0-18
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/commonEncoders.d.ts +0 -7
- package/dist/commonEncoders.js +1 -7
- package/dist/createTransport.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interactions/accounts.js +2 -1
- package/dist/interactions/commonCodecs.d.ts +7 -0
- package/dist/interactions/commonCodecs.js +8 -0
- package/dist/interactions/features.d.ts +2 -2
- package/dist/interactions/features.js +2 -2
- package/dist/interactions/message.d.ts +1704 -0
- package/dist/interactions/message.js +60 -0
- package/dist/interactions/papiProvider.d.ts +2 -2
- package/dist/interactions/papiProvider.js +3 -2
- package/dist/interactions/sign.d.ts +20 -3
- package/dist/interactions/sign.js +1 -42
- package/dist/interactions/types.d.ts +1 -0
- package/dist/interactions/types.js +1 -0
- package/dist/interactions/v1/accounts.d.ts +128 -0
- package/dist/interactions/v1/accounts.js +51 -0
- package/dist/interactions/v1/chat.d.ts +295 -0
- package/dist/interactions/v1/chat.js +73 -0
- package/dist/interactions/v1/createTransaction.d.ts +197 -0
- package/dist/interactions/v1/createTransaction.js +41 -0
- package/dist/interactions/v1/feature.d.ts +11 -0
- package/dist/interactions/v1/feature.js +7 -0
- package/dist/interactions/v1/handshake.d.ts +28 -0
- package/dist/interactions/v1/handshake.js +12 -0
- package/dist/interactions/v1/jsonRpc.d.ts +6 -0
- package/dist/interactions/v1/jsonRpc.js +6 -0
- package/dist/interactions/v1/permission.d.ts +48 -0
- package/dist/interactions/v1/permission.js +18 -0
- package/dist/interactions/v1/sign.d.ts +92 -0
- package/dist/interactions/v1/sign.js +43 -0
- package/dist/interactions/v1/statementStore.d.ts +118 -0
- package/dist/interactions/v1/statementStore.js +47 -0
- package/dist/interactions/v1/storage.d.ts +41 -0
- package/dist/interactions/v1/storage.js +16 -0
- package/dist/messageEncoder.d.ts +68 -107
- package/dist/messageEncoder.js +11 -14
- package/package.json +1 -1
package/dist/commonEncoders.d.ts
CHANGED
package/dist/commonEncoders.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { fromHex, toHex } from '@polkadot-api/utils';
|
|
2
|
-
import { Bytes
|
|
2
|
+
import { Bytes } from 'scale-ts';
|
|
3
3
|
import { createTransportEncoder } from './createTransportEncoder.js';
|
|
4
4
|
export const hexCodec = createTransportEncoder({
|
|
5
5
|
codec: Bytes(),
|
|
6
6
|
from: v => toHex(v),
|
|
7
7
|
to: fromHex,
|
|
8
8
|
});
|
|
9
|
-
export function Result(codec) {
|
|
10
|
-
return Enum({
|
|
11
|
-
Ok: codec,
|
|
12
|
-
Err: str,
|
|
13
|
-
});
|
|
14
|
-
}
|
package/dist/createTransport.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { createTransport } from './createTransport.js';
|
|
|
4
4
|
export type { ConnectionStatus, HexString, Logger, Transport, TransportProvider } from './types.js';
|
|
5
5
|
export { createDefaultLogger } from './logger.js';
|
|
6
6
|
export { type InjectedAccountSchema } from './interactions/accounts.js';
|
|
7
|
-
export { type TxPayloadV1 } from './interactions/sign.js';
|
|
7
|
+
export { type SignPayloadRequest, type TxPayloadV1 } from './interactions/sign.js';
|
|
8
8
|
export { signPayloadCodec } from './interactions/sign.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Enum, Option, Struct, Vector, _void, str } from 'scale-ts';
|
|
2
|
+
import { hexCodec } from '../commonEncoders.js';
|
|
2
3
|
import { createTransportEncoder } from '../createTransportEncoder.js';
|
|
3
4
|
const keypairCodec = Enum({
|
|
4
5
|
ed25519: _void,
|
|
@@ -15,7 +16,7 @@ const keypairEncoder = createTransportEncoder({
|
|
|
15
16
|
});
|
|
16
17
|
const injectedAccountCodec = Struct({
|
|
17
18
|
address: str,
|
|
18
|
-
genesisHash: Option(
|
|
19
|
+
genesisHash: Option(hexCodec),
|
|
19
20
|
name: Option(str),
|
|
20
21
|
type: Option(keypairEncoder),
|
|
21
22
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Codec } from 'scale-ts';
|
|
2
|
+
export declare const Nullable: <T>(inner: Codec<T>) => Codec<T | null>;
|
|
3
|
+
export declare const Hex: (length?: number) => Codec<`0x${string}`>;
|
|
4
|
+
export declare const GenericErr: Codec<{
|
|
5
|
+
reason: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const GenesisHash: Codec<`0x${string}`>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { fromHex, toHex } from '@polkadot-api/utils';
|
|
2
|
+
import { Bytes, Option, Struct, enhanceCodec, str } from 'scale-ts';
|
|
3
|
+
export const Nullable = (inner) => enhanceCodec(Option(inner), v => v ?? undefined, v => v ?? null);
|
|
4
|
+
export const Hex = (length) => enhanceCodec(Bytes(length), fromHex, v => toHex(v));
|
|
5
|
+
export const GenericErr = Struct({
|
|
6
|
+
reason: str,
|
|
7
|
+
});
|
|
8
|
+
export const GenesisHash = Hex();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const supportFeatureRequestV1Encoder: import("scale-ts").Codec<{
|
|
2
2
|
tag: "chain";
|
|
3
3
|
value: {
|
|
4
|
-
|
|
4
|
+
genesisHash: `0x${string}`;
|
|
5
5
|
};
|
|
6
6
|
}>;
|
|
7
7
|
export declare const supportFeatureResponseV1: import("scale-ts").Codec<{
|
|
8
8
|
tag: "chain";
|
|
9
9
|
value: {
|
|
10
|
-
|
|
10
|
+
genesisHash: `0x${string}`;
|
|
11
11
|
result: boolean;
|
|
12
12
|
};
|
|
13
13
|
}>;
|
|
@@ -2,12 +2,12 @@ import { Enum, Struct, bool } from 'scale-ts';
|
|
|
2
2
|
import { hexCodec } from '../commonEncoders.js';
|
|
3
3
|
export const supportFeatureRequestV1Encoder = Enum({
|
|
4
4
|
chain: Struct({
|
|
5
|
-
|
|
5
|
+
genesisHash: hexCodec,
|
|
6
6
|
}),
|
|
7
7
|
});
|
|
8
8
|
export const supportFeatureResponseV1 = Enum({
|
|
9
9
|
chain: Struct({
|
|
10
|
-
|
|
10
|
+
genesisHash: hexCodec,
|
|
11
11
|
result: bool,
|
|
12
12
|
}),
|
|
13
13
|
});
|