@notabene/javascript-sdk 2.9.3 → 2.10.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +22 -29
  2. package/dist/cjs/notabene.cjs +1 -1
  3. package/dist/cjs/notabene.d.ts +78 -26
  4. package/dist/cjs/package.json +2 -1
  5. package/dist/esm/notabene.d.ts +78 -26
  6. package/dist/esm/notabene.js +19 -13
  7. package/dist/esm/package.json +2 -1
  8. package/dist/notabene.d.ts +78 -26
  9. package/dist/notabene.js +19 -13
  10. package/docs/README.md +218 -47
  11. package/docs/_media/TransactionOptions.md +9 -9
  12. package/docs/_media/getRefreshResult.md +35 -0
  13. package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
  14. package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
  15. package/docs/ivms/types/type-aliases/Address.md +1 -1
  16. package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
  17. package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
  18. package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
  19. package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
  20. package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
  21. package/docs/ivms/types/type-aliases/ISODate.md +1 -1
  22. package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
  23. package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
  24. package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
  25. package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
  26. package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
  27. package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
  28. package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
  29. package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
  30. package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
  31. package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
  32. package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
  33. package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
  34. package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
  35. package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
  36. package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
  37. package/docs/ivms/types/type-aliases/Originator.md +1 -1
  38. package/docs/ivms/types/type-aliases/Person.md +1 -1
  39. package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
  40. package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
  41. package/docs/notabene/README.md +7 -1
  42. package/docs/notabene/classes/ConnectionManager.md +19 -5
  43. package/docs/notabene/classes/EmbeddedComponent.md +17 -17
  44. package/docs/notabene/classes/default.md +7 -7
  45. package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
  46. package/docs/notabene/functions/getRefreshResult.md +11 -3
  47. package/docs/notabene/interfaces/ConnectionData.md +8 -8
  48. package/docs/notabene/interfaces/ConnectionMetadata.md +6 -6
  49. package/docs/notabene/interfaces/ConnectionResponse.md +12 -12
  50. package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
  51. package/docs/notabene/type-aliases/ConnectionResult.md +17 -0
  52. package/docs/notabene/type-aliases/ConnectionStatus.md +1 -1
  53. package/docs/notabene/type-aliases/MessageCallback.md +1 -1
  54. package/docs/notabene/type-aliases/TransactionType.md +1 -1
  55. package/docs/types/README.md +1 -0
  56. package/docs/types/enumerations/AgentType.md +2 -2
  57. package/docs/types/enumerations/CMType.md +7 -7
  58. package/docs/types/enumerations/ErrorIdentifierCode.md +4 -4
  59. package/docs/types/enumerations/HMType.md +2 -2
  60. package/docs/types/enumerations/PersonType.md +3 -3
  61. package/docs/types/enumerations/ProofStatus.md +4 -4
  62. package/docs/types/enumerations/ProofTypes.md +27 -17
  63. package/docs/types/enumerations/Status.md +5 -5
  64. package/docs/types/enumerations/VASPSearchControl.md +2 -2
  65. package/docs/types/enumerations/ValidationSections.md +4 -4
  66. package/docs/types/interfaces/Account.md +59 -0
  67. package/docs/types/interfaces/Agent.md +6 -6
  68. package/docs/types/interfaces/CallbackOptions.md +2 -2
  69. package/docs/types/interfaces/ComponentRequest.md +2 -2
  70. package/docs/types/interfaces/ComponentResponse.md +4 -4
  71. package/docs/types/interfaces/ConnectionRecord.md +7 -7
  72. package/docs/types/interfaces/ConnectionRequest.md +3 -3
  73. package/docs/types/interfaces/Counterparty.md +10 -10
  74. package/docs/types/interfaces/DeclarationProof.md +6 -6
  75. package/docs/types/interfaces/Deposit.md +25 -11
  76. package/docs/types/interfaces/DepositRequest.md +9 -9
  77. package/docs/types/interfaces/DepositRequestOptions.md +1 -1
  78. package/docs/types/interfaces/DepositTransaction.md +23 -9
  79. package/docs/types/interfaces/LegalPerson.md +13 -13
  80. package/docs/types/interfaces/MicroTransferProof.md +9 -9
  81. package/docs/types/interfaces/NaturalPerson.md +13 -13
  82. package/docs/types/interfaces/OwnershipProof.md +4 -4
  83. package/docs/types/interfaces/RefreshSource.md +2 -2
  84. package/docs/types/interfaces/Refreshable.md +1 -1
  85. package/docs/types/interfaces/ScreenshotProof.md +5 -5
  86. package/docs/types/interfaces/SignatureProof.md +10 -10
  87. package/docs/types/interfaces/ThresholdOptions.md +3 -3
  88. package/docs/types/interfaces/Transaction.md +18 -8
  89. package/docs/types/interfaces/TransactionOptions.md +9 -9
  90. package/docs/types/interfaces/TransactionResponse.md +9 -9
  91. package/docs/types/interfaces/VASP.md +9 -9
  92. package/docs/types/interfaces/Wallet.md +8 -8
  93. package/docs/types/interfaces/Withdrawal.md +24 -10
  94. package/docs/types/type-aliases/BlockchainAddress.md +1 -1
  95. package/docs/types/type-aliases/CAIP10.md +1 -1
  96. package/docs/types/type-aliases/CAIP19.md +1 -1
  97. package/docs/types/type-aliases/CAIP2.md +1 -1
  98. package/docs/types/type-aliases/CAIP220.md +1 -1
  99. package/docs/types/type-aliases/Cancel.md +1 -1
  100. package/docs/types/type-aliases/Completed.md +1 -1
  101. package/docs/types/type-aliases/ComponentMessage.md +1 -1
  102. package/docs/types/type-aliases/ConnectionOptions.md +1 -1
  103. package/docs/types/type-aliases/CounterpartyAssistConfig.md +2 -2
  104. package/docs/types/type-aliases/CryptoCredential.md +1 -1
  105. package/docs/types/type-aliases/DID.md +1 -1
  106. package/docs/types/type-aliases/DTI.md +1 -1
  107. package/docs/types/type-aliases/Destination.md +1 -1
  108. package/docs/types/type-aliases/Error.md +1 -1
  109. package/docs/types/type-aliases/FieldOptions.md +1 -1
  110. package/docs/types/type-aliases/FieldTypes.md +1 -1
  111. package/docs/types/type-aliases/HostMessage.md +1 -1
  112. package/docs/types/type-aliases/ISOCurrency.md +1 -1
  113. package/docs/types/type-aliases/InvalidValue.md +1 -1
  114. package/docs/types/type-aliases/LEI.md +1 -1
  115. package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
  116. package/docs/types/type-aliases/LegalPersonFields.md +1 -1
  117. package/docs/types/type-aliases/NationalIdentifierTypeFieldOptions.md +1 -1
  118. package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
  119. package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
  120. package/docs/types/type-aliases/NotabeneAsset.md +1 -1
  121. package/docs/types/type-aliases/Ready.md +1 -1
  122. package/docs/types/type-aliases/ResizeRequest.md +1 -1
  123. package/docs/types/type-aliases/Source.md +1 -1
  124. package/docs/types/type-aliases/Theme.md +1 -1
  125. package/docs/types/type-aliases/TransactionAsset.md +1 -1
  126. package/docs/types/type-aliases/TravelAddress.md +1 -1
  127. package/docs/types/type-aliases/URI.md +1 -1
  128. package/docs/types/type-aliases/UUID.md +1 -1
  129. package/docs/types/type-aliases/UpdateValue.md +1 -1
  130. package/docs/types/type-aliases/V1Asset.md +1 -1
  131. package/docs/types/type-aliases/V1Transaction.md +1 -1
  132. package/docs/types/type-aliases/VASPOptions.md +1 -1
  133. package/docs/types/type-aliases/ValidationError.md +1 -1
  134. package/package.json +2 -1
  135. package/src/types.ts +36 -2
  136. package/src/utils/connections.ts +47 -21
  137. package/src/utils/encryption.ts +13 -6
  138. package/docs/notabene/interfaces/ConnectionResult.md +0 -61
package/README.md CHANGED
@@ -303,6 +303,10 @@ const withdrawal = notabene.createWithdrawalAssist({
303
303
  currency: 'USD', // ISO currency code
304
304
  price: 1700.12, // Asset price
305
305
  },
306
+ customer: {
307
+ name: 'John Smith',
308
+ email: "john.smith@domain.com",
309
+ },
306
310
  });
307
311
  ```
308
312
 
@@ -312,6 +316,7 @@ const withdrawal = notabene.createWithdrawalAssist({
312
316
  - `destination`: The destination or blockchain address for the withdrawal. See [Destination](#destination)
313
317
  - `amountDecimal`: The amount to transfer in decimal format. See [Transaction Amount](#transaction-amount)
314
318
  - `assetPrice`: Optional price information in a fiat currency. See [Asset Price](#asset-price)
319
+ - `customer`: Optional Customer object containing their name and email
315
320
 
316
321
  If any of the required parameters are missing the component will just show the Notabene badge.
317
322
 
@@ -329,6 +334,10 @@ const withdrawal = notabene.createWithdrawalAssist(
329
334
  currency: 'USD', // ISO currency code
330
335
  price: 1700.12, // Asset price
331
336
  },
337
+ customer: {
338
+ name: 'John Smith',
339
+ email: "john.smith@domain.com",
340
+ },
332
341
  },
333
342
  {
334
343
  proofs: {
@@ -348,6 +357,10 @@ See [Transaction Options](#transaction-options)
348
357
 
349
358
  The Connect Wallet component helps you collect and verify the address of your users self-hosted wallet in one go.
350
359
 
360
+ ### Parameters
361
+
362
+ - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
363
+
351
364
  ```js
352
365
  const connect = notabene.createConnectWallet({
353
366
  asset: 'ETH',
@@ -356,31 +369,6 @@ const connect = notabene.createConnectWallet({
356
369
  const { proof, txCreate } = await connect.openModal();
357
370
  ```
358
371
 
359
- ### Parameters
360
-
361
- - `asset`: The cryptocurrency or token being transferred. See [Asset Specification](#asset-specification)
362
-
363
- ### Configuration Options
364
-
365
- Include configuration Options as a second optional parameter:
366
-
367
- ```js
368
- const connect = notabene.createConnectWallet(
369
- {
370
- asset: 'ETH',
371
- },
372
- {
373
- proofs: {
374
- microTransfer: {
375
- destination: '0x...',
376
- amountSubunits: '12344',
377
- timeout: 86440,
378
- },
379
- },
380
- },
381
- );
382
- ```
383
-
384
372
  ## Deposit Request
385
373
 
386
374
  The Deposit Request lets your customers request deposits that are fully Travel Rule compliant.
@@ -720,6 +708,7 @@ import Notabene, {
720
708
  } from '@notabene/javascript-sdk';
721
709
 
722
710
  const options: TransactionOptions = {
711
+ jurisdiction: "US", // Defaults to the jurisdiction associated with customer token
723
712
  proofs: {
724
713
  reuseProof: true, // Defaults true
725
714
  microTransfer: {
@@ -920,9 +909,13 @@ The two options are:
920
909
 
921
910
  ### Counterparty Field Properties
922
911
 
923
- 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.
912
+ 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.
924
913
 
925
- We recommend working closely with your compliance team for this. Bearing in mind that different jurisdictions have different rules.
914
+ If a specific jurisdiction is manually configured, the component will instead derive the fields according to that jurisdiction’s rules.
915
+
916
+ 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.
917
+
918
+ We recommend working closely with your compliance team when making these configurations, as regulatory requirements vary significantly across jurisdictions.
926
919
 
927
920
  Each field can be configured like this:
928
921
 
@@ -968,8 +961,8 @@ const options: TransactionOptions = {
968
961
  },
969
962
  legalPerson: {
970
963
  name: true, // Default true
971
- lei: true, // Default true
972
- website: { optional: true }, // Default true
964
+ lei: {optional: true }, // Default optional
965
+ website: { optional: true }, // Default optional
973
966
  email: true,
974
967
  phone: true,
975
968
  geographicAddress: false,
@@ -1 +1 @@
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||{}),y=(t=>(t.ASSET="asset",t.DESTINATION="destination",t.COUNTERPARTY="counterparty",t.AGENT="agent",t))(y||{}),l=(t=>(t.COMPLETE="complete",t.RESIZE="resize",t.RESULT="result",t.READY="ready",t.INVALID="invalid",t.ERROR="error",t.CANCEL="cancel",t))(l||{}),A=(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))(A||{}),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||{}),b=(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))(b||{});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 I{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 x(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 L({ciphertext:t,key:e}){const[n,r]=t.split("-"),s=new Uint8Array(atob(e).split("").map(N=>N.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 S(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 L({ciphertext:s,key:t.key});return n.status==="completed"?{...r,result:i.result}:{...r,tx:i.tx}}class M{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 L({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 O{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=x({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 I(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=M;exports.EmbeddedComponent=I;exports.ErrorIdentifierCode=A;exports.HMType=p;exports.PersonType=w;exports.ProofStatus=C;exports.ProofTypes=b;exports.Status=g;exports.VASPSearchControl=v;exports.ValidationSections=y;exports.decodeFragmentToObject=D;exports.default=O;exports.getRefreshResult=S;
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;
@@ -218,7 +218,9 @@ export declare enum CMType {
218
218
  READY = "ready",
219
219
  INVALID = "invalid",
220
220
  ERROR = "error",
221
- CANCEL = "cancel"
221
+ CANCEL = "cancel",
222
+ WARNING = "warning",
223
+ INFO = "info"
222
224
  }
223
225
 
224
226
  /**
@@ -249,11 +251,14 @@ export declare type Completed<T> = {
249
251
  * @see {@link Completed} For successful completion message format
250
252
  * @see {@link Cancel} For cancellation message format
251
253
  * @see {@link Error} For error message format
254
+ * @see {@link Ready} For ready message format
252
255
  * @see {@link ResizeRequest} For resize message format
253
256
  * @see {@link InvalidValue} For validation failure message format
257
+ * @see {@link Warning} For warning message format
258
+ * @see {@link Info} For info message format
254
259
  * @public
255
260
  */
256
- export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T>;
261
+ export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T> | Warning | Info;
257
262
 
258
263
  /**
259
264
  * Base interface for requests sent to SDK components
@@ -303,10 +308,10 @@ export declare interface ComponentResponse {
303
308
  }
304
309
 
305
310
  export declare interface ConnectionData<T extends ComponentRequest> {
306
- tx: T;
307
- authToken?: string;
308
- txOptions?: TransactionOptions;
309
- result?: TransactionResponse<T>;
311
+ readonly tx: T;
312
+ readonly authToken?: string;
313
+ readonly txOptions?: TransactionOptions;
314
+ readonly result?: TransactionResponse<T>;
310
315
  }
311
316
 
312
317
  /**
@@ -317,21 +322,26 @@ export declare class ConnectionManager {
317
322
  constructor(endpoint: string);
318
323
  /**
319
324
  * Creates a new encrypted connection
325
+ * @template T Type of component request
320
326
  * @param data The component request data to encrypt and store
321
- * @param participants Array of participant identifiers
327
+ * @param metadata Connection metadata including participants and transaction type
322
328
  * @returns Promise resolving to connection details including ID, version, and encryption key
323
329
  */
324
330
  create<T extends ComponentRequest>(data: ConnectionData<T>, metadata: ConnectionMetadata): Promise<ConnectionResponse<T>>;
325
331
  /**
326
332
  * Updates an existing connection with new encrypted data
333
+ * @template T Type of component request
327
334
  * @param id Connection ID
328
335
  * @param data New data to encrypt and store
329
336
  * @param version Current version number
337
+ * @param status New connection status
338
+ * @param key Current encryption key
330
339
  * @returns Promise resolving to updated connection details including new encryption key
331
340
  */
332
341
  update<T extends ComponentRequest>(id: UUID, data: ConnectionData<T>, version: number, status: ConnectionStatus, key: string): Promise<ConnectionResponse<T>>;
333
342
  /**
334
343
  * Retrieves and decrypts connection data
344
+ * @template T Type of component request
335
345
  * @param id Connection ID
336
346
  * @param key Encryption key from previous create/update operation
337
347
  * @returns Promise resolving to connection details including decrypted data
@@ -340,14 +350,16 @@ export declare class ConnectionManager {
340
350
  /**
341
351
  * Closes a connection
342
352
  * @param id Connection ID
353
+ * @returns Promise resolving when the connection is closed
343
354
  */
344
355
  close(id: UUID): Promise<void>;
345
356
  }
346
357
 
347
358
  export declare interface ConnectionMetadata {
348
- nodeUrl?: string;
349
- participants: string[];
350
- transactionType: TransactionType;
359
+ readonly nodeUrl?: string;
360
+ readonly participants: readonly string[];
361
+ readonly transactionType: TransactionType;
362
+ readonly locale?: string;
351
363
  }
352
364
 
353
365
  /**
@@ -365,21 +377,29 @@ export declare interface ConnectionRequest extends ComponentRequest {
365
377
  }
366
378
 
367
379
  export declare interface ConnectionResponse<T extends ComponentRequest> {
368
- id: UUID;
369
- version: number;
370
- status: ConnectionStatus;
371
- metadata: ConnectionMetadata;
372
- data: ConnectionData<T>;
373
- key: string;
380
+ readonly id: UUID;
381
+ readonly version: number;
382
+ readonly status: ConnectionStatus;
383
+ readonly metadata: ConnectionMetadata;
384
+ readonly data: ConnectionData<T>;
385
+ readonly key: string;
374
386
  }
375
387
 
376
- export declare interface ConnectionResult<T extends ComponentRequest> {
377
- id: UUID;
378
- metadata: ConnectionMetadata;
379
- status: ConnectionStatus;
380
- tx?: T;
381
- result?: TransactionResponse<T>;
382
- }
388
+ export declare type ConnectionResult<T extends ComponentRequest> = {
389
+ readonly id: UUID;
390
+ readonly metadata: ConnectionMetadata;
391
+ readonly status: 'closed';
392
+ } | {
393
+ readonly id: UUID;
394
+ readonly metadata: ConnectionMetadata;
395
+ readonly status: 'completed';
396
+ readonly result: TransactionResponse<T>;
397
+ } | {
398
+ readonly id: UUID;
399
+ readonly metadata: ConnectionMetadata;
400
+ readonly status: 'active';
401
+ readonly tx: T;
402
+ };
383
403
 
384
404
  export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
385
405
 
@@ -666,7 +686,6 @@ export declare enum ErrorIdentifierCode {
666
686
  */
667
687
  export declare type FieldOptions = boolean | string[] | {
668
688
  optional: boolean;
669
- transmit: boolean;
670
689
  };
671
690
 
672
691
  /**
@@ -678,6 +697,12 @@ export declare type FieldTypes = {
678
697
  legalPerson?: LegalPersonFields;
679
698
  };
680
699
 
700
+ /**
701
+ * Retrieves and processes connection refresh data
702
+ * @template T Type of component request
703
+ * @param refreshSource Source information for the refresh operation
704
+ * @returns Promise resolving to connection result with decrypted data
705
+ */
681
706
  export declare function getRefreshResult<T extends ComponentRequest>(refreshSource: RefreshSource): Promise<ConnectionResult<T>>;
682
707
 
683
708
  /**
@@ -712,6 +737,18 @@ export declare enum HMType {
712
737
  */
713
738
  export declare type HostMessage<T, O> = UpdateValue<T, O>;
714
739
 
740
+ /**
741
+ * Represents an info component message
742
+ * @param message - Info message
743
+ * @param description - Description of the info message
744
+ * @public
745
+ */
746
+ declare type Info = {
747
+ type: CMType.INFO;
748
+ message: string;
749
+ description?: string;
750
+ };
751
+
715
752
  /**
716
753
  * Intermediary VASP
717
754
  * Represents an intermediary Virtual Asset Service Provider
@@ -1375,7 +1412,8 @@ export declare enum ProofTypes {
1375
1412
  CIP8 = "cip-8",
1376
1413
  MicroTransfer = "microtransfer",
1377
1414
  Screenshot = "screenshot",
1378
- Connect = "connect"
1415
+ Connect = "connect",
1416
+ CONCORDIUM = "concordium"
1379
1417
  }
1380
1418
 
1381
1419
  /**
@@ -1433,7 +1471,7 @@ export declare interface ScreenshotProof extends OwnershipProof {
1433
1471
  * @public
1434
1472
  */
1435
1473
  export declare interface SignatureProof extends OwnershipProof {
1436
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.XLM_ED25519;
1474
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1437
1475
  proof: string;
1438
1476
  attestation: string;
1439
1477
  wallet_provider: string;
@@ -1547,6 +1585,7 @@ export declare interface TransactionOptions {
1547
1585
  fallbacks?: ProofTypes[];
1548
1586
  deminimis?: ThresholdOptions;
1549
1587
  };
1588
+ jurisdiction?: string;
1550
1589
  allowedAgentTypes?: AgentType[];
1551
1590
  allowedCounterpartyTypes?: PersonType[];
1552
1591
  fields?: FieldTypes;
@@ -1727,6 +1766,7 @@ export declare interface VASP extends Agent {
1727
1766
  logo?: URI;
1728
1767
  website?: URI;
1729
1768
  countryOfRegistration?: ISOCountryCode;
1769
+ jurisdictions?: string;
1730
1770
  }
1731
1771
 
1732
1772
  /**
@@ -1761,6 +1801,18 @@ export declare interface Wallet extends Agent {
1761
1801
  wallet_connect_id?: string;
1762
1802
  }
1763
1803
 
1804
+ /**
1805
+ * Represents a warning component message
1806
+ * @param message - Warning message
1807
+ * @param description - Description of the warning message
1808
+ * @public
1809
+ */
1810
+ declare type Warning = {
1811
+ type: CMType.WARNING;
1812
+ message: string;
1813
+ description?: string;
1814
+ };
1815
+
1764
1816
  /**
1765
1817
  * An object representing a withdrawal transaction
1766
1818
  * @public
@@ -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.9.3",
13
+ "version": "2.10.0-next.4",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",
@@ -53,6 +53,7 @@
53
53
  "build:dev": "yarn build && yarn dev",
54
54
  "build:clean": "rimraf dist ts-out coverage temp",
55
55
  "build": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs && yarn docs",
56
+ "build:no-docs": "vite build && yarn typecheck && api-extractor run --local && node scripts/copy-types.mjs",
56
57
  "lint": "eslint . --max-warnings 0",
57
58
  "lint:fix": "yarn lint --fix --cache --no-warn-ignored",
58
59
  "format": "prettier --write --cache .",
@@ -218,7 +218,9 @@ export declare enum CMType {
218
218
  READY = "ready",
219
219
  INVALID = "invalid",
220
220
  ERROR = "error",
221
- CANCEL = "cancel"
221
+ CANCEL = "cancel",
222
+ WARNING = "warning",
223
+ INFO = "info"
222
224
  }
223
225
 
224
226
  /**
@@ -249,11 +251,14 @@ export declare type Completed<T> = {
249
251
  * @see {@link Completed} For successful completion message format
250
252
  * @see {@link Cancel} For cancellation message format
251
253
  * @see {@link Error} For error message format
254
+ * @see {@link Ready} For ready message format
252
255
  * @see {@link ResizeRequest} For resize message format
253
256
  * @see {@link InvalidValue} For validation failure message format
257
+ * @see {@link Warning} For warning message format
258
+ * @see {@link Info} For info message format
254
259
  * @public
255
260
  */
256
- export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T>;
261
+ export declare type ComponentMessage<T> = Completed<T> | Cancel | Error_2 | Ready | ResizeRequest | InvalidValue<T> | Warning | Info;
257
262
 
258
263
  /**
259
264
  * Base interface for requests sent to SDK components
@@ -303,10 +308,10 @@ export declare interface ComponentResponse {
303
308
  }
304
309
 
305
310
  export declare interface ConnectionData<T extends ComponentRequest> {
306
- tx: T;
307
- authToken?: string;
308
- txOptions?: TransactionOptions;
309
- result?: TransactionResponse<T>;
311
+ readonly tx: T;
312
+ readonly authToken?: string;
313
+ readonly txOptions?: TransactionOptions;
314
+ readonly result?: TransactionResponse<T>;
310
315
  }
311
316
 
312
317
  /**
@@ -317,21 +322,26 @@ export declare class ConnectionManager {
317
322
  constructor(endpoint: string);
318
323
  /**
319
324
  * Creates a new encrypted connection
325
+ * @template T Type of component request
320
326
  * @param data The component request data to encrypt and store
321
- * @param participants Array of participant identifiers
327
+ * @param metadata Connection metadata including participants and transaction type
322
328
  * @returns Promise resolving to connection details including ID, version, and encryption key
323
329
  */
324
330
  create<T extends ComponentRequest>(data: ConnectionData<T>, metadata: ConnectionMetadata): Promise<ConnectionResponse<T>>;
325
331
  /**
326
332
  * Updates an existing connection with new encrypted data
333
+ * @template T Type of component request
327
334
  * @param id Connection ID
328
335
  * @param data New data to encrypt and store
329
336
  * @param version Current version number
337
+ * @param status New connection status
338
+ * @param key Current encryption key
330
339
  * @returns Promise resolving to updated connection details including new encryption key
331
340
  */
332
341
  update<T extends ComponentRequest>(id: UUID, data: ConnectionData<T>, version: number, status: ConnectionStatus, key: string): Promise<ConnectionResponse<T>>;
333
342
  /**
334
343
  * Retrieves and decrypts connection data
344
+ * @template T Type of component request
335
345
  * @param id Connection ID
336
346
  * @param key Encryption key from previous create/update operation
337
347
  * @returns Promise resolving to connection details including decrypted data
@@ -340,14 +350,16 @@ export declare class ConnectionManager {
340
350
  /**
341
351
  * Closes a connection
342
352
  * @param id Connection ID
353
+ * @returns Promise resolving when the connection is closed
343
354
  */
344
355
  close(id: UUID): Promise<void>;
345
356
  }
346
357
 
347
358
  export declare interface ConnectionMetadata {
348
- nodeUrl?: string;
349
- participants: string[];
350
- transactionType: TransactionType;
359
+ readonly nodeUrl?: string;
360
+ readonly participants: readonly string[];
361
+ readonly transactionType: TransactionType;
362
+ readonly locale?: string;
351
363
  }
352
364
 
353
365
  /**
@@ -365,21 +377,29 @@ export declare interface ConnectionRequest extends ComponentRequest {
365
377
  }
366
378
 
367
379
  export declare interface ConnectionResponse<T extends ComponentRequest> {
368
- id: UUID;
369
- version: number;
370
- status: ConnectionStatus;
371
- metadata: ConnectionMetadata;
372
- data: ConnectionData<T>;
373
- key: string;
380
+ readonly id: UUID;
381
+ readonly version: number;
382
+ readonly status: ConnectionStatus;
383
+ readonly metadata: ConnectionMetadata;
384
+ readonly data: ConnectionData<T>;
385
+ readonly key: string;
374
386
  }
375
387
 
376
- export declare interface ConnectionResult<T extends ComponentRequest> {
377
- id: UUID;
378
- metadata: ConnectionMetadata;
379
- status: ConnectionStatus;
380
- tx?: T;
381
- result?: TransactionResponse<T>;
382
- }
388
+ export declare type ConnectionResult<T extends ComponentRequest> = {
389
+ readonly id: UUID;
390
+ readonly metadata: ConnectionMetadata;
391
+ readonly status: 'closed';
392
+ } | {
393
+ readonly id: UUID;
394
+ readonly metadata: ConnectionMetadata;
395
+ readonly status: 'completed';
396
+ readonly result: TransactionResponse<T>;
397
+ } | {
398
+ readonly id: UUID;
399
+ readonly metadata: ConnectionMetadata;
400
+ readonly status: 'active';
401
+ readonly tx: T;
402
+ };
383
403
 
384
404
  export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
385
405
 
@@ -666,7 +686,6 @@ export declare enum ErrorIdentifierCode {
666
686
  */
667
687
  export declare type FieldOptions = boolean | string[] | {
668
688
  optional: boolean;
669
- transmit: boolean;
670
689
  };
671
690
 
672
691
  /**
@@ -678,6 +697,12 @@ export declare type FieldTypes = {
678
697
  legalPerson?: LegalPersonFields;
679
698
  };
680
699
 
700
+ /**
701
+ * Retrieves and processes connection refresh data
702
+ * @template T Type of component request
703
+ * @param refreshSource Source information for the refresh operation
704
+ * @returns Promise resolving to connection result with decrypted data
705
+ */
681
706
  export declare function getRefreshResult<T extends ComponentRequest>(refreshSource: RefreshSource): Promise<ConnectionResult<T>>;
682
707
 
683
708
  /**
@@ -712,6 +737,18 @@ export declare enum HMType {
712
737
  */
713
738
  export declare type HostMessage<T, O> = UpdateValue<T, O>;
714
739
 
740
+ /**
741
+ * Represents an info component message
742
+ * @param message - Info message
743
+ * @param description - Description of the info message
744
+ * @public
745
+ */
746
+ declare type Info = {
747
+ type: CMType.INFO;
748
+ message: string;
749
+ description?: string;
750
+ };
751
+
715
752
  /**
716
753
  * Intermediary VASP
717
754
  * Represents an intermediary Virtual Asset Service Provider
@@ -1375,7 +1412,8 @@ export declare enum ProofTypes {
1375
1412
  CIP8 = "cip-8",
1376
1413
  MicroTransfer = "microtransfer",
1377
1414
  Screenshot = "screenshot",
1378
- Connect = "connect"
1415
+ Connect = "connect",
1416
+ CONCORDIUM = "concordium"
1379
1417
  }
1380
1418
 
1381
1419
  /**
@@ -1433,7 +1471,7 @@ export declare interface ScreenshotProof extends OwnershipProof {
1433
1471
  * @public
1434
1472
  */
1435
1473
  export declare interface SignatureProof extends OwnershipProof {
1436
- type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.XLM_ED25519;
1474
+ type: ProofTypes.EIP191 | ProofTypes.EIP712 | ProofTypes.EIP1271 | ProofTypes.BIP137 | ProofTypes.BIP322 | ProofTypes.BIP137_XPUB | ProofTypes.ED25519 | ProofTypes.TIP191 | ProofTypes.SIWX | ProofTypes.SIWE | ProofTypes.CIP8 | ProofTypes.XRP_ED25519 | ProofTypes.CONCORDIUM | ProofTypes.XLM_ED25519;
1437
1475
  proof: string;
1438
1476
  attestation: string;
1439
1477
  wallet_provider: string;
@@ -1547,6 +1585,7 @@ export declare interface TransactionOptions {
1547
1585
  fallbacks?: ProofTypes[];
1548
1586
  deminimis?: ThresholdOptions;
1549
1587
  };
1588
+ jurisdiction?: string;
1550
1589
  allowedAgentTypes?: AgentType[];
1551
1590
  allowedCounterpartyTypes?: PersonType[];
1552
1591
  fields?: FieldTypes;
@@ -1727,6 +1766,7 @@ export declare interface VASP extends Agent {
1727
1766
  logo?: URI;
1728
1767
  website?: URI;
1729
1768
  countryOfRegistration?: ISOCountryCode;
1769
+ jurisdictions?: string;
1730
1770
  }
1731
1771
 
1732
1772
  /**
@@ -1761,6 +1801,18 @@ export declare interface Wallet extends Agent {
1761
1801
  wallet_connect_id?: string;
1762
1802
  }
1763
1803
 
1804
+ /**
1805
+ * Represents a warning component message
1806
+ * @param message - Warning message
1807
+ * @param description - Description of the warning message
1808
+ * @public
1809
+ */
1810
+ declare type Warning = {
1811
+ type: CMType.WARNING;
1812
+ message: string;
1813
+ description?: string;
1814
+ };
1815
+
1764
1816
  /**
1765
1817
  * An object representing a withdrawal transaction
1766
1818
  * @public