@notabene/javascript-sdk 2.0.2 → 2.0.4-NEXT.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +28 -0
  2. package/dist/notabene.cjs +1 -1
  3. package/dist/notabene.d.ts +30 -17
  4. package/dist/notabene.js +98 -70
  5. package/docs/README.md +28 -0
  6. package/docs/_media/TransactionOptions.md +6 -6
  7. package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
  8. package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
  9. package/docs/ivms/types/type-aliases/Address.md +1 -1
  10. package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
  11. package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
  12. package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
  13. package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
  14. package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
  15. package/docs/ivms/types/type-aliases/ISODate.md +1 -1
  16. package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
  17. package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
  18. package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
  19. package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
  20. package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
  21. package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
  22. package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
  23. package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
  24. package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
  25. package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
  26. package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
  27. package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
  28. package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
  29. package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
  30. package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
  31. package/docs/ivms/types/type-aliases/Originator.md +1 -1
  32. package/docs/ivms/types/type-aliases/Person.md +1 -1
  33. package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
  34. package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
  35. package/docs/notabene/README.md +6 -6
  36. package/docs/notabene/classes/EmbeddedComponent.md +39 -16
  37. package/docs/notabene/classes/default.md +6 -6
  38. package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
  39. package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
  40. package/docs/notabene/type-aliases/MessageCallback.md +1 -1
  41. package/docs/types/README.md +1 -1
  42. package/docs/types/enumerations/AgentType.md +2 -2
  43. package/docs/types/enumerations/CMType.md +6 -17
  44. package/docs/types/enumerations/HMType.md +2 -2
  45. package/docs/types/enumerations/PersonType.md +3 -3
  46. package/docs/types/enumerations/ProofStatus.md +4 -4
  47. package/docs/types/enumerations/ProofTypes.md +12 -12
  48. package/docs/types/enumerations/Status.md +5 -5
  49. package/docs/types/enumerations/VASPSearchControl.md +34 -0
  50. package/docs/types/enumerations/ValidationSections.md +4 -4
  51. package/docs/types/interfaces/Agent.md +6 -6
  52. package/docs/types/interfaces/CallbackOptions.md +2 -2
  53. package/docs/types/interfaces/ComponentRequest.md +2 -2
  54. package/docs/types/interfaces/ComponentResponse.md +4 -4
  55. package/docs/types/interfaces/ConnectionRecord.md +7 -7
  56. package/docs/types/interfaces/ConnectionRequest.md +3 -3
  57. package/docs/types/interfaces/Counterparty.md +10 -10
  58. package/docs/types/interfaces/DeclarationProof.md +6 -6
  59. package/docs/types/interfaces/Deposit.md +9 -9
  60. package/docs/types/interfaces/DepositRequest.md +7 -7
  61. package/docs/types/interfaces/DepositRequestOptions.md +1 -1
  62. package/docs/types/interfaces/LegalPerson.md +13 -13
  63. package/docs/types/interfaces/MicroTransferProof.md +9 -9
  64. package/docs/types/interfaces/NaturalPerson.md +13 -13
  65. package/docs/types/interfaces/OwnershipProof.md +4 -4
  66. package/docs/types/interfaces/ScreenshotProof.md +5 -5
  67. package/docs/types/interfaces/SignatureProof.md +7 -7
  68. package/docs/types/interfaces/ThresholdOptions.md +3 -3
  69. package/docs/types/interfaces/Transaction.md +8 -8
  70. package/docs/types/interfaces/TransactionOptions.md +6 -6
  71. package/docs/types/interfaces/TransactionResponse.md +8 -8
  72. package/docs/types/interfaces/VASP.md +9 -9
  73. package/docs/types/interfaces/Wallet.md +8 -8
  74. package/docs/types/interfaces/Withdrawal.md +9 -9
  75. package/docs/types/type-aliases/BlockchainAddress.md +1 -1
  76. package/docs/types/type-aliases/CAIP10.md +1 -1
  77. package/docs/types/type-aliases/CAIP19.md +1 -1
  78. package/docs/types/type-aliases/CAIP2.md +1 -1
  79. package/docs/types/type-aliases/CAIP220.md +1 -1
  80. package/docs/types/type-aliases/Cancel.md +1 -1
  81. package/docs/types/type-aliases/Completed.md +1 -1
  82. package/docs/types/type-aliases/ComponentMessage.md +2 -4
  83. package/docs/types/type-aliases/ConnectionOptions.md +1 -1
  84. package/docs/types/type-aliases/CryptoCredential.md +1 -1
  85. package/docs/types/type-aliases/DID.md +1 -1
  86. package/docs/types/type-aliases/DTI.md +1 -1
  87. package/docs/types/type-aliases/Destination.md +1 -1
  88. package/docs/types/type-aliases/Error.md +17 -1
  89. package/docs/types/type-aliases/FieldOptions.md +1 -1
  90. package/docs/types/type-aliases/FieldTypes.md +1 -1
  91. package/docs/types/type-aliases/HostMessage.md +1 -1
  92. package/docs/types/type-aliases/ISOCurrency.md +1 -1
  93. package/docs/types/type-aliases/InvalidValue.md +1 -1
  94. package/docs/types/type-aliases/LEI.md +1 -1
  95. package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
  96. package/docs/types/type-aliases/LegalPersonFields.md +1 -1
  97. package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
  98. package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
  99. package/docs/types/type-aliases/NotabeneAsset.md +1 -1
  100. package/docs/types/type-aliases/ResizeRequest.md +1 -1
  101. package/docs/types/type-aliases/Source.md +1 -1
  102. package/docs/types/type-aliases/Theme.md +9 -9
  103. package/docs/types/type-aliases/TransactionAsset.md +1 -1
  104. package/docs/types/type-aliases/TravelAddress.md +1 -1
  105. package/docs/types/type-aliases/URI.md +1 -1
  106. package/docs/types/type-aliases/UUID.md +1 -1
  107. package/docs/types/type-aliases/UpdateValue.md +1 -1
  108. package/docs/types/type-aliases/V1Asset.md +1 -1
  109. package/docs/types/type-aliases/V1Transaction.md +1 -1
  110. package/docs/types/type-aliases/VASPOptions.md +5 -1
  111. package/docs/types/type-aliases/ValidationError.md +1 -1
  112. package/package.json +15 -14
  113. package/src/components/EmbeddedComponent.ts +45 -4
  114. package/src/components/__tests__/EmbeddedComponent.test.ts +126 -3
  115. package/src/notabene.ts +23 -23
  116. package/src/types.ts +23 -18
  117. package/src/utils/__tests__/MessageEventManager.test.ts +7 -7
  118. package/docs/types/type-aliases/Ready.md +0 -21
package/README.md CHANGED
@@ -207,6 +207,30 @@ try {
207
207
  }
208
208
  ```
209
209
 
210
+ ### Popup
211
+
212
+ All components support being opened in a popup window using `popup()`, which returns a promise.
213
+
214
+ Many embedded wallets refuse to work in an iframe. In this case it is better to use a popup window.
215
+
216
+ Unfortunately there are also some restrictions on popup windows:
217
+
218
+ - [Popup window Restrictions](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
219
+
220
+ * [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
221
+
222
+ ```js
223
+ const withdrawal = notabene.createWithdrawalAssist(tx, options);
224
+ try {
225
+ const { valid, value, txCreate, ivms101, proof } = await withdrawal.popup();
226
+ if (valid) {
227
+ // Submit result to your backend
228
+ }
229
+ } catch (e) {
230
+ console.error(e);
231
+ }
232
+ ```
233
+
210
234
  ### Linked Component
211
235
 
212
236
  In some cases, in particular institutional or mobile apps you may prefer to link your customers to the component through an email or redirect the user to it in a mobile app.
@@ -453,6 +477,10 @@ const options: TransactionOptions = {
453
477
  vasps: {
454
478
  addUnknown: true, // Allow users to add a missing VASP - Defaults to false
455
479
  onlyActive: true, // Only list active VASPs - Default false
480
+ searchable: [
481
+ VASPSearchControl.ALLOWED, // JS: 'allowed'
482
+ VASPSearchControl.PENDING // JS: 'pending'
483
+ ] // Control searches for VASPs - Defaults to undefined
456
484
  },
457
485
  hide: [ValidationSections.ASSET, ValidationSections.DESTINATION], // Don't show specific sections of component
458
486
  },
package/dist/notabene.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var I=(e,t,r)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var o=(e,t,r)=>I(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||{}),f=(e=>(e.ASSET="asset",e.DESTINATION="destination",e.COUNTERPARTY="counterparty",e.AGENT="agent",e))(f||{}),h=(e=>(e.COMPLETE="complete",e.RESIZE="resize",e.RESULT="result",e.READY="ready",e.INVALID="invalid",e.ERROR="error",e.CANCEL="cancel",e))(h||{}),l=(e=>(e.UPDATE="update",e.REQUEST_RESPONSE="requestResponse",e))(l||{}),E=(e=>(e.PENDING="pending",e.FAILED="rejected",e.FLAGGED="flagged",e.VERIFIED="verified",e))(E||{}),p=(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.BIP137_XPUB="xpub",e.ED25519="ed25519",e.MicroTransfer="microtransfer",e.Screenshot="screenshot",e.Connect="connect",e))(p||{});class w{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 i=this.listeners.get(t);i&&(i.delete(r),i.size===0&&this.listeners.delete(t))}handleMessage(t){const r=t.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(t){this.port&&this.port.postMessage(t)}}class v{constructor(t,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=t,this._value=r,this._options=i,this.eventManager=new w,this.on(h.INVALID,s=>{s.type===h.INVALID&&(this._errors=s.errors,this._value=s.value)}),this.on(h.RESIZE,s=>{s.type===h.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(t){const r=document.querySelector(t);if(!r)throw new Error(`parentID ${t} not found`);this.embed(r)}embed(t,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",this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.overflow="hidden",this.iframe.scrolling="no",t.appendChild(this.iframe),window.addEventListener("message",n=>{var a,d;n.source===((a=this.iframe)==null?void 0:a.contentWindow)&&((d=this.eventManager)==null||d.setPort(n.ports[0]))}),(s=(i=this.iframe)==null?void 0:i.contentWindow)==null||s.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:l.UPDATE,value:t,options:this._options})}completion(){return new Promise((t,r)=>{let i,s;function n(){i&&i(),s&&s()}i=this.on(h.COMPLETE,a=>{t(a.response),n()}),s=this.on("error",a=>{r(new Error(a.message)),n()})})}openModal(){return 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),this.on(h.CANCEL,()=>{this.closeModal()}),this.on(h.COMPLETE,()=>{this.closeModal()}),this.modal.showModal(),this.modal.addEventListener("click",()=>{this.closeModal()}),this.completion()}closeModal(){var t;this.modal&&((t=this.modal)==null||t.close(),this.modal.remove(),this.modal=void 0)}}function b(e){return Object.entries(e).map(([t,r])=>{if(r==null)return;const i=encodeURIComponent(t),s=encodeURIComponent(typeof r=="object"?JSON.stringify(r):String(r));return`${i}=${s}`}).filter(t=>t!==void 0).join("&")}function U(e){const t=e.slice(1);return t?t.split("&").filter(Boolean).reduce((i,s)=>{const[n,a]=s.split("=");return n&&(i[decodeURIComponent(n)]=a?decodeURIComponent(a):""),i},{}):{}}class R{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,i,s){const n=new URL(this.uxUrl);n.pathname=t;const a=b({authToken:this.authToken,value:r,configuration:i});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()}createComponent(t,r,i,s){return new v(this.componentUrl(t,r,i,s),r,i)}createWithdrawalAssist(t,r,i){return this.createComponent("withdrawal-assist",t,r,i)}createConnectWallet(t,r,i){return this.createComponent("connect",t,r,i)}createDepositRequest(t,r,i){return this.createComponent("deposit-request",t,r,i)}}exports.AgentType=c;exports.CMType=h;exports.EmbeddedComponent=v;exports.HMType=l;exports.PersonType=m;exports.ProofStatus=E;exports.ProofTypes=p;exports.Status=u;exports.ValidationSections=f;exports.decodeFragmentToObject=U;exports.default=R;
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.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.BIP137_XPUB="xpub",t.ED25519="ed25519",t.MicroTransfer="microtransfer",t.Screenshot="screenshot",t.Connect="connect",t))(v||{});class C{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 C,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()})})}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)}popup(){const e=window.open(this.url,"_blank","popup=true");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 b(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 L{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=b({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=L;
@@ -193,7 +193,6 @@ export declare type Cancel = {
193
193
  * - COMPLETE: Indicates a completed operation with response data
194
194
  * - RESIZE: Request to adjust component size/dimensions
195
195
  * - RESULT: Operation result notification
196
- * - READY: Component is initialized and ready
197
196
  * - INVALID: Validation failed with errors
198
197
  * - ERROR: Operation encountered an error
199
198
  * - CANCEL: Operation was cancelled
@@ -203,7 +202,6 @@ export declare const enum CMType {
203
202
  COMPLETE = "complete",
204
203
  RESIZE = "resize",
205
204
  RESULT = "result",
206
- READY = "ready",
207
205
  INVALID = "invalid",
208
206
  ERROR = "error",
209
207
  CANCEL = "cancel"
@@ -229,7 +227,6 @@ export declare type Completed<T> = {
229
227
  * - Completed: Operation finished successfully with response data
230
228
  * - Cancel: User cancelled the operation
231
229
  * - Error: Operation failed with error message
232
- * - Ready: Component initialized and ready for use
233
230
  * - ResizeRequest: Component needs to adjust its dimensions
234
231
  * - InvalidValue: Validation failed with current partial value
235
232
  *
@@ -238,12 +235,11 @@ export declare type Completed<T> = {
238
235
  * @see {@link Completed} For successful completion message format
239
236
  * @see {@link Cancel} For cancellation message format
240
237
  * @see {@link Error} For error message format
241
- * @see {@link Ready} For ready message format
242
238
  * @see {@link ResizeRequest} For resize message format
243
239
  * @see {@link InvalidValue} For validation failure message format
244
240
  * @public
245
241
  */
246
- export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T>;
242
+ export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | ResizeRequest | InvalidValue<T>;
247
243
 
248
244
  /**
249
245
  * Base interface for requests sent to SDK components
@@ -528,16 +524,27 @@ export declare class EmbeddedComponent<V, O> {
528
524
  *
529
525
  */
530
526
  closeModal(): void;
527
+ /**
528
+ * Opens the component in a popup window. This may be needed to support many self-hosted wallets
529
+ * @returns A promise that resolves with the transaction response
530
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
531
+ * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
532
+ */
533
+ popup(): Promise<TransactionResponse<V>>;
531
534
  }
532
535
 
533
536
  /**
534
537
  * Represents an error component message
535
538
  * @param message - Error message
539
+ * @param description - Description of the error message
540
+ * @param identifier - Identifier code of the error message
536
541
  * @public
537
542
  */
538
543
  declare type Error_2 = {
539
544
  type: CMType.ERROR;
540
545
  message: string;
546
+ description?: string;
547
+ identifier?: string;
541
548
  };
542
549
  export { Error_2 as Error }
543
550
 
@@ -1209,14 +1216,6 @@ export declare enum ProofTypes {
1209
1216
  Connect = "connect"
1210
1217
  }
1211
1218
 
1212
- /**
1213
- * Represents a ready component message
1214
- * @public
1215
- */
1216
- export declare type Ready = {
1217
- type: CMType.READY;
1218
- };
1219
-
1220
1219
  declare type RequestID = UUID;
1221
1220
 
1222
1221
  /**
@@ -1284,10 +1283,10 @@ export declare enum Status {
1284
1283
  * @public
1285
1284
  */
1286
1285
  export declare type Theme = {
1287
- primaryColor: string;
1288
- secondaryColor: string;
1289
- fontFamily: string;
1290
- logo: string;
1286
+ primaryColor?: string;
1287
+ secondaryColor?: string;
1288
+ fontFamily?: string;
1289
+ logo?: string;
1291
1290
  };
1292
1291
 
1293
1292
  /**
@@ -1544,8 +1543,22 @@ export declare interface VASP extends Agent {
1544
1543
  export declare type VASPOptions = {
1545
1544
  addUnknown?: boolean;
1546
1545
  onlyActive?: boolean;
1546
+ searchable?: VASPSearchControl[];
1547
1547
  };
1548
1548
 
1549
+ /**
1550
+ * VASP Visibility Control representing allow/deny behaviour for VASP visibility
1551
+ *
1552
+ * @remarks
1553
+ * - ALLOWED: Include VASPs you have explicitly allowed in the Notabene Network
1554
+ * - PENDING: Include VASPs neither allowed nor denied
1555
+ * @public
1556
+ */
1557
+ export declare const enum VASPSearchControl {
1558
+ ALLOWED = "allowed",
1559
+ PENDING = "pending"
1560
+ }
1561
+
1549
1562
  /**
1550
1563
  * A wallet agent acting on behalf of the counterparty
1551
1564
  * @public
package/dist/notabene.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var c = Object.defineProperty;
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.ASSET = "asset", e.DESTINATION = "destination", e.COUNTERPARTY = "counterparty", e.AGENT = "agent", e))(p || {}), 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 || {}), d = /* @__PURE__ */ ((e) => (e.UPDATE = "update", e.REQUEST_RESPONSE = "requestResponse", e))(d || {}), v = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.FAILED = "rejected", e.FLAGGED = "flagged", e.VERIFIED = "verified", e))(v || {}), 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.BIP137_XPUB = "xpub", e.ED25519 = "ed25519", e.MicroTransfer = "microtransfer", e.Screenshot = "screenshot", e.Connect = "connect", e))(g || {});
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.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.BIP137_XPUB = "xpub", t.ED25519 = "ed25519", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t))(w || {});
5
5
  class I {
6
6
  constructor() {
7
7
  o(this, "listeners", /* @__PURE__ */ new Map());
@@ -16,8 +16,8 @@ class I {
16
16
  *
17
17
  * @param port - The MessagePort instance to use for communication
18
18
  */
19
- setPort(t) {
20
- this.port = t, this.port.onmessage = this.handleMessage, this.port.start();
19
+ setPort(e) {
20
+ this.port = e, 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(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);
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);
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(t, r) {
45
- const i = this.listeners.get(t);
46
- i && (i.delete(r), i.size === 0 && this.listeners.delete(t));
44
+ off(e, r) {
45
+ const i = this.listeners.get(e);
46
+ i && (i.delete(r), i.size === 0 && this.listeners.delete(e));
47
47
  }
48
48
  /**
49
49
  * Internal message handler for processing received messages.
@@ -53,8 +53,8 @@ class I {
53
53
  *
54
54
  * @param event - The message event containing the component message
55
55
  */
56
- handleMessage(t) {
57
- const r = t.data;
56
+ handleMessage(e) {
57
+ const r = e.data;
58
58
  if (typeof r == "object" && r !== null && "type" in r) {
59
59
  const i = r.type, s = this.listeners.get(i);
60
60
  s && s.forEach((n) => n(r));
@@ -64,17 +64,17 @@ class I {
64
64
  * Sends a message through the message port
65
65
  * @param message The host message to send
66
66
  */
67
- send(t) {
68
- this.port && this.port.postMessage(t);
67
+ send(e) {
68
+ this.port && this.port.postMessage(e);
69
69
  }
70
70
  }
71
- class w {
71
+ class C {
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(t, r, i) {
77
+ constructor(e, r, i) {
78
78
  o(this, "_url");
79
79
  o(this, "_value");
80
80
  o(this, "_options");
@@ -82,7 +82,7 @@ class w {
82
82
  o(this, "iframe");
83
83
  o(this, "eventManager");
84
84
  o(this, "modal");
85
- this._url = t, this._value = r, this._options = i, this.eventManager = new I(), this.on(h.INVALID, (s) => {
85
+ this._url = e, this._value = r, this._options = i, this.eventManager = new I(), this.on(h.INVALID, (s) => {
86
86
  s.type === h.INVALID && (this._errors = s.errors, this._value = s.value);
87
87
  }), this.on(h.RESIZE, (s) => {
88
88
  s.type === h.RESIZE && this.iframe && (this.iframe.style.height = `${s.height}px`);
@@ -119,18 +119,18 @@ class w {
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(t) {
123
- const r = document.querySelector(t);
124
- if (!r) throw new Error(`parentID ${t} not found`);
122
+ mount(e) {
123
+ const r = document.querySelector(e);
124
+ if (!r) throw new Error(`parentID ${e} 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(t, r = !1) {
131
+ embed(e, r = !1) {
132
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", this.iframe.style.width = "100%", this.iframe.style.border = "none", this.iframe.style.overflow = "hidden", this.iframe.scrolling = "no", t.appendChild(this.iframe), window.addEventListener("message", (n) => {
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) => {
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
136
  }), (s = (i = this.iframe) == null ? void 0 : i.contentWindow) == null || s.focus();
@@ -142,46 +142,48 @@ class w {
142
142
  * Sends a message to the embedded component
143
143
  * @param message - The message to send
144
144
  */
145
- send(t) {
146
- this.eventManager.send(t);
145
+ send(e) {
146
+ this.eventManager.send(e);
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(t, r) {
154
- return this.eventManager.on(t, r);
153
+ on(e, r) {
154
+ return this.eventManager.on(e, 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(t, r) {
162
- this.eventManager.off(t, r);
161
+ off(e, r) {
162
+ this.eventManager.off(e, 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(t, r) {
169
- this._value = t, r && (this._options = r), this.send({ type: d.UPDATE, value: t, options: this._options });
168
+ update(e, r) {
169
+ this._value = e, r && (this._options = r), this.send({ type: d.UPDATE, value: e, 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((t, r) => {
177
- let i, s;
178
- function n() {
179
- i && i(), s && s();
176
+ return new Promise((e, r) => {
177
+ let i, s, n;
178
+ function a() {
179
+ i && i(), s && s(), n && n();
180
180
  }
181
- i = this.on(h.COMPLETE, (a) => {
182
- t(a.response), n();
183
- }), s = this.on("error", (a) => {
184
- r(new Error(a.message)), n();
181
+ i = this.on(h.COMPLETE, (l) => {
182
+ e(l.response), a();
183
+ }), s = this.on(h.CANCEL, () => {
184
+ r(new Error("User cancelled")), a();
185
+ }), n = this.on("error", (l) => {
186
+ r(new Error(l.message)), a();
185
187
  });
186
188
  });
187
189
  }
@@ -189,36 +191,61 @@ class w {
189
191
  * Opens the component in a modal dialog
190
192
  */
191
193
  openModal() {
192
- return 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), this.on(h.CANCEL, () => {
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, () => {
193
196
  this.closeModal();
194
- }), this.on(h.COMPLETE, () => {
197
+ }), r = this.on(h.COMPLETE, () => {
195
198
  this.closeModal();
196
- }), this.modal.showModal(), this.modal.addEventListener("click", () => {
199
+ });
200
+ return this.modal.showModal(), this.modal.addEventListener("click", () => {
197
201
  this.closeModal();
198
- }), this.completion();
202
+ }), this.completion().finally(() => {
203
+ e(), r();
204
+ });
199
205
  }
200
206
  /**
201
207
  * Closes the modal dialog
202
208
  *
203
209
  */
204
210
  closeModal() {
205
- var t;
206
- this.modal && ((t = this.modal) == null || t.close(), this.modal.remove(), this.modal = void 0);
211
+ var e;
212
+ this.modal && ((e = this.modal) == null || e.close(), this.modal.remove(), this.modal = void 0);
213
+ }
214
+ /**
215
+ * Opens the component in a popup window. This may be needed to support many self-hosted wallets
216
+ * @returns A promise that resolves with the transaction response
217
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
218
+ * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
219
+ */
220
+ popup() {
221
+ const e = window.open(this.url, "_blank", "popup=true");
222
+ window.addEventListener("message", (s) => {
223
+ var n;
224
+ s.source === e && (console.log("received message from popup", s.data), (n = this.eventManager) == null || n.setPort(s.ports[0]));
225
+ });
226
+ const r = this.on(h.CANCEL, () => {
227
+ e == null || e.close();
228
+ }), i = this.on(h.COMPLETE, () => {
229
+ e == null || e.close();
230
+ });
231
+ return this.completion().finally(() => {
232
+ r(), i();
233
+ });
207
234
  }
208
235
  }
209
- function U(e) {
210
- return Object.entries(e).map(([t, r]) => {
236
+ function U(t) {
237
+ return Object.entries(t).map(([e, r]) => {
211
238
  if (r == null) return;
212
- const i = encodeURIComponent(t), s = encodeURIComponent(
239
+ const i = encodeURIComponent(e), s = encodeURIComponent(
213
240
  typeof r == "object" ? JSON.stringify(r) : String(r)
214
241
  // Use String() to handle all primitive types
215
242
  );
216
243
  return `${i}=${s}`;
217
- }).filter((t) => t !== void 0).join("&");
244
+ }).filter((e) => e !== void 0).join("&");
218
245
  }
219
- function b(e) {
220
- const t = e.slice(1);
221
- return t ? t.split("&").filter(Boolean).reduce(
246
+ function b(t) {
247
+ const e = t.slice(1);
248
+ return e ? e.split("&").filter(Boolean).reduce(
222
249
  (i, s) => {
223
250
  const [n, a] = s.split("=");
224
251
  return n && (i[decodeURIComponent(n)] = a ? decodeURIComponent(a) : ""), i;
@@ -226,19 +253,19 @@ function b(e) {
226
253
  {}
227
254
  ) : {};
228
255
  }
229
- class A {
256
+ class N {
230
257
  /**
231
258
  * Creates a new instance of the Notabene SDK
232
259
  *
233
260
  * @param config - Configuration options for the Notabene SDK
234
261
  */
235
- constructor(t) {
262
+ constructor(e) {
236
263
  o(this, "nodeUrl");
237
264
  o(this, "authToken");
238
265
  o(this, "uxUrl");
239
266
  o(this, "theme");
240
267
  o(this, "locale");
241
- this.uxUrl = t.uxUrl || "https://connect.notabene.id", this.nodeUrl = t.nodeUrl, this.authToken = t.authToken, this.theme = t.theme, this.locale = t.locale;
268
+ this.uxUrl = e.uxUrl || "https://connect.notabene.id", this.nodeUrl = e.nodeUrl, this.authToken = e.authToken, this.theme = e.theme, this.locale = e.locale;
242
269
  }
243
270
  /**
244
271
  * Generates a URL for a Notabene component
@@ -250,9 +277,9 @@ class A {
250
277
  * @returns component URL
251
278
  * @internal
252
279
  */
253
- componentUrl(t, r, i, s) {
280
+ componentUrl(e, r, i, s) {
254
281
  const n = new URL(this.uxUrl);
255
- n.pathname = t;
282
+ n.pathname = e;
256
283
  const a = U({
257
284
  authToken: this.authToken,
258
285
  value: r,
@@ -270,9 +297,9 @@ class A {
270
297
  * @returns A new EmbeddedComponent instance
271
298
  * @internal
272
299
  */
273
- createComponent(t, r, i, s) {
274
- return new w(
275
- this.componentUrl(t, r, i, s),
300
+ createComponent(e, r, i, s) {
301
+ return new C(
302
+ this.componentUrl(e, r, i, s),
276
303
  r,
277
304
  i
278
305
  );
@@ -285,10 +312,10 @@ class A {
285
312
  * @param callbacks - Optional callback configuration
286
313
  * @returns A new EmbeddedComponent instance for withdrawal assistance
287
314
  */
288
- createWithdrawalAssist(t, r, i) {
315
+ createWithdrawalAssist(e, r, i) {
289
316
  return this.createComponent(
290
317
  "withdrawal-assist",
291
- t,
318
+ e,
292
319
  r,
293
320
  i
294
321
  );
@@ -302,10 +329,10 @@ class A {
302
329
  * @returns A new EmbeddedComponent instance for connection
303
330
  * @alpha
304
331
  */
305
- createConnectWallet(t, r, i) {
332
+ createConnectWallet(e, r, i) {
306
333
  return this.createComponent(
307
334
  "connect",
308
- t,
335
+ e,
309
336
  r,
310
337
  i
311
338
  );
@@ -319,10 +346,10 @@ class A {
319
346
  * @returns A new EmbeddedComponent instance for deposit requests
320
347
  * @public
321
348
  */
322
- createDepositRequest(t, r, i) {
349
+ createDepositRequest(e, r, i) {
323
350
  return this.createComponent(
324
351
  "deposit-request",
325
- t,
352
+ e,
326
353
  r,
327
354
  i
328
355
  );
@@ -331,13 +358,14 @@ class A {
331
358
  export {
332
359
  u as AgentType,
333
360
  h as CMType,
334
- w as EmbeddedComponent,
361
+ C as EmbeddedComponent,
335
362
  d as HMType,
336
363
  E as PersonType,
337
- v as ProofStatus,
338
- g as ProofTypes,
364
+ g as ProofStatus,
365
+ w as ProofTypes,
339
366
  f as Status,
340
- p as ValidationSections,
367
+ p as VASPSearchControl,
368
+ v as ValidationSections,
341
369
  b as decodeFragmentToObject,
342
- A as default
370
+ N as default
343
371
  };
package/docs/README.md CHANGED
@@ -211,6 +211,30 @@ try {
211
211
  }
212
212
  ```
213
213
 
214
+ ### Popup
215
+
216
+ All components support being opened in a popup window using `popup()`, which returns a promise.
217
+
218
+ Many embedded wallets refuse to work in an iframe. In this case it is better to use a popup window.
219
+
220
+ Unfortunately there are also some restrictions on popup windows:
221
+
222
+ - [Popup window Restrictions](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
223
+
224
+ * [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
225
+
226
+ ```js
227
+ const withdrawal = notabene.createWithdrawalAssist(tx, options);
228
+ try {
229
+ const { valid, value, txCreate, ivms101, proof } = await withdrawal.popup();
230
+ if (valid) {
231
+ // Submit result to your backend
232
+ }
233
+ } catch (e) {
234
+ console.error(e);
235
+ }
236
+ ```
237
+
214
238
  ### Linked Component
215
239
 
216
240
  In some cases, in particular institutional or mobile apps you may prefer to link your customers to the component through an email or redirect the user to it in a mobile app.
@@ -457,6 +481,10 @@ const options: TransactionOptions = {
457
481
  vasps: {
458
482
  addUnknown: true, // Allow users to add a missing VASP - Defaults to false
459
483
  onlyActive: true, // Only list active VASPs - Default false
484
+ searchable: [
485
+ VASPSearchControl.ALLOWED, // JS: 'allowed'
486
+ VASPSearchControl.PENDING // JS: 'pending'
487
+ ] // Control searches for VASPs - Defaults to undefined
460
488
  },
461
489
  hide: [ValidationSections.ASSET, ValidationSections.DESTINATION], // Don't show specific sections of component
462
490
  },
@@ -16,7 +16,7 @@ Configuration options for Transaction components
16
16
 
17
17
  #### Defined in
18
18
 
19
- [types.ts:754](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L754)
19
+ [types.ts:768](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L768)
20
20
 
21
21
  ***
22
22
 
@@ -26,7 +26,7 @@ Configuration options for Transaction components
26
26
 
27
27
  #### Defined in
28
28
 
29
- [types.ts:755](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L755)
29
+ [types.ts:769](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L769)
30
30
 
31
31
  ***
32
32
 
@@ -36,7 +36,7 @@ Configuration options for Transaction components
36
36
 
37
37
  #### Defined in
38
38
 
39
- [types.ts:756](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L756)
39
+ [types.ts:770](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L770)
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:758](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L758)
49
+ [types.ts:772](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L772)
50
50
 
51
51
  ***
52
52
 
@@ -80,7 +80,7 @@ Configuration options for Transaction components
80
80
 
81
81
  #### Defined in
82
82
 
83
- [types.ts:745](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L745)
83
+ [types.ts:759](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L759)
84
84
 
85
85
  ***
86
86
 
@@ -90,4 +90,4 @@ Configuration options for Transaction components
90
90
 
91
91
  #### Defined in
92
92
 
93
- [types.ts:757](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f75feb1dd5dd91003bcc9aa8429d05c94c878b06/src/types.ts#L757)
93
+ [types.ts:771](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/f4e73b4e984837ed8a53f91590a8d1276a1aa25a/src/types.ts#L771)