2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
function I(t,e,r,_,o){let l,c;try{const w=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),p=a,q=s(_,n.__wbindgen_malloc,n.__wbindgen_realloc),v=a,F=s(o,n.__wbindgen_malloc,n.__wbindgen_realloc),U=a,k=n.complete_dual_transaction_request(w,d,y,m,b,p,q,v,F,U);var i=k[0],f=k[1];if(k[3])throw i=0,f=0,u(k[2]);return l=i,c=f,g(i,f)}finally{n.__wbindgen_free(l,c,1)}}function M(t,e){let r,_;try{const c=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=a,f=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=n.create_handshake_proof(c,i,f,w);var o=d[0],l=d[1];if(d[3])throw o=0,l=0,u(d[2]);return r=o,_=l,g(o,l)}finally{n.__wbindgen_free(r,_,1)}}function B(t,e){let r,_;try{const c=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=a,f=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=n.create_wallet_registration(c,i,f,w);var o=d[0],l=d[1];if(d[3])throw o=0,l=0,u(d[2]);return r=o,_=l,g(o,l)}finally{n.__wbindgen_free(r,_,1)}}function C(t,e,r){let _,o;try{const i=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),f=a,w=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=n.create_wallet_registration_from_keys(i,f,w,d,y,m);var l=b[0],c=b[1];if(b[3])throw l=0,c=0,u(b[2]);return _=l,o=c,g(l,c)}finally{n.__wbindgen_free(_,o,1)}}function D(t){let e,r;try{const l=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),c=a,i=n.decode_transaction(l,c);var _=i[0],o=i[1];if(i[3])throw _=0,o=0,u(i[2]);return e=_,r=o,g(_,o)}finally{n.__wbindgen_free(e,r,1)}}function j(t,e,r){let _,o;try{const i=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),f=a,w=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=n.export_legacy_wallet(i,f,w,d,y,m);var l=b[0],c=b[1];if(b[3])throw l=0,c=0,u(b[2]);return _=l,o=c,g(l,c)}finally{n.__wbindgen_free(_,o,1)}}function z(t){let e,r;try{const l=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),c=a,i=n.generate_browser_wallet(l,c);var _=i[0],o=i[1];if(i[3])throw _=0,o=0,u(i[2]);return e=_,r=o,g(_,o)}finally{n.__wbindgen_free(e,r,1)}}function N(t,e,r){let _,o;try{const i=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),f=a,w=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=n.import_legacy_wallet(i,f,w,d,y,m);var l=b[0],c=b[1];if(b[3])throw l=0,c=0,u(b[2]);return _=l,o=c,g(l,c)}finally{n.__wbindgen_free(_,o,1)}}function V(t,e){let r,_;try{const c=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=a,f=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=n.import_private_key(c,i,f,w);var o=d[0],l=d[1];if(d[3])throw o=0,l=0,u(d[2]);return r=o,_=l,g(o,l)}finally{n.__wbindgen_free(r,_,1)}}function G(t,e,r){let _,o;try{const i=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),f=a,w=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=n.import_private_key_image(i,f,w,d,y,m);var l=b[0],c=b[1];if(b[3])throw l=0,c=0,u(b[2]);return _=l,o=c,g(l,c)}finally{n.__wbindgen_free(_,o,1)}}function H(t){let e,r;try{const l=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),c=a,i=n.inspect_transaction_request(l,c);var _=i[0],o=i[1];if(i[3])throw _=0,o=0,u(i[2]);return e=_,r=o,g(_,o)}finally{n.__wbindgen_free(e,r,1)}}function P(t,e,r){let _,o;try{const i=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),f=a,w=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=a,y=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=a,b=n.sign_message_request(i,f,w,d,y,m);var l=b[0],c=b[1];if(b[3])throw l=0,c=0,u(b[2]);return _=l,o=c,g(l,c)}finally{n.__wbindgen_free(_,o,1)}}function X(t,e,r,_){let o,l;try{const f=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),y=a,m=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),b=a,p=n.sign_transaction_request(f,w,d,y,m,b,_);var c=p[0],i=p[1];if(p[3])throw c=0,i=0,u(p[2]);return o=c,l=i,g(c,i)}finally{n.__wbindgen_free(o,l,1)}}function Y(){let t,e;try{const o=n.transaction_type_registry();var r=o[0],_=o[1];if(o[3])throw r=0,_=0,u(o[2]);return t=r,e=_,g(r,_)}finally{n.__wbindgen_free(t,e,1)}}function J(t,e){let r,_;try{const c=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=a,f=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=n.unlock_browser_wallet(c,i,f,w);var o=d[0],l=d[1];if(d[3])throw o=0,l=0,u(d[2]);return r=o,_=l,g(o,l)}finally{n.__wbindgen_free(r,_,1)}}function K(t,e,r,_){let o,l;try{const f=s(t,n.__wbindgen_malloc,n.__wbindgen_realloc),w=a,d=s(e,n.__wbindgen_malloc,n.__wbindgen_realloc),y=a,m=s(r,n.__wbindgen_malloc,n.__wbindgen_realloc),b=a,p=s(_,n.__wbindgen_malloc,n.__wbindgen_realloc),q=a,v=n.verify_message_proof(f,w,d,y,m,b,p,q);var c=v[0],i=v[1];if(v[3])throw c=0,i=0,u(v[2]);return o=c,l=i,g(c,i)}finally{n.__wbindgen_free(o,l,1)}}function Q(){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 r=e;return typeof r=="object"&&r!==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,r){throw new Error(g(e,r))},__wbg_call_a6e5c5dce5018821:function(){return R(function(e,r,_){return e.call(r,_)},arguments)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return R(function(e,r){e.getRandomValues(r)},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,r,_){Uint8Array.prototype.set.call(S(e,r),_)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return R(function(e,r){e.randomFillSync(r)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return R(function(){return module.require},arguments)},__wbg_static_accessor_GLOBAL_4ef717fb391d88b7:function(){const e=typeof global>"u"?null:global;return W(e)?0:h(e)},__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4:function(){const e=typeof globalThis>"u"?null:globalThis;return W(e)?0:h(e)},__wbg_static_accessor_SELF_146583524fe1469b:function(){const e=typeof self>"u"?null:self;return W(e)?0:h(e)},__wbg_static_accessor_WINDOW_f2829a2234d7819e:function(){const e=typeof window>"u"?null:window;return W(e)?0:h(e)},__wbg_subarray_3ed232c8a6baee09:function(e,r,_){return e.subarray(r>>>0,_>>>0)},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbindgen_cast_0000000000000001:function(e,r){return S(e,r)},__wbindgen_cast_0000000000000002:function(e,r){return g(e,r)},__wbindgen_init_externref_table:function(){const e=n.__wbindgen_externrefs,r=e.grow(4);e.set(0,void 0),e.set(r+0,void 0),e.set(r+1,null),e.set(r+2,!0),e.set(r+3,!1)}}}}function h(t){const e=n.__externref_table_alloc();return n.__wbindgen_externrefs.set(e,t),e}function S(t,e){return t=t>>>0,A().subarray(t/1,t/1+e)}function g(t,e){return $(t>>>0,e)}let x=null;function A(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(n.memory.buffer)),x}function R(t,e){try{return t.apply(this,e)}catch(r){const _=h(r);n.__wbindgen_exn_store(_)}}function W(t){return t==null}function s(t,e,r){if(r===void 0){const i=T.encode(t),f=e(i.length,1)>>>0;return A().subarray(f,f+i.length).set(i),a=i.length,f}let _=t.length,o=e(_,1)>>>0;const l=A();let c=0;for(;c<_;c++){const i=t.charCodeAt(c);if(i>127)break;l[o+c]=i}if(c!==_){c!==0&&(t=t.slice(c)),o=r(o,_,_=c+t.length*3,1)>>>0;const i=A().subarray(o+c,o+_),f=T.encodeInto(t,i);c+=f.written,o=r(o,_,c,1)>>>0}return a=c,o}function u(t){const e=n.__wbindgen_externrefs.get(t);return n.__externref_table_dealloc(t),e}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const Z=2146435072;let O=0;function $(t,e){return O+=e,O>=Z&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=e),E.decode(A().subarray(t,t+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(t,e){const r=T.encode(t);return e.set(r),{read:t.length,written:r.length}});let a=0,n;function ee(t,e){return n=t.exports,x=null,n.__wbindgen_start(),n}async function ne(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(o){if(t.ok&&r(t.type)&&t.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",o);else throw o}const _=await t.arrayBuffer();return await WebAssembly.instantiate(_,e)}else{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}function r(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}async function te(t){if(n!==void 0)return n;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),t===void 0&&(t=new URL("/assets/contractless_browser_core_bg-C_vtp2Os.wasm",import.meta.url));const e=Q();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:r,module:_}=await ne(await t,e);return ee(r)}let L;async function re(){return L??(L=te()),await L,{complete_dual_transaction_request:I,create_handshake_proof:M,create_wallet_registration:B,create_wallet_registration_from_keys:C,decode_transaction:D,export_legacy_wallet:j,generate_browser_wallet:z,import_legacy_wallet:N,import_private_key:V,import_private_key_image:G,inspect_transaction_request:H,sign_message_request:P,sign_transaction_request:X,transaction_type_registry:Y,unlock_browser_wallet:J,verify_message_proof:K}}export{re as c};
|