@notabene/javascript-sdk 2.9.3 → 2.10.0-next.4
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 +22 -29
- package/dist/cjs/notabene.cjs +1 -1
- package/dist/cjs/notabene.d.ts +78 -26
- package/dist/cjs/package.json +2 -1
- package/dist/esm/notabene.d.ts +78 -26
- package/dist/esm/notabene.js +19 -13
- package/dist/esm/package.json +2 -1
- package/dist/notabene.d.ts +78 -26
- package/dist/notabene.js +19 -13
- package/docs/README.md +218 -47
- package/docs/_media/TransactionOptions.md +9 -9
- package/docs/_media/getRefreshResult.md +35 -0
- package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
- package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
- package/docs/ivms/types/type-aliases/Address.md +1 -1
- package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
- package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
- package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
- package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
- package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
- package/docs/ivms/types/type-aliases/ISODate.md +1 -1
- package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
- package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
- package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
- package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
- package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
- package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
- package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
- package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
- package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
- package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
- package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
- package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
- package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
- package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
- package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
- package/docs/ivms/types/type-aliases/Originator.md +1 -1
- package/docs/ivms/types/type-aliases/Person.md +1 -1
- package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
- package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
- package/docs/notabene/README.md +7 -1
- package/docs/notabene/classes/ConnectionManager.md +19 -5
- package/docs/notabene/classes/EmbeddedComponent.md +17 -17
- package/docs/notabene/classes/default.md +7 -7
- package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
- package/docs/notabene/functions/getRefreshResult.md +11 -3
- package/docs/notabene/interfaces/ConnectionData.md +8 -8
- package/docs/notabene/interfaces/ConnectionMetadata.md +6 -6
- package/docs/notabene/interfaces/ConnectionResponse.md +12 -12
- package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
- package/docs/notabene/type-aliases/ConnectionResult.md +17 -0
- package/docs/notabene/type-aliases/ConnectionStatus.md +1 -1
- package/docs/notabene/type-aliases/MessageCallback.md +1 -1
- package/docs/notabene/type-aliases/TransactionType.md +1 -1
- package/docs/types/README.md +1 -0
- package/docs/types/enumerations/AgentType.md +2 -2
- package/docs/types/enumerations/CMType.md +7 -7
- package/docs/types/enumerations/ErrorIdentifierCode.md +4 -4
- package/docs/types/enumerations/HMType.md +2 -2
- package/docs/types/enumerations/PersonType.md +3 -3
- package/docs/types/enumerations/ProofStatus.md +4 -4
- package/docs/types/enumerations/ProofTypes.md +27 -17
- package/docs/types/enumerations/Status.md +5 -5
- package/docs/types/enumerations/VASPSearchControl.md +2 -2
- package/docs/types/enumerations/ValidationSections.md +4 -4
- package/docs/types/interfaces/Account.md +59 -0
- package/docs/types/interfaces/Agent.md +6 -6
- package/docs/types/interfaces/CallbackOptions.md +2 -2
- package/docs/types/interfaces/ComponentRequest.md +2 -2
- package/docs/types/interfaces/ComponentResponse.md +4 -4
- package/docs/types/interfaces/ConnectionRecord.md +7 -7
- package/docs/types/interfaces/ConnectionRequest.md +3 -3
- package/docs/types/interfaces/Counterparty.md +10 -10
- package/docs/types/interfaces/DeclarationProof.md +6 -6
- package/docs/types/interfaces/Deposit.md +25 -11
- package/docs/types/interfaces/DepositRequest.md +9 -9
- package/docs/types/interfaces/DepositRequestOptions.md +1 -1
- package/docs/types/interfaces/DepositTransaction.md +23 -9
- package/docs/types/interfaces/LegalPerson.md +13 -13
- package/docs/types/interfaces/MicroTransferProof.md +9 -9
- package/docs/types/interfaces/NaturalPerson.md +13 -13
- package/docs/types/interfaces/OwnershipProof.md +4 -4
- package/docs/types/interfaces/RefreshSource.md +2 -2
- package/docs/types/interfaces/Refreshable.md +1 -1
- package/docs/types/interfaces/ScreenshotProof.md +5 -5
- package/docs/types/interfaces/SignatureProof.md +10 -10
- package/docs/types/interfaces/ThresholdOptions.md +3 -3
- package/docs/types/interfaces/Transaction.md +18 -8
- package/docs/types/interfaces/TransactionOptions.md +9 -9
- package/docs/types/interfaces/TransactionResponse.md +9 -9
- package/docs/types/interfaces/VASP.md +9 -9
- package/docs/types/interfaces/Wallet.md +8 -8
- package/docs/types/interfaces/Withdrawal.md +24 -10
- package/docs/types/type-aliases/BlockchainAddress.md +1 -1
- package/docs/types/type-aliases/CAIP10.md +1 -1
- package/docs/types/type-aliases/CAIP19.md +1 -1
- package/docs/types/type-aliases/CAIP2.md +1 -1
- package/docs/types/type-aliases/CAIP220.md +1 -1
- package/docs/types/type-aliases/Cancel.md +1 -1
- package/docs/types/type-aliases/Completed.md +1 -1
- package/docs/types/type-aliases/ComponentMessage.md +1 -1
- package/docs/types/type-aliases/ConnectionOptions.md +1 -1
- package/docs/types/type-aliases/CounterpartyAssistConfig.md +2 -2
- package/docs/types/type-aliases/CryptoCredential.md +1 -1
- package/docs/types/type-aliases/DID.md +1 -1
- package/docs/types/type-aliases/DTI.md +1 -1
- package/docs/types/type-aliases/Destination.md +1 -1
- package/docs/types/type-aliases/Error.md +1 -1
- package/docs/types/type-aliases/FieldOptions.md +1 -1
- package/docs/types/type-aliases/FieldTypes.md +1 -1
- package/docs/types/type-aliases/HostMessage.md +1 -1
- package/docs/types/type-aliases/ISOCurrency.md +1 -1
- package/docs/types/type-aliases/InvalidValue.md +1 -1
- package/docs/types/type-aliases/LEI.md +1 -1
- package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
- package/docs/types/type-aliases/LegalPersonFields.md +1 -1
- package/docs/types/type-aliases/NationalIdentifierTypeFieldOptions.md +1 -1
- package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
- package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
- package/docs/types/type-aliases/NotabeneAsset.md +1 -1
- package/docs/types/type-aliases/Ready.md +1 -1
- package/docs/types/type-aliases/ResizeRequest.md +1 -1
- package/docs/types/type-aliases/Source.md +1 -1
- package/docs/types/type-aliases/Theme.md +1 -1
- package/docs/types/type-aliases/TransactionAsset.md +1 -1
- package/docs/types/type-aliases/TravelAddress.md +1 -1
- package/docs/types/type-aliases/URI.md +1 -1
- package/docs/types/type-aliases/UUID.md +1 -1
- package/docs/types/type-aliases/UpdateValue.md +1 -1
- package/docs/types/type-aliases/V1Asset.md +1 -1
- package/docs/types/type-aliases/V1Transaction.md +1 -1
- package/docs/types/type-aliases/VASPOptions.md +1 -1
- package/docs/types/type-aliases/ValidationError.md +1 -1
- package/package.json +2 -1
- package/src/types.ts +36 -2
- package/src/utils/connections.ts +47 -21
- package/src/utils/encryption.ts +13 -6
- package/docs/notabene/interfaces/ConnectionResult.md +0 -61
package/dist/esm/notabene.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var g = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var a = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}),
|
|
5
|
-
class
|
|
4
|
+
var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
|
|
5
|
+
class R {
|
|
6
6
|
constructor() {
|
|
7
7
|
a(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
8
|
a(this, "port");
|
|
@@ -68,7 +68,7 @@ class _ {
|
|
|
68
68
|
this.port && this.port.postMessage(e);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class _ {
|
|
72
72
|
/**
|
|
73
73
|
* Creates an instance of EmbeddedComponent.
|
|
74
74
|
* @param url - The URL of the embedded component
|
|
@@ -82,7 +82,7 @@ class x {
|
|
|
82
82
|
a(this, "iframe");
|
|
83
83
|
a(this, "eventManager");
|
|
84
84
|
a(this, "modal");
|
|
85
|
-
this._url = e, this._value = n, this._options = s, this.eventManager = new
|
|
85
|
+
this._url = e, this._value = n, this._options = s, this.eventManager = new R(), this.on(l.INVALID, (r) => {
|
|
86
86
|
r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
|
|
87
87
|
}), this.on(l.RESIZE, (r) => {
|
|
88
88
|
r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
|
|
@@ -237,7 +237,7 @@ class x {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function x(t) {
|
|
241
241
|
return Object.entries(t).map(([e, n]) => {
|
|
242
242
|
if (n == null) return;
|
|
243
243
|
const s = encodeURIComponent(e), r = encodeURIComponent(
|
|
@@ -338,8 +338,9 @@ class S {
|
|
|
338
338
|
}
|
|
339
339
|
/**
|
|
340
340
|
* Creates a new encrypted connection
|
|
341
|
+
* @template T Type of component request
|
|
341
342
|
* @param data The component request data to encrypt and store
|
|
342
|
-
* @param participants
|
|
343
|
+
* @param metadata Connection metadata including participants and transaction type
|
|
343
344
|
* @returns Promise resolving to connection details including ID, version, and encryption key
|
|
344
345
|
*/
|
|
345
346
|
async create(e, n) {
|
|
@@ -367,9 +368,12 @@ class S {
|
|
|
367
368
|
}
|
|
368
369
|
/**
|
|
369
370
|
* Updates an existing connection with new encrypted data
|
|
371
|
+
* @template T Type of component request
|
|
370
372
|
* @param id Connection ID
|
|
371
373
|
* @param data New data to encrypt and store
|
|
372
374
|
* @param version Current version number
|
|
375
|
+
* @param status New connection status
|
|
376
|
+
* @param key Current encryption key
|
|
373
377
|
* @returns Promise resolving to updated connection details including new encryption key
|
|
374
378
|
*/
|
|
375
379
|
async update(e, n, s, r, i) {
|
|
@@ -398,6 +402,7 @@ class S {
|
|
|
398
402
|
}
|
|
399
403
|
/**
|
|
400
404
|
* Retrieves and decrypts connection data
|
|
405
|
+
* @template T Type of component request
|
|
401
406
|
* @param id Connection ID
|
|
402
407
|
* @param key Encryption key from previous create/update operation
|
|
403
408
|
* @returns Promise resolving to connection details including decrypted data
|
|
@@ -424,6 +429,7 @@ class S {
|
|
|
424
429
|
/**
|
|
425
430
|
* Closes a connection
|
|
426
431
|
* @param id Connection ID
|
|
432
|
+
* @returns Promise resolving when the connection is closed
|
|
427
433
|
*/
|
|
428
434
|
async close(e) {
|
|
429
435
|
const n = await fetch(`${this.endpoint}/${e}`, {
|
|
@@ -460,7 +466,7 @@ class k {
|
|
|
460
466
|
componentUrl(e, n, s, r) {
|
|
461
467
|
const i = new URL(this.uxUrl);
|
|
462
468
|
i.pathname = e;
|
|
463
|
-
const o =
|
|
469
|
+
const o = x({
|
|
464
470
|
authToken: this.authToken,
|
|
465
471
|
value: n,
|
|
466
472
|
configuration: s
|
|
@@ -478,7 +484,7 @@ class k {
|
|
|
478
484
|
* @internal
|
|
479
485
|
*/
|
|
480
486
|
createComponent(e, n, s, r) {
|
|
481
|
-
return new
|
|
487
|
+
return new _(
|
|
482
488
|
this.componentUrl(e, n, s, r),
|
|
483
489
|
n,
|
|
484
490
|
s
|
|
@@ -556,15 +562,15 @@ export {
|
|
|
556
562
|
A as AgentType,
|
|
557
563
|
l as CMType,
|
|
558
564
|
S as ConnectionManager,
|
|
559
|
-
|
|
560
|
-
|
|
565
|
+
_ as EmbeddedComponent,
|
|
566
|
+
b as ErrorIdentifierCode,
|
|
561
567
|
E as HMType,
|
|
562
568
|
y as PersonType,
|
|
563
|
-
|
|
569
|
+
C as ProofStatus,
|
|
564
570
|
U as ProofTypes,
|
|
565
571
|
I as Status,
|
|
566
|
-
|
|
567
|
-
|
|
572
|
+
N as VASPSearchControl,
|
|
573
|
+
L as ValidationSections,
|
|
568
574
|
O as decodeFragmentToObject,
|
|
569
575
|
k as default,
|
|
570
576
|
M as getRefreshResult
|
package/dist/esm/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"packageManager": "yarn@4.5.1",
|
|
13
|
-
"version": "2.
|
|
13
|
+
"version": "2.10.0-next.4",
|
|
14
14
|
"source": "src/notabene.ts",
|
|
15
15
|
"main": "dist/cjs/notabene.cjs",
|
|
16
16
|
"module": "dist/esm/notabene.js",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"build:dev": "yarn build && yarn dev",
|
|
54
54
|
"build:clean": "rimraf dist ts-out coverage temp",
|
|
55
55
|
"build": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs && yarn docs",
|
|
56
|
+
"build:no-docs": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs",
|
|
56
57
|
"lint": "eslint . --max-warnings 0",
|
|
57
58
|
"lint:fix": "yarn lint --fix --cache --no-warn-ignored",
|
|
58
59
|
"format": "prettier --write --cache .",
|
package/dist/notabene.d.ts
CHANGED
|
@@ -218,7 +218,9 @@ export declare enum CMType {
|
|
|
218
218
|
READY = "ready",
|
|
219
219
|
INVALID = "invalid",
|
|
220
220
|
ERROR = "error",
|
|
221
|
-
CANCEL = "cancel"
|
|
221
|
+
CANCEL = "cancel",
|
|
222
|
+
WARNING = "warning",
|
|
223
|
+
INFO = "info"
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
/**
|
|
@@ -249,11 +251,14 @@ export declare type Completed<T> = {
|
|
|
249
251
|
* @see {@link Completed} For successful completion message format
|
|
250
252
|
* @see {@link Cancel} For cancellation message format
|
|
251
253
|
* @see {@link Error} For error message format
|
|
254
|
+
* @see {@link Ready} For ready message format
|
|
252
255
|
* @see {@link ResizeRequest} For resize message format
|
|
253
256
|
* @see {@link InvalidValue} For validation failure message format
|
|
257
|
+
* @see {@link Warning} For warning message format
|
|
258
|
+
* @see {@link Info} For info message format
|
|
254
259
|
* @public
|
|
255
260
|
*/
|
|
256
|
-
export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T
|
|
261
|
+
export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T> | Warning | Info;
|
|
257
262
|
|
|
258
263
|
/**
|
|
259
264
|
* Base interface for requests sent to SDK components
|
|
@@ -303,10 +308,10 @@ export declare interface ComponentResponse {
|
|
|
303
308
|
}
|
|
304
309
|
|
|
305
310
|
export declare interface ConnectionData<T extends ComponentRequest> {
|
|
306
|
-
tx: T;
|
|
307
|
-
authToken?: string;
|
|
308
|
-
txOptions?: TransactionOptions;
|
|
309
|
-
result?: TransactionResponse<T>;
|
|
311
|
+
readonly tx: T;
|
|
312
|
+
readonly authToken?: string;
|
|
313
|
+
readonly txOptions?: TransactionOptions;
|
|
314
|
+
readonly result?: TransactionResponse<T>;
|
|
310
315
|
}
|
|
311
316
|
|
|
312
317
|
/**
|
|
@@ -317,21 +322,26 @@ export declare class ConnectionManager {
|
|
|
317
322
|
constructor(endpoint: string);
|
|
318
323
|
/**
|
|
319
324
|
* Creates a new encrypted connection
|
|
325
|
+
* @template T Type of component request
|
|
320
326
|
* @param data The component request data to encrypt and store
|
|
321
|
-
* @param participants
|
|
327
|
+
* @param metadata Connection metadata including participants and transaction type
|
|
322
328
|
* @returns Promise resolving to connection details including ID, version, and encryption key
|
|
323
329
|
*/
|
|
324
330
|
create<T extends ComponentRequest>(data: ConnectionData<T>, metadata: ConnectionMetadata): Promise<ConnectionResponse<T>>;
|
|
325
331
|
/**
|
|
326
332
|
* Updates an existing connection with new encrypted data
|
|
333
|
+
* @template T Type of component request
|
|
327
334
|
* @param id Connection ID
|
|
328
335
|
* @param data New data to encrypt and store
|
|
329
336
|
* @param version Current version number
|
|
337
|
+
* @param status New connection status
|
|
338
|
+
* @param key Current encryption key
|
|
330
339
|
* @returns Promise resolving to updated connection details including new encryption key
|
|
331
340
|
*/
|
|
332
341
|
update<T extends ComponentRequest>(id: UUID, data: ConnectionData<T>, version: number, status: ConnectionStatus, key: string): Promise<ConnectionResponse<T>>;
|
|
333
342
|
/**
|
|
334
343
|
* Retrieves and decrypts connection data
|
|
344
|
+
* @template T Type of component request
|
|
335
345
|
* @param id Connection ID
|
|
336
346
|
* @param key Encryption key from previous create/update operation
|
|
337
347
|
* @returns Promise resolving to connection details including decrypted data
|
|
@@ -340,14 +350,16 @@ export declare class ConnectionManager {
|
|
|
340
350
|
/**
|
|
341
351
|
* Closes a connection
|
|
342
352
|
* @param id Connection ID
|
|
353
|
+
* @returns Promise resolving when the connection is closed
|
|
343
354
|
*/
|
|
344
355
|
close(id: UUID): Promise<void>;
|
|
345
356
|
}
|
|
346
357
|
|
|
347
358
|
export declare interface ConnectionMetadata {
|
|
348
|
-
nodeUrl?: string;
|
|
349
|
-
participants: string[];
|
|
350
|
-
transactionType: TransactionType;
|
|
359
|
+
readonly nodeUrl?: string;
|
|
360
|
+
readonly participants: readonly string[];
|
|
361
|
+
readonly transactionType: TransactionType;
|
|
362
|
+
readonly locale?: string;
|
|
351
363
|
}
|
|
352
364
|
|
|
353
365
|
/**
|
|
@@ -365,21 +377,29 @@ export declare interface ConnectionRequest extends ComponentRequest {
|
|
|
365
377
|
}
|
|
366
378
|
|
|
367
379
|
export declare interface ConnectionResponse<T extends ComponentRequest> {
|
|
368
|
-
id: UUID;
|
|
369
|
-
version: number;
|
|
370
|
-
status: ConnectionStatus;
|
|
371
|
-
metadata: ConnectionMetadata;
|
|
372
|
-
data: ConnectionData<T>;
|
|
373
|
-
key: string;
|
|
380
|
+
readonly id: UUID;
|
|
381
|
+
readonly version: number;
|
|
382
|
+
readonly status: ConnectionStatus;
|
|
383
|
+
readonly metadata: ConnectionMetadata;
|
|
384
|
+
readonly data: ConnectionData<T>;
|
|
385
|
+
readonly key: string;
|
|
374
386
|
}
|
|
375
387
|
|
|
376
|
-
export declare
|
|
377
|
-
id: UUID;
|
|
378
|
-
metadata: ConnectionMetadata;
|
|
379
|
-
status:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
388
|
+
export declare type ConnectionResult<T extends ComponentRequest> = {
|
|
389
|
+
readonly id: UUID;
|
|
390
|
+
readonly metadata: ConnectionMetadata;
|
|
391
|
+
readonly status: 'closed';
|
|
392
|
+
} | {
|
|
393
|
+
readonly id: UUID;
|
|
394
|
+
readonly metadata: ConnectionMetadata;
|
|
395
|
+
readonly status: 'completed';
|
|
396
|
+
readonly result: TransactionResponse<T>;
|
|
397
|
+
} | {
|
|
398
|
+
readonly id: UUID;
|
|
399
|
+
readonly metadata: ConnectionMetadata;
|
|
400
|
+
readonly status: 'active';
|
|
401
|
+
readonly tx: T;
|
|
402
|
+
};
|
|
383
403
|
|
|
384
404
|
export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
|
|
385
405
|
|
|
@@ -666,7 +686,6 @@ export declare enum ErrorIdentifierCode {
|
|
|
666
686
|
*/
|
|
667
687
|
export declare type FieldOptions = boolean | string[] | {
|
|
668
688
|
optional: boolean;
|
|
669
|
-
transmit: boolean;
|
|
670
689
|
};
|
|
671
690
|
|
|
672
691
|
/**
|
|
@@ -678,6 +697,12 @@ export declare type FieldTypes = {
|
|
|
678
697
|
legalPerson?: LegalPersonFields;
|
|
679
698
|
};
|
|
680
699
|
|
|
700
|
+
/**
|
|
701
|
+
* Retrieves and processes connection refresh data
|
|
702
|
+
* @template T Type of component request
|
|
703
|
+
* @param refreshSource Source information for the refresh operation
|
|
704
|
+
* @returns Promise resolving to connection result with decrypted data
|
|
705
|
+
*/
|
|
681
706
|
export declare function getRefreshResult<T extends ComponentRequest>(refreshSource: RefreshSource): Promise<ConnectionResult<T>>;
|
|
682
707
|
|
|
683
708
|
/**
|
|
@@ -712,6 +737,18 @@ export declare enum HMType {
|
|
|
712
737
|
*/
|
|
713
738
|
export declare type HostMessage<T, O> = UpdateValue<T, O>;
|
|
714
739
|
|
|
740
|
+
/**
|
|
741
|
+
* Represents an info component message
|
|
742
|
+
* @param message - Info message
|
|
743
|
+
* @param description - Description of the info message
|
|
744
|
+
* @public
|
|
745
|
+
*/
|
|
746
|
+
declare type Info = {
|
|
747
|
+
type: CMType.INFO;
|
|
748
|
+
message: string;
|
|
749
|
+
description?: string;
|
|
750
|
+
};
|
|
751
|
+
|
|
715
752
|
/**
|
|
716
753
|
* Intermediary VASP
|
|
717
754
|
* Represents an intermediary Virtual Asset Service Provider
|
|
@@ -1375,7 +1412,8 @@ export declare enum ProofTypes {
|
|
|
1375
1412
|
CIP8 = "cip-8",
|
|
1376
1413
|
MicroTransfer = "microtransfer",
|
|
1377
1414
|
Screenshot = "screenshot",
|
|
1378
|
-
Connect = "connect"
|
|
1415
|
+
Connect = "connect",
|
|
1416
|
+
CONCORDIUM = "concordium"
|
|
1379
1417
|
}
|
|
1380
1418
|
|
|
1381
1419
|
/**
|
|
@@ -1433,7 +1471,7 @@ export declare interface ScreenshotProof extends OwnershipProof {
|
|
|
1433
1471
|
* @public
|
|
1434
1472
|
*/
|
|
1435
1473
|
export declare interface SignatureProof extends OwnershipProof {
|
|
1436
|
-
type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.XLM_ED25519;
|
|
1474
|
+
type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
|
|
1437
1475
|
proof: string;
|
|
1438
1476
|
attestation: string;
|
|
1439
1477
|
wallet_provider: string;
|
|
@@ -1547,6 +1585,7 @@ export declare interface TransactionOptions {
|
|
|
1547
1585
|
fallbacks?: ProofTypes[];
|
|
1548
1586
|
deminimis?: ThresholdOptions;
|
|
1549
1587
|
};
|
|
1588
|
+
jurisdiction?: string;
|
|
1550
1589
|
allowedAgentTypes?: AgentType[];
|
|
1551
1590
|
allowedCounterpartyTypes?: PersonType[];
|
|
1552
1591
|
fields?: FieldTypes;
|
|
@@ -1727,6 +1766,7 @@ export declare interface VASP extends Agent {
|
|
|
1727
1766
|
logo?: URI;
|
|
1728
1767
|
website?: URI;
|
|
1729
1768
|
countryOfRegistration?: ISOCountryCode;
|
|
1769
|
+
jurisdictions?: string;
|
|
1730
1770
|
}
|
|
1731
1771
|
|
|
1732
1772
|
/**
|
|
@@ -1761,6 +1801,18 @@ export declare interface Wallet extends Agent {
|
|
|
1761
1801
|
wallet_connect_id?: string;
|
|
1762
1802
|
}
|
|
1763
1803
|
|
|
1804
|
+
/**
|
|
1805
|
+
* Represents a warning component message
|
|
1806
|
+
* @param message - Warning message
|
|
1807
|
+
* @param description - Description of the warning message
|
|
1808
|
+
* @public
|
|
1809
|
+
*/
|
|
1810
|
+
declare type Warning = {
|
|
1811
|
+
type: CMType.WARNING;
|
|
1812
|
+
message: string;
|
|
1813
|
+
description?: string;
|
|
1814
|
+
};
|
|
1815
|
+
|
|
1764
1816
|
/**
|
|
1765
1817
|
* An object representing a withdrawal transaction
|
|
1766
1818
|
* @public
|
package/dist/notabene.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var g = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var a = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}),
|
|
5
|
-
class
|
|
4
|
+
var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
|
|
5
|
+
class R {
|
|
6
6
|
constructor() {
|
|
7
7
|
a(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
8
|
a(this, "port");
|
|
@@ -68,7 +68,7 @@ class _ {
|
|
|
68
68
|
this.port && this.port.postMessage(e);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class _ {
|
|
72
72
|
/**
|
|
73
73
|
* Creates an instance of EmbeddedComponent.
|
|
74
74
|
* @param url - The URL of the embedded component
|
|
@@ -82,7 +82,7 @@ class x {
|
|
|
82
82
|
a(this, "iframe");
|
|
83
83
|
a(this, "eventManager");
|
|
84
84
|
a(this, "modal");
|
|
85
|
-
this._url = e, this._value = n, this._options = s, this.eventManager = new
|
|
85
|
+
this._url = e, this._value = n, this._options = s, this.eventManager = new R(), this.on(l.INVALID, (r) => {
|
|
86
86
|
r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
|
|
87
87
|
}), this.on(l.RESIZE, (r) => {
|
|
88
88
|
r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
|
|
@@ -237,7 +237,7 @@ class x {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function x(t) {
|
|
241
241
|
return Object.entries(t).map(([e, n]) => {
|
|
242
242
|
if (n == null) return;
|
|
243
243
|
const s = encodeURIComponent(e), r = encodeURIComponent(
|
|
@@ -338,8 +338,9 @@ class S {
|
|
|
338
338
|
}
|
|
339
339
|
/**
|
|
340
340
|
* Creates a new encrypted connection
|
|
341
|
+
* @template T Type of component request
|
|
341
342
|
* @param data The component request data to encrypt and store
|
|
342
|
-
* @param participants
|
|
343
|
+
* @param metadata Connection metadata including participants and transaction type
|
|
343
344
|
* @returns Promise resolving to connection details including ID, version, and encryption key
|
|
344
345
|
*/
|
|
345
346
|
async create(e, n) {
|
|
@@ -367,9 +368,12 @@ class S {
|
|
|
367
368
|
}
|
|
368
369
|
/**
|
|
369
370
|
* Updates an existing connection with new encrypted data
|
|
371
|
+
* @template T Type of component request
|
|
370
372
|
* @param id Connection ID
|
|
371
373
|
* @param data New data to encrypt and store
|
|
372
374
|
* @param version Current version number
|
|
375
|
+
* @param status New connection status
|
|
376
|
+
* @param key Current encryption key
|
|
373
377
|
* @returns Promise resolving to updated connection details including new encryption key
|
|
374
378
|
*/
|
|
375
379
|
async update(e, n, s, r, i) {
|
|
@@ -398,6 +402,7 @@ class S {
|
|
|
398
402
|
}
|
|
399
403
|
/**
|
|
400
404
|
* Retrieves and decrypts connection data
|
|
405
|
+
* @template T Type of component request
|
|
401
406
|
* @param id Connection ID
|
|
402
407
|
* @param key Encryption key from previous create/update operation
|
|
403
408
|
* @returns Promise resolving to connection details including decrypted data
|
|
@@ -424,6 +429,7 @@ class S {
|
|
|
424
429
|
/**
|
|
425
430
|
* Closes a connection
|
|
426
431
|
* @param id Connection ID
|
|
432
|
+
* @returns Promise resolving when the connection is closed
|
|
427
433
|
*/
|
|
428
434
|
async close(e) {
|
|
429
435
|
const n = await fetch(`${this.endpoint}/${e}`, {
|
|
@@ -460,7 +466,7 @@ class k {
|
|
|
460
466
|
componentUrl(e, n, s, r) {
|
|
461
467
|
const i = new URL(this.uxUrl);
|
|
462
468
|
i.pathname = e;
|
|
463
|
-
const o =
|
|
469
|
+
const o = x({
|
|
464
470
|
authToken: this.authToken,
|
|
465
471
|
value: n,
|
|
466
472
|
configuration: s
|
|
@@ -478,7 +484,7 @@ class k {
|
|
|
478
484
|
* @internal
|
|
479
485
|
*/
|
|
480
486
|
createComponent(e, n, s, r) {
|
|
481
|
-
return new
|
|
487
|
+
return new _(
|
|
482
488
|
this.componentUrl(e, n, s, r),
|
|
483
489
|
n,
|
|
484
490
|
s
|
|
@@ -556,15 +562,15 @@ export {
|
|
|
556
562
|
A as AgentType,
|
|
557
563
|
l as CMType,
|
|
558
564
|
S as ConnectionManager,
|
|
559
|
-
|
|
560
|
-
|
|
565
|
+
_ as EmbeddedComponent,
|
|
566
|
+
b as ErrorIdentifierCode,
|
|
561
567
|
E as HMType,
|
|
562
568
|
y as PersonType,
|
|
563
|
-
|
|
569
|
+
C as ProofStatus,
|
|
564
570
|
U as ProofTypes,
|
|
565
571
|
I as Status,
|
|
566
|
-
|
|
567
|
-
|
|
572
|
+
N as VASPSearchControl,
|
|
573
|
+
L as ValidationSections,
|
|
568
574
|
O as decodeFragmentToObject,
|
|
569
575
|
k as default,
|
|
570
576
|
M as getRefreshResult
|