@notabene/javascript-sdk 2.10.0 → 2.11.0-next.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.
Files changed (139) hide show
  1. package/dist/cjs/notabene.cjs +1 -1
  2. package/dist/cjs/notabene.d.ts +77 -2
  3. package/dist/cjs/package.json +1 -1
  4. package/dist/esm/notabene.d.ts +77 -2
  5. package/dist/esm/notabene.js +19 -19
  6. package/dist/esm/package.json +1 -1
  7. package/dist/notabene.d.ts +77 -2
  8. package/dist/notabene.js +19 -19
  9. package/docs/README.md +227 -51
  10. package/docs/_media/TransactionOptions.md +19 -9
  11. package/docs/_media/getRefreshResult.md +35 -0
  12. package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
  13. package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
  14. package/docs/ivms/types/type-aliases/Address.md +1 -1
  15. package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
  16. package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
  17. package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
  18. package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
  19. package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
  20. package/docs/ivms/types/type-aliases/ISODate.md +1 -1
  21. package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
  22. package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
  23. package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
  24. package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
  25. package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
  26. package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
  27. package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
  28. package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
  29. package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
  30. package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
  31. package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
  32. package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
  33. package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
  34. package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
  35. package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
  36. package/docs/ivms/types/type-aliases/Originator.md +1 -1
  37. package/docs/ivms/types/type-aliases/Person.md +1 -1
  38. package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
  39. package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
  40. package/docs/notabene/README.md +7 -1
  41. package/docs/notabene/classes/ConnectionManager.md +19 -5
  42. package/docs/notabene/classes/EmbeddedComponent.md +17 -17
  43. package/docs/notabene/classes/default.md +7 -7
  44. package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
  45. package/docs/notabene/functions/getRefreshResult.md +11 -3
  46. package/docs/notabene/interfaces/ConnectionData.md +8 -8
  47. package/docs/notabene/interfaces/ConnectionMetadata.md +6 -6
  48. package/docs/notabene/interfaces/ConnectionResponse.md +12 -12
  49. package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
  50. package/docs/notabene/type-aliases/ConnectionResult.md +17 -0
  51. package/docs/notabene/type-aliases/ConnectionStatus.md +1 -1
  52. package/docs/notabene/type-aliases/MessageCallback.md +1 -1
  53. package/docs/notabene/type-aliases/TransactionType.md +1 -1
  54. package/docs/types/README.md +3 -0
  55. package/docs/types/enumerations/AgentType.md +2 -2
  56. package/docs/types/enumerations/CMType.md +27 -7
  57. package/docs/types/enumerations/ErrorIdentifierCode.md +4 -4
  58. package/docs/types/enumerations/HMType.md +2 -2
  59. package/docs/types/enumerations/PersonType.md +3 -3
  60. package/docs/types/enumerations/ProofStatus.md +4 -4
  61. package/docs/types/enumerations/ProofTypes.md +39 -17
  62. package/docs/types/enumerations/Status.md +5 -5
  63. package/docs/types/enumerations/VASPSearchControl.md +2 -2
  64. package/docs/types/enumerations/ValidationSections.md +4 -4
  65. package/docs/types/interfaces/Account.md +59 -0
  66. package/docs/types/interfaces/Agent.md +6 -6
  67. package/docs/types/interfaces/CallbackOptions.md +2 -2
  68. package/docs/types/interfaces/ComponentRequest.md +2 -2
  69. package/docs/types/interfaces/ComponentResponse.md +4 -4
  70. package/docs/types/interfaces/ConnectionRecord.md +7 -7
  71. package/docs/types/interfaces/ConnectionRequest.md +3 -3
  72. package/docs/types/interfaces/Counterparty.md +10 -10
  73. package/docs/types/interfaces/DeclarationProof.md +6 -6
  74. package/docs/types/interfaces/Deposit.md +25 -11
  75. package/docs/types/interfaces/DepositRequest.md +9 -9
  76. package/docs/types/interfaces/DepositRequestOptions.md +1 -1
  77. package/docs/types/interfaces/DepositTransaction.md +23 -9
  78. package/docs/types/interfaces/LegalPerson.md +13 -13
  79. package/docs/types/interfaces/MicroTransferProof.md +9 -9
  80. package/docs/types/interfaces/NaturalPerson.md +13 -13
  81. package/docs/types/interfaces/OwnershipProof.md +4 -4
  82. package/docs/types/interfaces/RefreshSource.md +2 -2
  83. package/docs/types/interfaces/Refreshable.md +1 -1
  84. package/docs/types/interfaces/ScreenshotProof.md +5 -5
  85. package/docs/types/interfaces/SignatureProof.md +14 -12
  86. package/docs/types/interfaces/ThresholdOptions.md +3 -3
  87. package/docs/types/interfaces/Transaction.md +18 -8
  88. package/docs/types/interfaces/TransactionOptions.md +19 -9
  89. package/docs/types/interfaces/TransactionResponse.md +9 -9
  90. package/docs/types/interfaces/VASP.md +19 -9
  91. package/docs/types/interfaces/Wallet.md +8 -8
  92. package/docs/types/interfaces/Withdrawal.md +24 -10
  93. package/docs/types/type-aliases/BlockchainAddress.md +1 -1
  94. package/docs/types/type-aliases/CAIP10.md +1 -1
  95. package/docs/types/type-aliases/CAIP19.md +1 -1
  96. package/docs/types/type-aliases/CAIP2.md +1 -1
  97. package/docs/types/type-aliases/CAIP220.md +1 -1
  98. package/docs/types/type-aliases/Cancel.md +1 -1
  99. package/docs/types/type-aliases/Completed.md +1 -1
  100. package/docs/types/type-aliases/ComponentMessage.md +5 -2
  101. package/docs/types/type-aliases/ConnectionOptions.md +1 -1
  102. package/docs/types/type-aliases/CounterpartyAssistConfig.md +2 -2
  103. package/docs/types/type-aliases/CryptoCredential.md +1 -1
  104. package/docs/types/type-aliases/DID.md +1 -1
  105. package/docs/types/type-aliases/DTI.md +1 -1
  106. package/docs/types/type-aliases/Destination.md +1 -1
  107. package/docs/types/type-aliases/Error.md +1 -1
  108. package/docs/types/type-aliases/FieldOptions.md +2 -2
  109. package/docs/types/type-aliases/FieldTypes.md +1 -1
  110. package/docs/types/type-aliases/HostMessage.md +1 -1
  111. package/docs/types/type-aliases/ISOCurrency.md +1 -1
  112. package/docs/types/type-aliases/Info.md +37 -0
  113. package/docs/types/type-aliases/InvalidValue.md +1 -1
  114. package/docs/types/type-aliases/LEI.md +1 -1
  115. package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
  116. package/docs/types/type-aliases/LegalPersonFields.md +1 -1
  117. package/docs/types/type-aliases/NationalIdentifierTypeFieldOptions.md +1 -1
  118. package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
  119. package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
  120. package/docs/types/type-aliases/NotabeneAsset.md +1 -1
  121. package/docs/types/type-aliases/Ready.md +1 -1
  122. package/docs/types/type-aliases/ResizeRequest.md +1 -1
  123. package/docs/types/type-aliases/Source.md +1 -1
  124. package/docs/types/type-aliases/Theme.md +1 -1
  125. package/docs/types/type-aliases/TransactionAsset.md +1 -1
  126. package/docs/types/type-aliases/TravelAddress.md +1 -1
  127. package/docs/types/type-aliases/URI.md +1 -1
  128. package/docs/types/type-aliases/UUID.md +1 -1
  129. package/docs/types/type-aliases/UpdateValue.md +1 -1
  130. package/docs/types/type-aliases/V1Asset.md +1 -1
  131. package/docs/types/type-aliases/V1Transaction.md +1 -1
  132. package/docs/types/type-aliases/VASPOptions.md +1 -1
  133. package/docs/types/type-aliases/ValidationError.md +1 -1
  134. package/docs/types/type-aliases/Warning.md +37 -0
  135. package/package.json +1 -1
  136. package/src/notabene.ts +6 -0
  137. package/src/types.ts +81 -4
  138. package/src/utils/connections.ts +1 -0
  139. package/docs/notabene/interfaces/ConnectionResult.md +0 -61
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 || {}), 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))(U || {});
5
- class _ {
4
+ var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), I = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(I || {}), y = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(y || {}), 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 || {}), C = /* @__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))(C || {}), p = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(p || {}), b = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(b || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.SOL_SIWX = "sol-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.COSMOS = "cosmos-ecdsa", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
5
+ class O {
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 x {
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 _(), this.on(l.INVALID, (r) => {
85
+ this._url = e, this._value = n, this._options = s, this.eventManager = new O(), 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`);
@@ -166,7 +166,7 @@ class x {
166
166
  * @param value - The new transaction value
167
167
  */
168
168
  update(e, n) {
169
- this._value = e, n && (this._options = n), this.send({ type: E.UPDATE, value: e, options: this._options });
169
+ this._value = e, n && (this._options = n), this.send({ type: p.UPDATE, value: e, options: this._options });
170
170
  }
171
171
  /**
172
172
  * Waits for the component to complete and returns the transaction response
@@ -237,7 +237,7 @@ class x {
237
237
  });
238
238
  }
239
239
  }
240
- function R(t) {
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(
@@ -247,7 +247,7 @@ function R(t) {
247
247
  return `${s}=${r}`;
248
248
  }).filter((e) => e !== void 0).join("&");
249
249
  }
250
- function O(t) {
250
+ function D(t) {
251
251
  const e = t.slice(1);
252
252
  return e ? e.split("&").filter(Boolean).reduce(
253
253
  (s, r) => {
@@ -257,7 +257,7 @@ function O(t) {
257
257
  {}
258
258
  ) : {};
259
259
  }
260
- async function p(t, e) {
260
+ async function E(t, e) {
261
261
  const n = JSON.stringify(t), s = new TextEncoder(), r = e ? m(e) : crypto.getRandomValues(new Uint8Array(32)), i = await crypto.subtle.importKey(
262
262
  "raw",
263
263
  r,
@@ -344,7 +344,7 @@ class M {
344
344
  * @returns Promise resolving to connection details including ID, version, and encryption key
345
345
  */
346
346
  async create(e, n) {
347
- const s = await p(e), r = {
347
+ const s = await E(e), r = {
348
348
  metadata: n,
349
349
  sealed: s.ciphertext
350
350
  }, i = await fetch(this.endpoint, {
@@ -377,7 +377,7 @@ class M {
377
377
  * @returns Promise resolving to updated connection details including new encryption key
378
378
  */
379
379
  async update(e, n, s, r, i) {
380
- const o = await p(n, i), c = {
380
+ const o = await E(n, i), c = {
381
381
  sealed: o.ciphertext,
382
382
  version: s,
383
383
  status: r
@@ -466,7 +466,7 @@ class k {
466
466
  componentUrl(e, n, s, r) {
467
467
  const i = new URL(this.uxUrl);
468
468
  i.pathname = e;
469
- const o = R({
469
+ const o = x({
470
470
  authToken: this.authToken,
471
471
  value: n,
472
472
  configuration: s
@@ -484,7 +484,7 @@ class k {
484
484
  * @internal
485
485
  */
486
486
  createComponent(e, n, s, r) {
487
- return new x(
487
+ return new _(
488
488
  this.componentUrl(e, n, s, r),
489
489
  n,
490
490
  s
@@ -562,16 +562,16 @@ export {
562
562
  A as AgentType,
563
563
  l as CMType,
564
564
  M as ConnectionManager,
565
- x as EmbeddedComponent,
566
- b as ErrorIdentifierCode,
567
- E as HMType,
568
- y as PersonType,
569
- C as ProofStatus,
565
+ _ as EmbeddedComponent,
566
+ C as ErrorIdentifierCode,
567
+ p as HMType,
568
+ I as PersonType,
569
+ b as ProofStatus,
570
570
  U as ProofTypes,
571
- I as Status,
571
+ y as Status,
572
572
  N as VASPSearchControl,
573
573
  L as ValidationSections,
574
- O as decodeFragmentToObject,
574
+ D as decodeFragmentToObject,
575
575
  k as default,
576
576
  S as getRefreshResult
577
577
  };
package/docs/README.md CHANGED
@@ -47,6 +47,11 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
47
47
  - [Parameters](#parameters-2)
48
48
  - [Deposit Assist](#deposit-assist)
49
49
  - [Parameters](#parameters-3)
50
+ - [Counterparty Assist](#counterparty-assist)
51
+ - [Use Cases](#use-cases)
52
+ - [Counterparty Assist Configuration](#counterparty-assist-configuration)
53
+ - [Component Response](#component-response)
54
+ - [Retrieving Completed Data](#retrieving-completed-data)
50
55
  - [Error handling](#error-handling)
51
56
  - [Error reference](#error-reference)
52
57
  - [Transaction parameters](#transaction-parameters)
@@ -67,6 +72,7 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
67
72
  - [Counterparty Field Properties](#counterparty-field-properties)
68
73
  - [Full Example](#full-example)
69
74
  - [Field reference](#field-reference)
75
+ - [Configure Counterparty Assist](#counterparty-assist-configuration)
70
76
  - [Locales](#locales)
71
77
  - [Theming](#theming)
72
78
  - [License](#license)
@@ -301,6 +307,10 @@ const withdrawal = notabene.createWithdrawalAssist({
301
307
  currency: 'USD', // ISO currency code
302
308
  price: 1700.12, // Asset price
303
309
  },
310
+ customer: {
311
+ name: 'John Smith',
312
+ email: "john.smith@domain.com",
313
+ },
304
314
  });
305
315
  ```
306
316
 
@@ -310,6 +320,7 @@ const withdrawal = notabene.createWithdrawalAssist({
310
320
  - `destination`: The destination or blockchain address for the withdrawal. See [Destination](#destination)
311
321
  - `amountDecimal`: The amount to transfer in decimal format. See [Transaction Amount](#transaction-amount)
312
322
  - `assetPrice`: Optional price information in a fiat currency. See [Asset Price](#asset-price)
323
+ - `customer`: Optional Customer object containing their name and email
313
324
 
314
325
  If any of the required parameters are missing the component will just show the Notabene badge.
315
326
 
@@ -327,6 +338,10 @@ const withdrawal = notabene.createWithdrawalAssist(
327
338
  currency: 'USD', // ISO currency code
328
339
  price: 1700.12, // Asset price
329
340
  },
341
+ customer: {
342
+ name: 'John Smith',
343
+ email: "john.smith@domain.com",
344
+ },
330
345
  },
331
346
  {
332
347
  proofs: {
@@ -346,6 +361,10 @@ See [Transaction Options](#transaction-options)
346
361
 
347
362
  The Connect Wallet component helps you collect and verify the address of your users self-hosted wallet in one go.
348
363
 
364
+ ### Parameters
365
+
366
+ - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
367
+
349
368
  ```js
350
369
  const connect = notabene.createConnectWallet({
351
370
  asset: 'ETH',
@@ -354,37 +373,12 @@ const connect = notabene.createConnectWallet({
354
373
  const { proof, txCreate } = await connect.openModal();
355
374
  ```
356
375
 
357
- ### Parameters
358
-
359
- - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
360
-
361
- ### Configuration Options
362
-
363
- Include configuration Options as a second optional parameter:
364
-
365
- ```js
366
- const connect = notabene.createConnectWallet(
367
- {
368
- asset: 'ETH',
369
- },
370
- {
371
- proofs: {
372
- microTransfer: {
373
- destination: '0x...',
374
- amountSubunits: '12344',
375
- timeout: 86440,
376
- },
377
- },
378
- },
379
- );
380
- ```
381
-
382
376
  ## Deposit Request
383
377
 
384
378
  The Deposit Request lets your customers request deposits that are fully Travel Rule compliant.
385
379
 
386
380
  ```js
387
- const withdrawal = notabene.createDepositRequest({
381
+ const depositRequest = notabene.createDepositRequest({
388
382
  asset: 'ETH',
389
383
  destination: '0x...',
390
384
  amountDecimal: 1.23,
@@ -398,7 +392,7 @@ const withdrawal = notabene.createDepositRequest({
398
392
 
399
393
  - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
400
394
  - `destination`: The destination or blockchain address for the withdrawal. See [Destination](#destination)
401
- - `amountDecimal`: The amount to deposit in decimal format. See [Transaction Amount](#transaction-amount)
395
+ - `amountDecimal`: Optional amount to deposit in decimal format. See [Transaction Amount](#transaction-amount)
402
396
  - `customer`: Optional Customer object containing their name
403
397
 
404
398
  If any of the required parameters are missing the component will just show the Notabene badge.
@@ -425,7 +419,7 @@ const deposit = notabene.createDepositAssist(
425
419
  ### Parameters
426
420
 
427
421
  - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
428
- - `source`: The source or blockchain address for the deposit. See [Source](#source)
422
+ - `source`: The source or blockchain address for the deposit. See [Origin](#origin)
429
423
  - `destination`: The destination or blockchain address for the deposit. See [Destination](#destination)
430
424
  - `amountDecimal`: Optional amount to deposit in decimal format. See [Transaction Amount](#transaction-amount)
431
425
  - `transactionId`: Optional transactionId of a Notabene transaction. Will be returned with the payload to assist updating the Transaction
@@ -434,6 +428,186 @@ If any of the required parameters are missing the component will just show the N
434
428
 
435
429
  ---
436
430
 
431
+ ## Counterparty Handoff
432
+
433
+ **Counterparty Assist** is a feature built into the existing **Withdrawal** and **Deposit Assist** components. When enabled, it allows users to hand off data collection to a counterparty — or to another device — by sharing a secure link. This helps ensure more accurate and complete information, especially when the counterparty is best suited to provide the required data.
434
+
435
+ This feature does not function as a standalone component. Instead, it augments the Withdrawal and Deposit flows when configured.
436
+
437
+ ### Use Cases
438
+
439
+ #### Third Parties (`natural`, `legal`)
440
+
441
+ During the counterparty data collection step, users can generate and share a link to allow third-party counterparties (individuals or organizations) to enter their own data. This ensures data accuracy and supports robust address verification by allowing the rightful owner to provide the necessary information.
442
+
443
+ #### First Parties (`self`)
444
+
445
+ During the address verification step, users can share a link to complete self-hosted wallet proof submissions on another device. This is especially useful if the original device used to initiate the process doesn't support signing or wallet access.
446
+
447
+ ### Counterparty Assist Configuration
448
+
449
+ You can enable **Counterparty Assist** by specifying the counterparty types you want the feature to apply to using the counterpartyAssist configuration field.
450
+
451
+ - `false`: Disable the feature explicitly
452
+ - `undefined` (not configured): Feature is disabled by default
453
+ - `{ counterpartyTypes: [PersonType.SELF, PersonType.NATURAL, PersonType.LEGAL] }`: Enable for specific counterparty types
454
+
455
+ **Example Config**
456
+
457
+ ```js
458
+ import Notabene, {
459
+ PersonType,
460
+ } from '@notabene/javascript-sdk';
461
+
462
+ // Counterparty assist is enabled for specific counterparty types
463
+ const options: TransactionOptions = {
464
+ ...
465
+ counterpartyAssist: {
466
+ counterpartyTypes: [
467
+ PersonType.LEGAL, // JS: 'legal'
468
+ PersonType.NATURAL, // JS: 'natural'
469
+ PersonType.SELF, // JS: 'self'
470
+ ],
471
+ }
472
+ };
473
+ ```
474
+
475
+ ### Component Response
476
+
477
+ The component emits a response once a participant has completed their portion of the process. Depending on the party type — **Third Party** (`natural`, `legal`) or **First Party** (`self`) — the behavior and expectations differ slightly.
478
+
479
+ #### Third Parties (`natural`, `legal`)
480
+
481
+ When a third party completes their step after following the shared link, the host application will receive a **`COMPLETE`** message from the component. However, because not all required data may be available at this point, the `response` object will include the information gathered so far, along with a `refreshSource` field. This allows the host to fetch the latest encrypted data once it's available.
482
+
483
+ ##### Refresh Source Fields
484
+
485
+ | Field | Type | Description |
486
+ |-------|--------|--------------------------------------------------------------------------------------------------|
487
+ | `url` | URI | The endpoint where the host can retrieve the encrypted data. |
488
+ | `key` | string | The encryption key used to decrypt the PII (Personally Identifiable Information). Not stored by Notabene. |
489
+
490
+ **Example Response**
491
+
492
+ ```js
493
+ {
494
+ type: CMType.COMPLETE, // 'complete'
495
+ response: { // transaciton data + refresh source
496
+ destination: "0xFf9A04788972C3803959454ECAE1ed327826a216",
497
+ asset: "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
498
+ customer: {
499
+ type: "natural",
500
+ name: "sdfsd",
501
+ email: "sdjlf@sdlfj.com"
502
+ },
503
+ amountDecimal: 100,
504
+ counterparty: {
505
+ type: "natural"
506
+ },
507
+ account: {
508
+ caip10: "eip155:1:0xFf9A04788972C3803959454ECAE1ed327826a216",
509
+ blockchainAddress: "0xFf9A04788972C3803959454ECAE1ed327826a216",
510
+ chain: "eip155:1",
511
+ did: "did:pkh:eip155:1:0xFf9A04788972C3803959454ECAE1ed327826a216",
512
+ valid: true
513
+ },
514
+ refreshSource: {
515
+ url: "https://safe-connections.notabene.id/17f76e4c-9a2a-4c34-afcb-b4868e609a96", // endpoint to retreive data
516
+ key: "1Lcp5SFhaMHH7CAEILrS8IWA6BXS4tFZunPx08WU5Ok=" // key that can be used to decrypt data
517
+ }
518
+ }
519
+ }
520
+ ```
521
+
522
+ #### First Parties (`self`)
523
+
524
+ When the user is the originator (i.e., acting on their own behalf), they complete the verification process via a shared link and are then prompted to return to the original page to continue.
525
+
526
+ Upon completion, the component emits a **`COMPLETE`** response. In this case, the component handles all necessary data updates internally, so **no additional action is required from the host** to retrieve updated data. The host can directly proceed to submit the transfer to the Notabene API.
527
+
528
+ ### Retrieving Completed Data
529
+ **(Third Parties Only: `natural`, `legal`)**
530
+
531
+ When data submission is handed off to third parties, we cannot predict how long it will take them to complete the process. For this reason, we provide the host with all the information needed to retrieve the data and allow them to design how the user experiences this flow.
532
+
533
+ To simplify retrieval and decryption, we provide an asynchronous [`getRefreshResult`](_media/getRefreshResult.md) function. It accepts a `refreshSource` and returns information about the associated transaction.
534
+
535
+ **Example**
536
+
537
+ ```js
538
+ import { getRefreshResult } from "@notabene/javascript-sdk";
539
+
540
+ const transaction = await getRefreshResult({
541
+ url: "https://safe-connections.notabene.id/17f76e4c-9a2a-4c34-afcb-b4868e609a96",
542
+ key: "1Lcp5SFhaMHH7CAEILrS8IWA6BXS4tFZunPx08WU5Ok="
543
+ })
544
+ ```
545
+
546
+ #### Response from `getRefreshResult`
547
+
548
+ | **Property** | **Type** | **Optional?** | **Description** |
549
+ |--------------|---------------------------------------|---------------|---------------------------------------------------------------------------------|
550
+ | `id` | `UUID` | No | Unique identifier for the transaction. |
551
+ | `metadata` | `ConnectionMetadata` | No | Metadata associated with the transaction. |
552
+ | `status` | `'active'` \| `'completed'` \| `'closed'` | No | Current status of the transaction’s data collection. |
553
+ | `tx` | `T` | Yes | Ongoing transaction data (available when status is `active`). |
554
+ | `result` | `TransactionResponse<T>` | Yes | Finalized transaction data (available when status is `completed`). |
555
+
556
+ **Example Active Transaction Data**
557
+
558
+ ```js
559
+ {
560
+ "id": "17f76e4c-9a2a-4c34-afcb-b4868e609a96",
561
+ "metadata": {
562
+ "participants": [
563
+ "did:ethr:0x54b75d2a0925508682e65194cccb6f1e8eaafb2c"
564
+ ],
565
+ "nodeUrl": "https://api-qa.eu.notabene.id",
566
+ "transactionType": "withdraw"
567
+ },
568
+ "status": "active",
569
+ "tx": {
570
+ //...
571
+ }
572
+ }
573
+ ```
574
+
575
+ **Example Completed Transaction Data**
576
+
577
+ ```js
578
+ {
579
+ "id": "17f76e4c-9a2a-4c34-afcb-b4868e609a96",
580
+ "metadata": {
581
+ "participants": [
582
+ "did:ethr:0x54b75d2a0925508682e65194cccb6f1e8eaafb2c" // DID of transaction participants
583
+ ],
584
+ "nodeUrl": "https://api-qa.eu.notabene.dev",
585
+ "transactionType": "withdraw"
586
+ },
587
+ "status": "completed",
588
+ "result": { // the response returned from the embedded component when all information is successfully collected
589
+ "proof": {
590
+ //...
591
+ },
592
+ "txCreate": {
593
+ //...
594
+ },
595
+ "errors": [],
596
+ "status": "pending",
597
+ "valid": true,
598
+ "value": {
599
+ //...
600
+ },
601
+ "ivms101": {
602
+ //...
603
+ }
604
+ }
605
+ }
606
+
607
+ ```
608
+
609
+ Once the host has retrieved the completed data, they can finalize the transaction by submitting it to the Notabene API.
610
+
437
611
  ## Error handling
438
612
 
439
613
  If any error occurs, the `error` event is passed containing a message.
@@ -484,7 +658,6 @@ The `asset` field the following types of assets specified:
484
658
 
485
659
  - `notabene_asset` code passed as a`string`. See [Notabene Assets Service](https://devx.notabene.id/docs/coins-decimals#assets-service-api).
486
660
  - [CAIP-19](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md_) is a chain agnostic format allows you to support the widest amount of assets and blockchains including NFTs.
487
- - [DTI](https://www.iso.org/standard/80601.html) is the ISO Digital Token Identifier format. See [DTI registry](https://dtif.org/registry-search/) for supported tokens.
488
661
 
489
662
  ### Transaction amount
490
663
 
@@ -501,18 +674,9 @@ Specify the beneficiary address as `destination` using one of the following form
501
674
  - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
502
675
  - Native blockchain address
503
676
 
504
- ### Origin
505
-
506
- Specify the originator address as `origin` using one of the following formats:
507
-
508
- - [CAIP-10](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md_) is a chain agnostic format allows you to specify the specific blockchain and address
509
- - [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) EVM URI
510
- - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
511
- - Native blockchain address
512
-
513
677
  ### Source
514
678
 
515
- Specify the source address as `source` using one of the following formats:
679
+ Specify the originator address as `source` using one of the following formats:
516
680
 
517
681
  - [CAIP-10](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md_) is a chain agnostic format allows you to specify the specific blockchain and address
518
682
  - [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) EVM URI
@@ -546,6 +710,7 @@ import Notabene, {
546
710
  } from '@notabene/javascript-sdk';
547
711
 
548
712
  const options: TransactionOptions = {
713
+ jurisdiction: "US", // Defaults to the jurisdiction associated with customer token
549
714
  proofs: {
550
715
  reuseProof: true, // Defaults true
551
716
  microTransfer: {
@@ -588,16 +753,23 @@ const options: TransactionOptions = {
588
753
  nationalIdentification: false,
589
754
  countryOfRegistration: true,
590
755
  },
591
- vasps: {
592
- addUnknown: true, // Allow users to add a missing VASP - Defaults to false
593
- onlyActive: true, // Only list active VASPs - Default false
594
- searchable: [
595
- VASPSearchControl.ALLOWED, // JS: 'allowed'
596
- VASPSearchControl.PENDING, // JS: 'pending'
597
- ], // Control searches for VASPs - Defaults to undefined
598
- },
599
756
  hide: [ValidationSections.ASSET, ValidationSections.DESTINATION], // Don't show specific sections of component
600
757
  },
758
+ vasps: {
759
+ addUnknown: true, // Allow users to add a missing VASP - Defaults to false
760
+ onlyActive: true, // Only list active VASPs - Default false
761
+ searchable: [
762
+ VASPSearchControl.ALLOWED, // JS: 'allowed'
763
+ VASPSearchControl.PENDING, // JS: 'pending'
764
+ ], // Control searches for VASPs - Defaults to undefined
765
+ },
766
+ counterpartyAssist: { // Allows users to share a link to collect counterparty data
767
+ counterpartyTypes: [
768
+ PersonType.LEGAL, // JS: 'legal'
769
+ PersonType.NATURAL, // JS: 'natural'
770
+ PersonType.SELF, // JS: 'self'
771
+ ],
772
+ }
601
773
  };
602
774
  const withdrawal = notabene.createWithdrawalAssist(tx, options);
603
775
  ```
@@ -739,9 +911,13 @@ The two options are:
739
911
 
740
912
  ### Counterparty Field Properties
741
913
 
742
- The fields requested from a customer about a counterparty can be configured with the fields object. You can configure required and optional fields individually for both natural and legal persons.
914
+ By default, counterparty fields are determined based on the rules of the jurisdiction associated with the VASP using the component. This ensures compliance even when fields are not explicitly configured.
915
+
916
+ If a specific jurisdiction is manually configured, the component will instead derive the fields according to that jurisdiction’s rules.
743
917
 
744
- We recommend working closely with your compliance team for this. Bearing in mind that different jurisdictions have different rules.
918
+ For VASPs seeking more granular control over the fields displayed to customers about counterparties, the fields object can be used to customize visibility. Required and optional fields can be configured independently for both natural and legal persons.
919
+
920
+ We recommend working closely with your compliance team when making these configurations, as regulatory requirements vary significantly across jurisdictions.
745
921
 
746
922
  Each field can be configured like this:
747
923
 
@@ -787,8 +963,8 @@ const options: TransactionOptions = {
787
963
  },
788
964
  legalPerson: {
789
965
  name: true, // Default true
790
- lei: true, // Default true
791
- website: { optional: true }, // Default true
966
+ lei: {optional: true }, // Default optional
967
+ website: { optional: true }, // Default optional
792
968
  email: true,
793
969
  phone: true,
794
970
  geographicAddress: false,
@@ -16,7 +16,7 @@ Configuration options for Transaction components
16
16
 
17
17
  #### Defined in
18
18
 
19
- [types.ts:844](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L844)
19
+ [types.ts:854](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L854)
20
20
 
21
21
  ***
22
22
 
@@ -26,17 +26,17 @@ Configuration options for Transaction components
26
26
 
27
27
  #### Defined in
28
28
 
29
- [types.ts:845](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L845)
29
+ [types.ts:855](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L855)
30
30
 
31
31
  ***
32
32
 
33
- ### counterpartyAssistConfig?
33
+ ### counterpartyAssist?
34
34
 
35
- > `optional` **counterpartyAssistConfig**: [`CounterpartyAssistConfig`](../type-aliases/CounterpartyAssistConfig.md)
35
+ > `optional` **counterpartyAssist**: [`CounterpartyAssistConfig`](../type-aliases/CounterpartyAssistConfig.md)
36
36
 
37
37
  #### Defined in
38
38
 
39
- [types.ts:849](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L849)
39
+ [types.ts:859](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L859)
40
40
 
41
41
  ***
42
42
 
@@ -46,7 +46,7 @@ Configuration options for Transaction components
46
46
 
47
47
  #### Defined in
48
48
 
49
- [types.ts:846](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L846)
49
+ [types.ts:856](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L856)
50
50
 
51
51
  ***
52
52
 
@@ -56,7 +56,17 @@ Configuration options for Transaction components
56
56
 
57
57
  #### Defined in
58
58
 
59
- [types.ts:848](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L848)
59
+ [types.ts:858](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L858)
60
+
61
+ ***
62
+
63
+ ### jurisdiction?
64
+
65
+ > `optional` **jurisdiction**: `string`
66
+
67
+ #### Defined in
68
+
69
+ [types.ts:853](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L853)
60
70
 
61
71
  ***
62
72
 
@@ -94,7 +104,7 @@ Configuration options for Transaction components
94
104
 
95
105
  #### Defined in
96
106
 
97
- [types.ts:834](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L834)
107
+ [types.ts:843](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L843)
98
108
 
99
109
  ***
100
110
 
@@ -104,4 +114,4 @@ Configuration options for Transaction components
104
114
 
105
115
  #### Defined in
106
116
 
107
- [types.ts:847](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/types.ts#L847)
117
+ [types.ts:857](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L857)
@@ -0,0 +1,35 @@
1
+ [**@notabene/javascript-sdk**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@notabene/javascript-sdk](../../modules.md) / [notabene](../README.md) / getRefreshResult
6
+
7
+ # Function: getRefreshResult()
8
+
9
+ > **getRefreshResult**\<`T`\>(`refreshSource`): `Promise`\<[`ConnectionResult`](../type-aliases/ConnectionResult.md)\<`T`\>\>
10
+
11
+ Retrieves and processes connection refresh data
12
+
13
+ ## Type Parameters
14
+
15
+ • **T** *extends* [`ComponentRequest`](../../types/interfaces/ComponentRequest.md)
16
+
17
+ Type of component request
18
+
19
+ ## Parameters
20
+
21
+ ### refreshSource
22
+
23
+ [`RefreshSource`](../../types/interfaces/RefreshSource.md)
24
+
25
+ Source information for the refresh operation
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<[`ConnectionResult`](../type-aliases/ConnectionResult.md)\<`T`\>\>
30
+
31
+ Promise resolving to connection result with decrypted data
32
+
33
+ ## Defined in
34
+
35
+ [utils/connections.ts:60](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/utils/connections.ts#L60)
@@ -18,7 +18,7 @@ Published May 2020
18
18
 
19
19
  #### Defined in
20
20
 
21
- [ivms/types.ts:365](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/ivms/types.ts#L365)
21
+ [ivms/types.ts:365](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/ivms/types.ts#L365)
22
22
 
23
23
  ***
24
24
 
@@ -30,4 +30,4 @@ Published August 2023
30
30
 
31
31
  #### Defined in
32
32
 
33
- [ivms/types.ts:367](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/ivms/types.ts#L367)
33
+ [ivms/types.ts:367](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/ivms/types.ts#L367)
@@ -19,7 +19,7 @@ The version of IVMS 101 to which the payload complies.
19
19
 
20
20
  #### Defined in
21
21
 
22
- [ivms/types.ts:358](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/ivms/types.ts#L358)
22
+ [ivms/types.ts:358](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/ivms/types.ts#L358)
23
23
 
24
24
  ***
25
25
 
@@ -31,4 +31,4 @@ The method used to map from a national system of writing to Latin script.
31
31
 
32
32
  #### Defined in
33
33
 
34
- [ivms/types.ts:356](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/ivms/types.ts#L356)
34
+ [ivms/types.ts:356](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/ivms/types.ts#L356)
@@ -111,4 +111,4 @@ Name of a built-up area, with defined boundaries, and a local government.
111
111
 
112
112
  ## Defined in
113
113
 
114
- [ivms/types.ts:119](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f6a0825d098b61a3bc31d6c197072643eb78a452/src/ivms/types.ts#L119)
114
+ [ivms/types.ts:119](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/ivms/types.ts#L119)