@notabene/javascript-sdk 2.4.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,32 +20,50 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
20
20
 
21
21
  ## Table of Contents
22
22
 
23
- - [Installation](#installation)
24
- - [Quick Start](#quick-start)
25
- - [Core Concepts](#core-concepts)
26
- - [Authentication](#authentication)
27
- - [General Component Usage](#general-component-usage)
28
- - [Embedded Component](#embedded-component)
29
- - [Dynamic updates](#dynamic-updates)
30
- - [Modal](#modal)
31
- - [Linked Component](#linked-component)
32
- - [Components](#components)
23
+ - [Notabene SafeConnect Components JavaScript SDK](#notabene-safeconnect-components-javascript-sdk)
24
+ - [Table of Contents](#table-of-contents)
25
+ - [Installation](#installation)
26
+ - [Quick Start](#quick-start)
27
+ - [Core Concepts](#core-concepts)
28
+ - [Authentication](#authentication)
29
+ - [General Component Usage](#general-component-usage)
30
+ - [Embedded Component](#embedded-component)
31
+ - [Dynamic updates](#dynamic-updates)
32
+ - [Modal](#modal)
33
+ - [Popup](#popup)
34
+ - [Linked Component](#linked-component)
35
+ - [Components](#components)
33
36
  - [Assisted Withdrawal](#assisted-withdrawal)
37
+ - [Parameters](#parameters)
38
+ - [Configuration Options](#configuration-options)
34
39
  - [Connect Wallet](#connect-wallet)
40
+ - [Parameters](#parameters-1)
41
+ - [Configuration Options](#configuration-options-1)
35
42
  - [Deposit Request](#deposit-request)
36
- - [Error handling](#error-handling)
37
- - [Transaction parameters](#transaction-parameters)
38
- - [Asset specification](#asset-specification)
39
- - [Transaction amount](#transaction-amount)
40
- - [Destination](#destination)
41
- - [Asset Price](#asset-price)
42
- - [Configuration](#configuration)
43
- - [Transaction Options](#transaction-options)
44
- - [Common use cases](#common-use-cases)
45
- - [Configuring ownership proofs](#configuring-ownership-proofs)
46
- - [Counterparty Field Properties](#counterparty-field-properties)
47
- - [Locales](#locales)
48
- - [License](#license)
43
+ - [Parameters](#parameters-2)
44
+ - [Deposit Assist](#deposit-assist)
45
+ - [Parameters](#parameters-3)
46
+ - [Error handling](#error-handling)
47
+ - [Transaction parameters](#transaction-parameters)
48
+ - [Asset specification](#asset-specification)
49
+ - [Transaction amount](#transaction-amount)
50
+ - [Destination](#destination)
51
+ - [Origin](#origin)
52
+ - [Asset Price](#asset-price)
53
+ - [Configuration](#configuration)
54
+ - [Transaction Options](#transaction-options)
55
+ - [Common use cases](#common-use-cases)
56
+ - [Only allow first party transactions](#only-allow-first-party-transactions)
57
+ - [Only VASP to VASP transactions](#only-vasp-to-vasp-transactions)
58
+ - [Only Self-hosted wallet transactions](#only-self-hosted-wallet-transactions)
59
+ - [Configuring ownership proofs](#configuring-ownership-proofs)
60
+ - [Supporting Micro Transactions (aka Satoshi tests)](#supporting-micro-transactions-aka-satoshi-tests)
61
+ - [Fallback Proof Options](#fallback-proof-options)
62
+ - [Counterparty Field Properties](#counterparty-field-properties)
63
+ - [Full Example](#full-example)
64
+ - [Field reference](#field-reference)
65
+ - [Locales](#locales)
66
+ - [License](#license)
49
67
 
50
68
  ## Installation
51
69
 
@@ -371,6 +389,33 @@ const withdrawal = notabene.createDepositRequest({
371
389
 
372
390
  If any of the required parameters are missing the component will just show the Notabene badge.
373
391
 
392
+ ## Deposit Assist
393
+
394
+ The Deposit Assist component helps you collect missing Travel Rule data after a deposit has already been recorded on-chain. For example, if the deposit arrived with incomplete originator information, you can use Deposit Assist to request this information from your end-user.
395
+
396
+ ```js
397
+ const deposit = notabene.createDepositAssist(
398
+ {
399
+ asset: 'ETH',
400
+ amountDecimal: 1.23,
401
+ origin: '0x...',
402
+ destination: '0x...',
403
+ },
404
+ {
405
+ // Optional transaction options
406
+ },
407
+ );
408
+ ```
409
+
410
+ ### Parameters
411
+
412
+ - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
413
+ - `origin`: The origin or blockchain address for the deposit. See [Origin](#origin)
414
+ - `destination`: The destination or blockchain address for the deposit. See [Destination](#destination)
415
+ - `amountDecimal`: Optional amount to deposit in decimal format. See [Transaction Amount](#transaction-amount)
416
+
417
+ If any of the required parameters are missing the component will just show the Notabene badge.
418
+
374
419
  ---
375
420
 
376
421
  ## Error handling
@@ -406,6 +451,15 @@ Specify the beneficiary address as `destination` using one of the following form
406
451
  - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
407
452
  - Native blockchain address
408
453
 
454
+ ### Origin
455
+
456
+ Specify the originator address as `origin` using one of the following formats:
457
+
458
+ - [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
459
+ - [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) EVM URI
460
+ - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
461
+ - Native blockchain address
462
+
409
463
  ### Asset Price
410
464
 
411
465
  The price of the asset is used to determine certain rules based on thresholds. We recommond you pass in your price like this:
@@ -479,8 +533,8 @@ const options: TransactionOptions = {
479
533
  onlyActive: true, // Only list active VASPs - Default false
480
534
  searchable: [
481
535
  VASPSearchControl.ALLOWED, // JS: 'allowed'
482
- VASPSearchControl.PENDING // JS: 'pending'
483
- ] // Control searches for VASPs - Defaults to undefined
536
+ VASPSearchControl.PENDING, // JS: 'pending'
537
+ ], // Control searches for VASPs - Defaults to undefined
484
538
  },
485
539
  hide: [ValidationSections.ASSET, ValidationSections.DESTINATION], // Don't show specific sections of component
486
540
  },
package/dist/notabene.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var w=Object.defineProperty;var I=(t,e,r)=>e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>I(t,typeof e!="symbol"?e+"":e,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var c=(t=>(t.PRIVATE="WALLET",t.VASP="VASP",t))(c||{}),m=(t=>(t.NATURAL="natural",t.LEGAL="legal",t.SELF="self",t))(m||{}),u=(t=>(t.EMPTY="empty",t.VERIFY="verify",t.PENDING="pending",t.VERIFIED="verified",t.BANNED="banned",t))(u||{}),E=(t=>(t.ALLOWED="allowed",t.PENDING="pending",t))(E||{}),f=(t=>(t.ASSET="asset",t.DESTINATION="destination",t.COUNTERPARTY="counterparty",t.AGENT="agent",t))(f||{}),a=(t=>(t.COMPLETE="complete",t.RESIZE="resize",t.RESULT="result",t.READY="ready",t.INVALID="invalid",t.ERROR="error",t.CANCEL="cancel",t))(a||{}),d=(t=>(t.UPDATE="update",t.REQUEST_RESPONSE="requestResponse",t))(d||{}),p=(t=>(t.PENDING="pending",t.FAILED="rejected",t.FLAGGED="flagged",t.VERIFIED="verified",t))(p||{}),v=(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.MicroTransfer="microtransfer",t.Screenshot="screenshot",t.Connect="connect",t))(v||{});class b{constructor(){o(this,"listeners",new Map);o(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,r){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(r),()=>this.off(e,r)}off(e,r){const i=this.listeners.get(e);i&&(i.delete(r),i.size===0&&this.listeners.delete(e))}handleMessage(e){const r=e.data;if(typeof r=="object"&&r!==null&&"type"in r){const i=r.type,s=this.listeners.get(i);s&&s.forEach(n=>n(r))}}send(e){this.port&&this.port.postMessage(e)}}class g{constructor(e,r,i){o(this,"_url");o(this,"_value");o(this,"_options");o(this,"_errors",[]);o(this,"iframe");o(this,"eventManager");o(this,"modal");this._url=e,this._value=r,this._options=i,this.eventManager=new b,this.on(a.INVALID,s=>{s.type===a.INVALID&&(this._errors=s.errors,this._value=s.value)}),this.on(a.RESIZE,s=>{s.type===a.RESIZE&&this.iframe&&(this.iframe.style.height=`${s.height}px`)})}get url(){return this._url}get value(){return this._value}get options(){return this._options}get errors(){return this._errors}open(){document.location.href=this.url}mount(e){const r=document.querySelector(e);if(!r)throw new Error(`parentID ${e} not found`);this.embed(r)}embed(e,r=!1){var i,s;this.removeEmbed(),this.iframe=document.createElement("iframe"),this.iframe.src=this.url+(r?"":"&embedded=true"),this.iframe.allow="web-share; clipboard-write; hid; bluetooth;",this.iframe.style.width="100%",this.iframe.style.height="0px",this.iframe.style.border="none",this.iframe.style.overflow="hidden",this.iframe.scrolling="no",e.appendChild(this.iframe),window.addEventListener("message",n=>{var l,h;n.source===((l=this.iframe)==null?void 0:l.contentWindow)&&((h=this.eventManager)==null||h.setPort(n.ports[0]))}),(s=(i=this.iframe)==null?void 0:i.contentWindow)==null||s.focus()}removeEmbed(){this.iframe&&this.iframe.remove()}send(e){this.eventManager.send(e)}on(e,r){return this.eventManager.on(e,r)}off(e,r){this.eventManager.off(e,r)}update(e,r){this._value=e,r&&(this._options=r),this.send({type:d.UPDATE,value:e,options:this._options})}completion(){return new Promise((e,r)=>{let i,s,n;function l(){i&&i(),s&&s(),n&&n()}i=this.on(a.COMPLETE,h=>{e(h.response),l()}),s=this.on(a.CANCEL,()=>{r(new Error("User cancelled")),l()}),n=this.on("error",h=>{r(new Error(h.message)),l()})})}async openModal(){this.modal&&this.closeModal(),this.modal=document.createElement("dialog"),this.modal.style.border="none",this.modal.style.backgroundColor="white",this.modal.style.maxWidth="100vw",this.modal.style.maxHeight="100vh",this.modal.style.width="600px",this.modal.style.height="600px",document.body.appendChild(this.modal),this.embed(this.modal,!0);const e=this.on(a.CANCEL,()=>{this.closeModal()}),r=this.on(a.COMPLETE,()=>{this.closeModal()});return this.modal.showModal(),this.modal.addEventListener("click",()=>{this.closeModal()}),this.completion().finally(()=>{e(),r()})}closeModal(){var e;this.modal&&((e=this.modal)==null||e.close(),this.modal.remove(),this.modal=void 0)}async popup(){const e=window.open(this.url,"_blank","popup=true,width=600,height=600");window.addEventListener("message",s=>{var n;s.source===e&&(console.log("received message from popup",s.data),(n=this.eventManager)==null||n.setPort(s.ports[0]))});const r=this.on(a.CANCEL,()=>{e==null||e.close()}),i=this.on(a.COMPLETE,()=>{e==null||e.close()});return this.completion().finally(()=>{r(),i()})}}function C(t){return Object.entries(t).map(([e,r])=>{if(r==null)return;const i=encodeURIComponent(e),s=encodeURIComponent(typeof r=="object"?JSON.stringify(r):String(r));return`${i}=${s}`}).filter(e=>e!==void 0).join("&")}function U(t){const e=t.slice(1);return e?e.split("&").filter(Boolean).reduce((i,s)=>{const[n,l]=s.split("=");return n&&(i[decodeURIComponent(n)]=l?decodeURIComponent(l):""),i},{}):{}}class A{constructor(e){o(this,"nodeUrl");o(this,"authToken");o(this,"uxUrl");o(this,"theme");o(this,"locale");this.uxUrl=e.uxUrl||"https://connect.notabene.id",this.nodeUrl=e.nodeUrl,this.authToken=e.authToken,this.theme=e.theme,this.locale=e.locale}componentUrl(e,r,i,s){const n=new URL(this.uxUrl);n.pathname=e;const l=C({authToken:this.authToken,value:r,configuration:i});return n.hash=l,this.nodeUrl&&n.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&n.searchParams.set("theme",JSON.stringify(this.theme)),this.locale&&n.searchParams.set("locale",this.locale),s&&(s.callback&&n.searchParams.set("callback_url",s.callback),s.redirectUri&&n.searchParams.set("redirect_uri",s.redirectUri)),n.toString()}createComponent(e,r,i,s){return new g(this.componentUrl(e,r,i,s),r,i)}createWithdrawalAssist(e,r,i){return this.createComponent("withdrawal-assist",e,r,i)}createConnectWallet(e,r,i){return this.createComponent("connect",e,r,i)}createDepositRequest(e,r,i){return this.createComponent("deposit-request",e,r,i)}}exports.AgentType=c;exports.CMType=a;exports.EmbeddedComponent=g;exports.HMType=d;exports.PersonType=m;exports.ProofStatus=p;exports.ProofTypes=v;exports.Status=u;exports.VASPSearchControl=E;exports.ValidationSections=f;exports.decodeFragmentToObject=U;exports.default=A;
1
+ "use strict";var L=Object.defineProperty;var A=(e,t,r)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var o=(e,t,r)=>A(e,typeof t!="symbol"?t+"":t,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var c=(e=>(e.PRIVATE="WALLET",e.VASP="VASP",e))(c||{}),m=(e=>(e.NATURAL="natural",e.LEGAL="legal",e.SELF="self",e))(m||{}),u=(e=>(e.EMPTY="empty",e.VERIFY="verify",e.PENDING="pending",e.VERIFIED="verified",e.BANNED="banned",e))(u||{}),E=(e=>(e.ALLOWED="allowed",e.PENDING="pending",e))(E||{}),p=(e=>(e.ASSET="asset",e.DESTINATION="destination",e.COUNTERPARTY="counterparty",e.AGENT="agent",e))(p||{}),a=(e=>(e.COMPLETE="complete",e.RESIZE="resize",e.RESULT="result",e.READY="ready",e.INVALID="invalid",e.ERROR="error",e.CANCEL="cancel",e))(a||{}),f=(e=>(e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",e.WALLET_NOT_SUPPORTED="WALLET_NOT_SUPPORTED",e.TOKEN_INVALID="TOKEN_INVALID",e))(f||{}),d=(e=>(e.UPDATE="update",e.REQUEST_RESPONSE="requestResponse",e))(d||{}),v=(e=>(e.PENDING="pending",e.FAILED="rejected",e.FLAGGED="flagged",e.VERIFIED="verified",e))(v||{}),I=(e=>(e.SelfDeclaration="self-declaration",e.SIWE="siwe",e.SIWX="siwx",e.EIP191="eip-191",e.EIP712="eip-712",e.EIP1271="eip-1271",e.BIP137="bip-137",e.BIP322="bip-322",e.BIP137_XPUB="xpub",e.TIP191="tip-191",e.ED25519="ed25519",e.MicroTransfer="microtransfer",e.Screenshot="screenshot",e.Connect="connect",e))(I||{});class N{constructor(){o(this,"listeners",new Map);o(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(t){this.port=t,this.port.onmessage=this.handleMessage,this.port.start()}on(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>this.off(t,r)}off(t,r){const s=this.listeners.get(t);s&&(s.delete(r),s.size===0&&this.listeners.delete(t))}handleMessage(t){const r=t.data;if(typeof r=="object"&&r!==null&&"type"in r){const s=r.type,i=this.listeners.get(s);i&&i.forEach(n=>n(r))}}send(t){this.port&&this.port.postMessage(t)}}class g{constructor(t,r,s){o(this,"_url");o(this,"_value");o(this,"_options");o(this,"_errors",[]);o(this,"iframe");o(this,"eventManager");o(this,"modal");this._url=t,this._value=r,this._options=s,this.eventManager=new N,this.on(a.INVALID,i=>{i.type===a.INVALID&&(this._errors=i.errors,this._value=i.value)}),this.on(a.RESIZE,i=>{i.type===a.RESIZE&&this.iframe&&(this.iframe.style.height=`${i.height}px`)})}get url(){return this._url}get value(){return this._value}get options(){return this._options}get errors(){return this._errors}open(){document.location.href=this.url}mount(t){const r=document.querySelector(t);if(!r)throw new Error(`parentID ${t} not found`);this.embed(r)}embed(t,r=!1){var s,i;this.removeEmbed(),this.iframe=document.createElement("iframe"),this.iframe.src=this.url+(r?"":"&embedded=true"),this.iframe.allow="web-share; clipboard-write; hid; bluetooth;",this.iframe.style.width="100%",this.iframe.style.height="0px",this.iframe.style.border="none",this.iframe.style.overflow="hidden",this.iframe.scrolling="no",t.appendChild(this.iframe),window.addEventListener("message",n=>{var l,h;n.source===((l=this.iframe)==null?void 0:l.contentWindow)&&((h=this.eventManager)==null||h.setPort(n.ports[0]))}),(i=(s=this.iframe)==null?void 0:s.contentWindow)==null||i.focus()}removeEmbed(){this.iframe&&this.iframe.remove()}send(t){this.eventManager.send(t)}on(t,r){return this.eventManager.on(t,r)}off(t,r){this.eventManager.off(t,r)}update(t,r){this._value=t,r&&(this._options=r),this.send({type:d.UPDATE,value:t,options:this._options})}completion(){return new Promise((t,r)=>{let s,i,n;function l(){s&&s(),i&&i(),n&&n()}s=this.on(a.COMPLETE,h=>{t(h.response),l()}),i=this.on(a.CANCEL,()=>{r(new Error("User cancelled")),l()}),n=this.on("error",h=>{r(new Error(h.message)),l()})})}async openModal(){this.modal&&this.closeModal(),this.modal=document.createElement("dialog"),this.modal.style.border="none",this.modal.style.backgroundColor="white",this.modal.style.maxWidth="100vw",this.modal.style.maxHeight="100vh",this.modal.style.width="600px",this.modal.style.height="600px",document.body.appendChild(this.modal),this.embed(this.modal,!0);const t=this.on(a.CANCEL,()=>{this.closeModal()}),r=this.on(a.COMPLETE,()=>{this.closeModal()});return this.modal.showModal(),this.modal.addEventListener("click",()=>{this.closeModal()}),this.completion().finally(()=>{t(),r()})}closeModal(){var t;this.modal&&((t=this.modal)==null||t.close(),this.modal.remove(),this.modal=void 0)}async popup(){const t=window.open(this.url,"_blank","popup=true,width=600,height=600");window.addEventListener("message",i=>{var n;i.source===t&&(console.log("received message from popup",i.data),(n=this.eventManager)==null||n.setPort(i.ports[0]))});const r=this.on(a.CANCEL,()=>{t==null||t.close()}),s=this.on(a.COMPLETE,()=>{t==null||t.close()});return this.completion().finally(()=>{r(),s()})}}function w(e){return Object.entries(e).map(([t,r])=>{if(r==null)return;const s=encodeURIComponent(t),i=encodeURIComponent(typeof r=="object"?JSON.stringify(r):String(r));return`${s}=${i}`}).filter(t=>t!==void 0).join("&")}function _(e){const t=e.slice(1);return t?t.split("&").filter(Boolean).reduce((s,i)=>{const[n,l]=i.split("=");return n&&(s[decodeURIComponent(n)]=l?decodeURIComponent(l):""),s},{}):{}}class C{constructor(t){o(this,"nodeUrl");o(this,"authToken");o(this,"uxUrl");o(this,"theme");o(this,"locale");this.uxUrl=t.uxUrl||"https://connect.notabene.id",this.nodeUrl=t.nodeUrl,this.authToken=t.authToken,this.theme=t.theme,this.locale=t.locale}componentUrl(t,r,s,i){const n=new URL(this.uxUrl);n.pathname=t;const l=w({authToken:this.authToken,value:r,configuration:s});return n.hash=l,this.nodeUrl&&n.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&n.searchParams.set("theme",JSON.stringify(this.theme)),this.locale&&n.searchParams.set("locale",this.locale),i&&(i.callback&&n.searchParams.set("callback_url",i.callback),i.redirectUri&&n.searchParams.set("redirect_uri",i.redirectUri)),n.toString()}createComponent(t,r,s,i){return new g(this.componentUrl(t,r,s,i),r,s)}createWithdrawalAssist(t,r,s){return this.createComponent("withdrawal-assist",t,r,s)}createConnectWallet(t,r,s){return this.createComponent("connect",t,r,s)}createDepositRequest(t,r,s){return this.createComponent("deposit-request",t,r,s)}createDepositAssist(t,r,s){return this.createComponent("deposit-assist",t,r,s)}}exports.AgentType=c;exports.CMType=a;exports.EmbeddedComponent=g;exports.ErrorIdentifierCode=f;exports.HMType=d;exports.PersonType=m;exports.ProofStatus=v;exports.ProofTypes=I;exports.Status=u;exports.VASPSearchControl=E;exports.ValidationSections=p;exports.decodeFragmentToObject=_;exports.default=C;
@@ -550,7 +550,7 @@ declare type Error_2 = {
550
550
  };
551
551
  export { Error_2 as Error }
552
552
 
553
- declare enum ErrorIdentifierCode {
553
+ export declare enum ErrorIdentifierCode {
554
554
  SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
555
555
  WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED",
556
556
  WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED",
@@ -1002,6 +1002,16 @@ declare class Notabene {
1002
1002
  * @public
1003
1003
  */
1004
1004
  createDepositRequest(value: DepositRequest, options?: DepositRequestOptions, callbacks?: CallbackOptions): EmbeddedComponent<DepositRequest, DepositRequestOptions>;
1005
+ /**
1006
+ * Creates a deposit assist component
1007
+ *
1008
+ * @param value - Partial deposit transaction data
1009
+ * @param options - Optional transaction options
1010
+ * @param callbacks - Optional callback configuration
1011
+ * @returns A new EmbeddedComponent instance for deposit assistance
1012
+ * @public
1013
+ */
1014
+ createDepositAssist(value: Partial<Deposit>, options?: TransactionOptions, callbacks?: CallbackOptions): EmbeddedComponent<Deposit, TransactionOptions>;
1005
1015
  }
1006
1016
  export default Notabene;
1007
1017
 
@@ -1401,6 +1411,7 @@ export declare interface TransactionOptions {
1401
1411
  * - ivms101: IVMS 101 travel rule data for the transaction
1402
1412
  * - proof: Optional ownership proof details if required
1403
1413
  * - txCreate: Optional V1 transaction payload for legacy API compatibility
1414
+ * - txUpdate: Optional V1 transaction payload for legacy API compatibility
1404
1415
  *
1405
1416
  * @typeParam V - Type of the transaction value being returned
1406
1417
  *
@@ -1415,6 +1426,7 @@ export declare interface TransactionResponse<V> extends ComponentResponse {
1415
1426
  ivms101: IVMS101;
1416
1427
  proof?: OwnershipProof;
1417
1428
  txCreate?: V1Transaction;
1429
+ txUpdate?: V1Transaction;
1418
1430
  }
1419
1431
 
1420
1432
  /**
@@ -1524,6 +1536,7 @@ export declare type V1Transaction = {
1524
1536
  originatorVASPdid: DID;
1525
1537
  beneficiaryVASPdid: DID;
1526
1538
  beneficiaryProof?: OwnershipProof;
1539
+ originatorProof?: OwnershipProof;
1527
1540
  originator?: Originator;
1528
1541
  beneficiary: Beneficiary;
1529
1542
  };
package/dist/notabene.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var c = Object.defineProperty;
2
- var m = (t, e, r) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var o = (t, e, r) => m(t, typeof e != "symbol" ? e + "" : e, r);
4
- var u = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(u || {}), E = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(E || {}), f = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(f || {}), p = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(p || {}), v = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(v || {}), h = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t))(h || {}), d = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(d || {}), g = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(g || {}), w = /* @__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.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t))(w || {});
5
- class I {
2
+ var m = (e, t, r) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var o = (e, t, r) => m(e, typeof t != "symbol" ? t + "" : t, r);
4
+ var u = /* @__PURE__ */ ((e) => (e.PRIVATE = "WALLET", e.VASP = "VASP", e))(u || {}), E = /* @__PURE__ */ ((e) => (e.NATURAL = "natural", e.LEGAL = "legal", e.SELF = "self", e))(E || {}), f = /* @__PURE__ */ ((e) => (e.EMPTY = "empty", e.VERIFY = "verify", e.PENDING = "pending", e.VERIFIED = "verified", e.BANNED = "banned", e))(f || {}), p = /* @__PURE__ */ ((e) => (e.ALLOWED = "allowed", e.PENDING = "pending", e))(p || {}), v = /* @__PURE__ */ ((e) => (e.ASSET = "asset", e.DESTINATION = "destination", e.COUNTERPARTY = "counterparty", e.AGENT = "agent", e))(v || {}), h = /* @__PURE__ */ ((e) => (e.COMPLETE = "complete", e.RESIZE = "resize", e.RESULT = "result", e.READY = "ready", e.INVALID = "invalid", e.ERROR = "error", e.CANCEL = "cancel", e))(h || {}), I = /* @__PURE__ */ ((e) => (e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", e.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", e.TOKEN_INVALID = "TOKEN_INVALID", e))(I || {}), d = /* @__PURE__ */ ((e) => (e.UPDATE = "update", e.REQUEST_RESPONSE = "requestResponse", e))(d || {}), L = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.FAILED = "rejected", e.FLAGGED = "flagged", e.VERIFIED = "verified", e))(L || {}), g = /* @__PURE__ */ ((e) => (e.SelfDeclaration = "self-declaration", e.SIWE = "siwe", e.SIWX = "siwx", e.EIP191 = "eip-191", e.EIP712 = "eip-712", e.EIP1271 = "eip-1271", e.BIP137 = "bip-137", e.BIP322 = "bip-322", e.BIP137_XPUB = "xpub", e.TIP191 = "tip-191", e.ED25519 = "ed25519", e.MicroTransfer = "microtransfer", e.Screenshot = "screenshot", e.Connect = "connect", e))(g || {});
5
+ class A {
6
6
  constructor() {
7
7
  o(this, "listeners", /* @__PURE__ */ new Map());
8
8
  o(this, "port");
@@ -16,8 +16,8 @@ class I {
16
16
  *
17
17
  * @param port - The MessagePort instance to use for communication
18
18
  */
19
- setPort(e) {
20
- this.port = e, this.port.onmessage = this.handleMessage, this.port.start();
19
+ setPort(t) {
20
+ this.port = t, this.port.onmessage = this.handleMessage, this.port.start();
21
21
  }
22
22
  /**
23
23
  * Registers a callback for a specific message type.
@@ -29,8 +29,8 @@ class I {
29
29
  * @param callback - The callback function to execute when matching messages are received
30
30
 
31
31
  */
32
- on(e, r) {
33
- return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(r), () => this.off(e, r);
32
+ on(t, r) {
33
+ return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(r), () => this.off(t, r);
34
34
  }
35
35
  /**
36
36
  * Removes a callback for a specific message type.
@@ -41,9 +41,9 @@ class I {
41
41
  * @param messageType - The type of message to remove listener from
42
42
  * @param callback - The callback function to remove
43
43
  */
44
- off(e, r) {
45
- const i = this.listeners.get(e);
46
- i && (i.delete(r), i.size === 0 && this.listeners.delete(e));
44
+ off(t, r) {
45
+ const s = this.listeners.get(t);
46
+ s && (s.delete(r), s.size === 0 && this.listeners.delete(t));
47
47
  }
48
48
  /**
49
49
  * Internal message handler for processing received messages.
@@ -53,28 +53,28 @@ class I {
53
53
  *
54
54
  * @param event - The message event containing the component message
55
55
  */
56
- handleMessage(e) {
57
- const r = e.data;
56
+ handleMessage(t) {
57
+ const r = t.data;
58
58
  if (typeof r == "object" && r !== null && "type" in r) {
59
- const i = r.type, s = this.listeners.get(i);
60
- s && s.forEach((n) => n(r));
59
+ const s = r.type, i = this.listeners.get(s);
60
+ i && i.forEach((n) => n(r));
61
61
  }
62
62
  }
63
63
  /**
64
64
  * Sends a message through the message port
65
65
  * @param message The host message to send
66
66
  */
67
- send(e) {
68
- this.port && this.port.postMessage(e);
67
+ send(t) {
68
+ this.port && this.port.postMessage(t);
69
69
  }
70
70
  }
71
- class U {
71
+ class N {
72
72
  /**
73
73
  * Creates an instance of EmbeddedComponent.
74
74
  * @param url - The URL of the embedded component
75
75
  * @param value - The initial transaction value
76
76
  */
77
- constructor(e, r, i) {
77
+ constructor(t, r, s) {
78
78
  o(this, "_url");
79
79
  o(this, "_value");
80
80
  o(this, "_options");
@@ -82,10 +82,10 @@ class U {
82
82
  o(this, "iframe");
83
83
  o(this, "eventManager");
84
84
  o(this, "modal");
85
- this._url = e, this._value = r, this._options = i, this.eventManager = new I(), this.on(h.INVALID, (s) => {
86
- s.type === h.INVALID && (this._errors = s.errors, this._value = s.value);
87
- }), this.on(h.RESIZE, (s) => {
88
- s.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${s.height}px`);
85
+ this._url = t, this._value = r, this._options = s, this.eventManager = new A(), this.on(h.INVALID, (i) => {
86
+ i.type === h.INVALID && (this._errors = i.errors, this._value = i.value);
87
+ }), this.on(h.RESIZE, (i) => {
88
+ i.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${i.height}px`);
89
89
  });
90
90
  }
91
91
  /**
@@ -119,21 +119,21 @@ class U {
119
119
  * @param parentId - The ID of the parent element
120
120
  * @throws Will throw an error if the parent element is not found
121
121
  */
122
- mount(e) {
123
- const r = document.querySelector(e);
124
- if (!r) throw new Error(`parentID ${e} not found`);
122
+ mount(t) {
123
+ const r = document.querySelector(t);
124
+ if (!r) throw new Error(`parentID ${t} not found`);
125
125
  this.embed(r);
126
126
  }
127
127
  /**
128
128
  * Embeds the component into a parent element
129
129
  * @param parent - The parent element to embed the component into
130
130
  */
131
- embed(e, r = !1) {
132
- var i, s;
133
- this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (r ? "" : "&embedded=true"), this.iframe.allow = "web-share; clipboard-write; hid; bluetooth;", this.iframe.style.width = "100%", this.iframe.style.height = "0px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.scrolling = "no", e.appendChild(this.iframe), window.addEventListener("message", (n) => {
131
+ embed(t, r = !1) {
132
+ var s, i;
133
+ this.removeEmbed(), this.iframe = document.createElement("iframe"), this.iframe.src = this.url + (r ? "" : "&embedded=true"), this.iframe.allow = "web-share; clipboard-write; hid; bluetooth;", this.iframe.style.width = "100%", this.iframe.style.height = "0px", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.scrolling = "no", t.appendChild(this.iframe), window.addEventListener("message", (n) => {
134
134
  var a, l;
135
135
  n.source === ((a = this.iframe) == null ? void 0 : a.contentWindow) && ((l = this.eventManager) == null || l.setPort(n.ports[0]));
136
- }), (s = (i = this.iframe) == null ? void 0 : i.contentWindow) == null || s.focus();
136
+ }), (i = (s = this.iframe) == null ? void 0 : s.contentWindow) == null || i.focus();
137
137
  }
138
138
  removeEmbed() {
139
139
  this.iframe && this.iframe.remove();
@@ -142,45 +142,45 @@ class U {
142
142
  * Sends a message to the embedded component
143
143
  * @param message - The message to send
144
144
  */
145
- send(e) {
146
- this.eventManager.send(e);
145
+ send(t) {
146
+ this.eventManager.send(t);
147
147
  }
148
148
  /**
149
149
  * Adds an event listener for a specific message type
150
150
  * @param messageType - The type of message to listen for
151
151
  * @param callback - The callback function to execute when the message is received
152
152
  */
153
- on(e, r) {
154
- return this.eventManager.on(e, r);
153
+ on(t, r) {
154
+ return this.eventManager.on(t, r);
155
155
  }
156
156
  /**
157
157
  * Removes an event listener for a specific message type
158
158
  * @param messageType - The type of message to stop listening for
159
159
  * @param callback - The callback function to remove
160
160
  */
161
- off(e, r) {
162
- this.eventManager.off(e, r);
161
+ off(t, r) {
162
+ this.eventManager.off(t, r);
163
163
  }
164
164
  /**
165
165
  * Updates the transaction value and sends an update message to the component
166
166
  * @param value - The new transaction value
167
167
  */
168
- update(e, r) {
169
- this._value = e, r && (this._options = r), this.send({ type: d.UPDATE, value: e, options: this._options });
168
+ update(t, r) {
169
+ this._value = t, r && (this._options = r), this.send({ type: d.UPDATE, value: t, options: this._options });
170
170
  }
171
171
  /**
172
172
  * Waits for the component to complete and returns the transaction response
173
173
  * @returns A promise that resolves with the transaction response
174
174
  */
175
175
  completion() {
176
- return new Promise((e, r) => {
177
- let i, s, n;
176
+ return new Promise((t, r) => {
177
+ let s, i, n;
178
178
  function a() {
179
- i && i(), s && s(), n && n();
179
+ s && s(), i && i(), n && n();
180
180
  }
181
- i = this.on(h.COMPLETE, (l) => {
182
- e(l.response), a();
183
- }), s = this.on(h.CANCEL, () => {
181
+ s = this.on(h.COMPLETE, (l) => {
182
+ t(l.response), a();
183
+ }), i = this.on(h.CANCEL, () => {
184
184
  r(new Error("User cancelled")), a();
185
185
  }), n = this.on("error", (l) => {
186
186
  r(new Error(l.message)), a();
@@ -192,7 +192,7 @@ class U {
192
192
  */
193
193
  async openModal() {
194
194
  this.modal && this.closeModal(), this.modal = document.createElement("dialog"), this.modal.style.border = "none", this.modal.style.backgroundColor = "white", this.modal.style.maxWidth = "100vw", this.modal.style.maxHeight = "100vh", this.modal.style.width = "600px", this.modal.style.height = "600px", document.body.appendChild(this.modal), this.embed(this.modal, !0);
195
- const e = this.on(h.CANCEL, () => {
195
+ const t = this.on(h.CANCEL, () => {
196
196
  this.closeModal();
197
197
  }), r = this.on(h.COMPLETE, () => {
198
198
  this.closeModal();
@@ -200,7 +200,7 @@ class U {
200
200
  return this.modal.showModal(), this.modal.addEventListener("click", () => {
201
201
  this.closeModal();
202
202
  }), this.completion().finally(() => {
203
- e(), r();
203
+ t(), r();
204
204
  });
205
205
  }
206
206
  /**
@@ -208,8 +208,8 @@ class U {
208
208
  *
209
209
  */
210
210
  closeModal() {
211
- var e;
212
- this.modal && ((e = this.modal) == null || e.close(), this.modal.remove(), this.modal = void 0);
211
+ var t;
212
+ this.modal && ((t = this.modal) == null || t.close(), this.modal.remove(), this.modal = void 0);
213
213
  }
214
214
  /**
215
215
  * Opens the component in a popup window. This may be needed to support many self-hosted wallets
@@ -218,58 +218,58 @@ class U {
218
218
  * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
219
219
  */
220
220
  async popup() {
221
- const e = window.open(
221
+ const t = window.open(
222
222
  this.url,
223
223
  "_blank",
224
224
  "popup=true,width=600,height=600"
225
225
  );
226
- window.addEventListener("message", (s) => {
226
+ window.addEventListener("message", (i) => {
227
227
  var n;
228
- s.source === e && (console.log("received message from popup", s.data), (n = this.eventManager) == null || n.setPort(s.ports[0]));
228
+ i.source === t && (console.log("received message from popup", i.data), (n = this.eventManager) == null || n.setPort(i.ports[0]));
229
229
  });
230
230
  const r = this.on(h.CANCEL, () => {
231
- e == null || e.close();
232
- }), i = this.on(h.COMPLETE, () => {
233
- e == null || e.close();
231
+ t == null || t.close();
232
+ }), s = this.on(h.COMPLETE, () => {
233
+ t == null || t.close();
234
234
  });
235
235
  return this.completion().finally(() => {
236
- r(), i();
236
+ r(), s();
237
237
  });
238
238
  }
239
239
  }
240
- function b(t) {
241
- return Object.entries(t).map(([e, r]) => {
240
+ function w(e) {
241
+ return Object.entries(e).map(([t, r]) => {
242
242
  if (r == null) return;
243
- const i = encodeURIComponent(e), s = encodeURIComponent(
243
+ const s = encodeURIComponent(t), i = encodeURIComponent(
244
244
  typeof r == "object" ? JSON.stringify(r) : String(r)
245
245
  // Use String() to handle all primitive types
246
246
  );
247
- return `${i}=${s}`;
248
- }).filter((e) => e !== void 0).join("&");
247
+ return `${s}=${i}`;
248
+ }).filter((t) => t !== void 0).join("&");
249
249
  }
250
- function L(t) {
251
- const e = t.slice(1);
252
- return e ? e.split("&").filter(Boolean).reduce(
253
- (i, s) => {
254
- const [n, a] = s.split("=");
255
- return n && (i[decodeURIComponent(n)] = a ? decodeURIComponent(a) : ""), i;
250
+ function U(e) {
251
+ const t = e.slice(1);
252
+ return t ? t.split("&").filter(Boolean).reduce(
253
+ (s, i) => {
254
+ const [n, a] = i.split("=");
255
+ return n && (s[decodeURIComponent(n)] = a ? decodeURIComponent(a) : ""), s;
256
256
  },
257
257
  {}
258
258
  ) : {};
259
259
  }
260
- class A {
260
+ class C {
261
261
  /**
262
262
  * Creates a new instance of the Notabene SDK
263
263
  *
264
264
  * @param config - Configuration options for the Notabene SDK
265
265
  */
266
- constructor(e) {
266
+ constructor(t) {
267
267
  o(this, "nodeUrl");
268
268
  o(this, "authToken");
269
269
  o(this, "uxUrl");
270
270
  o(this, "theme");
271
271
  o(this, "locale");
272
- this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.locale = e.locale;
272
+ this.uxUrl = t.uxUrl || "https://connect.notabene.id", this.nodeUrl = t.nodeUrl, this.authToken = t.authToken, this.theme = t.theme, this.locale = t.locale;
273
273
  }
274
274
  /**
275
275
  * Generates a URL for a Notabene component
@@ -281,15 +281,15 @@ class A {
281
281
  * @returns component URL
282
282
  * @internal
283
283
  */
284
- componentUrl(e, r, i, s) {
284
+ componentUrl(t, r, s, i) {
285
285
  const n = new URL(this.uxUrl);
286
- n.pathname = e;
287
- const a = b({
286
+ n.pathname = t;
287
+ const a = w({
288
288
  authToken: this.authToken,
289
289
  value: r,
290
- configuration: i
290
+ configuration: s
291
291
  });
292
- return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && n.searchParams.set("locale", this.locale), s && (s.callback && n.searchParams.set("callback_url", s.callback), s.redirectUri && n.searchParams.set("redirect_uri", s.redirectUri)), n.toString();
292
+ return n.hash = a, this.nodeUrl && n.searchParams.set("nodeUrl", this.nodeUrl), this.theme && n.searchParams.set("theme", JSON.stringify(this.theme)), this.locale && n.searchParams.set("locale", this.locale), i && (i.callback && n.searchParams.set("callback_url", i.callback), i.redirectUri && n.searchParams.set("redirect_uri", i.redirectUri)), n.toString();
293
293
  }
294
294
  /**
295
295
  * Creates a new embedded component
@@ -301,11 +301,11 @@ class A {
301
301
  * @returns A new EmbeddedComponent instance
302
302
  * @internal
303
303
  */
304
- createComponent(e, r, i, s) {
305
- return new U(
306
- this.componentUrl(e, r, i, s),
304
+ createComponent(t, r, s, i) {
305
+ return new N(
306
+ this.componentUrl(t, r, s, i),
307
307
  r,
308
- i
308
+ s
309
309
  );
310
310
  }
311
311
  /**
@@ -316,12 +316,12 @@ class A {
316
316
  * @param callbacks - Optional callback configuration
317
317
  * @returns A new EmbeddedComponent instance for withdrawal assistance
318
318
  */
319
- createWithdrawalAssist(e, r, i) {
319
+ createWithdrawalAssist(t, r, s) {
320
320
  return this.createComponent(
321
321
  "withdrawal-assist",
322
- e,
322
+ t,
323
323
  r,
324
- i
324
+ s
325
325
  );
326
326
  }
327
327
  /**
@@ -333,12 +333,12 @@ class A {
333
333
  * @returns A new EmbeddedComponent instance for connection
334
334
  * @alpha
335
335
  */
336
- createConnectWallet(e, r, i) {
336
+ createConnectWallet(t, r, s) {
337
337
  return this.createComponent(
338
338
  "connect",
339
- e,
339
+ t,
340
340
  r,
341
- i
341
+ s
342
342
  );
343
343
  }
344
344
  /**
@@ -350,26 +350,44 @@ class A {
350
350
  * @returns A new EmbeddedComponent instance for deposit requests
351
351
  * @public
352
352
  */
353
- createDepositRequest(e, r, i) {
353
+ createDepositRequest(t, r, s) {
354
354
  return this.createComponent(
355
355
  "deposit-request",
356
- e,
356
+ t,
357
+ r,
358
+ s
359
+ );
360
+ }
361
+ /**
362
+ * Creates a deposit assist component
363
+ *
364
+ * @param value - Partial deposit transaction data
365
+ * @param options - Optional transaction options
366
+ * @param callbacks - Optional callback configuration
367
+ * @returns A new EmbeddedComponent instance for deposit assistance
368
+ * @public
369
+ */
370
+ createDepositAssist(t, r, s) {
371
+ return this.createComponent(
372
+ "deposit-assist",
373
+ t,
357
374
  r,
358
- i
375
+ s
359
376
  );
360
377
  }
361
378
  }
362
379
  export {
363
380
  u as AgentType,
364
381
  h as CMType,
365
- U as EmbeddedComponent,
382
+ N as EmbeddedComponent,
383
+ I as ErrorIdentifierCode,
366
384
  d as HMType,
367
385
  E as PersonType,
368
- g as ProofStatus,
369
- w as ProofTypes,
386
+ L as ProofStatus,
387
+ g as ProofTypes,
370
388
  f as Status,
371
389
  p as VASPSearchControl,
372
390
  v as ValidationSections,
373
- L as decodeFragmentToObject,
374
- A as default
391
+ U as decodeFragmentToObject,
392
+ C as default
375
393
  };
package/docs/README.md CHANGED
@@ -24,32 +24,50 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
24
24
 
25
25
  ## Table of Contents
26
26
 
27
- - [Installation](#installation)
28
- - [Quick Start](#quick-start)
29
- - [Core Concepts](#core-concepts)
30
- - [Authentication](#authentication)
31
- - [General Component Usage](#general-component-usage)
32
- - [Embedded Component](#embedded-component)
33
- - [Dynamic updates](#dynamic-updates)
34
- - [Modal](#modal)
35
- - [Linked Component](#linked-component)
36
- - [Components](#components)
27
+ - [Notabene SafeConnect Components JavaScript SDK](#notabene-safeconnect-components-javascript-sdk)
28
+ - [Table of Contents](#table-of-contents)
29
+ - [Installation](#installation)
30
+ - [Quick Start](#quick-start)
31
+ - [Core Concepts](#core-concepts)
32
+ - [Authentication](#authentication)
33
+ - [General Component Usage](#general-component-usage)
34
+ - [Embedded Component](#embedded-component)
35
+ - [Dynamic updates](#dynamic-updates)
36
+ - [Modal](#modal)
37
+ - [Popup](#popup)
38
+ - [Linked Component](#linked-component)
39
+ - [Components](#components)
37
40
  - [Assisted Withdrawal](#assisted-withdrawal)
41
+ - [Parameters](#parameters)
42
+ - [Configuration Options](#configuration-options)
38
43
  - [Connect Wallet](#connect-wallet)
44
+ - [Parameters](#parameters-1)
45
+ - [Configuration Options](#configuration-options-1)
39
46
  - [Deposit Request](#deposit-request)
40
- - [Error handling](#error-handling)
41
- - [Transaction parameters](#transaction-parameters)
42
- - [Asset specification](#asset-specification)
43
- - [Transaction amount](#transaction-amount)
44
- - [Destination](#destination)
45
- - [Asset Price](#asset-price)
46
- - [Configuration](#configuration)
47
- - [Transaction Options](#transaction-options)
48
- - [Common use cases](#common-use-cases)
49
- - [Configuring ownership proofs](#configuring-ownership-proofs)
50
- - [Counterparty Field Properties](#counterparty-field-properties)
51
- - [Locales](#locales)
52
- - [License](#license)
47
+ - [Parameters](#parameters-2)
48
+ - [Deposit Assist](#deposit-assist)
49
+ - [Parameters](#parameters-3)
50
+ - [Error handling](#error-handling)
51
+ - [Transaction parameters](#transaction-parameters)
52
+ - [Asset specification](#asset-specification)
53
+ - [Transaction amount](#transaction-amount)
54
+ - [Destination](#destination)
55
+ - [Origin](#origin)
56
+ - [Asset Price](#asset-price)
57
+ - [Configuration](#configuration)
58
+ - [Transaction Options](#transaction-options)
59
+ - [Common use cases](#common-use-cases)
60
+ - [Only allow first party transactions](#only-allow-first-party-transactions)
61
+ - [Only VASP to VASP transactions](#only-vasp-to-vasp-transactions)
62
+ - [Only Self-hosted wallet transactions](#only-self-hosted-wallet-transactions)
63
+ - [Configuring ownership proofs](#configuring-ownership-proofs)
64
+ - [Supporting Micro Transactions (aka Satoshi tests)](#supporting-micro-transactions-aka-satoshi-tests)
65
+ - [Fallback Proof Options](#fallback-proof-options)
66
+ - [Counterparty Field Properties](#counterparty-field-properties)
67
+ - [Full Example](#full-example)
68
+ - [Field reference](#field-reference)
69
+ - [Locales](#locales)
70
+ - [License](#license)
53
71
 
54
72
  ## Installation
55
73
 
@@ -375,6 +393,33 @@ const withdrawal = notabene.createDepositRequest({
375
393
 
376
394
  If any of the required parameters are missing the component will just show the Notabene badge.
377
395
 
396
+ ## Deposit Assist
397
+
398
+ The Deposit Assist component helps you collect missing Travel Rule data after a deposit has already been recorded on-chain. For example, if the deposit arrived with incomplete originator information, you can use Deposit Assist to request this information from your end-user.
399
+
400
+ ```js
401
+ const deposit = notabene.createDepositAssist(
402
+ {
403
+ asset: 'ETH',
404
+ amountDecimal: 1.23,
405
+ origin: '0x...',
406
+ destination: '0x...',
407
+ },
408
+ {
409
+ // Optional transaction options
410
+ },
411
+ );
412
+ ```
413
+
414
+ ### Parameters
415
+
416
+ - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
417
+ - `origin`: The origin or blockchain address for the deposit. See [Origin](#origin)
418
+ - `destination`: The destination or blockchain address for the deposit. See [Destination](#destination)
419
+ - `amountDecimal`: Optional amount to deposit in decimal format. See [Transaction Amount](#transaction-amount)
420
+
421
+ If any of the required parameters are missing the component will just show the Notabene badge.
422
+
378
423
  ---
379
424
 
380
425
  ## Error handling
@@ -410,6 +455,15 @@ Specify the beneficiary address as `destination` using one of the following form
410
455
  - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
411
456
  - Native blockchain address
412
457
 
458
+ ### Origin
459
+
460
+ Specify the originator address as `origin` using one of the following formats:
461
+
462
+ - [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
463
+ - [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) EVM URI
464
+ - [BIP-21](https://en.bitcoin.it/wiki/BIP_0021) Bitcoin URI
465
+ - Native blockchain address
466
+
413
467
  ### Asset Price
414
468
 
415
469
  The price of the asset is used to determine certain rules based on thresholds. We recommond you pass in your price like this:
@@ -483,8 +537,8 @@ const options: TransactionOptions = {
483
537
  onlyActive: true, // Only list active VASPs - Default false
484
538
  searchable: [
485
539
  VASPSearchControl.ALLOWED, // JS: 'allowed'
486
- VASPSearchControl.PENDING // JS: 'pending'
487
- ] // Control searches for VASPs - Defaults to undefined
540
+ VASPSearchControl.PENDING, // JS: 'pending'
541
+ ], // Control searches for VASPs - Defaults to undefined
488
542
  },
489
543
  hide: [ValidationSections.ASSET, ValidationSections.DESTINATION], // Don't show specific sections of component
490
544
  },
@@ -15,6 +15,7 @@ Extends ComponentResponse to add transaction-specific response data:
15
15
  - ivms101: IVMS 101 travel rule data for the transaction
16
16
  - proof: Optional ownership proof details if required
17
17
  - txCreate: Optional V1 transaction payload for legacy API compatibility
18
+ - txUpdate: Optional V1 transaction payload for legacy API compatibility
18
19
 
19
20
  ## See
20
21
 
@@ -32,6 +32,10 @@ Transaction payload suitable for calling Notabene v1 tx/create
32
32
 
33
33
  > `optional` **originatorEqualsBeneficiary**: `boolean`
34
34
 
35
+ ### originatorProof?
36
+
37
+ > `optional` **originatorProof**: [`OwnershipProof`](../interfaces/OwnershipProof.md)
38
+
35
39
  ### originatorVASPdid
36
40
 
37
41
  > **originatorVASPdid**: [`DID`](DID.md)
package/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.4.1",
13
+ "version": "2.5.1",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/notabene.js",
16
16
  "types": "dist/notabene.d.ts",
@@ -6,6 +6,7 @@ import {
6
6
  arbitraryComponent,
7
7
  arbitraryConnectionOptions,
8
8
  arbitraryConnectionRequest,
9
+ arbitraryDeposit,
9
10
  arbitraryDepositRequest,
10
11
  arbitraryDepositRequestOptions,
11
12
  arbitraryLocale,
@@ -267,4 +268,39 @@ describe('Notabene', () => {
267
268
  },
268
269
  );
269
270
  });
271
+ describe('createDepositAssist', () => {
272
+ test.prop([
273
+ fc.string({ minLength: 3 }), // authToken
274
+ fc.webUrl(), // nodeUrl
275
+ arbitraryDeposit(),
276
+ arbitraryTransactionOptions(), // options
277
+ abitraryCallbackOptions(), // callbacks
278
+ ])(
279
+ 'Should create deposit assist component with correct URL',
280
+ (authToken, nodeUrl, value, options, callbacks) => {
281
+ const notabene = new Notabene({
282
+ nodeUrl,
283
+ authToken,
284
+ });
285
+
286
+ const component = notabene.createDepositAssist(
287
+ value,
288
+ options,
289
+ callbacks,
290
+ );
291
+ const url = new URL(component.url);
292
+
293
+ return (
294
+ url.pathname === '/deposit-assist' &&
295
+ url.hash ===
296
+ `#authToken=${encodeURIComponent(authToken)}&value=${encodeURIComponent(
297
+ JSON.stringify(value),
298
+ )}&configuration=${encodeURIComponent(JSON.stringify(options))}` &&
299
+ url.searchParams.get('nodeUrl') === nodeUrl &&
300
+ url.searchParams.get('callback_url') === callbacks.callback &&
301
+ url.searchParams.get('redirect_uri') === callbacks.redirectUri
302
+ );
303
+ },
304
+ );
305
+ });
270
306
  });
package/src/notabene.ts CHANGED
@@ -55,6 +55,7 @@ import type {
55
55
  import {
56
56
  AgentType,
57
57
  CMType,
58
+ ErrorIdentifierCode,
58
59
  HMType,
59
60
  PersonType,
60
61
  ProofStatus,
@@ -71,6 +72,7 @@ export {
71
72
  AgentType,
72
73
  CMType,
73
74
  decodeFragmentToObject,
75
+ ErrorIdentifierCode,
74
76
  HMType,
75
77
  PersonType,
76
78
  ProofStatus,
@@ -321,4 +323,26 @@ export default class Notabene {
321
323
  callbacks,
322
324
  );
323
325
  }
326
+
327
+ /**
328
+ * Creates a deposit assist component
329
+ *
330
+ * @param value - Partial deposit transaction data
331
+ * @param options - Optional transaction options
332
+ * @param callbacks - Optional callback configuration
333
+ * @returns A new EmbeddedComponent instance for deposit assistance
334
+ * @public
335
+ */
336
+ public createDepositAssist(
337
+ value: Partial<Deposit>,
338
+ options?: TransactionOptions,
339
+ callbacks?: CallbackOptions,
340
+ ) {
341
+ return this.createComponent<Deposit, TransactionOptions>(
342
+ 'deposit-assist',
343
+ value,
344
+ options,
345
+ callbacks,
346
+ );
347
+ }
324
348
  }
package/src/types.ts CHANGED
@@ -616,6 +616,7 @@ export type V1Transaction = {
616
616
  originatorVASPdid: DID;
617
617
  beneficiaryVASPdid: DID;
618
618
  beneficiaryProof?: OwnershipProof;
619
+ originatorProof?: OwnershipProof;
619
620
  originator?: Originator;
620
621
  beneficiary: Beneficiary;
621
622
  };
@@ -655,6 +656,7 @@ export interface ComponentResponse {
655
656
  * - ivms101: IVMS 101 travel rule data for the transaction
656
657
  * - proof: Optional ownership proof details if required
657
658
  * - txCreate: Optional V1 transaction payload for legacy API compatibility
659
+ * - txUpdate: Optional V1 transaction payload for legacy API compatibility
658
660
  *
659
661
  * @typeParam V - Type of the transaction value being returned
660
662
  *
@@ -669,6 +671,7 @@ export interface TransactionResponse<V> extends ComponentResponse {
669
671
  ivms101: IVMS101;
670
672
  proof?: OwnershipProof;
671
673
  txCreate?: V1Transaction;
674
+ txUpdate?: V1Transaction;
672
675
  }
673
676
 
674
677
  /**
@@ -11,6 +11,7 @@ import type {
11
11
  ConnectionRequest,
12
12
  Counterparty,
13
13
  CryptoCredential,
14
+ Deposit,
14
15
  DepositRequest,
15
16
  DepositRequestOptions,
16
17
  DID,
@@ -242,3 +243,13 @@ export const arbitraryConnectionOptions =
242
243
  proofs: transactionOptions.map((opt) => opt.proofs),
243
244
  });
244
245
  };
246
+
247
+ export const arbitraryDeposit = (): fc.Arbitrary<Deposit> =>
248
+ fc.record({
249
+ agent: arbitraryAgent(),
250
+ counterparty: arbitraryCounterparty(),
251
+ asset: arbitraryTransactionAsset(),
252
+ amountDecimal: fc.float({ min: 0, max: 1e6 }),
253
+ origin: fc.oneof(arbitraryBlockchainAddress(), arbitraryCAIP10()),
254
+ destination: fc.oneof(arbitraryBlockchainAddress(), arbitraryCAIP10()),
255
+ });