@notabene/javascript-sdk 2.10.0-next.4 → 2.11.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 (136) hide show
  1. package/dist/cjs/notabene.cjs +1 -1
  2. package/dist/cjs/notabene.d.ts +60 -1
  3. package/dist/cjs/package.json +1 -1
  4. package/dist/esm/notabene.d.ts +60 -1
  5. package/dist/esm/notabene.js +14 -14
  6. package/dist/esm/package.json +1 -1
  7. package/dist/notabene.d.ts +60 -1
  8. package/dist/notabene.js +14 -14
  9. package/docs/README.md +9 -4
  10. package/docs/_media/TransactionOptions.md +17 -7
  11. package/docs/_media/getRefreshResult.md +1 -1
  12. package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
  13. package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
  14. package/docs/ivms/types/type-aliases/Address.md +1 -1
  15. package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
  16. package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
  17. package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
  18. package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
  19. package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
  20. package/docs/ivms/types/type-aliases/ISODate.md +1 -1
  21. package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
  22. package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
  23. package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
  24. package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
  25. package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
  26. package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
  27. package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
  28. package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
  29. package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
  30. package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
  31. package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
  32. package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
  33. package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
  34. package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
  35. package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
  36. package/docs/ivms/types/type-aliases/Originator.md +1 -1
  37. package/docs/ivms/types/type-aliases/Person.md +1 -1
  38. package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
  39. package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
  40. package/docs/notabene/classes/ConnectionManager.md +5 -5
  41. package/docs/notabene/classes/EmbeddedComponent.md +17 -17
  42. package/docs/notabene/classes/default.md +7 -7
  43. package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
  44. package/docs/notabene/functions/getRefreshResult.md +1 -1
  45. package/docs/notabene/interfaces/ConnectionData.md +4 -4
  46. package/docs/notabene/interfaces/ConnectionMetadata.md +3 -3
  47. package/docs/notabene/interfaces/ConnectionResponse.md +6 -6
  48. package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
  49. package/docs/notabene/type-aliases/ConnectionResult.md +1 -1
  50. package/docs/notabene/type-aliases/ConnectionStatus.md +1 -1
  51. package/docs/notabene/type-aliases/MessageCallback.md +1 -1
  52. package/docs/notabene/type-aliases/TransactionType.md +1 -1
  53. package/docs/types/README.md +2 -0
  54. package/docs/types/enumerations/AgentType.md +2 -2
  55. package/docs/types/enumerations/CMType.md +27 -7
  56. package/docs/types/enumerations/ErrorIdentifierCode.md +4 -4
  57. package/docs/types/enumerations/HMType.md +2 -2
  58. package/docs/types/enumerations/PersonType.md +3 -3
  59. package/docs/types/enumerations/ProofStatus.md +4 -4
  60. package/docs/types/enumerations/ProofTypes.md +30 -18
  61. package/docs/types/enumerations/Status.md +5 -5
  62. package/docs/types/enumerations/VASPSearchControl.md +2 -2
  63. package/docs/types/enumerations/ValidationSections.md +4 -4
  64. package/docs/types/interfaces/Account.md +5 -5
  65. package/docs/types/interfaces/Agent.md +6 -6
  66. package/docs/types/interfaces/CallbackOptions.md +2 -2
  67. package/docs/types/interfaces/ComponentRequest.md +2 -2
  68. package/docs/types/interfaces/ComponentResponse.md +4 -4
  69. package/docs/types/interfaces/ConnectionRecord.md +7 -7
  70. package/docs/types/interfaces/ConnectionRequest.md +3 -3
  71. package/docs/types/interfaces/Counterparty.md +10 -10
  72. package/docs/types/interfaces/DeclarationProof.md +6 -6
  73. package/docs/types/interfaces/Deposit.md +12 -12
  74. package/docs/types/interfaces/DepositRequest.md +7 -7
  75. package/docs/types/interfaces/DepositRequestOptions.md +1 -1
  76. package/docs/types/interfaces/DepositTransaction.md +10 -10
  77. package/docs/types/interfaces/LegalPerson.md +13 -13
  78. package/docs/types/interfaces/MicroTransferProof.md +9 -9
  79. package/docs/types/interfaces/NaturalPerson.md +13 -13
  80. package/docs/types/interfaces/OwnershipProof.md +4 -4
  81. package/docs/types/interfaces/RefreshSource.md +2 -2
  82. package/docs/types/interfaces/Refreshable.md +1 -1
  83. package/docs/types/interfaces/ScreenshotProof.md +5 -5
  84. package/docs/types/interfaces/SignatureProof.md +14 -12
  85. package/docs/types/interfaces/ThresholdOptions.md +3 -3
  86. package/docs/types/interfaces/Transaction.md +9 -9
  87. package/docs/types/interfaces/TransactionOptions.md +17 -7
  88. package/docs/types/interfaces/TransactionResponse.md +9 -9
  89. package/docs/types/interfaces/VASP.md +19 -9
  90. package/docs/types/interfaces/Wallet.md +8 -8
  91. package/docs/types/interfaces/Withdrawal.md +11 -11
  92. package/docs/types/type-aliases/BlockchainAddress.md +1 -1
  93. package/docs/types/type-aliases/CAIP10.md +1 -1
  94. package/docs/types/type-aliases/CAIP19.md +1 -1
  95. package/docs/types/type-aliases/CAIP2.md +1 -1
  96. package/docs/types/type-aliases/CAIP220.md +1 -1
  97. package/docs/types/type-aliases/Cancel.md +1 -1
  98. package/docs/types/type-aliases/Completed.md +1 -1
  99. package/docs/types/type-aliases/ComponentMessage.md +5 -2
  100. package/docs/types/type-aliases/ConnectionOptions.md +1 -1
  101. package/docs/types/type-aliases/CounterpartyAssistConfig.md +1 -1
  102. package/docs/types/type-aliases/CryptoCredential.md +1 -1
  103. package/docs/types/type-aliases/DID.md +1 -1
  104. package/docs/types/type-aliases/DTI.md +1 -1
  105. package/docs/types/type-aliases/Destination.md +1 -1
  106. package/docs/types/type-aliases/Error.md +1 -1
  107. package/docs/types/type-aliases/FieldOptions.md +2 -2
  108. package/docs/types/type-aliases/FieldTypes.md +1 -1
  109. package/docs/types/type-aliases/HostMessage.md +1 -1
  110. package/docs/types/type-aliases/ISOCurrency.md +1 -1
  111. package/docs/types/type-aliases/Info.md +37 -0
  112. package/docs/types/type-aliases/InvalidValue.md +1 -1
  113. package/docs/types/type-aliases/LEI.md +1 -1
  114. package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
  115. package/docs/types/type-aliases/LegalPersonFields.md +1 -1
  116. package/docs/types/type-aliases/NationalIdentifierTypeFieldOptions.md +1 -1
  117. package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
  118. package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
  119. package/docs/types/type-aliases/NotabeneAsset.md +1 -1
  120. package/docs/types/type-aliases/Ready.md +1 -1
  121. package/docs/types/type-aliases/ResizeRequest.md +1 -1
  122. package/docs/types/type-aliases/Source.md +1 -1
  123. package/docs/types/type-aliases/Theme.md +1 -1
  124. package/docs/types/type-aliases/TransactionAsset.md +1 -1
  125. package/docs/types/type-aliases/TravelAddress.md +1 -1
  126. package/docs/types/type-aliases/URI.md +1 -1
  127. package/docs/types/type-aliases/UUID.md +1 -1
  128. package/docs/types/type-aliases/UpdateValue.md +1 -1
  129. package/docs/types/type-aliases/V1Asset.md +1 -1
  130. package/docs/types/type-aliases/V1Transaction.md +1 -1
  131. package/docs/types/type-aliases/VASPOptions.md +1 -1
  132. package/docs/types/type-aliases/ValidationError.md +1 -1
  133. package/docs/types/type-aliases/Warning.md +37 -0
  134. package/package.json +1 -1
  135. package/src/notabene.ts +4 -0
  136. package/src/types.ts +65 -3
@@ -1 +1 @@
1
- "use strict";var U=Object.defineProperty;var R=(t,e,n)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var a=(t,e,n)=>R(t,typeof e!="symbol"?e+"":e,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f=(t=>(t.PRIVATE="WALLET",t.VASP="VASP",t))(f||{}),w=(t=>(t.NATURAL="natural",t.LEGAL="legal",t.SELF="self",t))(w||{}),g=(t=>(t.EMPTY="empty",t.VERIFY="verify",t.PENDING="pending",t.VERIFIED="verified",t.BANNED="banned",t))(g||{}),v=(t=>(t.ALLOWED="allowed",t.PENDING="pending",t))(v||{}),A=(t=>(t.ASSET="asset",t.DESTINATION="destination",t.COUNTERPARTY="counterparty",t.AGENT="agent",t))(A||{}),l=(t=>(t.COMPLETE="complete",t.RESIZE="resize",t.RESULT="result",t.READY="ready",t.INVALID="invalid",t.ERROR="error",t.CANCEL="cancel",t.WARNING="warning",t.INFO="info",t))(l||{}),y=(t=>(t.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",t.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",t.WALLET_NOT_SUPPORTED="WALLET_NOT_SUPPORTED",t.TOKEN_INVALID="TOKEN_INVALID",t))(y||{}),p=(t=>(t.UPDATE="update",t.REQUEST_RESPONSE="requestResponse",t))(p||{}),C=(t=>(t.PENDING="pending",t.FAILED="rejected",t.FLAGGED="flagged",t.VERIFIED="verified",t))(C||{}),I=(t=>(t.SelfDeclaration="self-declaration",t.SIWE="siwe",t.SIWX="siwx",t.EIP191="eip-191",t.EIP712="eip-712",t.EIP1271="eip-1271",t.BIP137="bip-137",t.BIP322="bip-322",t.BIP137_XPUB="xpub",t.TIP191="tip-191",t.ED25519="ed25519",t.XRP_ED25519="xrp-ed25519",t.XLM_ED25519="xlm-ed25519",t.CIP8="cip-8",t.MicroTransfer="microtransfer",t.Screenshot="screenshot",t.Connect="connect",t.CONCORDIUM="concordium",t))(I||{});class _{constructor(){a(this,"listeners",new Map);a(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){const r=this.listeners.get(e);r&&(r.delete(n),r.size===0&&this.listeners.delete(e))}handleMessage(e){const n=e.data;if(typeof n=="object"&&n!==null&&"type"in n){const r=n.type,s=this.listeners.get(r);s&&s.forEach(i=>i(n))}}send(e){this.port&&this.port.postMessage(e)}}class b{constructor(e,n,r){a(this,"_url");a(this,"_value");a(this,"_options");a(this,"_errors",[]);a(this,"iframe");a(this,"eventManager");a(this,"modal");this._url=e,this._value=n,this._options=r,this.eventManager=new _,this.on(l.INVALID,s=>{s.type===l.INVALID&&(this._errors=s.errors,this._value=s.value)}),this.on(l.RESIZE,s=>{s.type===l.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 n=document.querySelector(e);if(!n)throw new Error(`parentID ${e} not found`);this.embed(n)}embed(e,n=!1){var r,s;this.removeEmbed(),this.iframe=document.createElement("iframe"),this.iframe.src=this.url+(n?"":"&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",i=>{var o,c;i.source===((o=this.iframe)==null?void 0:o.contentWindow)&&((c=this.eventManager)==null||c.setPort(i.ports[0]))}),(s=(r=this.iframe)==null?void 0:r.contentWindow)==null||s.focus()}removeEmbed(){this.iframe&&this.iframe.remove()}send(e){this.eventManager.send(e)}on(e,n){return this.eventManager.on(e,n)}off(e,n){this.eventManager.off(e,n)}update(e,n){this._value=e,n&&(this._options=n),this.send({type:p.UPDATE,value:e,options:this._options})}completion(){return new Promise((e,n)=>{let r,s,i;function o(){r&&r(),s&&s(),i&&i()}r=this.on(l.COMPLETE,c=>{e(c.response),o()}),s=this.on(l.CANCEL,()=>{n(new Error("User cancelled")),o()}),i=this.on("error",c=>{n(new Error(c.message)),o()})})}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(l.CANCEL,()=>{this.closeModal()}),n=this.on(l.COMPLETE,()=>{this.closeModal()});return this.modal.showModal(),this.modal.addEventListener("click",()=>{this.closeModal()}),this.completion().finally(()=>{e(),n()})}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 i;s.source===e&&(console.log("received message from popup",s.data),(i=this.eventManager)==null||i.setPort(s.ports[0]))});const n=this.on(l.CANCEL,()=>{e==null||e.close()}),r=this.on(l.COMPLETE,()=>{e==null||e.close()});return this.completion().finally(()=>{n(),r()})}}function O(t){return Object.entries(t).map(([e,n])=>{if(n==null)return;const r=encodeURIComponent(e),s=encodeURIComponent(typeof n=="object"?JSON.stringify(n):String(n));return`${r}=${s}`}).filter(e=>e!==void 0).join("&")}function D(t){const e=t.slice(1);return e?e.split("&").filter(Boolean).reduce((r,s)=>{const[i,o]=s.split("=");return i&&(r[decodeURIComponent(i)]=o?decodeURIComponent(o):""),r},{}):{}}async function E(t,e){const n=JSON.stringify(t),r=new TextEncoder,s=e?m(e):crypto.getRandomValues(new Uint8Array(32)),i=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["encrypt"]),o=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},i,r.encode(n));return{ciphertext:`${u(o)}-${u(c)}`,key:u(s)}}async function N({ciphertext:t,key:e}){const[n,r]=t.split("-"),s=new Uint8Array(atob(e).split("").map(L=>L.charCodeAt(0))),i=m(n),o=m(r),c=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["decrypt"]),d=new TextDecoder,h=await crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(i)},c,o);return JSON.parse(d.decode(h))}function u(t){const e=new Uint8Array(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}function m(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}async function x(t){const e=await fetch(t.url,{method:"GET"});if(!e.ok)throw new Error(`Failed to get connection: ${await e.text()}`);const n=await e.json();if(!n.id||!n.metadata||!n.status||!n.sealed)throw new Error("Data missing from server response");const r={id:n.id,metadata:n.metadata,status:n.status};if(n.status==="closed")return r;const s=n.sealed[n.sealed.length-1],i=await N({ciphertext:s,key:t.key});return n.status==="completed"?{...r,result:i.result}:{...r,tx:i.tx}}class S{constructor(e){a(this,"endpoint");this.endpoint=e}async create(e,n){const r=await E(e),s={metadata:n,sealed:r.ciphertext},i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!i.ok)throw new Error(`Failed to create connection: ${await i.text()}`);const o=await i.json();return{id:o.id,version:o.version,status:o.status,metadata:n,data:e,key:r.key}}async update(e,n,r,s,i){const o=await E(n,i),c={sealed:o.ciphertext,version:r,status:s},d=await fetch(`${this.endpoint}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok)throw new Error(`Failed to update connection: ${await d.text()}`);const h=await d.json();return{id:h.id,metadata:h.metadata,version:h.version,status:h.status,data:n,key:o.key}}async get(e,n){const r=await fetch(`${this.endpoint}/${e}`,{method:"GET"});if(!r.ok)throw new Error(`Failed to get connection: ${await r.text()}`);const s=await r.json(),i=s.sealed[s.sealed.length-1],o=await N({ciphertext:i,key:n});return{id:s.id,status:s.status,version:s.version,metadata:s.metadata,data:o,key:n}}async close(e){const n=await fetch(`${this.endpoint}/${e}`,{method:"DELETE"});if(!n.ok)throw new Error(`Failed to close connection: ${await n.text()}`)}}class M{constructor(e){a(this,"nodeUrl");a(this,"authToken");a(this,"uxUrl");a(this,"theme");a(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,n,r,s){const i=new URL(this.uxUrl);i.pathname=e;const o=O({authToken:this.authToken,value:n,configuration:r});return i.hash=o,this.nodeUrl&&i.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&i.searchParams.set("theme",JSON.stringify(this.theme)),this.locale&&i.searchParams.set("locale",this.locale),s&&(s.callback&&i.searchParams.set("callback_url",s.callback),s.redirectUri&&i.searchParams.set("redirect_uri",s.redirectUri)),i.toString()}createComponent(e,n,r,s){return new b(this.componentUrl(e,n,r,s),n,r)}createWithdrawalAssist(e,n,r){return this.createComponent("withdrawal-assist",e,n,r)}createConnectWallet(e,n,r){return this.createComponent("connect",e,n,r)}createDepositRequest(e,n,r){return this.createComponent("deposit-request",e,n,r)}createDepositAssist(e,n,r){return this.createComponent("deposit-assist",e,n,r)}}exports.AgentType=f;exports.CMType=l;exports.ConnectionManager=S;exports.EmbeddedComponent=b;exports.ErrorIdentifierCode=y;exports.HMType=p;exports.PersonType=w;exports.ProofStatus=C;exports.ProofTypes=I;exports.Status=g;exports.VASPSearchControl=v;exports.ValidationSections=A;exports.decodeFragmentToObject=D;exports.default=M;exports.getRefreshResult=x;
1
+ "use strict";var U=Object.defineProperty;var _=(t,e,n)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var a=(t,e,n)=>_(t,typeof e!="symbol"?e+"":e,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f=(t=>(t.PRIVATE="WALLET",t.VASP="VASP",t))(f||{}),w=(t=>(t.NATURAL="natural",t.LEGAL="legal",t.SELF="self",t))(w||{}),g=(t=>(t.EMPTY="empty",t.VERIFY="verify",t.PENDING="pending",t.VERIFIED="verified",t.BANNED="banned",t))(g||{}),v=(t=>(t.ALLOWED="allowed",t.PENDING="pending",t))(v||{}),A=(t=>(t.ASSET="asset",t.DESTINATION="destination",t.COUNTERPARTY="counterparty",t.AGENT="agent",t))(A||{}),l=(t=>(t.COMPLETE="complete",t.RESIZE="resize",t.RESULT="result",t.READY="ready",t.INVALID="invalid",t.ERROR="error",t.CANCEL="cancel",t.WARNING="warning",t.INFO="info",t))(l||{}),y=(t=>(t.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",t.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",t.WALLET_NOT_SUPPORTED="WALLET_NOT_SUPPORTED",t.TOKEN_INVALID="TOKEN_INVALID",t))(y||{}),p=(t=>(t.UPDATE="update",t.REQUEST_RESPONSE="requestResponse",t))(p||{}),I=(t=>(t.PENDING="pending",t.FAILED="rejected",t.FLAGGED="flagged",t.VERIFIED="verified",t))(I||{}),C=(t=>(t.SelfDeclaration="self-declaration",t.SIWE="siwe",t.SIWX="siwx",t.SOL_SIWX="sol-siwx",t.EIP191="eip-191",t.EIP712="eip-712",t.EIP1271="eip-1271",t.BIP137="bip-137",t.BIP322="bip-322",t.BIP137_XPUB="xpub",t.TIP191="tip-191",t.ED25519="ed25519",t.XRP_ED25519="xrp-ed25519",t.XLM_ED25519="xlm-ed25519",t.CIP8="cip-8",t.MicroTransfer="microtransfer",t.Screenshot="screenshot",t.Connect="connect",t.CONCORDIUM="concordium",t))(C||{});class R{constructor(){a(this,"listeners",new Map);a(this,"port");this.handleMessage=this.handleMessage.bind(this)}setPort(e){this.port=e,this.port.onmessage=this.handleMessage,this.port.start()}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){const r=this.listeners.get(e);r&&(r.delete(n),r.size===0&&this.listeners.delete(e))}handleMessage(e){const n=e.data;if(typeof n=="object"&&n!==null&&"type"in n){const r=n.type,s=this.listeners.get(r);s&&s.forEach(i=>i(n))}}send(e){this.port&&this.port.postMessage(e)}}class b{constructor(e,n,r){a(this,"_url");a(this,"_value");a(this,"_options");a(this,"_errors",[]);a(this,"iframe");a(this,"eventManager");a(this,"modal");this._url=e,this._value=n,this._options=r,this.eventManager=new R,this.on(l.INVALID,s=>{s.type===l.INVALID&&(this._errors=s.errors,this._value=s.value)}),this.on(l.RESIZE,s=>{s.type===l.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 n=document.querySelector(e);if(!n)throw new Error(`parentID ${e} not found`);this.embed(n)}embed(e,n=!1){var r,s;this.removeEmbed(),this.iframe=document.createElement("iframe"),this.iframe.src=this.url+(n?"":"&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",i=>{var o,c;i.source===((o=this.iframe)==null?void 0:o.contentWindow)&&((c=this.eventManager)==null||c.setPort(i.ports[0]))}),(s=(r=this.iframe)==null?void 0:r.contentWindow)==null||s.focus()}removeEmbed(){this.iframe&&this.iframe.remove()}send(e){this.eventManager.send(e)}on(e,n){return this.eventManager.on(e,n)}off(e,n){this.eventManager.off(e,n)}update(e,n){this._value=e,n&&(this._options=n),this.send({type:p.UPDATE,value:e,options:this._options})}completion(){return new Promise((e,n)=>{let r,s,i;function o(){r&&r(),s&&s(),i&&i()}r=this.on(l.COMPLETE,c=>{e(c.response),o()}),s=this.on(l.CANCEL,()=>{n(new Error("User cancelled")),o()}),i=this.on("error",c=>{n(new Error(c.message)),o()})})}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(l.CANCEL,()=>{this.closeModal()}),n=this.on(l.COMPLETE,()=>{this.closeModal()});return this.modal.showModal(),this.modal.addEventListener("click",()=>{this.closeModal()}),this.completion().finally(()=>{e(),n()})}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 i;s.source===e&&(console.log("received message from popup",s.data),(i=this.eventManager)==null||i.setPort(s.ports[0]))});const n=this.on(l.CANCEL,()=>{e==null||e.close()}),r=this.on(l.COMPLETE,()=>{e==null||e.close()});return this.completion().finally(()=>{n(),r()})}}function O(t){return Object.entries(t).map(([e,n])=>{if(n==null)return;const r=encodeURIComponent(e),s=encodeURIComponent(typeof n=="object"?JSON.stringify(n):String(n));return`${r}=${s}`}).filter(e=>e!==void 0).join("&")}function S(t){const e=t.slice(1);return e?e.split("&").filter(Boolean).reduce((r,s)=>{const[i,o]=s.split("=");return i&&(r[decodeURIComponent(i)]=o?decodeURIComponent(o):""),r},{}):{}}async function E(t,e){const n=JSON.stringify(t),r=new TextEncoder,s=e?m(e):crypto.getRandomValues(new Uint8Array(32)),i=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["encrypt"]),o=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},i,r.encode(n));return{ciphertext:`${u(o)}-${u(c)}`,key:u(s)}}async function N({ciphertext:t,key:e}){const[n,r]=t.split("-"),s=new Uint8Array(atob(e).split("").map(L=>L.charCodeAt(0))),i=m(n),o=m(r),c=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["decrypt"]),d=new TextDecoder,h=await crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(i)},c,o);return JSON.parse(d.decode(h))}function u(t){const e=new Uint8Array(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}function m(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}async function x(t){const e=await fetch(t.url,{method:"GET"});if(!e.ok)throw new Error(`Failed to get connection: ${await e.text()}`);const n=await e.json();if(!n.id||!n.metadata||!n.status||!n.sealed)throw new Error("Data missing from server response");const r={id:n.id,metadata:n.metadata,status:n.status};if(n.status==="closed")return r;const s=n.sealed[n.sealed.length-1],i=await N({ciphertext:s,key:t.key});return n.status==="completed"?{...r,result:i.result}:{...r,tx:i.tx}}class D{constructor(e){a(this,"endpoint");this.endpoint=e}async create(e,n){const r=await E(e),s={metadata:n,sealed:r.ciphertext},i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!i.ok)throw new Error(`Failed to create connection: ${await i.text()}`);const o=await i.json();return{id:o.id,version:o.version,status:o.status,metadata:n,data:e,key:r.key}}async update(e,n,r,s,i){const o=await E(n,i),c={sealed:o.ciphertext,version:r,status:s},d=await fetch(`${this.endpoint}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok)throw new Error(`Failed to update connection: ${await d.text()}`);const h=await d.json();return{id:h.id,metadata:h.metadata,version:h.version,status:h.status,data:n,key:o.key}}async get(e,n){const r=await fetch(`${this.endpoint}/${e}`,{method:"GET"});if(!r.ok)throw new Error(`Failed to get connection: ${await r.text()}`);const s=await r.json(),i=s.sealed[s.sealed.length-1],o=await N({ciphertext:i,key:n});return{id:s.id,status:s.status,version:s.version,metadata:s.metadata,data:o,key:n}}async close(e){const n=await fetch(`${this.endpoint}/${e}`,{method:"DELETE"});if(!n.ok)throw new Error(`Failed to close connection: ${await n.text()}`)}}class M{constructor(e){a(this,"nodeUrl");a(this,"authToken");a(this,"uxUrl");a(this,"theme");a(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,n,r,s){const i=new URL(this.uxUrl);i.pathname=e;const o=O({authToken:this.authToken,value:n,configuration:r});return i.hash=o,this.nodeUrl&&i.searchParams.set("nodeUrl",this.nodeUrl),this.theme&&i.searchParams.set("theme",JSON.stringify(this.theme)),this.locale&&i.searchParams.set("locale",this.locale),s&&(s.callback&&i.searchParams.set("callback_url",s.callback),s.redirectUri&&i.searchParams.set("redirect_uri",s.redirectUri)),i.toString()}createComponent(e,n,r,s){return new b(this.componentUrl(e,n,r,s),n,r)}createWithdrawalAssist(e,n,r){return this.createComponent("withdrawal-assist",e,n,r)}createConnectWallet(e,n,r){return this.createComponent("connect",e,n,r)}createDepositRequest(e,n,r){return this.createComponent("deposit-request",e,n,r)}createDepositAssist(e,n,r){return this.createComponent("deposit-assist",e,n,r)}}exports.AgentType=f;exports.CMType=l;exports.ConnectionManager=D;exports.EmbeddedComponent=b;exports.ErrorIdentifierCode=y;exports.HMType=p;exports.PersonType=w;exports.ProofStatus=I;exports.ProofTypes=C;exports.Status=g;exports.VASPSearchControl=v;exports.ValidationSections=A;exports.decodeFragmentToObject=S;exports.default=M;exports.getRefreshResult=x;
@@ -1377,6 +1377,8 @@ export declare enum ProofStatus {
1377
1377
  * - SelfDeclaration: User self-declares ownership without cryptographic proof
1378
1378
  * - EIP191: Ethereum personal signature following EIP-191 standard
1379
1379
  * - SIWE: Sign-In with Ethereum message signature (EIP-4361)
1380
+ * - SIWX: Sign-In with X message signature
1381
+ * - SOL_SIWX: Sign-In with Solana message signature (SIWE for Solana)
1380
1382
  * - EIP712: Ethereum typed data signature following EIP-712 standard
1381
1383
  * - BIP137: Bitcoin message signature following BIP-137
1382
1384
  * - BIP322: Bitcoin message signature following BIP-322
@@ -1399,6 +1401,7 @@ export declare enum ProofTypes {
1399
1401
  SelfDeclaration = "self-declaration",
1400
1402
  SIWE = "siwe",
1401
1403
  SIWX = "siwx",
1404
+ SOL_SIWX = "sol-siwx",
1402
1405
  EIP191 = "eip-191",
1403
1406
  EIP712 = "eip-712",
1404
1407
  EIP1271 = "eip-1271",
@@ -1471,14 +1474,70 @@ export declare interface ScreenshotProof extends OwnershipProof {
1471
1474
  * @public
1472
1475
  */
1473
1476
  export declare interface SignatureProof extends OwnershipProof {
1474
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1477
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SOL_SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1475
1478
  proof: string;
1476
1479
  attestation: string;
1477
1480
  wallet_provider: string;
1478
1481
  xpub?: string;
1479
1482
  chainSpecificData?: {
1480
1483
  cardanoCoseKey?: string;
1484
+ } | SolanaMetadata;
1485
+ }
1486
+
1487
+ /**
1488
+ * Input for SIWX message signing
1489
+ * Every SIWX message must include the following fields:
1490
+ * - domain
1491
+ * - address
1492
+ * - statement
1493
+ * - uri
1494
+ * - version
1495
+ * - chainId
1496
+ *
1497
+ * Optional fields:
1498
+ * - nonce
1499
+ * - issuedAt
1500
+ * - expirationTime
1501
+ * - notBefore
1502
+ * - requestId
1503
+ * - resources
1504
+ *
1505
+ * @public
1506
+ */
1507
+ export declare interface SIWXInput {
1508
+ domain: string;
1509
+ address: string;
1510
+ statement?: string;
1511
+ uri?: string;
1512
+ version?: string;
1513
+ chainId?: string;
1514
+ nonce?: string;
1515
+ issuedAt?: string;
1516
+ expirationTime?: string;
1517
+ notBefore?: string;
1518
+ requestId?: string;
1519
+ resources?: readonly string[];
1520
+ }
1521
+
1522
+ /**
1523
+ * Metadata for Solana SIWX ownership proofs
1524
+ * @remarks
1525
+ * - Includes the account public key and address
1526
+ * - Includes the signed message
1527
+ * - Includes the signature
1528
+ * - Includes the message
1529
+ *
1530
+ * @see {@link SignatureProof} For signature-based proofs
1531
+ * @public
1532
+ */
1533
+ export declare interface SolanaMetadata {
1534
+ account: {
1535
+ address: string;
1536
+ publicKey: Uint8Array;
1481
1537
  };
1538
+ signedMessage: Uint8Array;
1539
+ signature: Uint8Array;
1540
+ message: SIWXInput;
1482
1541
  }
1483
1542
 
1484
1543
  /**
@@ -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.10.0-next.4",
13
+ "version": "2.11.0",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",
@@ -1377,6 +1377,8 @@ export declare enum ProofStatus {
1377
1377
  * - SelfDeclaration: User self-declares ownership without cryptographic proof
1378
1378
  * - EIP191: Ethereum personal signature following EIP-191 standard
1379
1379
  * - SIWE: Sign-In with Ethereum message signature (EIP-4361)
1380
+ * - SIWX: Sign-In with X message signature
1381
+ * - SOL_SIWX: Sign-In with Solana message signature (SIWE for Solana)
1380
1382
  * - EIP712: Ethereum typed data signature following EIP-712 standard
1381
1383
  * - BIP137: Bitcoin message signature following BIP-137
1382
1384
  * - BIP322: Bitcoin message signature following BIP-322
@@ -1399,6 +1401,7 @@ export declare enum ProofTypes {
1399
1401
  SelfDeclaration = "self-declaration",
1400
1402
  SIWE = "siwe",
1401
1403
  SIWX = "siwx",
1404
+ SOL_SIWX = "sol-siwx",
1402
1405
  EIP191 = "eip-191",
1403
1406
  EIP712 = "eip-712",
1404
1407
  EIP1271 = "eip-1271",
@@ -1471,14 +1474,70 @@ export declare interface ScreenshotProof extends OwnershipProof {
1471
1474
  * @public
1472
1475
  */
1473
1476
  export declare interface SignatureProof extends OwnershipProof {
1474
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1477
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SOL_SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1475
1478
  proof: string;
1476
1479
  attestation: string;
1477
1480
  wallet_provider: string;
1478
1481
  xpub?: string;
1479
1482
  chainSpecificData?: {
1480
1483
  cardanoCoseKey?: string;
1484
+ } | SolanaMetadata;
1485
+ }
1486
+
1487
+ /**
1488
+ * Input for SIWX message signing
1489
+ * Every SIWX message must include the following fields:
1490
+ * - domain
1491
+ * - address
1492
+ * - statement
1493
+ * - uri
1494
+ * - version
1495
+ * - chainId
1496
+ *
1497
+ * Optional fields:
1498
+ * - nonce
1499
+ * - issuedAt
1500
+ * - expirationTime
1501
+ * - notBefore
1502
+ * - requestId
1503
+ * - resources
1504
+ *
1505
+ * @public
1506
+ */
1507
+ export declare interface SIWXInput {
1508
+ domain: string;
1509
+ address: string;
1510
+ statement?: string;
1511
+ uri?: string;
1512
+ version?: string;
1513
+ chainId?: string;
1514
+ nonce?: string;
1515
+ issuedAt?: string;
1516
+ expirationTime?: string;
1517
+ notBefore?: string;
1518
+ requestId?: string;
1519
+ resources?: readonly string[];
1520
+ }
1521
+
1522
+ /**
1523
+ * Metadata for Solana SIWX ownership proofs
1524
+ * @remarks
1525
+ * - Includes the account public key and address
1526
+ * - Includes the signed message
1527
+ * - Includes the signature
1528
+ * - Includes the message
1529
+ *
1530
+ * @see {@link SignatureProof} For signature-based proofs
1531
+ * @public
1532
+ */
1533
+ export declare interface SolanaMetadata {
1534
+ account: {
1535
+ address: string;
1536
+ publicKey: Uint8Array;
1481
1537
  };
1538
+ signedMessage: Uint8Array;
1539
+ signature: Uint8Array;
1540
+ message: SIWXInput;
1482
1541
  }
1483
1542
 
1484
1543
  /**
@@ -1,8 +1,8 @@
1
1
  var v = Object.defineProperty;
2
2
  var g = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var a = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
4
- var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
5
- class R {
4
+ var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), I = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(I || {}), y = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(y || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.SOL_SIWX = "sol-siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
5
+ class _ {
6
6
  constructor() {
7
7
  a(this, "listeners", /* @__PURE__ */ new Map());
8
8
  a(this, "port");
@@ -68,7 +68,7 @@ class R {
68
68
  this.port && this.port.postMessage(e);
69
69
  }
70
70
  }
71
- class _ {
71
+ class x {
72
72
  /**
73
73
  * Creates an instance of EmbeddedComponent.
74
74
  * @param url - The URL of the embedded component
@@ -82,7 +82,7 @@ class _ {
82
82
  a(this, "iframe");
83
83
  a(this, "eventManager");
84
84
  a(this, "modal");
85
- this._url = e, this._value = n, this._options = s, this.eventManager = new R(), this.on(l.INVALID, (r) => {
85
+ this._url = e, this._value = n, this._options = s, this.eventManager = new _(), this.on(l.INVALID, (r) => {
86
86
  r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
87
87
  }), this.on(l.RESIZE, (r) => {
88
88
  r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
@@ -237,7 +237,7 @@ class _ {
237
237
  });
238
238
  }
239
239
  }
240
- function x(t) {
240
+ function R(t) {
241
241
  return Object.entries(t).map(([e, n]) => {
242
242
  if (n == null) return;
243
243
  const s = encodeURIComponent(e), r = encodeURIComponent(
@@ -303,7 +303,7 @@ function m(t) {
303
303
  n[s] = e.charCodeAt(s);
304
304
  return n;
305
305
  }
306
- async function M(t) {
306
+ async function S(t) {
307
307
  const e = await fetch(t.url, {
308
308
  method: "GET"
309
309
  });
@@ -331,7 +331,7 @@ async function M(t) {
331
331
  tx: i.tx
332
332
  };
333
333
  }
334
- class S {
334
+ class M {
335
335
  constructor(e) {
336
336
  a(this, "endpoint");
337
337
  this.endpoint = e;
@@ -466,7 +466,7 @@ class k {
466
466
  componentUrl(e, n, s, r) {
467
467
  const i = new URL(this.uxUrl);
468
468
  i.pathname = e;
469
- const o = x({
469
+ const o = R({
470
470
  authToken: this.authToken,
471
471
  value: n,
472
472
  configuration: s
@@ -484,7 +484,7 @@ class k {
484
484
  * @internal
485
485
  */
486
486
  createComponent(e, n, s, r) {
487
- return new _(
487
+ return new x(
488
488
  this.componentUrl(e, n, s, r),
489
489
  n,
490
490
  s
@@ -561,17 +561,17 @@ class k {
561
561
  export {
562
562
  A as AgentType,
563
563
  l as CMType,
564
- S as ConnectionManager,
565
- _ as EmbeddedComponent,
564
+ M as ConnectionManager,
565
+ x as EmbeddedComponent,
566
566
  b as ErrorIdentifierCode,
567
567
  E as HMType,
568
- y as PersonType,
568
+ I as PersonType,
569
569
  C as ProofStatus,
570
570
  U as ProofTypes,
571
- I as Status,
571
+ y as Status,
572
572
  N as VASPSearchControl,
573
573
  L as ValidationSections,
574
574
  O as decodeFragmentToObject,
575
575
  k as default,
576
- M as getRefreshResult
576
+ S as getRefreshResult
577
577
  };
@@ -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.10.0-next.4",
13
+ "version": "2.11.0",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",
@@ -1377,6 +1377,8 @@ export declare enum ProofStatus {
1377
1377
  * - SelfDeclaration: User self-declares ownership without cryptographic proof
1378
1378
  * - EIP191: Ethereum personal signature following EIP-191 standard
1379
1379
  * - SIWE: Sign-In with Ethereum message signature (EIP-4361)
1380
+ * - SIWX: Sign-In with X message signature
1381
+ * - SOL_SIWX: Sign-In with Solana message signature (SIWE for Solana)
1380
1382
  * - EIP712: Ethereum typed data signature following EIP-712 standard
1381
1383
  * - BIP137: Bitcoin message signature following BIP-137
1382
1384
  * - BIP322: Bitcoin message signature following BIP-322
@@ -1399,6 +1401,7 @@ export declare enum ProofTypes {
1399
1401
  SelfDeclaration = "self-declaration",
1400
1402
  SIWE = "siwe",
1401
1403
  SIWX = "siwx",
1404
+ SOL_SIWX = "sol-siwx",
1402
1405
  EIP191 = "eip-191",
1403
1406
  EIP712 = "eip-712",
1404
1407
  EIP1271 = "eip-1271",
@@ -1471,14 +1474,70 @@ export declare interface ScreenshotProof extends OwnershipProof {
1471
1474
  * @public
1472
1475
  */
1473
1476
  export declare interface SignatureProof extends OwnershipProof {
1474
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1477
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SOL_SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1475
1478
  proof: string;
1476
1479
  attestation: string;
1477
1480
  wallet_provider: string;
1478
1481
  xpub?: string;
1479
1482
  chainSpecificData?: {
1480
1483
  cardanoCoseKey?: string;
1484
+ } | SolanaMetadata;
1485
+ }
1486
+
1487
+ /**
1488
+ * Input for SIWX message signing
1489
+ * Every SIWX message must include the following fields:
1490
+ * - domain
1491
+ * - address
1492
+ * - statement
1493
+ * - uri
1494
+ * - version
1495
+ * - chainId
1496
+ *
1497
+ * Optional fields:
1498
+ * - nonce
1499
+ * - issuedAt
1500
+ * - expirationTime
1501
+ * - notBefore
1502
+ * - requestId
1503
+ * - resources
1504
+ *
1505
+ * @public
1506
+ */
1507
+ export declare interface SIWXInput {
1508
+ domain: string;
1509
+ address: string;
1510
+ statement?: string;
1511
+ uri?: string;
1512
+ version?: string;
1513
+ chainId?: string;
1514
+ nonce?: string;
1515
+ issuedAt?: string;
1516
+ expirationTime?: string;
1517
+ notBefore?: string;
1518
+ requestId?: string;
1519
+ resources?: readonly string[];
1520
+ }
1521
+
1522
+ /**
1523
+ * Metadata for Solana SIWX ownership proofs
1524
+ * @remarks
1525
+ * - Includes the account public key and address
1526
+ * - Includes the signed message
1527
+ * - Includes the signature
1528
+ * - Includes the message
1529
+ *
1530
+ * @see {@link SignatureProof} For signature-based proofs
1531
+ * @public
1532
+ */
1533
+ export declare interface SolanaMetadata {
1534
+ account: {
1535
+ address: string;
1536
+ publicKey: Uint8Array;
1481
1537
  };
1538
+ signedMessage: Uint8Array;
1539
+ signature: Uint8Array;
1540
+ message: SIWXInput;
1482
1541
  }
1483
1542
 
1484
1543
  /**
package/dist/notabene.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var v = Object.defineProperty;
2
2
  var g = (t, e, n) => e in t ? v(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var a = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
4
- var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), y = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(y || {}), I = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(I || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
5
- class R {
4
+ var A = /* @__PURE__ */ ((t) => (t.PRIVATE = "WALLET", t.VASP = "VASP", t))(A || {}), I = /* @__PURE__ */ ((t) => (t.NATURAL = "natural", t.LEGAL = "legal", t.SELF = "self", t))(I || {}), y = /* @__PURE__ */ ((t) => (t.EMPTY = "empty", t.VERIFY = "verify", t.PENDING = "pending", t.VERIFIED = "verified", t.BANNED = "banned", t))(y || {}), N = /* @__PURE__ */ ((t) => (t.ALLOWED = "allowed", t.PENDING = "pending", t))(N || {}), L = /* @__PURE__ */ ((t) => (t.ASSET = "asset", t.DESTINATION = "destination", t.COUNTERPARTY = "counterparty", t.AGENT = "agent", t))(L || {}), l = /* @__PURE__ */ ((t) => (t.COMPLETE = "complete", t.RESIZE = "resize", t.RESULT = "result", t.READY = "ready", t.INVALID = "invalid", t.ERROR = "error", t.CANCEL = "cancel", t.WARNING = "warning", t.INFO = "info", t))(l || {}), b = /* @__PURE__ */ ((t) => (t.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", t.WALLET_CONNECTION_FAILED = "WALLET_CONNECTION_FAILED", t.WALLET_NOT_SUPPORTED = "WALLET_NOT_SUPPORTED", t.TOKEN_INVALID = "TOKEN_INVALID", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.UPDATE = "update", t.REQUEST_RESPONSE = "requestResponse", t))(E || {}), C = /* @__PURE__ */ ((t) => (t.PENDING = "pending", t.FAILED = "rejected", t.FLAGGED = "flagged", t.VERIFIED = "verified", t))(C || {}), U = /* @__PURE__ */ ((t) => (t.SelfDeclaration = "self-declaration", t.SIWE = "siwe", t.SIWX = "siwx", t.SOL_SIWX = "sol-siwx", t.EIP191 = "eip-191", t.EIP712 = "eip-712", t.EIP1271 = "eip-1271", t.BIP137 = "bip-137", t.BIP322 = "bip-322", t.BIP137_XPUB = "xpub", t.TIP191 = "tip-191", t.ED25519 = "ed25519", t.XRP_ED25519 = "xrp-ed25519", t.XLM_ED25519 = "xlm-ed25519", t.CIP8 = "cip-8", t.MicroTransfer = "microtransfer", t.Screenshot = "screenshot", t.Connect = "connect", t.CONCORDIUM = "concordium", t))(U || {});
5
+ class _ {
6
6
  constructor() {
7
7
  a(this, "listeners", /* @__PURE__ */ new Map());
8
8
  a(this, "port");
@@ -68,7 +68,7 @@ class R {
68
68
  this.port && this.port.postMessage(e);
69
69
  }
70
70
  }
71
- class _ {
71
+ class x {
72
72
  /**
73
73
  * Creates an instance of EmbeddedComponent.
74
74
  * @param url - The URL of the embedded component
@@ -82,7 +82,7 @@ class _ {
82
82
  a(this, "iframe");
83
83
  a(this, "eventManager");
84
84
  a(this, "modal");
85
- this._url = e, this._value = n, this._options = s, this.eventManager = new R(), this.on(l.INVALID, (r) => {
85
+ this._url = e, this._value = n, this._options = s, this.eventManager = new _(), this.on(l.INVALID, (r) => {
86
86
  r.type === l.INVALID && (this._errors = r.errors, this._value = r.value);
87
87
  }), this.on(l.RESIZE, (r) => {
88
88
  r.type === l.RESIZE && this.iframe && (this.iframe.style.height = `${r.height}px`);
@@ -237,7 +237,7 @@ class _ {
237
237
  });
238
238
  }
239
239
  }
240
- function x(t) {
240
+ function R(t) {
241
241
  return Object.entries(t).map(([e, n]) => {
242
242
  if (n == null) return;
243
243
  const s = encodeURIComponent(e), r = encodeURIComponent(
@@ -303,7 +303,7 @@ function m(t) {
303
303
  n[s] = e.charCodeAt(s);
304
304
  return n;
305
305
  }
306
- async function M(t) {
306
+ async function S(t) {
307
307
  const e = await fetch(t.url, {
308
308
  method: "GET"
309
309
  });
@@ -331,7 +331,7 @@ async function M(t) {
331
331
  tx: i.tx
332
332
  };
333
333
  }
334
- class S {
334
+ class M {
335
335
  constructor(e) {
336
336
  a(this, "endpoint");
337
337
  this.endpoint = e;
@@ -466,7 +466,7 @@ class k {
466
466
  componentUrl(e, n, s, r) {
467
467
  const i = new URL(this.uxUrl);
468
468
  i.pathname = e;
469
- const o = x({
469
+ const o = R({
470
470
  authToken: this.authToken,
471
471
  value: n,
472
472
  configuration: s
@@ -484,7 +484,7 @@ class k {
484
484
  * @internal
485
485
  */
486
486
  createComponent(e, n, s, r) {
487
- return new _(
487
+ return new x(
488
488
  this.componentUrl(e, n, s, r),
489
489
  n,
490
490
  s
@@ -561,17 +561,17 @@ class k {
561
561
  export {
562
562
  A as AgentType,
563
563
  l as CMType,
564
- S as ConnectionManager,
565
- _ as EmbeddedComponent,
564
+ M as ConnectionManager,
565
+ x as EmbeddedComponent,
566
566
  b as ErrorIdentifierCode,
567
567
  E as HMType,
568
- y as PersonType,
568
+ I as PersonType,
569
569
  C as ProofStatus,
570
570
  U as ProofTypes,
571
- I as Status,
571
+ y as Status,
572
572
  N as VASPSearchControl,
573
573
  L as ValidationSections,
574
574
  O as decodeFragmentToObject,
575
575
  k as default,
576
- M as getRefreshResult
576
+ S as getRefreshResult
577
577
  };
package/docs/README.md CHANGED
@@ -710,6 +710,7 @@ import Notabene, {
710
710
  } from '@notabene/javascript-sdk';
711
711
 
712
712
  const options: TransactionOptions = {
713
+ jurisdiction: "US", // Defaults to the jurisdiction associated with customer token
713
714
  proofs: {
714
715
  reuseProof: true, // Defaults true
715
716
  microTransfer: {
@@ -910,9 +911,13 @@ The two options are:
910
911
 
911
912
  ### Counterparty Field Properties
912
913
 
913
- The fields requested from a customer about a counterparty can be configured with the fields object. You can configure required and optional fields individually for both natural and legal persons.
914
+ By default, counterparty fields are determined based on the rules of the jurisdiction associated with the VASP using the component. This ensures compliance even when fields are not explicitly configured.
914
915
 
915
- We recommend working closely with your compliance team for this. Bearing in mind that different jurisdictions have different rules.
916
+ If a specific jurisdiction is manually configured, the component will instead derive the fields according to that jurisdiction’s rules.
917
+
918
+ For VASPs seeking more granular control over the fields displayed to customers about counterparties, the fields object can be used to customize visibility. Required and optional fields can be configured independently for both natural and legal persons.
919
+
920
+ We recommend working closely with your compliance team when making these configurations, as regulatory requirements vary significantly across jurisdictions.
916
921
 
917
922
  Each field can be configured like this:
918
923
 
@@ -958,8 +963,8 @@ const options: TransactionOptions = {
958
963
  },
959
964
  legalPerson: {
960
965
  name: true, // Default true
961
- lei: true, // Default true
962
- website: { optional: true }, // Default true
966
+ lei: {optional: true }, // Default optional
967
+ website: { optional: true }, // Default optional
963
968
  email: true,
964
969
  phone: true,
965
970
  geographicAddress: false,
@@ -16,7 +16,7 @@ Configuration options for Transaction components
16
16
 
17
17
  #### Defined in
18
18
 
19
- [types.ts:853](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L853)
19
+ [types.ts:854](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L854)
20
20
 
21
21
  ***
22
22
 
@@ -26,7 +26,7 @@ Configuration options for Transaction components
26
26
 
27
27
  #### Defined in
28
28
 
29
- [types.ts:854](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L854)
29
+ [types.ts:855](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L855)
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:858](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L858)
39
+ [types.ts:859](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L859)
40
40
 
41
41
  ***
42
42
 
@@ -46,7 +46,7 @@ Configuration options for Transaction components
46
46
 
47
47
  #### Defined in
48
48
 
49
- [types.ts:855](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L855)
49
+ [types.ts:856](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L856)
50
50
 
51
51
  ***
52
52
 
@@ -56,7 +56,17 @@ Configuration options for Transaction components
56
56
 
57
57
  #### Defined in
58
58
 
59
- [types.ts:857](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L857)
59
+ [types.ts:858](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L858)
60
+
61
+ ***
62
+
63
+ ### jurisdiction?
64
+
65
+ > `optional` **jurisdiction**: `string`
66
+
67
+ #### Defined in
68
+
69
+ [types.ts:853](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L853)
60
70
 
61
71
  ***
62
72
 
@@ -94,7 +104,7 @@ Configuration options for Transaction components
94
104
 
95
105
  #### Defined in
96
106
 
97
- [types.ts:843](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L843)
107
+ [types.ts:843](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L843)
98
108
 
99
109
  ***
100
110
 
@@ -104,4 +114,4 @@ Configuration options for Transaction components
104
114
 
105
115
  #### Defined in
106
116
 
107
- [types.ts:856](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/types.ts#L856)
117
+ [types.ts:857](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/types.ts#L857)
@@ -32,4 +32,4 @@ Promise resolving to connection result with decrypted data
32
32
 
33
33
  ## Defined in
34
34
 
35
- [utils/connections.ts:60](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/b3b58dde23d9780aa680a2d943b97074d4e49921/src/utils/connections.ts#L60)
35
+ [utils/connections.ts:60](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/52abba74a4a6b14d6ca0d23191964d38919d32ea/src/utils/connections.ts#L60)