2 lines
25 KiB
JavaScript
2 lines
25 KiB
JavaScript
function _e(n){let e,t;try{const i=F(n,o.__wbindgen_malloc),l=w,s=o.bytes_to_short_address(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function re(n,e,t,_,r){let i,l;try{const f=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),A=w,W=u(_,o.__wbindgen_malloc,o.__wbindgen_realloc),$=w,z=u(r,o.__wbindgen_malloc,o.__wbindgen_realloc),G=w,T=o.complete_dual_transaction_request(f,d,m,p,b,A,W,$,z,G);var s=T[0],a=T[1];if(T[3])throw s=0,a=0,x(T[2]);return i=s,l=a,h(s,a)}finally{o.__wbindgen_free(i,l,1)}}function oe(n,e){let t,_;try{const l=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=w,a=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=o.create_handshake_proof(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,x(d[2]);return t=r,_=i,h(r,i)}finally{o.__wbindgen_free(t,_,1)}}function ce(n,e){let t,_;try{const l=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=w,a=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=o.create_wallet_registration(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,x(d[2]);return t=r,_=i,h(r,i)}finally{o.__wbindgen_free(t,_,1)}}function ie(n,e,t){let _,r;try{const s=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=o.create_wallet_registration_from_keys(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,x(b[2]);return _=i,r=l,h(i,l)}finally{o.__wbindgen_free(_,r,1)}}function se(n){let e,t;try{const i=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=o.decode_transaction(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function le(n){let e,t;try{const i=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=o.decode_transfer(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function ae(n,e,t){let _,r;try{const s=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=o.export_legacy_wallet(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,x(b[2]);return _=i,r=l,h(i,l)}finally{o.__wbindgen_free(_,r,1)}}function de(n){let e,t;try{const i=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=o.generate_browser_wallet(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function fe(n,e,t){let _,r;try{const s=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=o.import_legacy_wallet(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,x(b[2]);return _=i,r=l,h(i,l)}finally{o.__wbindgen_free(_,r,1)}}function be(n,e){let t,_;try{const l=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=w,a=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=o.import_private_key(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,x(d[2]);return t=r,_=i,h(r,i)}finally{o.__wbindgen_free(t,_,1)}}function we(n,e,t){let _,r;try{const s=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=o.import_private_key_image(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,x(b[2]);return _=i,r=l,h(i,l)}finally{o.__wbindgen_free(_,r,1)}}function ge(n){let e,t;try{const i=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=o.inspect_transaction_request(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function ue(n){let e,t;try{const i=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=o.public_key_to_short_address(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,x(s[2]);return e=_,t=r,h(_,r)}finally{o.__wbindgen_free(e,t,1)}}function ye(n){const e=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),t=w,_=o.short_address_to_bytes(e,t);if(_[3])throw x(_[2]);var r=Y(_[0],_[1]).slice();return o.__wbindgen_free(_[0],_[1]*1,1),r}function me(n,e,t){let _,r;try{const s=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=w,m=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),p=w,b=o.sign_message_request(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,x(b[2]);return _=i,r=l,h(i,l)}finally{o.__wbindgen_free(_,r,1)}}function pe(n,e,t,_){let r,i;try{const a=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),m=w,p=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),b=w,A=o.sign_transaction_request(a,f,d,m,p,b,_);var l=A[0],s=A[1];if(A[3])throw l=0,s=0,x(A[2]);return r=l,i=s,h(l,s)}finally{o.__wbindgen_free(r,i,1)}}function he(n){let e,t;try{const _=F(n,o.__wbindgen_malloc),r=w,i=o.skein_128_hex(_,r);return e=i[0],t=i[1],h(i[0],i[1])}finally{o.__wbindgen_free(e,t,1)}}function ve(n){let e,t;try{const _=F(n,o.__wbindgen_malloc),r=w,i=o.skein_256_hex(_,r);return e=i[0],t=i[1],h(i[0],i[1])}finally{o.__wbindgen_free(e,t,1)}}function xe(n){let e,t;try{const _=F(n,o.__wbindgen_malloc),r=w,i=o.skein_512_hex(_,r);return e=i[0],t=i[1],h(i[0],i[1])}finally{o.__wbindgen_free(e,t,1)}}function ke(){let n,e;try{const r=o.transaction_type_registry();var t=r[0],_=r[1];if(r[3])throw t=0,_=0,x(r[2]);return n=t,e=_,h(t,_)}finally{o.__wbindgen_free(n,e,1)}}function Ae(n,e){let t,_;try{const l=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=w,a=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=o.unlock_browser_wallet(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,x(d[2]);return t=r,_=i,h(r,i)}finally{o.__wbindgen_free(t,_,1)}}function $e(n,e,t){const _=F(n,o.__wbindgen_malloc),r=w,i=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=o.verify_bytes_hex(_,r,i,l,s,a);if(f[2])throw x(f[1]);return f[0]!==0}function Te(n,e,t){const _=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=w,i=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=w,s=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),a=w,f=o.verify_hash_hex(_,r,i,l,s,a);if(f[2])throw x(f[1]);return f[0]!==0}function We(n,e,t,_){let r,i;try{const a=u(n,o.__wbindgen_malloc,o.__wbindgen_realloc),f=w,d=u(e,o.__wbindgen_malloc,o.__wbindgen_realloc),m=w,p=u(t,o.__wbindgen_malloc,o.__wbindgen_realloc),b=w,A=u(_,o.__wbindgen_malloc,o.__wbindgen_realloc),W=w,$=o.verify_message_proof(a,f,d,m,p,b,A,W);var l=$[0],s=$[1];if($[3])throw l=0,s=0,x($[2]);return r=l,i=s,h(l,s)}finally{o.__wbindgen_free(r,i,1)}}function J(){return{__proto__:null,"./contractless_browser_core_bg.js":{__proto__:null,__wbg___wbindgen_is_function_1ff95bcc5517c252:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_a27215656b807791:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_ea5e6cc2e4141dfe:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_c05833b95a3cf397:function(e){return e===void 0},__wbg___wbindgen_throw_344f42d3211c4765:function(e,t){throw new Error(h(e,t))},__wbg_call_a6e5c5dce5018821:function(){return U(function(e,t,_){return e.call(t,_)},arguments)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return U(function(e,t){e.getRandomValues(t)},arguments)},__wbg_length_1f0964f4a5e2c6d8:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_with_length_e6785c33c8e4cce8:function(e){return new Uint8Array(e>>>0)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_4770620bbe4688a0:function(e,t,_){Uint8Array.prototype.set.call(Y(e,t),_)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return U(function(e,t){e.randomFillSync(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return U(function(){return module.require},arguments)},__wbg_static_accessor_GLOBAL_4ef717fb391d88b7:function(){const e=typeof global>"u"?null:global;return D(e)?0:q(e)},__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4:function(){const e=typeof globalThis>"u"?null:globalThis;return D(e)?0:q(e)},__wbg_static_accessor_SELF_146583524fe1469b:function(){const e=typeof self>"u"?null:self;return D(e)?0:q(e)},__wbg_static_accessor_WINDOW_f2829a2234d7819e:function(){const e=typeof window>"u"?null:window;return D(e)?0:q(e)},__wbg_subarray_3ed232c8a6baee09:function(e,t,_){return e.subarray(t>>>0,_>>>0)},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbindgen_cast_0000000000000001:function(e,t){return Y(e,t)},__wbindgen_cast_0000000000000002:function(e,t){return h(e,t)},__wbindgen_init_externref_table:function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function q(n){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,n),e}function Y(n,e){return n=n>>>0,S().subarray(n/1,n/1+e)}function h(n,e){return Oe(n>>>0,e)}let R=null;function S(){return(R===null||R.byteLength===0)&&(R=new Uint8Array(o.memory.buffer)),R}function U(n,e){try{return n.apply(this,e)}catch(t){const _=q(t);o.__wbindgen_exn_store(_)}}function D(n){return n==null}function F(n,e){const t=e(n.length*1,1)>>>0;return S().set(n,t/1),w=n.length,t}function u(n,e,t){if(t===void 0){const s=j.encode(n),a=e(s.length,1)>>>0;return S().subarray(a,a+s.length).set(s),w=s.length,a}let _=n.length,r=e(_,1)>>>0;const i=S();let l=0;for(;l<_;l++){const s=n.charCodeAt(l);if(s>127)break;i[r+l]=s}if(l!==_){l!==0&&(n=n.slice(l)),r=t(r,_,_=l+n.length*3,1)>>>0;const s=S().subarray(r+l,r+_),a=j.encodeInto(n,s);l+=a.written,r=t(r,_,l,1)>>>0}return w=l,r}function x(n){const e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}let N=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});N.decode();const Se=2146435072;let H=0;function Oe(n,e){return H+=e,H>=Se&&(N=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),N.decode(),H=e),N.decode(S().subarray(n,n+e))}const j=new TextEncoder;"encodeInto"in j||(j.encodeInto=function(n,e){const t=j.encode(n);return e.set(t),{read:n.length,written:t.length}});let w=0,o;function K(n,e){return o=n.exports,R=null,o.__wbindgen_start(),o}async function qe(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(r){if(n.ok&&t(n.type)&&n.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const _=await n.arrayBuffer();return await WebAssembly.instantiate(_,e)}else{const _=await WebAssembly.instantiate(n,e);return _ instanceof WebAssembly.Instance?{instance:_,module:n}:_}function t(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}function Re(n){if(o!==void 0)return o;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return K(t)}async function Q(n){if(o!==void 0)return o;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),n===void 0&&(n=new URL("/assets/contractless_browser_core_bg-Dl61GrlP.wasm",import.meta.url));const e=J();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await qe(await n,e);return K(t)}const Ee=Object.freeze(Object.defineProperty({__proto__:null,bytes_to_short_address:_e,complete_dual_transaction_request:re,create_handshake_proof:oe,create_wallet_registration:ce,create_wallet_registration_from_keys:ie,decode_transaction:se,decode_transfer:le,default:Q,export_legacy_wallet:ae,generate_browser_wallet:de,import_legacy_wallet:fe,import_private_key:be,import_private_key_image:we,initSync:Re,inspect_transaction_request:ge,public_key_to_short_address:ue,short_address_to_bytes:ye,sign_message_request:me,sign_transaction_request:pe,skein_128_hex:he,skein_256_hex:ve,skein_512_hex:xe,transaction_type_registry:ke,unlock_browser_wallet:Ae,verify_bytes_hex:$e,verify_hash_hex:Te,verify_message_proof:We},Symbol.toStringTag,{value:"Module"}));function Me(n){let e,t;try{const i=I(n,c.__wbindgen_malloc),l=g,s=c.bytes_to_short_address(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function je(n,e,t,_,r){let i,l;try{const f=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),A=g,W=y(_,c.__wbindgen_malloc,c.__wbindgen_realloc),$=g,z=y(r,c.__wbindgen_malloc,c.__wbindgen_realloc),G=g,T=c.complete_dual_transaction_request(f,d,m,p,b,A,W,$,z,G);var s=T[0],a=T[1];if(T[3])throw s=0,a=0,k(T[2]);return i=s,l=a,v(s,a)}finally{c.__wbindgen_free(i,l,1)}}function Le(n,e){let t,_;try{const l=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),s=g,a=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=c.create_handshake_proof(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,k(d[2]);return t=r,_=i,v(r,i)}finally{c.__wbindgen_free(t,_,1)}}function Fe(n,e){let t,_;try{const l=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),s=g,a=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=c.create_wallet_registration(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,k(d[2]);return t=r,_=i,v(r,i)}finally{c.__wbindgen_free(t,_,1)}}function Ie(n,e,t){let _,r;try{const s=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=c.create_wallet_registration_from_keys(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,k(b[2]);return _=i,r=l,v(i,l)}finally{c.__wbindgen_free(_,r,1)}}function Ue(n){let e,t;try{const i=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=c.decode_transaction(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function De(n){let e,t;try{const i=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=c.decode_transfer(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function Be(n,e,t){let _,r;try{const s=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=c.export_legacy_wallet(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,k(b[2]);return _=i,r=l,v(i,l)}finally{c.__wbindgen_free(_,r,1)}}function Ce(n){let e,t;try{const i=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=c.generate_browser_wallet(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function Pe(n,e,t){let _,r;try{const s=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=c.import_legacy_wallet(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,k(b[2]);return _=i,r=l,v(i,l)}finally{c.__wbindgen_free(_,r,1)}}function Ne(n,e){let t,_;try{const l=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),s=g,a=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=c.import_private_key(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,k(d[2]);return t=r,_=i,v(r,i)}finally{c.__wbindgen_free(t,_,1)}}function Ve(n,e,t){let _,r;try{const s=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=c.import_private_key_image(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,k(b[2]);return _=i,r=l,v(i,l)}finally{c.__wbindgen_free(_,r,1)}}function ze(n){let e,t;try{const i=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=c.inspect_transaction_request(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function Ge(n){let e,t;try{const i=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=c.public_key_to_short_address(i,l);var _=s[0],r=s[1];if(s[3])throw _=0,r=0,k(s[2]);return e=_,t=r,v(_,r)}finally{c.__wbindgen_free(e,t,1)}}function He(n){const e=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),t=g,_=c.short_address_to_bytes(e,t);if(_[3])throw k(_[2]);var r=Z(_[0],_[1]).slice();return c.__wbindgen_free(_[0],_[1]*1,1),r}function Xe(n,e,t){let _,r;try{const s=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),d=g,m=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),p=g,b=c.sign_message_request(s,a,f,d,m,p);var i=b[0],l=b[1];if(b[3])throw i=0,l=0,k(b[2]);return _=i,r=l,v(i,l)}finally{c.__wbindgen_free(_,r,1)}}function Ye(n,e,t,_){let r,i;try{const a=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),m=g,p=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),b=g,A=c.sign_transaction_request(a,f,d,m,p,b,_);var l=A[0],s=A[1];if(A[3])throw l=0,s=0,k(A[2]);return r=l,i=s,v(l,s)}finally{c.__wbindgen_free(r,i,1)}}function Ze(n){let e,t;try{const _=I(n,c.__wbindgen_malloc),r=g,i=c.skein_128_hex(_,r);return e=i[0],t=i[1],v(i[0],i[1])}finally{c.__wbindgen_free(e,t,1)}}function Je(n){let e,t;try{const _=I(n,c.__wbindgen_malloc),r=g,i=c.skein_256_hex(_,r);return e=i[0],t=i[1],v(i[0],i[1])}finally{c.__wbindgen_free(e,t,1)}}function Ke(n){let e,t;try{const _=I(n,c.__wbindgen_malloc),r=g,i=c.skein_512_hex(_,r);return e=i[0],t=i[1],v(i[0],i[1])}finally{c.__wbindgen_free(e,t,1)}}function Qe(){let n,e;try{const r=c.transaction_type_registry();var t=r[0],_=r[1];if(r[3])throw t=0,_=0,k(r[2]);return n=t,e=_,v(t,_)}finally{c.__wbindgen_free(n,e,1)}}function en(n,e){let t,_;try{const l=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),s=g,a=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=c.unlock_browser_wallet(l,s,a,f);var r=d[0],i=d[1];if(d[3])throw r=0,i=0,k(d[2]);return t=r,_=i,v(r,i)}finally{c.__wbindgen_free(t,_,1)}}function nn(n,e,t){const _=I(n,c.__wbindgen_malloc),r=g,i=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=c.verify_bytes_hex(_,r,i,l,s,a);if(f[2])throw k(f[1]);return f[0]!==0}function tn(n,e,t){const _=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),r=g,i=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),l=g,s=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),a=g,f=c.verify_hash_hex(_,r,i,l,s,a);if(f[2])throw k(f[1]);return f[0]!==0}function _n(n,e,t,_){let r,i;try{const a=y(n,c.__wbindgen_malloc,c.__wbindgen_realloc),f=g,d=y(e,c.__wbindgen_malloc,c.__wbindgen_realloc),m=g,p=y(t,c.__wbindgen_malloc,c.__wbindgen_realloc),b=g,A=y(_,c.__wbindgen_malloc,c.__wbindgen_realloc),W=g,$=c.verify_message_proof(a,f,d,m,p,b,A,W);var l=$[0],s=$[1];if($[3])throw l=0,s=0,k($[2]);return r=l,i=s,v(l,s)}finally{c.__wbindgen_free(r,i,1)}}function ee(){return{__proto__:null,"./contractless_browser_core_bg.js":{__proto__:null,__wbg___wbindgen_is_function_1ff95bcc5517c252:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_a27215656b807791:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_ea5e6cc2e4141dfe:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_c05833b95a3cf397:function(e){return e===void 0},__wbg___wbindgen_throw_344f42d3211c4765:function(e,t){throw new Error(v(e,t))},__wbg_call_a6e5c5dce5018821:function(){return B(function(e,t,_){return e.call(t,_)},arguments)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return B(function(e,t){e.getRandomValues(t)},arguments)},__wbg_length_1f0964f4a5e2c6d8:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_with_length_e6785c33c8e4cce8:function(e){return new Uint8Array(e>>>0)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_4770620bbe4688a0:function(e,t,_){Uint8Array.prototype.set.call(Z(e,t),_)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return B(function(e,t){e.randomFillSync(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return B(function(){return module.require},arguments)},__wbg_static_accessor_GLOBAL_4ef717fb391d88b7:function(){const e=typeof global>"u"?null:global;return C(e)?0:E(e)},__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4:function(){const e=typeof globalThis>"u"?null:globalThis;return C(e)?0:E(e)},__wbg_static_accessor_SELF_146583524fe1469b:function(){const e=typeof self>"u"?null:self;return C(e)?0:E(e)},__wbg_static_accessor_WINDOW_f2829a2234d7819e:function(){const e=typeof window>"u"?null:window;return C(e)?0:E(e)},__wbg_subarray_3ed232c8a6baee09:function(e,t,_){return e.subarray(t>>>0,_>>>0)},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbindgen_cast_0000000000000001:function(e,t){return Z(e,t)},__wbindgen_cast_0000000000000002:function(e,t){return v(e,t)},__wbindgen_init_externref_table:function(){const e=c.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function E(n){const e=c.__externref_table_alloc();return c.__wbindgen_externrefs.set(e,n),e}function Z(n,e){return n=n>>>0,O().subarray(n/1,n/1+e)}function v(n,e){return on(n>>>0,e)}let M=null;function O(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(c.memory.buffer)),M}function B(n,e){try{return n.apply(this,e)}catch(t){const _=E(t);c.__wbindgen_exn_store(_)}}function C(n){return n==null}function I(n,e){const t=e(n.length*1,1)>>>0;return O().set(n,t/1),g=n.length,t}function y(n,e,t){if(t===void 0){const s=L.encode(n),a=e(s.length,1)>>>0;return O().subarray(a,a+s.length).set(s),g=s.length,a}let _=n.length,r=e(_,1)>>>0;const i=O();let l=0;for(;l<_;l++){const s=n.charCodeAt(l);if(s>127)break;i[r+l]=s}if(l!==_){l!==0&&(n=n.slice(l)),r=t(r,_,_=l+n.length*3,1)>>>0;const s=O().subarray(r+l,r+_),a=L.encodeInto(n,s);l+=a.written,r=t(r,_,l,1)>>>0}return g=l,r}function k(n){const e=c.__wbindgen_externrefs.get(n);return c.__externref_table_dealloc(n),e}let V=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});V.decode();const rn=2146435072;let X=0;function on(n,e){return X+=e,X>=rn&&(V=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),V.decode(),X=e),V.decode(O().subarray(n,n+e))}const L=new TextEncoder;"encodeInto"in L||(L.encodeInto=function(n,e){const t=L.encode(n);return e.set(t),{read:n.length,written:t.length}});let g=0,c;function ne(n,e){return c=n.exports,M=null,c.__wbindgen_start(),c}async function cn(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(r){if(n.ok&&t(n.type)&&n.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const _=await n.arrayBuffer();return await WebAssembly.instantiate(_,e)}else{const _=await WebAssembly.instantiate(n,e);return _ instanceof WebAssembly.Instance?{instance:_,module:n}:_}function t(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}function sn(n){if(c!==void 0)return c;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=ee();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return ne(t)}async function te(n){if(c!==void 0)return c;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),n===void 0&&(n=new URL("/assets/contractless_browser_core_bg-CM1Z7v2F.wasm",import.meta.url));const e=ee();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));const{instance:t,module:_}=await cn(await n,e);return ne(t)}const ln=Object.freeze(Object.defineProperty({__proto__:null,bytes_to_short_address:Me,complete_dual_transaction_request:je,create_handshake_proof:Le,create_wallet_registration:Fe,create_wallet_registration_from_keys:Ie,decode_transaction:Ue,decode_transfer:De,default:te,export_legacy_wallet:Be,generate_browser_wallet:Ce,import_legacy_wallet:Pe,import_private_key:Ne,import_private_key_image:Ve,initSync:sn,inspect_transaction_request:ze,public_key_to_short_address:Ge,short_address_to_bytes:He,sign_message_request:Xe,sign_transaction_request:Ye,skein_128_hex:Ze,skein_256_hex:Je,skein_512_hex:Ke,transaction_type_registry:Qe,unlock_browser_wallet:en,verify_bytes_hex:nn,verify_hash_hex:tn,verify_message_proof:_n},Symbol.toStringTag,{value:"Module"})),P={};async function an(n="testnet"){const e=n==="mainnet"?ln:Ee;return P[n]??(P[n]=n==="mainnet"?te():Q()),await P[n],e}export{an as c};
|