@hsuite/native-connect-types 1.0.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.
- package/README.md +50 -0
- package/dist/address-avatar.d.ts +67 -0
- package/dist/address-avatar.d.ts.map +1 -0
- package/dist/address-avatar.js +130 -0
- package/dist/address-avatar.js.map +1 -0
- package/dist/addressbook.d.ts +289 -0
- package/dist/addressbook.d.ts.map +1 -0
- package/dist/addressbook.js +82 -0
- package/dist/addressbook.js.map +1 -0
- package/dist/enrichment.d.ts +88 -0
- package/dist/enrichment.d.ts.map +1 -0
- package/dist/enrichment.js +47 -0
- package/dist/enrichment.js.map +1 -0
- package/dist/hedera-system-accounts.d.ts +49 -0
- package/dist/hedera-system-accounts.d.ts.map +1 -0
- package/dist/hedera-system-accounts.js +56 -0
- package/dist/hedera-system-accounts.js.map +1 -0
- package/dist/identity.d.ts +94 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +190 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/ledger.d.ts +848 -0
- package/dist/ledger.d.ts.map +1 -0
- package/dist/ledger.js +152 -0
- package/dist/ledger.js.map +1 -0
- package/dist/messages.d.ts +726 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +252 -0
- package/dist/messages.js.map +1 -0
- package/dist/multisig-account.d.ts +419 -0
- package/dist/multisig-account.d.ts.map +1 -0
- package/dist/multisig-account.js +201 -0
- package/dist/multisig-account.js.map +1 -0
- package/dist/private-key-export.d.ts +112 -0
- package/dist/private-key-export.d.ts.map +1 -0
- package/dist/private-key-export.js +11 -0
- package/dist/private-key-export.js.map +1 -0
- package/dist/rpc.d.ts +872 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +143 -0
- package/dist/rpc.js.map +1 -0
- package/dist/transaction-approval.d.ts +895 -0
- package/dist/transaction-approval.d.ts.map +1 -0
- package/dist/transaction-approval.js +11 -0
- package/dist/transaction-approval.js.map +1 -0
- package/dist/transaction-parser.d.ts +93 -0
- package/dist/transaction-parser.d.ts.map +1 -0
- package/dist/transaction-parser.js +11 -0
- package/dist/transaction-parser.js.map +1 -0
- package/dist/vault.d.ts +673 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +188 -0
- package/dist/vault.js.map +1 -0
- package/dist/widget.types.d.ts +323 -0
- package/dist/widget.types.d.ts.map +1 -0
- package/dist/widget.types.js +140 -0
- package/dist/widget.types.js.map +1 -0
- package/package.json +43 -0
- package/src/address-avatar.ts +181 -0
- package/src/addressbook.spec.ts +220 -0
- package/src/addressbook.ts +115 -0
- package/src/enrichment.ts +97 -0
- package/src/hedera-system-accounts.ts +60 -0
- package/src/identity.spec.ts +243 -0
- package/src/identity.ts +244 -0
- package/src/index.ts +197 -0
- package/src/ledger.spec.ts +366 -0
- package/src/ledger.ts +567 -0
- package/src/messages.ts +381 -0
- package/src/multisig-account.spec.ts +362 -0
- package/src/multisig-account.ts +310 -0
- package/src/private-key-export.ts +117 -0
- package/src/rpc.spec.ts +396 -0
- package/src/rpc.ts +257 -0
- package/src/transaction-approval.ts +1033 -0
- package/src/transaction-parser.ts +98 -0
- package/src/vault.spec.ts +268 -0
- package/src/vault.ts +256 -0
- package/src/widget.types.spec.ts +337 -0
- package/src/widget.types.ts +501 -0
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +11 -0
- package/vitest.config.ts +36 -0
package/dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HSuite Native Connect
|
|
3
|
+
* Copyright 2024-2025 HSuite (https://hsuite.finance)
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
|
6
|
+
*
|
|
7
|
+
* This file is part of HSuite Native Connect. For commercial licensing,
|
|
8
|
+
* visit https://hsuite.finance/licensing
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @file JSON-RPC 2.0 protocol implementation for HSuite Native Connect.
|
|
12
|
+
*
|
|
13
|
+
* This module implements a JSON-RPC 2.0 compliant protocol layer for
|
|
14
|
+
* structured communication between dApps and wallets. It provides:
|
|
15
|
+
*
|
|
16
|
+
* - **Request/Response Schemas**: Typed schemas for all RPC operations
|
|
17
|
+
* - **Version Negotiation**: Semantic versioning via {@link RpcVersionHeader}
|
|
18
|
+
* - **Method Definitions**: All supported RPC methods via {@link RpcMethodSchema}
|
|
19
|
+
* - **Envelope Wrapping**: Message envelope support for transport
|
|
20
|
+
*
|
|
21
|
+
* Supported RPC Methods:
|
|
22
|
+
* - `session/request` - Initiate dApp session
|
|
23
|
+
* - `session/approve` - Wallet approves/rejects session
|
|
24
|
+
* - `session/terminate` - End active session
|
|
25
|
+
* - `ledger/sign` - Sign transaction
|
|
26
|
+
* - `ledger/submit` - Submit signed transaction
|
|
27
|
+
* - `ledger/signAndSubmit` - Combined sign and submit
|
|
28
|
+
* - `wallet/accounts` - List available accounts
|
|
29
|
+
*
|
|
30
|
+
* @module types/rpc
|
|
31
|
+
*/
|
|
32
|
+
import { z } from 'zod';
|
|
33
|
+
import { SessionRequestSchema, SessionApprovalSchema, SignPayloadSchema, SignResultSchema, TransactionSubmissionSchema, MessageEnvelopeSchema } from './messages.js';
|
|
34
|
+
/**
|
|
35
|
+
* @description Current RPC protocol version
|
|
36
|
+
*/
|
|
37
|
+
export declare const RpcVersion = "1.1.0";
|
|
38
|
+
/**
|
|
39
|
+
* @description HTTP header name for RPC version negotiation
|
|
40
|
+
*/
|
|
41
|
+
export declare const RpcVersionHeader = "x-hsuite-rpc-version";
|
|
42
|
+
/**
|
|
43
|
+
* @description Schema for supported RPC method names
|
|
44
|
+
*/
|
|
45
|
+
export declare const RpcMethodSchema: z.ZodEnum<["session/request", "session/approve", "session/terminate", "session/status", "session/terminated", "session/updated", "ledger/sign", "ledger/submit", "ledger/signAndSubmit", "ledger/signMessage", "wallet/accounts", "wallet/register-ledger", "wallet/get-config"]>;
|
|
46
|
+
/**
|
|
47
|
+
* @description Type representing RPC method name
|
|
48
|
+
*/
|
|
49
|
+
export type RpcMethod = z.infer<typeof RpcMethodSchema>;
|
|
50
|
+
/**
|
|
51
|
+
* @description Schema for JSON-RPC 2.0 request
|
|
52
|
+
*/
|
|
53
|
+
export declare const RpcRequestSchema: z.ZodObject<{
|
|
54
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
55
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
56
|
+
method: z.ZodEnum<["session/request", "session/approve", "session/terminate", "session/status", "session/terminated", "session/updated", "ledger/sign", "ledger/submit", "ledger/signAndSubmit", "ledger/signMessage", "wallet/accounts", "wallet/register-ledger", "wallet/get-config"]>;
|
|
57
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
58
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
59
|
+
timestamp: z.ZodNumber;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
params?: unknown;
|
|
62
|
+
id?: string | number;
|
|
63
|
+
timestamp?: number;
|
|
64
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
65
|
+
origin?: string;
|
|
66
|
+
jsonrpc?: "2.0";
|
|
67
|
+
}, {
|
|
68
|
+
params?: unknown;
|
|
69
|
+
id?: string | number;
|
|
70
|
+
timestamp?: number;
|
|
71
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
72
|
+
origin?: string;
|
|
73
|
+
jsonrpc?: "2.0";
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* @description Type representing RPC request
|
|
77
|
+
*/
|
|
78
|
+
export type RpcRequest = z.infer<typeof RpcRequestSchema>;
|
|
79
|
+
/**
|
|
80
|
+
* @description Schema for JSON-RPC 2.0 error response
|
|
81
|
+
*/
|
|
82
|
+
export declare const RpcErrorSchema: z.ZodObject<{
|
|
83
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
84
|
+
id: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
85
|
+
error: z.ZodObject<{
|
|
86
|
+
code: z.ZodNumber;
|
|
87
|
+
message: z.ZodString;
|
|
88
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
code?: number;
|
|
91
|
+
message?: string;
|
|
92
|
+
data?: unknown;
|
|
93
|
+
}, {
|
|
94
|
+
code?: number;
|
|
95
|
+
message?: string;
|
|
96
|
+
data?: unknown;
|
|
97
|
+
}>;
|
|
98
|
+
timestamp: z.ZodNumber;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
id?: string | number;
|
|
101
|
+
timestamp?: number;
|
|
102
|
+
error?: {
|
|
103
|
+
code?: number;
|
|
104
|
+
message?: string;
|
|
105
|
+
data?: unknown;
|
|
106
|
+
};
|
|
107
|
+
jsonrpc?: "2.0";
|
|
108
|
+
}, {
|
|
109
|
+
id?: string | number;
|
|
110
|
+
timestamp?: number;
|
|
111
|
+
error?: {
|
|
112
|
+
code?: number;
|
|
113
|
+
message?: string;
|
|
114
|
+
data?: unknown;
|
|
115
|
+
};
|
|
116
|
+
jsonrpc?: "2.0";
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* @description Type representing RPC error response
|
|
120
|
+
*/
|
|
121
|
+
export type RpcError = z.infer<typeof RpcErrorSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* @description Schema for JSON-RPC 2.0 success response
|
|
124
|
+
*/
|
|
125
|
+
export declare const RpcSuccessSchema: z.ZodObject<{
|
|
126
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
127
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
128
|
+
result: z.ZodUnknown;
|
|
129
|
+
timestamp: z.ZodNumber;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
id?: string | number;
|
|
132
|
+
timestamp?: number;
|
|
133
|
+
result?: unknown;
|
|
134
|
+
jsonrpc?: "2.0";
|
|
135
|
+
}, {
|
|
136
|
+
id?: string | number;
|
|
137
|
+
timestamp?: number;
|
|
138
|
+
result?: unknown;
|
|
139
|
+
jsonrpc?: "2.0";
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* @description Type representing RPC success response with typed result
|
|
143
|
+
*/
|
|
144
|
+
export type RpcSuccess<T = unknown> = Omit<z.infer<typeof RpcSuccessSchema>, 'result'> & {
|
|
145
|
+
result: T;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* @description Type representing RPC response (success or error)
|
|
149
|
+
*/
|
|
150
|
+
export type RpcResponse<T = unknown> = RpcSuccess<T> | RpcError;
|
|
151
|
+
/**
|
|
152
|
+
* @description Type for session request wrapped in message envelope
|
|
153
|
+
*/
|
|
154
|
+
export type SessionRequestEnvelope = z.infer<typeof MessageEnvelopeSchema> & {
|
|
155
|
+
payload: z.infer<typeof SessionRequestSchema>;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* @description Type for session approval wrapped in message envelope
|
|
159
|
+
*/
|
|
160
|
+
export type SessionApprovalEnvelope = z.infer<typeof MessageEnvelopeSchema> & {
|
|
161
|
+
payload: z.infer<typeof SessionApprovalSchema>;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* @description Type for sign payload wrapped in message envelope
|
|
165
|
+
*/
|
|
166
|
+
export type SignPayloadEnvelope = z.infer<typeof MessageEnvelopeSchema> & {
|
|
167
|
+
payload: z.infer<typeof SignPayloadSchema>;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* @description Type for sign result wrapped in message envelope
|
|
171
|
+
*/
|
|
172
|
+
export type SignResultEnvelope = z.infer<typeof MessageEnvelopeSchema> & {
|
|
173
|
+
payload: z.infer<typeof SignResultSchema>;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* @description Type for transaction submission wrapped in message envelope
|
|
177
|
+
*/
|
|
178
|
+
export type TransactionSubmissionEnvelope = z.infer<typeof MessageEnvelopeSchema> & {
|
|
179
|
+
payload: z.infer<typeof TransactionSubmissionSchema>;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* @description Schema for session request RPC call
|
|
183
|
+
*/
|
|
184
|
+
export declare const RpcSessionRequestSchema: z.ZodObject<{
|
|
185
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
186
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
187
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
188
|
+
timestamp: z.ZodNumber;
|
|
189
|
+
} & {
|
|
190
|
+
method: z.ZodLiteral<"session/request">;
|
|
191
|
+
params: z.ZodObject<{
|
|
192
|
+
appId: z.ZodString;
|
|
193
|
+
appName: z.ZodString;
|
|
194
|
+
appIcon: z.ZodOptional<z.ZodString>;
|
|
195
|
+
ledgerId: z.ZodString;
|
|
196
|
+
networkId: z.ZodString;
|
|
197
|
+
purpose: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
198
|
+
permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
199
|
+
nonce: z.ZodString;
|
|
200
|
+
timestamp: z.ZodNumber;
|
|
201
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
ledgerId?: string;
|
|
204
|
+
networkId?: string;
|
|
205
|
+
metadata?: Record<string, unknown>;
|
|
206
|
+
purpose?: string[];
|
|
207
|
+
timestamp?: number;
|
|
208
|
+
appId?: string;
|
|
209
|
+
appName?: string;
|
|
210
|
+
appIcon?: string;
|
|
211
|
+
permissions?: string[];
|
|
212
|
+
nonce?: string;
|
|
213
|
+
}, {
|
|
214
|
+
ledgerId?: string;
|
|
215
|
+
networkId?: string;
|
|
216
|
+
metadata?: Record<string, unknown>;
|
|
217
|
+
purpose?: string[];
|
|
218
|
+
timestamp?: number;
|
|
219
|
+
appId?: string;
|
|
220
|
+
appName?: string;
|
|
221
|
+
appIcon?: string;
|
|
222
|
+
permissions?: string[];
|
|
223
|
+
nonce?: string;
|
|
224
|
+
}>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
params?: {
|
|
227
|
+
ledgerId?: string;
|
|
228
|
+
networkId?: string;
|
|
229
|
+
metadata?: Record<string, unknown>;
|
|
230
|
+
purpose?: string[];
|
|
231
|
+
timestamp?: number;
|
|
232
|
+
appId?: string;
|
|
233
|
+
appName?: string;
|
|
234
|
+
appIcon?: string;
|
|
235
|
+
permissions?: string[];
|
|
236
|
+
nonce?: string;
|
|
237
|
+
};
|
|
238
|
+
id?: string | number;
|
|
239
|
+
timestamp?: number;
|
|
240
|
+
method?: "session/request";
|
|
241
|
+
origin?: string;
|
|
242
|
+
jsonrpc?: "2.0";
|
|
243
|
+
}, {
|
|
244
|
+
params?: {
|
|
245
|
+
ledgerId?: string;
|
|
246
|
+
networkId?: string;
|
|
247
|
+
metadata?: Record<string, unknown>;
|
|
248
|
+
purpose?: string[];
|
|
249
|
+
timestamp?: number;
|
|
250
|
+
appId?: string;
|
|
251
|
+
appName?: string;
|
|
252
|
+
appIcon?: string;
|
|
253
|
+
permissions?: string[];
|
|
254
|
+
nonce?: string;
|
|
255
|
+
};
|
|
256
|
+
id?: string | number;
|
|
257
|
+
timestamp?: number;
|
|
258
|
+
method?: "session/request";
|
|
259
|
+
origin?: string;
|
|
260
|
+
jsonrpc?: "2.0";
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* @description Schema for session approval RPC call
|
|
264
|
+
*/
|
|
265
|
+
export declare const RpcSessionApproveSchema: z.ZodObject<{
|
|
266
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
267
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
268
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
269
|
+
timestamp: z.ZodNumber;
|
|
270
|
+
} & {
|
|
271
|
+
method: z.ZodLiteral<"session/approve">;
|
|
272
|
+
params: z.ZodObject<{
|
|
273
|
+
appId: z.ZodString;
|
|
274
|
+
appName: z.ZodString;
|
|
275
|
+
appIcon: z.ZodOptional<z.ZodString>;
|
|
276
|
+
ledgerId: z.ZodString;
|
|
277
|
+
networkId: z.ZodString;
|
|
278
|
+
purpose: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
279
|
+
permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
280
|
+
nonce: z.ZodString;
|
|
281
|
+
timestamp: z.ZodNumber;
|
|
282
|
+
} & {
|
|
283
|
+
approved: z.ZodBoolean;
|
|
284
|
+
accounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
285
|
+
ledgerId: z.ZodString;
|
|
286
|
+
networkId: z.ZodString;
|
|
287
|
+
address: z.ZodString;
|
|
288
|
+
publicKey: z.ZodString;
|
|
289
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
290
|
+
}, "strip", z.ZodTypeAny, {
|
|
291
|
+
ledgerId?: string;
|
|
292
|
+
networkId?: string;
|
|
293
|
+
address?: string;
|
|
294
|
+
publicKey?: string;
|
|
295
|
+
metadata?: Record<string, unknown>;
|
|
296
|
+
}, {
|
|
297
|
+
ledgerId?: string;
|
|
298
|
+
networkId?: string;
|
|
299
|
+
address?: string;
|
|
300
|
+
publicKey?: string;
|
|
301
|
+
metadata?: Record<string, unknown>;
|
|
302
|
+
}>, "many">>;
|
|
303
|
+
expiration: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
305
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
306
|
+
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
ledgerId?: string;
|
|
308
|
+
networkId?: string;
|
|
309
|
+
metadata?: Record<string, unknown>;
|
|
310
|
+
purpose?: string[];
|
|
311
|
+
timestamp?: number;
|
|
312
|
+
appId?: string;
|
|
313
|
+
appName?: string;
|
|
314
|
+
appIcon?: string;
|
|
315
|
+
permissions?: string[];
|
|
316
|
+
nonce?: string;
|
|
317
|
+
approved?: boolean;
|
|
318
|
+
accounts?: {
|
|
319
|
+
ledgerId?: string;
|
|
320
|
+
networkId?: string;
|
|
321
|
+
address?: string;
|
|
322
|
+
publicKey?: string;
|
|
323
|
+
metadata?: Record<string, unknown>;
|
|
324
|
+
}[];
|
|
325
|
+
expiration?: number;
|
|
326
|
+
signature?: string;
|
|
327
|
+
}, {
|
|
328
|
+
ledgerId?: string;
|
|
329
|
+
networkId?: string;
|
|
330
|
+
metadata?: Record<string, unknown>;
|
|
331
|
+
purpose?: string[];
|
|
332
|
+
timestamp?: number;
|
|
333
|
+
appId?: string;
|
|
334
|
+
appName?: string;
|
|
335
|
+
appIcon?: string;
|
|
336
|
+
permissions?: string[];
|
|
337
|
+
nonce?: string;
|
|
338
|
+
approved?: boolean;
|
|
339
|
+
accounts?: {
|
|
340
|
+
ledgerId?: string;
|
|
341
|
+
networkId?: string;
|
|
342
|
+
address?: string;
|
|
343
|
+
publicKey?: string;
|
|
344
|
+
metadata?: Record<string, unknown>;
|
|
345
|
+
}[];
|
|
346
|
+
expiration?: number;
|
|
347
|
+
signature?: string;
|
|
348
|
+
}>;
|
|
349
|
+
}, "strip", z.ZodTypeAny, {
|
|
350
|
+
params?: {
|
|
351
|
+
ledgerId?: string;
|
|
352
|
+
networkId?: string;
|
|
353
|
+
metadata?: Record<string, unknown>;
|
|
354
|
+
purpose?: string[];
|
|
355
|
+
timestamp?: number;
|
|
356
|
+
appId?: string;
|
|
357
|
+
appName?: string;
|
|
358
|
+
appIcon?: string;
|
|
359
|
+
permissions?: string[];
|
|
360
|
+
nonce?: string;
|
|
361
|
+
approved?: boolean;
|
|
362
|
+
accounts?: {
|
|
363
|
+
ledgerId?: string;
|
|
364
|
+
networkId?: string;
|
|
365
|
+
address?: string;
|
|
366
|
+
publicKey?: string;
|
|
367
|
+
metadata?: Record<string, unknown>;
|
|
368
|
+
}[];
|
|
369
|
+
expiration?: number;
|
|
370
|
+
signature?: string;
|
|
371
|
+
};
|
|
372
|
+
id?: string | number;
|
|
373
|
+
timestamp?: number;
|
|
374
|
+
method?: "session/approve";
|
|
375
|
+
origin?: string;
|
|
376
|
+
jsonrpc?: "2.0";
|
|
377
|
+
}, {
|
|
378
|
+
params?: {
|
|
379
|
+
ledgerId?: string;
|
|
380
|
+
networkId?: string;
|
|
381
|
+
metadata?: Record<string, unknown>;
|
|
382
|
+
purpose?: string[];
|
|
383
|
+
timestamp?: number;
|
|
384
|
+
appId?: string;
|
|
385
|
+
appName?: string;
|
|
386
|
+
appIcon?: string;
|
|
387
|
+
permissions?: string[];
|
|
388
|
+
nonce?: string;
|
|
389
|
+
approved?: boolean;
|
|
390
|
+
accounts?: {
|
|
391
|
+
ledgerId?: string;
|
|
392
|
+
networkId?: string;
|
|
393
|
+
address?: string;
|
|
394
|
+
publicKey?: string;
|
|
395
|
+
metadata?: Record<string, unknown>;
|
|
396
|
+
}[];
|
|
397
|
+
expiration?: number;
|
|
398
|
+
signature?: string;
|
|
399
|
+
};
|
|
400
|
+
id?: string | number;
|
|
401
|
+
timestamp?: number;
|
|
402
|
+
method?: "session/approve";
|
|
403
|
+
origin?: string;
|
|
404
|
+
jsonrpc?: "2.0";
|
|
405
|
+
}>;
|
|
406
|
+
/**
|
|
407
|
+
* @description Schema for signing RPC call
|
|
408
|
+
*/
|
|
409
|
+
export declare const RpcSignRequestSchema: z.ZodObject<{
|
|
410
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
411
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
412
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
413
|
+
timestamp: z.ZodNumber;
|
|
414
|
+
} & {
|
|
415
|
+
method: z.ZodLiteral<"ledger/sign">;
|
|
416
|
+
params: z.ZodObject<{
|
|
417
|
+
ledgerId: z.ZodString;
|
|
418
|
+
networkId: z.ZodString;
|
|
419
|
+
accountAddress: z.ZodString;
|
|
420
|
+
payload: z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>;
|
|
421
|
+
derivationPath: z.ZodOptional<z.ZodObject<{
|
|
422
|
+
purpose: z.ZodNumber;
|
|
423
|
+
coinType: z.ZodNumber;
|
|
424
|
+
account: z.ZodDefault<z.ZodNumber>;
|
|
425
|
+
change: z.ZodDefault<z.ZodNumber>;
|
|
426
|
+
addressIndex: z.ZodDefault<z.ZodNumber>;
|
|
427
|
+
}, "strip", z.ZodTypeAny, {
|
|
428
|
+
purpose?: number;
|
|
429
|
+
coinType?: number;
|
|
430
|
+
account?: number;
|
|
431
|
+
change?: number;
|
|
432
|
+
addressIndex?: number;
|
|
433
|
+
}, {
|
|
434
|
+
purpose?: number;
|
|
435
|
+
coinType?: number;
|
|
436
|
+
account?: number;
|
|
437
|
+
change?: number;
|
|
438
|
+
addressIndex?: number;
|
|
439
|
+
}>>;
|
|
440
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
441
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
442
|
+
isBatch: z.ZodOptional<z.ZodBoolean>;
|
|
443
|
+
batchKey: z.ZodOptional<z.ZodString>;
|
|
444
|
+
innerTransactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
445
|
+
payload: z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>;
|
|
446
|
+
description: z.ZodOptional<z.ZodString>;
|
|
447
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
448
|
+
}, "strip", z.ZodTypeAny, {
|
|
449
|
+
metadata?: Record<string, unknown>;
|
|
450
|
+
description?: string;
|
|
451
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
452
|
+
}, {
|
|
453
|
+
metadata?: Record<string, unknown>;
|
|
454
|
+
description?: string;
|
|
455
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
456
|
+
}>, "many">>;
|
|
457
|
+
}, "strip", z.ZodTypeAny, {
|
|
458
|
+
ledgerId?: string;
|
|
459
|
+
networkId?: string;
|
|
460
|
+
nonce?: string;
|
|
461
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
462
|
+
accountAddress?: string;
|
|
463
|
+
derivationPath?: {
|
|
464
|
+
purpose?: number;
|
|
465
|
+
coinType?: number;
|
|
466
|
+
account?: number;
|
|
467
|
+
change?: number;
|
|
468
|
+
addressIndex?: number;
|
|
469
|
+
};
|
|
470
|
+
context?: Record<string, unknown>;
|
|
471
|
+
isBatch?: boolean;
|
|
472
|
+
batchKey?: string;
|
|
473
|
+
innerTransactions?: {
|
|
474
|
+
metadata?: Record<string, unknown>;
|
|
475
|
+
description?: string;
|
|
476
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
477
|
+
}[];
|
|
478
|
+
}, {
|
|
479
|
+
ledgerId?: string;
|
|
480
|
+
networkId?: string;
|
|
481
|
+
nonce?: string;
|
|
482
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
483
|
+
accountAddress?: string;
|
|
484
|
+
derivationPath?: {
|
|
485
|
+
purpose?: number;
|
|
486
|
+
coinType?: number;
|
|
487
|
+
account?: number;
|
|
488
|
+
change?: number;
|
|
489
|
+
addressIndex?: number;
|
|
490
|
+
};
|
|
491
|
+
context?: Record<string, unknown>;
|
|
492
|
+
isBatch?: boolean;
|
|
493
|
+
batchKey?: string;
|
|
494
|
+
innerTransactions?: {
|
|
495
|
+
metadata?: Record<string, unknown>;
|
|
496
|
+
description?: string;
|
|
497
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
498
|
+
}[];
|
|
499
|
+
}>;
|
|
500
|
+
}, "strip", z.ZodTypeAny, {
|
|
501
|
+
params?: {
|
|
502
|
+
ledgerId?: string;
|
|
503
|
+
networkId?: string;
|
|
504
|
+
nonce?: string;
|
|
505
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
506
|
+
accountAddress?: string;
|
|
507
|
+
derivationPath?: {
|
|
508
|
+
purpose?: number;
|
|
509
|
+
coinType?: number;
|
|
510
|
+
account?: number;
|
|
511
|
+
change?: number;
|
|
512
|
+
addressIndex?: number;
|
|
513
|
+
};
|
|
514
|
+
context?: Record<string, unknown>;
|
|
515
|
+
isBatch?: boolean;
|
|
516
|
+
batchKey?: string;
|
|
517
|
+
innerTransactions?: {
|
|
518
|
+
metadata?: Record<string, unknown>;
|
|
519
|
+
description?: string;
|
|
520
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
521
|
+
}[];
|
|
522
|
+
};
|
|
523
|
+
id?: string | number;
|
|
524
|
+
timestamp?: number;
|
|
525
|
+
method?: "ledger/sign";
|
|
526
|
+
origin?: string;
|
|
527
|
+
jsonrpc?: "2.0";
|
|
528
|
+
}, {
|
|
529
|
+
params?: {
|
|
530
|
+
ledgerId?: string;
|
|
531
|
+
networkId?: string;
|
|
532
|
+
nonce?: string;
|
|
533
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
534
|
+
accountAddress?: string;
|
|
535
|
+
derivationPath?: {
|
|
536
|
+
purpose?: number;
|
|
537
|
+
coinType?: number;
|
|
538
|
+
account?: number;
|
|
539
|
+
change?: number;
|
|
540
|
+
addressIndex?: number;
|
|
541
|
+
};
|
|
542
|
+
context?: Record<string, unknown>;
|
|
543
|
+
isBatch?: boolean;
|
|
544
|
+
batchKey?: string;
|
|
545
|
+
innerTransactions?: {
|
|
546
|
+
metadata?: Record<string, unknown>;
|
|
547
|
+
description?: string;
|
|
548
|
+
payload?: string | Uint8Array<ArrayBuffer>;
|
|
549
|
+
}[];
|
|
550
|
+
};
|
|
551
|
+
id?: string | number;
|
|
552
|
+
timestamp?: number;
|
|
553
|
+
method?: "ledger/sign";
|
|
554
|
+
origin?: string;
|
|
555
|
+
jsonrpc?: "2.0";
|
|
556
|
+
}>;
|
|
557
|
+
/**
|
|
558
|
+
* @description Schema for signing RPC response
|
|
559
|
+
*/
|
|
560
|
+
export declare const RpcSignResponseSchema: z.ZodObject<{
|
|
561
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
562
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
563
|
+
timestamp: z.ZodNumber;
|
|
564
|
+
} & {
|
|
565
|
+
result: z.ZodObject<{
|
|
566
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
567
|
+
signedPayload: z.ZodOptional<z.ZodString>;
|
|
568
|
+
publicKey: z.ZodString;
|
|
569
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
570
|
+
algorithm: z.ZodString;
|
|
571
|
+
signedInnerTransactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
572
|
+
signedPayload: z.ZodString;
|
|
573
|
+
transactionId: z.ZodOptional<z.ZodString>;
|
|
574
|
+
}, "strip", z.ZodTypeAny, {
|
|
575
|
+
signedPayload?: string;
|
|
576
|
+
transactionId?: string;
|
|
577
|
+
}, {
|
|
578
|
+
signedPayload?: string;
|
|
579
|
+
transactionId?: string;
|
|
580
|
+
}>, "many">>;
|
|
581
|
+
transactionId: z.ZodOptional<z.ZodString>;
|
|
582
|
+
transactionHash: z.ZodOptional<z.ZodString>;
|
|
583
|
+
status: z.ZodOptional<z.ZodString>;
|
|
584
|
+
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
status?: string;
|
|
586
|
+
publicKey?: string;
|
|
587
|
+
signature?: string;
|
|
588
|
+
signedPayload?: string;
|
|
589
|
+
transactionId?: string;
|
|
590
|
+
payloadHash?: string;
|
|
591
|
+
algorithm?: string;
|
|
592
|
+
signedInnerTransactions?: {
|
|
593
|
+
signedPayload?: string;
|
|
594
|
+
transactionId?: string;
|
|
595
|
+
}[];
|
|
596
|
+
transactionHash?: string;
|
|
597
|
+
}, {
|
|
598
|
+
status?: string;
|
|
599
|
+
publicKey?: string;
|
|
600
|
+
signature?: string;
|
|
601
|
+
signedPayload?: string;
|
|
602
|
+
transactionId?: string;
|
|
603
|
+
payloadHash?: string;
|
|
604
|
+
algorithm?: string;
|
|
605
|
+
signedInnerTransactions?: {
|
|
606
|
+
signedPayload?: string;
|
|
607
|
+
transactionId?: string;
|
|
608
|
+
}[];
|
|
609
|
+
transactionHash?: string;
|
|
610
|
+
}>;
|
|
611
|
+
}, "strip", z.ZodTypeAny, {
|
|
612
|
+
id?: string | number;
|
|
613
|
+
timestamp?: number;
|
|
614
|
+
result?: {
|
|
615
|
+
status?: string;
|
|
616
|
+
publicKey?: string;
|
|
617
|
+
signature?: string;
|
|
618
|
+
signedPayload?: string;
|
|
619
|
+
transactionId?: string;
|
|
620
|
+
payloadHash?: string;
|
|
621
|
+
algorithm?: string;
|
|
622
|
+
signedInnerTransactions?: {
|
|
623
|
+
signedPayload?: string;
|
|
624
|
+
transactionId?: string;
|
|
625
|
+
}[];
|
|
626
|
+
transactionHash?: string;
|
|
627
|
+
};
|
|
628
|
+
jsonrpc?: "2.0";
|
|
629
|
+
}, {
|
|
630
|
+
id?: string | number;
|
|
631
|
+
timestamp?: number;
|
|
632
|
+
result?: {
|
|
633
|
+
status?: string;
|
|
634
|
+
publicKey?: string;
|
|
635
|
+
signature?: string;
|
|
636
|
+
signedPayload?: string;
|
|
637
|
+
transactionId?: string;
|
|
638
|
+
payloadHash?: string;
|
|
639
|
+
algorithm?: string;
|
|
640
|
+
signedInnerTransactions?: {
|
|
641
|
+
signedPayload?: string;
|
|
642
|
+
transactionId?: string;
|
|
643
|
+
}[];
|
|
644
|
+
transactionHash?: string;
|
|
645
|
+
};
|
|
646
|
+
jsonrpc?: "2.0";
|
|
647
|
+
}>;
|
|
648
|
+
/**
|
|
649
|
+
* @description Schema for transaction submission RPC call
|
|
650
|
+
*/
|
|
651
|
+
export declare const RpcSubmitRequestSchema: z.ZodObject<{
|
|
652
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
653
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
654
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
655
|
+
timestamp: z.ZodNumber;
|
|
656
|
+
} & {
|
|
657
|
+
method: z.ZodLiteral<"ledger/submit">;
|
|
658
|
+
params: z.ZodObject<{
|
|
659
|
+
ledgerId: z.ZodString;
|
|
660
|
+
networkId: z.ZodString;
|
|
661
|
+
transactionBlob: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
|
|
662
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
663
|
+
}, "strip", z.ZodTypeAny, {
|
|
664
|
+
ledgerId?: string;
|
|
665
|
+
networkId?: string;
|
|
666
|
+
context?: Record<string, unknown>;
|
|
667
|
+
transactionBlob?: Uint8Array<ArrayBuffer>;
|
|
668
|
+
}, {
|
|
669
|
+
ledgerId?: string;
|
|
670
|
+
networkId?: string;
|
|
671
|
+
context?: Record<string, unknown>;
|
|
672
|
+
transactionBlob?: Uint8Array<ArrayBuffer>;
|
|
673
|
+
}>;
|
|
674
|
+
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
params?: {
|
|
676
|
+
ledgerId?: string;
|
|
677
|
+
networkId?: string;
|
|
678
|
+
context?: Record<string, unknown>;
|
|
679
|
+
transactionBlob?: Uint8Array<ArrayBuffer>;
|
|
680
|
+
};
|
|
681
|
+
id?: string | number;
|
|
682
|
+
timestamp?: number;
|
|
683
|
+
method?: "ledger/submit";
|
|
684
|
+
origin?: string;
|
|
685
|
+
jsonrpc?: "2.0";
|
|
686
|
+
}, {
|
|
687
|
+
params?: {
|
|
688
|
+
ledgerId?: string;
|
|
689
|
+
networkId?: string;
|
|
690
|
+
context?: Record<string, unknown>;
|
|
691
|
+
transactionBlob?: Uint8Array<ArrayBuffer>;
|
|
692
|
+
};
|
|
693
|
+
id?: string | number;
|
|
694
|
+
timestamp?: number;
|
|
695
|
+
method?: "ledger/submit";
|
|
696
|
+
origin?: string;
|
|
697
|
+
jsonrpc?: "2.0";
|
|
698
|
+
}>;
|
|
699
|
+
/**
|
|
700
|
+
* @description Type for session request RPC call
|
|
701
|
+
*/
|
|
702
|
+
export type RpcSessionRequest = z.infer<typeof RpcSessionRequestSchema>;
|
|
703
|
+
/**
|
|
704
|
+
* @description Type for session approval RPC call
|
|
705
|
+
*/
|
|
706
|
+
export type RpcSessionApprove = z.infer<typeof RpcSessionApproveSchema>;
|
|
707
|
+
/**
|
|
708
|
+
* @description Type for signing RPC call
|
|
709
|
+
*/
|
|
710
|
+
export type RpcSignRequest = z.infer<typeof RpcSignRequestSchema>;
|
|
711
|
+
/**
|
|
712
|
+
* @description Type for signing RPC response
|
|
713
|
+
*/
|
|
714
|
+
export type RpcSignResponse = z.infer<typeof RpcSignResponseSchema>;
|
|
715
|
+
/**
|
|
716
|
+
* @description Type for transaction submission RPC call
|
|
717
|
+
*/
|
|
718
|
+
export type RpcSubmitRequest = z.infer<typeof RpcSubmitRequestSchema>;
|
|
719
|
+
/**
|
|
720
|
+
* @description Schema for semantic version header validation
|
|
721
|
+
*/
|
|
722
|
+
export declare const RpcVersionHeaderSchema: z.ZodString;
|
|
723
|
+
/**
|
|
724
|
+
* @description Schema for RPC envelope wrapper.
|
|
725
|
+
* Unknown fields are stripped to prevent injection of arbitrary properties.
|
|
726
|
+
* The hmac field is explicitly declared for HMAC signature verification.
|
|
727
|
+
* @security HWA-37 / SOC2 CC6.1 — strips unknown fields to prevent property injection
|
|
728
|
+
*/
|
|
729
|
+
export declare const RpcEnvelopeSchema: z.ZodObject<{
|
|
730
|
+
id: z.ZodString;
|
|
731
|
+
createdAt: z.ZodNumber;
|
|
732
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
733
|
+
} & {
|
|
734
|
+
topic: z.ZodLiteral<"rpc">;
|
|
735
|
+
version: z.ZodString;
|
|
736
|
+
hmac: z.ZodOptional<z.ZodString>;
|
|
737
|
+
payload: z.ZodUnion<[z.ZodObject<{
|
|
738
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
739
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
740
|
+
method: z.ZodEnum<["session/request", "session/approve", "session/terminate", "session/status", "session/terminated", "session/updated", "ledger/sign", "ledger/submit", "ledger/signAndSubmit", "ledger/signMessage", "wallet/accounts", "wallet/register-ledger", "wallet/get-config"]>;
|
|
741
|
+
params: z.ZodOptional<z.ZodUnknown>;
|
|
742
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
743
|
+
timestamp: z.ZodNumber;
|
|
744
|
+
}, "strip", z.ZodTypeAny, {
|
|
745
|
+
params?: unknown;
|
|
746
|
+
id?: string | number;
|
|
747
|
+
timestamp?: number;
|
|
748
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
749
|
+
origin?: string;
|
|
750
|
+
jsonrpc?: "2.0";
|
|
751
|
+
}, {
|
|
752
|
+
params?: unknown;
|
|
753
|
+
id?: string | number;
|
|
754
|
+
timestamp?: number;
|
|
755
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
756
|
+
origin?: string;
|
|
757
|
+
jsonrpc?: "2.0";
|
|
758
|
+
}>, z.ZodObject<{
|
|
759
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
760
|
+
id: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
761
|
+
error: z.ZodObject<{
|
|
762
|
+
code: z.ZodNumber;
|
|
763
|
+
message: z.ZodString;
|
|
764
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
765
|
+
}, "strip", z.ZodTypeAny, {
|
|
766
|
+
code?: number;
|
|
767
|
+
message?: string;
|
|
768
|
+
data?: unknown;
|
|
769
|
+
}, {
|
|
770
|
+
code?: number;
|
|
771
|
+
message?: string;
|
|
772
|
+
data?: unknown;
|
|
773
|
+
}>;
|
|
774
|
+
timestamp: z.ZodNumber;
|
|
775
|
+
}, "strip", z.ZodTypeAny, {
|
|
776
|
+
id?: string | number;
|
|
777
|
+
timestamp?: number;
|
|
778
|
+
error?: {
|
|
779
|
+
code?: number;
|
|
780
|
+
message?: string;
|
|
781
|
+
data?: unknown;
|
|
782
|
+
};
|
|
783
|
+
jsonrpc?: "2.0";
|
|
784
|
+
}, {
|
|
785
|
+
id?: string | number;
|
|
786
|
+
timestamp?: number;
|
|
787
|
+
error?: {
|
|
788
|
+
code?: number;
|
|
789
|
+
message?: string;
|
|
790
|
+
data?: unknown;
|
|
791
|
+
};
|
|
792
|
+
jsonrpc?: "2.0";
|
|
793
|
+
}>, z.ZodObject<{
|
|
794
|
+
jsonrpc: z.ZodLiteral<"2.0">;
|
|
795
|
+
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
796
|
+
result: z.ZodUnknown;
|
|
797
|
+
timestamp: z.ZodNumber;
|
|
798
|
+
}, "strip", z.ZodTypeAny, {
|
|
799
|
+
id?: string | number;
|
|
800
|
+
timestamp?: number;
|
|
801
|
+
result?: unknown;
|
|
802
|
+
jsonrpc?: "2.0";
|
|
803
|
+
}, {
|
|
804
|
+
id?: string | number;
|
|
805
|
+
timestamp?: number;
|
|
806
|
+
result?: unknown;
|
|
807
|
+
jsonrpc?: "2.0";
|
|
808
|
+
}>]>;
|
|
809
|
+
}, "strip", z.ZodTypeAny, {
|
|
810
|
+
id?: string;
|
|
811
|
+
createdAt?: number;
|
|
812
|
+
version?: string;
|
|
813
|
+
signature?: string;
|
|
814
|
+
payload?: {
|
|
815
|
+
params?: unknown;
|
|
816
|
+
id?: string | number;
|
|
817
|
+
timestamp?: number;
|
|
818
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
819
|
+
origin?: string;
|
|
820
|
+
jsonrpc?: "2.0";
|
|
821
|
+
} | {
|
|
822
|
+
id?: string | number;
|
|
823
|
+
timestamp?: number;
|
|
824
|
+
error?: {
|
|
825
|
+
code?: number;
|
|
826
|
+
message?: string;
|
|
827
|
+
data?: unknown;
|
|
828
|
+
};
|
|
829
|
+
jsonrpc?: "2.0";
|
|
830
|
+
} | {
|
|
831
|
+
id?: string | number;
|
|
832
|
+
timestamp?: number;
|
|
833
|
+
result?: unknown;
|
|
834
|
+
jsonrpc?: "2.0";
|
|
835
|
+
};
|
|
836
|
+
topic?: "rpc";
|
|
837
|
+
hmac?: string;
|
|
838
|
+
}, {
|
|
839
|
+
id?: string;
|
|
840
|
+
createdAt?: number;
|
|
841
|
+
version?: string;
|
|
842
|
+
signature?: string;
|
|
843
|
+
payload?: {
|
|
844
|
+
params?: unknown;
|
|
845
|
+
id?: string | number;
|
|
846
|
+
timestamp?: number;
|
|
847
|
+
method?: "session/request" | "session/approve" | "session/terminate" | "session/status" | "session/terminated" | "session/updated" | "ledger/sign" | "ledger/submit" | "ledger/signAndSubmit" | "ledger/signMessage" | "wallet/accounts" | "wallet/register-ledger" | "wallet/get-config";
|
|
848
|
+
origin?: string;
|
|
849
|
+
jsonrpc?: "2.0";
|
|
850
|
+
} | {
|
|
851
|
+
id?: string | number;
|
|
852
|
+
timestamp?: number;
|
|
853
|
+
error?: {
|
|
854
|
+
code?: number;
|
|
855
|
+
message?: string;
|
|
856
|
+
data?: unknown;
|
|
857
|
+
};
|
|
858
|
+
jsonrpc?: "2.0";
|
|
859
|
+
} | {
|
|
860
|
+
id?: string | number;
|
|
861
|
+
timestamp?: number;
|
|
862
|
+
result?: unknown;
|
|
863
|
+
jsonrpc?: "2.0";
|
|
864
|
+
};
|
|
865
|
+
topic?: "rpc";
|
|
866
|
+
hmac?: string;
|
|
867
|
+
}>;
|
|
868
|
+
/**
|
|
869
|
+
* @description Type representing RPC envelope
|
|
870
|
+
*/
|
|
871
|
+
export type RpcEnvelope = z.infer<typeof RpcEnvelopeSchema>;
|
|
872
|
+
//# sourceMappingURL=rpc.d.ts.map
|