hd-wallet-ui 2.1.3 → 2.2.2

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.
@@ -5,11 +5,13 @@ export type WalletRelayOperation =
5
5
  | 'sdn.auth.jcs-envelope.v2'
6
6
  | 'sdn.auth.publish-request.v1'
7
7
  | 'sdn.asset-review.authority-activation.v1'
8
- | 'sdn.asset-review.decision.v1';
8
+ | 'sdn.asset-review.decision.v1'
9
+ | 'sdn.wallet.field-open.v1'
10
+ | 'sdn.wallet.key-unwrap.v1';
9
11
 
10
12
  export type WalletClientStatus = 'dormant' | 'opening' | 'connected' | 'error';
11
13
  export type WalletClientId =
12
- | 'orbpro-pages-v1'
14
+ | 'digitalarsenal-pages-v1'
13
15
  | 'sdn-asset-models-pages-v1'
14
16
  | 'sdn-asset-review-v1'
15
17
  | 'sdn-flatbuffers-pages-v1'
@@ -27,6 +29,7 @@ export type WalletClientErrorCode =
27
29
  | 'EXPIRED'
28
30
  | 'INVALID_CLIENT'
29
31
  | 'INVALID_REQUEST'
32
+ | 'NOT_ADDRESSED_TO_ACCOUNT'
30
33
  | 'RELAY_ERROR'
31
34
  | 'REPLACED'
32
35
  | 'WALLET_NOT_COMPLETED';
@@ -225,6 +228,42 @@ export interface WalletPublicClient {
225
228
  destroy(): Promise<void>;
226
229
  }
227
230
 
231
+ /**
232
+ * One field sealed to the signed-in user's contact-encryption key with the SDN
233
+ * Unified ECIES field cipher: its SDS `$ENC` header bytes, the HKDF info
234
+ * (`sdn-field-encryption/v1|<site>|<schema>|<field>|k<version>`, equal to the
235
+ * header's CONTEXT), its field id and its ciphertext.
236
+ */
237
+ export interface SealedFieldInput {
238
+ readonly enc: Uint8Array;
239
+ readonly context: string;
240
+ readonly fieldId: number;
241
+ readonly ciphertext: Uint8Array;
242
+ }
243
+
244
+ export type OpenedField =
245
+ | { readonly plaintext: Uint8Array }
246
+ | { readonly refused: 'NOT_ADDRESSED_TO_ACCOUNT' };
247
+
248
+ /** sdn-flatbuffers-pages-v1: the wallet opens this site's fields after consent. */
249
+ export interface FlatbuffersWalletClient extends WalletPublicClient {
250
+ /** 1..16 fields, at most 4096 bytes each and 12288 bytes in all. */
251
+ openFields(value: { readonly fields: readonly SealedFieldInput[] }): Promise<readonly OpenedField[]>;
252
+ }
253
+
254
+ /**
255
+ * sdn-flatsql-pages-v1: the wallet unwraps one database's content key (an
256
+ * `$ENC` + `$KMF` pair wrapped to the user) after consent. The content key is
257
+ * a scoped key for that database, not a wallet key.
258
+ */
259
+ export interface FlatsqlWalletClient extends WalletPublicClient {
260
+ unwrapKey(value: {
261
+ readonly enc: Uint8Array;
262
+ readonly kmf: Uint8Array;
263
+ readonly context: string;
264
+ }): Promise<{ readonly contentKey: Uint8Array }>;
265
+ }
266
+
228
267
  export interface SdnWalletClient extends WalletPublicClient {
229
268
  requestSdnLoginV1(value: SdnLoginV1Request): Promise<RawWalletSignature>;
230
269
  requestSdnLoginV2(value: SdnLoginV2Request): Promise<CanonicalWalletSignature>;