@imtbl/sdk 1.10.0-alpha → 1.10.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/blockchain_data.d.ts +264 -845
  2. package/dist/blockchain_data.js +2 -274
  3. package/dist/browser/checkout/{BridgeWidget-36fe7401.js → BridgeWidget-31d071b4.js} +1 -1
  4. package/dist/browser/checkout/{OnRampWidget-21725b01.js → OnRampWidget-4eec34f6.js} +1 -1
  5. package/dist/browser/checkout/{SaleWidget-3677a1c5.js → SaleWidget-596fd2e5.js} +2 -2
  6. package/dist/browser/checkout/{SpendingCapHero-5fb4ac25.js → SpendingCapHero-bb5926a7.js} +1 -1
  7. package/dist/browser/checkout/{SwapWidget-0d6bc0d4.js → SwapWidget-35e7e9f2.js} +1 -1
  8. package/dist/browser/checkout/{TopUpView-60d92a82.js → TopUpView-a266b45b.js} +1 -1
  9. package/dist/browser/checkout/{WalletWidget-2fcbc4bb.js → WalletWidget-fbdc8df9.js} +1 -1
  10. package/dist/browser/checkout/{auto-track-62ee6964.js → auto-track-8e44b259.js} +1 -1
  11. package/dist/browser/checkout/{balance-b321aaf7.js → balance-2f1a40a7.js} +1 -1
  12. package/dist/browser/checkout/{index-ab695071.js → index-05c37e37.js} +1 -1
  13. package/dist/browser/checkout/{index-1a8c04a2.js → index-12cfbb8d.js} +1 -1
  14. package/dist/browser/checkout/{index-c4bede96.js → index-44c1fadf.js} +1 -1
  15. package/dist/browser/checkout/{index-407df153.js → index-75030038.js} +1 -1
  16. package/dist/browser/checkout/{index-352de7c2.js → index-881a9811.js} +1 -1
  17. package/dist/browser/checkout/{index-0dadb136.js → index-d506d80c.js} +1 -1
  18. package/dist/browser/checkout/index-d708abfc.js +1 -0
  19. package/dist/browser/checkout/{index-9ae59197.js → index-ec746bdd.js} +2 -2
  20. package/dist/browser/checkout/{index.umd-4c6acdc2.js → index.umd-8511e3cb.js} +1 -1
  21. package/dist/browser/checkout/{retry-d9a527bc.js → retry-d29da2e9.js} +1 -1
  22. package/dist/browser/checkout/sdk.js +8 -8
  23. package/dist/browser/checkout/{useTransakEvents-9ceb1e81.js → useTransakEvents-eca6f619.js} +1 -1
  24. package/dist/browser/checkout/widgets-esm.js +1 -1
  25. package/dist/browser/checkout/widgets.js +3 -3
  26. package/dist/checkout.d.ts +0 -3
  27. package/dist/checkout.js +4 -276
  28. package/dist/config.js +1 -1
  29. package/dist/index.browser.js +4 -4
  30. package/dist/index.browser.js.map +1 -1
  31. package/dist/index.cjs +6 -278
  32. package/dist/index.d.ts +263 -847
  33. package/dist/index.js +6 -278
  34. package/dist/orderbook.js +1 -1
  35. package/dist/passport.js +3 -203
  36. package/dist/x.js +2 -2
  37. package/package.json +1 -1
  38. package/dist/browser/checkout/index-a7be28ed.js +0 -1
@@ -1,2 +1,2 @@
1
- import{a$ as e,b0 as t,b1 as r,b2 as n,b3 as a,a as o,r as s}from"./index-9ae59197.js";
1
+ import{a$ as e,b0 as t,b1 as r,b2 as n,b3 as a,a as o,r as s}from"./index-ec746bdd.js";
2
2
  /*! https://mths.be/punycode v1.4.1 by @mathias */var h=2147483647,c=36,i=1,l=26,u=38,p=700,f=72,m=128,d="-",v=/[^\x20-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=c-i,g=Math.floor,y=String.fromCharCode;function O(e){throw new RangeError(E[e])}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?g(e/p):e>>1,e+=g(e/t);e>A*l>>1;n+=c)e=g(e/A);return g(n+(A+1)*e/(e+u))}function I(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(R,".")).split("."),t).join(".");return n+a}(e,(function(e){return v.test(e)?"xn--"+function(e){var t,r,n,a,o,s,u,p,v,R,E,A,I,b,C,_=[];for(e=function(e){for(var t,r,n=[],a=0,o=e.length;a<o;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<o?56320==(64512&(r=e.charCodeAt(a++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),a--):n.push(t);return n}(e),A=e.length,t=m,r=0,o=f,s=0;s<A;++s)(E=e[s])<128&&_.push(y(E));for(n=a=_.length,a&&_.push(d);n<A;){for(u=h,s=0;s<A;++s)(E=e[s])>=t&&E<u&&(u=E);for(u-t>g((h-r)/(I=n+1))&&O("overflow"),r+=(u-t)*I,t=u,s=0;s<A;++s)if((E=e[s])<t&&++r>h&&O("overflow"),E==t){for(p=r,v=c;!(p<(R=v<=o?i:v>=o+l?l:v-o));v+=c)C=p-R,b=c-R,_.push(y(T(R+C%b,0))),p=g(C/b);_.push(y(T(p,0))),o=S(r,I,n==a),r=0,++n}++r,++t}return _.join("")}(e):e}))}function b(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var C=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function _(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function D(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var L=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function N(e,t,r,n){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(t);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var h=e.length;s>0&&h>s&&(h=s);for(var c=0;c<h;++c){var i,l,u,p,f=e[c].replace(o,"%20"),m=f.indexOf(r);m>=0?(i=f.substr(0,m),l=f.substr(m+1)):(i=f,l=""),u=decodeURIComponent(i),p=decodeURIComponent(l),b(a,u)?C(a[u])?a[u].push(p):a[u]=[a[u],p]:a[u]=p}return a}var U={parse:B,resolve:function(e,t){return B(e,!1,!0).resolve(t)},resolveObject:function(e,t){return e?B(e,!1,!0).resolveObject(t):t},fileURLToPath:function(e){if("string"==typeof e)e=(new j).parse(e);else if(!(e instanceof j))throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof e+String(e));if("file:"!==e.protocol)throw new TypeError("The URL must be of scheme file");return function(e){const t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){const r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)throw new TypeError("must not include encoded / characters")}return decodeURIComponent(t)}(e)},format:function(e){r(e)&&(e=Q({},e));return V(e)},Url:j,URL:e.URL,URLSearchParams:e.URLSearchParams};function j(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var w,x,P=/^([a-z0-9.+-]+:)/i,K=/:[0-9]*$/,k=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,q=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(q),G=["%","/","?",";","#"].concat(F),W=["/","?","#"],$=255,M=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,J={javascript:!0,"javascript:":!0},Z={javascript:!0,"javascript:":!0},H={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function B(e,r,n){if(e&&t(e)&&e instanceof j)return e;var a=new j;return a.parse(e,r,n),a}function Q(e,t,n,a){if(!r(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",h=t.split(s);h[0]=h[0].replace(/\\/g,"/");var c=t=h.join(s);if(c=c.trim(),!a&&1===t.split("#").length){var i=k.exec(c);if(i)return e.path=c,e.href=c,e.pathname=i[1],i[2]?(e.search=i[2],e.query=n?N(e.search.substr(1)):e.search.substr(1)):n&&(e.search="",e.query={}),e}var l,u,p,f,m=P.exec(c);if(m){var d=(m=m[0]).toLowerCase();e.protocol=d,c=c.substr(m.length)}if(a||m||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===c.substr(0,2);!v||m&&Z[m]||(c=c.substr(2),e.slashes=!0)}if(!Z[m]&&(v||m&&!H[m])){var R,E,A=-1;for(l=0;l<W.length;l++)-1!==(u=c.indexOf(W[l]))&&(-1===A||u<A)&&(A=u);for(-1!==(E=-1===A?c.lastIndexOf("@"):c.lastIndexOf("@",A))&&(R=c.slice(0,E),c=c.slice(E+1),e.auth=decodeURIComponent(R)),A=-1,l=0;l<G.length;l++)-1!==(u=c.indexOf(G[l]))&&(-1===A||u<A)&&(A=u);-1===A&&(A=c.length),e.host=c.slice(0,A),c=c.slice(A),X(e),e.hostname=e.hostname||"";var g="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!g){var y=e.hostname.split(/\./);for(l=0,p=y.length;l<p;l++){var O=y[l];if(O&&!O.match(M)){for(var T="",S=0,b=O.length;S<b;S++)O.charCodeAt(S)>127?T+="x":T+=O[S];if(!T.match(M)){var C=y.slice(0,l),_=y.slice(l+1),D=O.match(z);D&&(C.push(D[1]),_.unshift(D[2])),_.length&&(c="/"+_.join(".")+c),e.hostname=C.join(".");break}}}}e.hostname.length>$?e.hostname="":e.hostname=e.hostname.toLowerCase(),g||(e.hostname=I(e.hostname)),f=e.port?":"+e.port:"";var L=e.hostname||"";e.host=L+f,e.href+=e.host,g&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==c[0]&&(c="/"+c))}if(!J[d])for(l=0,p=F.length;l<p;l++){var U=F[l];if(-1!==c.indexOf(U)){var j=encodeURIComponent(U);j===U&&(j=escape(U)),c=c.split(U).join(j)}}var w=c.indexOf("#");-1!==w&&(e.hash=c.substr(w),c=c.slice(0,w));var x=c.indexOf("?");if(-1!==x?(e.search=c.substr(x),e.query=c.substr(x+1),n&&(e.query=N(e.query)),c=c.slice(0,x)):n&&(e.search="",e.query={}),c&&(e.pathname=c),H[d]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){f=e.pathname||"";var K=e.search||"";e.path=f+K}return e.href=V(e),e}function V(e){var r=e.auth||"";r&&(r=(r=encodeURIComponent(r)).replace(/%3A/i,":"),r+="@");var n,a,o,s,h=e.protocol||"",c=e.pathname||"",i=e.hash||"",l=!1,u="";e.host?l=r+e.host:e.hostname&&(l=r+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(l+=":"+e.port)),e.query&&t(e.query)&&Object.keys(e.query).length&&(n=e.query,a=a||"&",o=o||"=",null===n&&(n=void 0),u="object"==typeof n?D(L(n),(function(e){var t=encodeURIComponent(_(e))+o;return C(n[e])?D(n[e],(function(e){return t+encodeURIComponent(_(e))})).join(a):t+encodeURIComponent(_(n[e]))})).join(a):s?encodeURIComponent(_(s))+o+encodeURIComponent(_(n)):"");var p=e.search||u&&"?"+u||"";return h&&":"!==h.substr(-1)&&(h+=":"),e.slashes||(!h||H[h])&&!1!==l?(l="//"+(l||""),c&&"/"!==c.charAt(0)&&(c="/"+c)):l||(l=""),i&&"#"!==i.charAt(0)&&(i="#"+i),p&&"?"!==p.charAt(0)&&(p="?"+p),h+l+(c=c.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(p=p.replace("#","%23"))+i}function X(e){var t=e.host,r=K.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}j.prototype.parse=function(e,t,r){return Q(this,e,t,r)},j.prototype.format=function(){return V(this)},j.prototype.resolve=function(e){return this.resolveObject(B(e,!1,!0)).format()},j.prototype.resolveObject=function(e){if(r(e)){var t=new j;t.parse(e,!1,!0),e=t}for(var o,s=new j,h=Object.keys(this),c=0;c<h.length;c++){var i=h[c];s[i]=this[i]}if(s.hash=e.hash,""===e.href)return s.href=s.format(),s;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),u=0;u<l.length;u++){var p=l[u];"protocol"!==p&&(s[p]=e[p])}return H[s.protocol]&&s.hostname&&!s.pathname&&(s.path=s.pathname="/"),s.href=s.format(),s}if(e.protocol&&e.protocol!==s.protocol){if(!H[e.protocol]){for(var f=Object.keys(e),m=0;m<f.length;m++){var d=f[m];s[d]=e[d]}return s.href=s.format(),s}if(s.protocol=e.protocol,e.host||Z[e.protocol])s.pathname=e.pathname;else{for(o=(e.pathname||"").split("/");o.length&&!(e.host=o.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),s.pathname=o.join("/")}if(s.search=e.search,s.query=e.query,s.host=e.host||"",s.auth=e.auth,s.hostname=e.hostname||e.host,s.port=e.port,s.pathname||s.search){var v=s.pathname||"",R=s.search||"";s.path=v+R}return s.slashes=s.slashes||e.slashes,s.href=s.format(),s}var E,A=s.pathname&&"/"===s.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=g||A||s.host&&e.pathname,O=y,T=s.pathname&&s.pathname.split("/")||[],S=s.protocol&&!H[s.protocol];if(o=e.pathname&&e.pathname.split("/")||[],S&&(s.hostname="",s.port=null,s.host&&(""===T[0]?T[0]=s.host:T.unshift(s.host)),s.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===o[0]?o[0]=e.host:o.unshift(e.host)),e.host=null),y=y&&(""===o[0]||""===T[0])),g)s.host=e.host||""===e.host?e.host:s.host,s.hostname=e.hostname||""===e.hostname?e.hostname:s.hostname,s.search=e.search,s.query=e.query,T=o;else if(o.length)T||(T=[]),T.pop(),T=T.concat(o),s.search=e.search,s.query=e.query;else if(!n(e.search))return S&&(s.hostname=s.host=T.shift(),(E=!!(s.host&&s.host.indexOf("@")>0)&&s.host.split("@"))&&(s.auth=E.shift(),s.host=s.hostname=E.shift())),s.search=e.search,s.query=e.query,a(s.pathname)&&a(s.search)||(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.href=s.format(),s;if(!T.length)return s.pathname=null,s.search?s.path="/"+s.search:s.path=null,s.href=s.format(),s;for(var I=T.slice(-1)[0],b=(s.host||e.host||T.length>1)&&("."===I||".."===I)||""===I,C=0,_=T.length;_>=0;_--)"."===(I=T[_])?T.splice(_,1):".."===I?(T.splice(_,1),C++):C&&(T.splice(_,1),C--);if(!y&&!O)for(;C--;C)T.unshift("..");!y||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),b&&"/"!==T.join("/").substr(-1)&&T.push("");var D=""===T[0]||T[0]&&"/"===T[0].charAt(0);return S&&(s.hostname=s.host=D?"":T.length?T.shift():"",(E=!!(s.host&&s.host.indexOf("@")>0)&&s.host.split("@"))&&(s.auth=E.shift(),s.host=s.hostname=E.shift())),(y=y||s.host&&T.length)&&!D&&T.unshift(""),T.length?s.pathname=T.join("/"):(s.pathname=null,s.path=null),a(s.pathname)&&a(s.search)||(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.auth=e.auth||s.auth,s.slashes=s.slashes||e.slashes,s.href=s.format(),s},j.prototype.parseHost=function(){return X(this)},function(e){e.TRANSAK_WIDGET_INITIALISED="TRANSAK_WIDGET_INITIALISED",e.TRANSAK_WIDGET_OPEN="TRANSAK_WIDGET_OPEN",e.TRANSAK_ORDER_CREATED="TRANSAK_ORDER_CREATED",e.TRANSAK_ORDER_SUCCESSFUL="TRANSAK_ORDER_SUCCESSFUL",e.TRANSAK_ORDER_FAILED="TRANSAK_ORDER_FAILED"}(w||(w={})),function(e){e.PROCESSING="PROCESSING",e.COMPLETED="COMPLETED"}(x||(x={}));const Y=["global.transak.com","global-stg.transak.com"],ee={[w.TRANSAK_WIDGET_OPEN]:{screen:"InputScreen",control:"TransakWidgetOpen",controlType:"IframeEvent"},[w.TRANSAK_ORDER_CREATED]:{screen:"InputScreen",control:"OrderCreated",controlType:"IframeEvent"},[`${w.TRANSAK_ORDER_SUCCESSFUL}${x.PROCESSING}`]:{screen:"OrderInProgress",control:"PaymentProcessing",controlType:"IframeEvent"},[`${w.TRANSAK_ORDER_SUCCESSFUL}${x.COMPLETED}`]:{screen:"Success",control:"PaymentCompleted",controlType:"IframeEvent"},[w.TRANSAK_ORDER_FAILED]:{screen:"Failure",control:"PaymentFailed",controlType:"IframeEvent"}},te=e=>{const{track:t}=o(),{userJourney:r,ref:n,email:a,userId:h,isPassportWallet:c,failedToLoadTimeoutInMs:i,onFailedToLoad:l}=e,[u,p]=s.useState(!1),f=i||1e4,m=s.useRef(void 0),d=s.useCallback((e=>{const n=e.event_id,o=[w.TRANSAK_ORDER_SUCCESSFUL].includes(n)?`${n}${e.data.status}`:n,s=ee?.[o]||{};Object.keys(s).length>=0&&t({...s,userJourney:r,extras:{email:a,userId:h,isPassportWallet:c}})}),[]),v=s.useCallback((t=>{switch(t.event_id){case w.TRANSAK_WIDGET_INITIALISED:r=t.data,p(!0),clearTimeout(m.current),m.current=void 0,e.onInit?.(r);break;case w.TRANSAK_WIDGET_OPEN:e.onOpen?.(t.data);break;case w.TRANSAK_ORDER_CREATED:e.onOrderCreated?.(t.data);break;case w.TRANSAK_ORDER_SUCCESSFUL:t.data.status===x.PROCESSING&&e.onOrderProcessing?.(t.data),t.data.status===x.COMPLETED&&e.onOrderCompleted?.(t.data);break;case w.TRANSAK_ORDER_FAILED:e.onOrderFailed?.(t.data)}var r}),[]),R=s.useCallback((e=>{const t=B(e.origin)?.host?.toLowerCase();e.source===n?.current?.contentWindow&&t&&Y.includes(t)&&(d(e.data),v(e.data),console.log("@@@ Transak event",e))}),[n]);return s.useEffect((()=>(window.addEventListener("message",R),()=>{clearTimeout(m.current),window.removeEventListener("message",R)})),[]),{initialised:u,onLoad:()=>{void 0!==l&&(void 0!==m.current||u||(m.current=setTimeout((()=>{u||l()}),f)))}}};export{Y as T,te as a,U as u};
@@ -1 +1 @@
1
- export{ca as WidgetsFactory}from"./index-9ae59197.js";
1
+ export{ca as WidgetsFactory}from"./index-ec746bdd.js";