@parity/truapi 0.1.0 → 0.3.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/client.js +5 -2
- package/dist/explorer/codegen/types.d.ts +2 -0
- package/dist/explorer/codegen/types.js +3610 -0
- package/dist/explorer/codegen/versions/0.2.0/services.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.2.0/services.js +644 -0
- package/dist/explorer/codegen/versions/0.2.0/types.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.2.0/types.js +3960 -0
- package/dist/explorer/codegen/versions/0.3.0/services.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.3.0/services.js +644 -0
- package/dist/explorer/codegen/versions/0.3.0/types.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.3.0/types.js +3610 -0
- package/dist/explorer/codegen/versions/0.3.1/services.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.3.1/services.js +644 -0
- package/dist/explorer/codegen/versions/0.3.1/types.d.ts +2 -0
- package/dist/explorer/codegen/versions/0.3.1/types.js +3610 -0
- package/dist/explorer/data-types.d.ts +49 -0
- package/dist/explorer/data-types.js +1 -0
- package/dist/explorer/versions.d.ts +9 -0
- package/dist/explorer/versions.js +21 -0
- package/dist/generated/client.d.ts +86 -65
- package/dist/generated/client.js +166 -194
- package/dist/generated/types.d.ts +442 -232
- package/dist/generated/types.js +110 -94
- package/dist/generated/wire-table.d.ts +5 -11
- package/dist/generated/wire-table.js +5 -11
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/playground/codegen/services.js +327 -84
- package/dist/playground/codegen/truapi-dts.d.ts +1 -0
- package/dist/playground/codegen/truapi-dts.js +4310 -0
- package/dist/playground/services-types.d.ts +11 -2
- package/dist/scale.d.ts +8 -1
- package/dist/scale.js +19 -1
- package/dist/transport.d.ts +33 -6
- package/dist/transport.js +150 -71
- package/dist/well-known-chains.d.ts +13 -0
- package/dist/well-known-chains.js +7 -0
- package/package.json +28 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ServiceInfo } from "../playground/services-types.js";
|
|
2
|
+
/** One named field or enum variant rendered on a `DataType`. */
|
|
3
|
+
export interface DataTypeField {
|
|
4
|
+
/** Field or variant name as it appears in the generated TS source. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Rendered TypeScript type expression. */
|
|
7
|
+
type: string;
|
|
8
|
+
/** First paragraph of the field/variant doc comment, when present. */
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A type surfaced by the TrUAPI explorer. One entry per public type in the
|
|
13
|
+
* generated client surface (versioned wrapper enums are not surfaced, the
|
|
14
|
+
* explorer routes around them via `MethodInfo.requestType`/`responseType`).
|
|
15
|
+
*/
|
|
16
|
+
export interface DataType {
|
|
17
|
+
/**
|
|
18
|
+
* Kebab-case identifier (e.g. `host-account-get-request`). Matches the
|
|
19
|
+
* `requestType`/`responseType`/`errorType` ids emitted on `MethodInfo`.
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/** Public TS type name (e.g. `HostAccountGetRequest`). */
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Rustdoc module bucket (`account`, `chat`, ...) or `shared` when the type
|
|
26
|
+
* lives outside `api::<service>`.
|
|
27
|
+
*/
|
|
28
|
+
category: string;
|
|
29
|
+
/** TypeScript source for the type, ready to render in a code block. */
|
|
30
|
+
definition: string;
|
|
31
|
+
/**
|
|
32
|
+
* Free-form doc comment, with the optional ```ts ... ``` example block
|
|
33
|
+
* stripped.
|
|
34
|
+
*/
|
|
35
|
+
description?: string;
|
|
36
|
+
/** Named fields, populated for `struct`-shaped types. */
|
|
37
|
+
fields?: DataTypeField[];
|
|
38
|
+
/** Variants, populated for `enum`-shaped types. */
|
|
39
|
+
variants?: DataTypeField[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* One snapshot of the API surface. `id` is `"main"` for the live codegen
|
|
43
|
+
* output, or a semver string (e.g. `"0.1.0"`) for an archived snapshot.
|
|
44
|
+
*/
|
|
45
|
+
export interface VersionEntry {
|
|
46
|
+
id: string;
|
|
47
|
+
services: ServiceInfo[];
|
|
48
|
+
types: DataType[];
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VersionEntry } from "./data-types.js";
|
|
2
|
+
export type { VersionEntry } from "./data-types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Version string declared in `js/packages/truapi/package.json` at codegen
|
|
5
|
+
* time. Mirrors the `truapi` crate version. Used by the explorer to render
|
|
6
|
+
* the `main` selector label as `main (x.y.z)`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const packageVersion = "0.3.1";
|
|
9
|
+
export declare const versions: VersionEntry[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Auto-generated by scripts/regen-explorer-versions.mjs. Do not edit by hand.
|
|
2
|
+
import { services as mainServices } from "../playground/codegen/services.js";
|
|
3
|
+
import { types as mainTypes } from "./codegen/types.js";
|
|
4
|
+
import { services as v0Services } from "./codegen/versions/0.3.1/services.js";
|
|
5
|
+
import { types as v0Types } from "./codegen/versions/0.3.1/types.js";
|
|
6
|
+
import { services as v1Services } from "./codegen/versions/0.3.0/services.js";
|
|
7
|
+
import { types as v1Types } from "./codegen/versions/0.3.0/types.js";
|
|
8
|
+
import { services as v2Services } from "./codegen/versions/0.2.0/services.js";
|
|
9
|
+
import { types as v2Types } from "./codegen/versions/0.2.0/types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Version string declared in `js/packages/truapi/package.json` at codegen
|
|
12
|
+
* time. Mirrors the `truapi` crate version. Used by the explorer to render
|
|
13
|
+
* the `main` selector label as `main (x.y.z)`.
|
|
14
|
+
*/
|
|
15
|
+
export const packageVersion = "0.3.1";
|
|
16
|
+
export const versions = [
|
|
17
|
+
{ id: "main", services: mainServices, types: mainTypes },
|
|
18
|
+
{ id: "0.3.1", services: v0Services, types: v0Types },
|
|
19
|
+
{ id: "0.3.0", services: v1Services, types: v1Types },
|
|
20
|
+
{ id: "0.2.0", services: v2Services, types: v2Types },
|
|
21
|
+
];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type Result } from "neverthrow";
|
|
1
|
+
import { ResultAsync, type Result } from "neverthrow";
|
|
2
2
|
import type { HexString } from "../scale.js";
|
|
3
3
|
import { SubscriptionError } from "../transport.js";
|
|
4
4
|
import type { ObservableLike, Observer, Subscription, TrUApiTransport } from "../transport.js";
|
|
5
5
|
import * as T from "./types.js";
|
|
6
|
-
export {
|
|
7
|
-
export type { ObservableLike, Observer, Subscription, TrUApiTransport };
|
|
6
|
+
export { ResultAsync, SubscriptionError };
|
|
7
|
+
export type { ObservableLike, Observer, Result, Subscription, TrUApiTransport };
|
|
8
8
|
export declare const TRUAPI_VERSION: 1;
|
|
9
9
|
export declare const TRUAPI_CODEC_VERSION: 1;
|
|
10
10
|
/** Account lookup, aliasing, and proof generation. */
|
|
@@ -14,22 +14,22 @@ export declare class AccountClient {
|
|
|
14
14
|
/** Subscribe to account connection status changes. */
|
|
15
15
|
connectionStatusSubscribe(): ObservableLike<T.HostAccountConnectionStatusSubscribeItem>;
|
|
16
16
|
/** Retrieve a product-scoped account. */
|
|
17
|
-
getAccount(request: T.HostAccountGetRequest):
|
|
17
|
+
getAccount(request: T.HostAccountGetRequest): ResultAsync<T.HostAccountGetResponse, T.HostAccountGetError>;
|
|
18
18
|
/** Retrieve a contextual alias for a product account. */
|
|
19
|
-
getAccountAlias(request: T.HostAccountGetAliasRequest):
|
|
19
|
+
getAccountAlias(request: T.HostAccountGetAliasRequest): ResultAsync<T.HostAccountGetAliasResponse, T.HostAccountGetError>;
|
|
20
20
|
/** Generate a ring VRF proof for a product account. */
|
|
21
|
-
createAccountProof(request: T.HostAccountCreateProofRequest):
|
|
21
|
+
createAccountProof(request: T.HostAccountCreateProofRequest): ResultAsync<T.HostAccountCreateProofResponse, T.HostAccountCreateProofError>;
|
|
22
22
|
/** List non-product accounts the user owns. */
|
|
23
|
-
getLegacyAccounts():
|
|
23
|
+
getLegacyAccounts(): ResultAsync<T.HostGetLegacyAccountsResponse, T.HostAccountGetError>;
|
|
24
24
|
/** Fetch the user's primary identity. */
|
|
25
|
-
getUserId():
|
|
25
|
+
getUserId(): ResultAsync<T.HostGetUserIdResponse, T.HostGetUserIdError>;
|
|
26
26
|
/**
|
|
27
27
|
* Request the host to present the login flow to the user.
|
|
28
28
|
*
|
|
29
29
|
* Products should call this in response to a user action (e.g. tapping a
|
|
30
30
|
* "Sign in" button), not automatically on load.
|
|
31
31
|
*/
|
|
32
|
-
requestLogin(request: T.HostRequestLoginRequest):
|
|
32
|
+
requestLogin(request: T.HostRequestLoginRequest): ResultAsync<T.HostRequestLoginResponse, T.HostRequestLoginError>;
|
|
33
33
|
}
|
|
34
34
|
/** Chain interaction methods. */
|
|
35
35
|
export declare class ChainClient {
|
|
@@ -40,42 +40,42 @@ export declare class ChainClient {
|
|
|
40
40
|
request: T.RemoteChainHeadFollowRequest;
|
|
41
41
|
}): ObservableLike<T.RemoteChainHeadFollowItem>;
|
|
42
42
|
/** Fetch a block header. */
|
|
43
|
-
getHeadHeader(request: T.RemoteChainHeadHeaderRequest):
|
|
43
|
+
getHeadHeader(request: T.RemoteChainHeadHeaderRequest): ResultAsync<T.RemoteChainHeadHeaderResponse, T.GenericError>;
|
|
44
44
|
/** Fetch a block body. */
|
|
45
|
-
getHeadBody(request: T.RemoteChainHeadBodyRequest):
|
|
45
|
+
getHeadBody(request: T.RemoteChainHeadBodyRequest): ResultAsync<T.RemoteChainHeadBodyResponse, T.GenericError>;
|
|
46
46
|
/** Query runtime storage at a specific block. */
|
|
47
|
-
getHeadStorage(request: T.RemoteChainHeadStorageRequest):
|
|
47
|
+
getHeadStorage(request: T.RemoteChainHeadStorageRequest): ResultAsync<T.RemoteChainHeadStorageResponse, T.GenericError>;
|
|
48
48
|
/** Invoke a runtime call at a specific block. */
|
|
49
|
-
callHead(request: T.RemoteChainHeadCallRequest):
|
|
49
|
+
callHead(request: T.RemoteChainHeadCallRequest): ResultAsync<T.RemoteChainHeadCallResponse, T.GenericError>;
|
|
50
50
|
/** Release pinned blocks. */
|
|
51
|
-
unpinHead(request: T.RemoteChainHeadUnpinRequest):
|
|
51
|
+
unpinHead(request: T.RemoteChainHeadUnpinRequest): ResultAsync<undefined, T.GenericError>;
|
|
52
52
|
/** Continue a paused chain-head operation. */
|
|
53
|
-
continueHead(request: T.RemoteChainHeadContinueRequest):
|
|
53
|
+
continueHead(request: T.RemoteChainHeadContinueRequest): ResultAsync<undefined, T.GenericError>;
|
|
54
54
|
/** Stop a chain-head operation. */
|
|
55
|
-
stopHeadOperation(request: T.RemoteChainHeadStopOperationRequest):
|
|
55
|
+
stopHeadOperation(request: T.RemoteChainHeadStopOperationRequest): ResultAsync<undefined, T.GenericError>;
|
|
56
56
|
/** Fetch the canonical genesis hash for a chain. */
|
|
57
|
-
getSpecGenesisHash(request: T.RemoteChainSpecGenesisHashRequest):
|
|
57
|
+
getSpecGenesisHash(request: T.RemoteChainSpecGenesisHashRequest): ResultAsync<T.RemoteChainSpecGenesisHashResponse, T.GenericError>;
|
|
58
58
|
/** Fetch the display name of a chain. */
|
|
59
|
-
getSpecChainName(request: T.RemoteChainSpecChainNameRequest):
|
|
59
|
+
getSpecChainName(request: T.RemoteChainSpecChainNameRequest): ResultAsync<T.RemoteChainSpecChainNameResponse, T.GenericError>;
|
|
60
60
|
/** Fetch the JSON-encoded properties of a chain. */
|
|
61
|
-
getSpecProperties(request: T.RemoteChainSpecPropertiesRequest):
|
|
61
|
+
getSpecProperties(request: T.RemoteChainSpecPropertiesRequest): ResultAsync<T.RemoteChainSpecPropertiesResponse, T.GenericError>;
|
|
62
62
|
/** Broadcast a signed transaction. */
|
|
63
|
-
broadcastTransaction(request: T.RemoteChainTransactionBroadcastRequest):
|
|
63
|
+
broadcastTransaction(request: T.RemoteChainTransactionBroadcastRequest): ResultAsync<T.RemoteChainTransactionBroadcastResponse, T.GenericError>;
|
|
64
64
|
/** Stop a transaction broadcast. */
|
|
65
|
-
stopTransaction(request: T.RemoteChainTransactionStopRequest):
|
|
65
|
+
stopTransaction(request: T.RemoteChainTransactionStopRequest): ResultAsync<undefined, T.GenericError>;
|
|
66
66
|
}
|
|
67
67
|
/** Chat room, bot, and message APIs. */
|
|
68
68
|
export declare class ChatClient {
|
|
69
69
|
private readonly transport;
|
|
70
70
|
constructor(transport: TrUApiTransport);
|
|
71
71
|
/** Create a chat room. */
|
|
72
|
-
createRoom(request: T.HostChatCreateRoomRequest):
|
|
72
|
+
createRoom(request: T.HostChatCreateRoomRequest): ResultAsync<T.HostChatCreateRoomResponse, T.HostChatCreateRoomError>;
|
|
73
73
|
/** Register a chat bot. */
|
|
74
|
-
registerBot(request: T.HostChatRegisterBotRequest):
|
|
74
|
+
registerBot(request: T.HostChatRegisterBotRequest): ResultAsync<T.HostChatRegisterBotResponse, T.HostChatRegisterBotError>;
|
|
75
75
|
/** Subscribe to the list of chat rooms. */
|
|
76
76
|
listSubscribe(): ObservableLike<T.HostChatListSubscribeItem>;
|
|
77
77
|
/** Post a message to a chat room. */
|
|
78
|
-
postMessage(request: T.HostChatPostMessageRequest):
|
|
78
|
+
postMessage(request: T.HostChatPostMessageRequest): ResultAsync<T.HostChatPostMessageResponse, T.HostChatPostMessageError>;
|
|
79
79
|
/** Subscribe to received chat actions. */
|
|
80
80
|
actionSubscribe(): ObservableLike<T.HostChatActionSubscribeItem>;
|
|
81
81
|
/**
|
|
@@ -92,53 +92,70 @@ export declare class EntropyClient {
|
|
|
92
92
|
private readonly transport;
|
|
93
93
|
constructor(transport: TrUApiTransport);
|
|
94
94
|
/** Derive deterministic entropy. */
|
|
95
|
-
derive(request: T.HostDeriveEntropyRequest):
|
|
96
|
-
}
|
|
97
|
-
/** JSON-RPC transport methods. */
|
|
98
|
-
export declare class JsonRpcClient {
|
|
99
|
-
private readonly transport;
|
|
100
|
-
constructor(transport: TrUApiTransport);
|
|
101
|
-
/** Send a JSON-RPC message. */
|
|
102
|
-
sendMessage(request: T.HostJsonrpcMessageSendRequest): Promise<Result<undefined, T.GenericError>>;
|
|
103
|
-
/** Subscribe to inbound JSON-RPC messages. */
|
|
104
|
-
subscribeMessages({ request, }: {
|
|
105
|
-
request: T.HostJsonrpcMessageSubscribeRequest;
|
|
106
|
-
}): ObservableLike<T.HostJsonrpcMessageSubscribeItem>;
|
|
95
|
+
derive(request: T.HostDeriveEntropyRequest): ResultAsync<T.HostDeriveEntropyResponse, T.HostDeriveEntropyError>;
|
|
107
96
|
}
|
|
108
97
|
/** Local key/value storage scoped to the calling product. */
|
|
109
98
|
export declare class LocalStorageClient {
|
|
110
99
|
private readonly transport;
|
|
111
100
|
constructor(transport: TrUApiTransport);
|
|
112
101
|
/** Read a value by key. */
|
|
113
|
-
read(request: T.HostLocalStorageReadRequest):
|
|
102
|
+
read(request: T.HostLocalStorageReadRequest): ResultAsync<T.HostLocalStorageReadResponse, T.HostLocalStorageReadError>;
|
|
114
103
|
/** Write a value to a key. */
|
|
115
|
-
write(request: T.HostLocalStorageWriteRequest):
|
|
104
|
+
write(request: T.HostLocalStorageWriteRequest): ResultAsync<undefined, T.HostLocalStorageReadError>;
|
|
116
105
|
/** Clear a value by key. */
|
|
117
|
-
clear(request: T.HostLocalStorageClearRequest):
|
|
106
|
+
clear(request: T.HostLocalStorageClearRequest): ResultAsync<undefined, T.HostLocalStorageReadError>;
|
|
107
|
+
}
|
|
108
|
+
/** Notification methods for locally-rendered push notifications. */
|
|
109
|
+
export declare class NotificationsClient {
|
|
110
|
+
private readonly transport;
|
|
111
|
+
constructor(transport: TrUApiTransport);
|
|
112
|
+
/**
|
|
113
|
+
* Send a push notification to the user.
|
|
114
|
+
*
|
|
115
|
+
* Returns a [`NotificationId`](crate::v01::NotificationId) that can be
|
|
116
|
+
* passed to [`cancel_push_notification`](Self::cancel_push_notification)
|
|
117
|
+
* to retract a scheduled notification. When `scheduled_at` is set the host
|
|
118
|
+
* persists the notification across restarts and fires it through the
|
|
119
|
+
* platform-native scheduler. See [RFC 0019].
|
|
120
|
+
*
|
|
121
|
+
* [RFC 0019]: https://github.com/paritytech/truapi/blob/main/docs/rfcs/0019-scheduled-notifications.md
|
|
122
|
+
*/
|
|
123
|
+
sendPushNotification(request: T.HostPushNotificationRequest): ResultAsync<T.HostPushNotificationResponse, T.HostPushNotificationError>;
|
|
124
|
+
/**
|
|
125
|
+
* Cancels a previously issued push notification.
|
|
126
|
+
*
|
|
127
|
+
* Cancellation is idempotent: returns `Ok(())` whether the notification is
|
|
128
|
+
* still pending, already fired, or was never issued. See [RFC 0019].
|
|
129
|
+
*
|
|
130
|
+
* [RFC 0019]: https://github.com/paritytech/truapi/blob/main/docs/rfcs/0019-scheduled-notifications.md
|
|
131
|
+
*/
|
|
132
|
+
cancelPushNotification(request: T.HostPushNotificationCancelRequest): ResultAsync<undefined, T.GenericError>;
|
|
118
133
|
}
|
|
119
134
|
/** Payment request and balance/status subscription methods. */
|
|
120
135
|
export declare class PaymentClient {
|
|
121
136
|
private readonly transport;
|
|
122
137
|
constructor(transport: TrUApiTransport);
|
|
123
138
|
/** Subscribe to payment balance updates. */
|
|
124
|
-
balanceSubscribe(
|
|
139
|
+
balanceSubscribe({ request, }: {
|
|
140
|
+
request: T.HostPaymentBalanceSubscribeRequest;
|
|
141
|
+
}): ObservableLike<T.HostPaymentBalanceSubscribeItem, T.HostPaymentBalanceSubscribeError>;
|
|
125
142
|
/** Request a payment from the user. */
|
|
126
|
-
request(request: T.
|
|
143
|
+
request(request: T.HostPaymentRequest): ResultAsync<T.HostPaymentResponse, T.HostPaymentError>;
|
|
127
144
|
/** Subscribe to payment lifecycle updates for a specific payment. */
|
|
128
145
|
statusSubscribe({ request, }: {
|
|
129
146
|
request: T.HostPaymentStatusSubscribeRequest;
|
|
130
147
|
}): ObservableLike<T.HostPaymentStatusSubscribeItem, T.HostPaymentStatusSubscribeError>;
|
|
131
148
|
/** Top up the user's payment balance. */
|
|
132
|
-
topUp(request: T.HostPaymentTopUpRequest):
|
|
149
|
+
topUp(request: T.HostPaymentTopUpRequest): ResultAsync<undefined, T.HostPaymentTopUpError>;
|
|
133
150
|
}
|
|
134
151
|
/** Permission request methods. */
|
|
135
152
|
export declare class PermissionsClient {
|
|
136
153
|
private readonly transport;
|
|
137
154
|
constructor(transport: TrUApiTransport);
|
|
138
155
|
/** Request a device-capability permission from the user. */
|
|
139
|
-
requestDevicePermission(request: T.HostDevicePermissionRequest):
|
|
140
|
-
/** Request
|
|
141
|
-
requestRemotePermission(request: T.RemotePermissionRequest):
|
|
156
|
+
requestDevicePermission(request: T.HostDevicePermissionRequest): ResultAsync<T.HostDevicePermissionResponse, T.GenericError>;
|
|
157
|
+
/** Request a remote-operation permission. */
|
|
158
|
+
requestRemotePermission(request: T.RemotePermissionRequest): ResultAsync<T.RemotePermissionResponse, T.GenericError>;
|
|
142
159
|
}
|
|
143
160
|
/** Preimage lookup and submission methods. */
|
|
144
161
|
export declare class PreimageClient {
|
|
@@ -149,31 +166,31 @@ export declare class PreimageClient {
|
|
|
149
166
|
request: T.RemotePreimageLookupSubscribeRequest;
|
|
150
167
|
}): ObservableLike<T.RemotePreimageLookupSubscribeItem>;
|
|
151
168
|
/** Submit a preimage. Returns the preimage key (hash) on success. */
|
|
152
|
-
submit(request: HexString):
|
|
169
|
+
submit(request: HexString): ResultAsync<HexString, T.PreimageSubmitError>;
|
|
153
170
|
}
|
|
154
171
|
/** Resource pre-allocation (allowance management). */
|
|
155
172
|
export declare class ResourceAllocationClient {
|
|
156
173
|
private readonly transport;
|
|
157
174
|
constructor(transport: TrUApiTransport);
|
|
158
175
|
/** Request the host to pre-allocate one or more resources. */
|
|
159
|
-
request(request: T.HostRequestResourceAllocationRequest):
|
|
176
|
+
request(request: T.HostRequestResourceAllocationRequest): ResultAsync<T.HostRequestResourceAllocationResponse, T.ResourceAllocationError>;
|
|
160
177
|
}
|
|
161
178
|
/** Signing operations. */
|
|
162
179
|
export declare class SigningClient {
|
|
163
180
|
private readonly transport;
|
|
164
181
|
constructor(transport: TrUApiTransport);
|
|
165
182
|
/** Construct a signed transaction for a product account. */
|
|
166
|
-
createTransaction(request: T.
|
|
167
|
-
/** Construct a signed transaction for a non-product account. */
|
|
168
|
-
createTransactionWithLegacyAccount(request: T.
|
|
183
|
+
createTransaction(request: T.ProductAccountTxPayload): ResultAsync<T.HostCreateTransactionResponse, T.HostCreateTransactionError>;
|
|
184
|
+
/** Construct a signed transaction for a non-product (legacy) account. */
|
|
185
|
+
createTransactionWithLegacyAccount(request: T.LegacyAccountTxPayload): ResultAsync<T.HostCreateTransactionWithLegacyAccountResponse, T.HostCreateTransactionError>;
|
|
169
186
|
/** Sign raw bytes with a non-product account. */
|
|
170
|
-
signRawWithLegacyAccount(request: T.HostSignRawWithLegacyAccountRequest):
|
|
187
|
+
signRawWithLegacyAccount(request: T.HostSignRawWithLegacyAccountRequest): ResultAsync<T.HostSignPayloadResponse, T.HostSignPayloadError>;
|
|
171
188
|
/** Sign an extrinsic payload with a non-product account. */
|
|
172
|
-
signPayloadWithLegacyAccount(request: T.HostSignPayloadWithLegacyAccountRequest):
|
|
189
|
+
signPayloadWithLegacyAccount(request: T.HostSignPayloadWithLegacyAccountRequest): ResultAsync<T.HostSignPayloadResponse, T.HostSignPayloadError>;
|
|
173
190
|
/** Sign raw bytes or a message. */
|
|
174
|
-
signRaw(request: T.HostSignRawRequest):
|
|
191
|
+
signRaw(request: T.HostSignRawRequest): ResultAsync<T.HostSignPayloadResponse, T.HostSignPayloadError>;
|
|
175
192
|
/** Sign an extrinsic payload. */
|
|
176
|
-
signPayload(request: T.HostSignPayloadRequest):
|
|
193
|
+
signPayload(request: T.HostSignPayloadRequest): ResultAsync<T.HostSignPayloadResponse, T.HostSignPayloadError>;
|
|
177
194
|
}
|
|
178
195
|
/** Statement store methods. */
|
|
179
196
|
export declare class StatementStoreClient {
|
|
@@ -183,35 +200,39 @@ export declare class StatementStoreClient {
|
|
|
183
200
|
subscribe({ request, }: {
|
|
184
201
|
request: T.RemoteStatementStoreSubscribeRequest;
|
|
185
202
|
}): ObservableLike<T.RemoteStatementStoreSubscribeItem>;
|
|
186
|
-
/**
|
|
187
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Create a proof for a statement.
|
|
205
|
+
*
|
|
206
|
+
* **Deprecated:** use [`create_proof_authorized`](Self::create_proof_authorized)
|
|
207
|
+
* instead, which uses a pre-allocated allowance account and does not
|
|
208
|
+
* require a per-call signing prompt.
|
|
209
|
+
*/
|
|
210
|
+
createProof(request: T.RemoteStatementStoreCreateProofRequest): ResultAsync<T.RemoteStatementStoreCreateProofResponse, T.RemoteStatementStoreCreateProofError>;
|
|
188
211
|
/**
|
|
189
212
|
* Create a proof for a statement using a pre-allocated allowance account,
|
|
190
213
|
* bypassing the per-call signing prompt.
|
|
191
214
|
*/
|
|
192
|
-
createProofAuthorized(request: T.Statement):
|
|
215
|
+
createProofAuthorized(request: T.Statement): ResultAsync<T.RemoteStatementStoreCreateProofResponse, T.RemoteStatementStoreCreateProofError>;
|
|
193
216
|
/**
|
|
194
217
|
* Submit a signed statement to the network. The request body is the
|
|
195
218
|
* [`SignedStatement`](crate::v01::SignedStatement) directly (no wrapping
|
|
196
219
|
* struct), matching upstream `triangle-js-sdks`.
|
|
197
220
|
*/
|
|
198
|
-
submit(request: T.SignedStatement):
|
|
221
|
+
submit(request: T.SignedStatement): ResultAsync<undefined, T.GenericError>;
|
|
199
222
|
}
|
|
200
223
|
/**
|
|
201
224
|
* General-purpose TrUAPI methods for handshake, feature detection,
|
|
202
|
-
*
|
|
225
|
+
* and navigation.
|
|
203
226
|
*/
|
|
204
227
|
export declare class SystemClient {
|
|
205
228
|
private readonly transport;
|
|
206
229
|
constructor(transport: TrUApiTransport);
|
|
207
230
|
/** Negotiate the wire codec version with the product. */
|
|
208
|
-
handshake():
|
|
231
|
+
handshake(): ResultAsync<undefined, T.HostHandshakeError>;
|
|
209
232
|
/** Query whether the host supports a specific feature. */
|
|
210
|
-
featureSupported(request: T.HostFeatureSupportedRequest):
|
|
211
|
-
/** Send a push notification to the user. */
|
|
212
|
-
pushNotification(request: T.HostPushNotificationRequest): Promise<Result<undefined, T.GenericError>>;
|
|
233
|
+
featureSupported(request: T.HostFeatureSupportedRequest): ResultAsync<T.HostFeatureSupportedResponse, T.GenericError>;
|
|
213
234
|
/** Request the host to open a URL. */
|
|
214
|
-
navigateTo(request: T.HostNavigateToRequest):
|
|
235
|
+
navigateTo(request: T.HostNavigateToRequest): ResultAsync<undefined, T.HostNavigateToError>;
|
|
215
236
|
}
|
|
216
237
|
/** Host theme subscription. */
|
|
217
238
|
export declare class ThemeClient {
|
|
@@ -225,8 +246,8 @@ export interface TrUApiClient {
|
|
|
225
246
|
readonly chain: ChainClient;
|
|
226
247
|
readonly chat: ChatClient;
|
|
227
248
|
readonly entropy: EntropyClient;
|
|
228
|
-
readonly jsonRpc: JsonRpcClient;
|
|
229
249
|
readonly localStorage: LocalStorageClient;
|
|
250
|
+
readonly notifications: NotificationsClient;
|
|
230
251
|
readonly payment: PaymentClient;
|
|
231
252
|
readonly permissions: PermissionsClient;
|
|
232
253
|
readonly preimage: PreimageClient;
|