From b0c56d16dbe7de30a16a0715148ecfe739c665da Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 15 Mar 2025 15:50:27 +0200 Subject: stellar freighter api update --- src/external/stellar-sdk-minimal.min.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/external/stellar-sdk-minimal.min.js (limited to 'src/external/stellar-sdk-minimal.min.js') diff --git a/src/external/stellar-sdk-minimal.min.js b/src/external/stellar-sdk-minimal.min.js new file mode 100644 index 0000000..14bcac2 --- /dev/null +++ b/src/external/stellar-sdk-minimal.min.js @@ -0,0 +1,3 @@ +/*! For license information please see stellar-sdk-minimal.min.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("StellarSdk",[],t):"object"==typeof exports?exports.StellarSdk=t():e.StellarSdk=t()}(self,(()=>(()=>{var e={"./node_modules/@stellar/js-xdr/dist/xdr.js":function(e){var t;t=()=>(()=>{var e={616:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(287);n.hp.alloc(1).subarray(0,1)instanceof n.hp||(n.hp.prototype.subarray=function(e,t){const r=Uint8Array.prototype.subarray.call(this,e,t);return Object.setPrototypeOf(r,n.hp.prototype),r});const o=n.hp},281:(e,t,r)=>{const n=r(164);e.exports=n},164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>D,Bool:()=>B,Double:()=>I,Enum:()=>z,Float:()=>C,Hyper:()=>A,Int:()=>_,LargeInt:()=>k,Opaque:()=>N,Option:()=>q,Quadruple:()=>R,Reference:()=>H,String:()=>U,Struct:()=>X,Union:()=>Q,UnsignedHyper:()=>O,UnsignedInt:()=>P,VarArray:()=>V,VarOpaque:()=>F,Void:()=>K,XdrReader:()=>u,XdrWriter:()=>d,config:()=>ne});class n extends TypeError{constructor(e){super(`XDR Write Error: ${e}`)}}class o extends TypeError{constructor(e){super(`XDR Read Error: ${e}`)}}class s extends TypeError{constructor(e){super(`XDR Type Definition Error: ${e}`)}}class i extends s{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var a=r(616).A;class u{constructor(e){if(!a.isBuffer(e)){if(!(e instanceof Array||Array.isArray(e)||ArrayBuffer.isView(e)))throw new o(`source invalid: ${e}`);e=a.from(e)}this._buffer=e,this._length=e.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length0){for(let e=0;e0){const e=this.alloc(r);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}static bufferChunkSize=c}var p=r(616).A;class f{toXDR(e="raw"){if(!this.write)return this.constructor.toXDR(this,e);const t=new d;return this.write(this,t),g(t.finalize(),e)}fromXDR(e,t="raw"){if(!this.read)return this.constructor.fromXDR(e,t);const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e,t="raw"){const r=new d;return this.write(e,r),g(r.finalize(),t)}static fromXDR(e,t="raw"){const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}static validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class h extends f{static read(e){throw new i}static write(e,t){throw new i}static isValid(e){return!1}}class y extends f{isValid(e){return!1}}class m extends TypeError{constructor(e){super(`Invalid format ${e}, must be one of "raw", "hex", "base64"`)}}function g(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new m(t)}}function v(e,t){switch(t){case"raw":return e;case"hex":return p.from(e,"hex");case"base64":return p.from(e,"base64");default:throw new m(t)}}function b(e,t){return null!=e&&(e instanceof t||w(e,t)&&"function"==typeof e.constructor.read&&"function"==typeof e.constructor.write&&w(e,"XdrType"))}function w(e,t){do{if(e.constructor.name===t)return!0}while(e=Object.getPrototypeOf(e));return!1}const S=2147483647;class _ extends h{static read(e){return e.readInt32BE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");if((0|e)!==e)throw new n("invalid i32 value");t.writeInt32BE(e)}static isValid(e){return"number"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=S}}function T(e,t,r){if("bigint"!=typeof e)throw new TypeError("Expected bigint 'value', got "+typeof e);const n=t/r;if(1===n)return[e];if(r<32||r>128||2!==n&&4!==n&&8!==n)throw new TypeError(`invalid bigint (${e}) and slice size (${t} -> ${r}) combination`);const o=BigInt(r),s=new Array(n);for(let t=0;t>=o;return s}function E(e,t){if(t)return[0n,(1n<=s&&o<=i)return o;throw new TypeError(`bigint values [${e}] for ${function(e,t){return`${t?"u":"i"}${e}`}(t,r)} out of range [${s}, ${i}]: ${o}`)}(e,this.size,this.unsigned)}get unsigned(){throw new i}get size(){throw new i}slice(e){return T(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t}=this.prototype;return 64===t?new this(e.readBigUInt64BE()):new this(...Array.from({length:t/64},(()=>e.readBigUInt64BE())).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if("bigint"!=typeof e||e>this.MAX_VALUE||e>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}A.defineIntBoundaries();const x=4294967295;class P extends h{static read(e){return e.readUInt32BE()}static write(e,t){if("number"!=typeof e||!(e>=0&&e<=x)||e%1!=0)throw new n("invalid u32 value");t.writeUInt32BE(e)}static isValid(e){return"number"==typeof e&&e%1==0&&e>=0&&e<=x}}P.MAX_VALUE=x,P.MIN_VALUE=0;class O extends k{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}O.defineIntBoundaries();class C extends h{static read(e){return e.readFloatBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeFloatBE(e)}static isValid(e){return"number"==typeof e}}class I extends h{static read(e){return e.readDoubleBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeDoubleBE(e)}static isValid(e){return"number"==typeof e}}class R extends h{static read(){throw new s("quadruple not supported")}static write(){throw new s("quadruple not supported")}static isValid(){return!1}}class B extends h{static read(e){const t=_.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new o(`got ${t} when trying to read a bool`)}}static write(e,t){const r=e?1:0;_.write(r,t)}static isValid(e){return"boolean"==typeof e}}var j=r(616).A;class U extends y{constructor(e=P.MAX_VALUE){super(),this._maxLength=e}read(e){const t=P.read(e);if(t>this._maxLength)throw new o(`saw ${t} length String, max allowed is ${this._maxLength}`);return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?j.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);P.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?j.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||j.isBuffer(e))&&e.length<=this._maxLength}}var L=r(616).A;class N extends y{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:r}=e;if(r!==this._length)throw new n(`got ${e.length} bytes, expected ${this._length}`);t.write(e,r)}isValid(e){return L.isBuffer(e)&&e.length===this._length}}var M=r(616).A;class F extends y{constructor(e=P.MAX_VALUE){super(),this._maxLength=e}read(e){const t=P.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarOpaque, max allowed is ${this._maxLength}`);return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);P.write(r,t),t.write(e,r)}isValid(e){return M.isBuffer(e)&&e.length<=this._maxLength}}class D extends y{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;rthis._maxLength)throw new o(`saw ${t} length VarArray, max allowed is ${this._maxLength}`);const r=new Array(t);for(let n=0;nthis._maxLength)throw new n(`got array of size ${e.length}, max allowed is ${this._maxLength}`);P.write(e.length,t);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class q extends h{constructor(e){super(),this._childType=e}read(e){if(B.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;B.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class K extends h{static read(){}static write(e){if(void 0!==e)throw new n("trying to write value to a void slot")}static isValid(e){return void 0===e}}class z extends h{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=_.read(e),r=this._byValue[t];if(void 0===r)throw new o(`unknown ${this.enumName} member for value ${t}`);return r}static write(e,t){if(!this.isValid(e))throw new n(`${e} has enum name ${e?.enumName}, not ${this.enumName}: ${JSON.stringify(e)}`);_.write(e.value,t)}static isValid(e){return e?.constructor?.enumName===this.enumName||b(e,this)}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError(`${e} is not a member of ${this.enumName}`);return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError(`${e} is not a value of any member of ${this.enumName}`);return t}static create(e,t,r){const n=class extends z{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[e,t]of Object.entries(r)){const r=new n(e,t);n._members[e]=r,n._byValue[t]=r,n[e]=()=>r}return n}}class H extends h{resolve(){throw new s('"resolve" method should be implemented in the descendant class')}}class X extends y{constructor(e){super(),this._attributes=e||{}}static read(e){const t={};for(const[r,n]of this._fields)t[r]=n.read(e);return new this(t)}static write(e,t){if(!this.isValid(e))throw new n(`${e} has struct name ${e?.constructor?.structName}, not ${this.structName}: ${JSON.stringify(e)}`);for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e?.constructor?.structName===this.structName||b(e,this)}static create(e,t,r){const n=class extends X{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let t=0;t{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=a(e),i=s[0],u=s[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,u)),c=0,d=u>0?i-4:i;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,s=[],i=16383,a=0,l=n-o;al?l:a+i));return 1===o?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=s[i],n[s.charCodeAt(i)]=i;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,s,i=[],a=t;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(e,t,r)=>{"use strict";const n=r(526),o=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=u,t.IS=50;const i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|h(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||G(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),a(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),r=a(t);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let s,i=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,a/=2,u/=2,r/=2}function l(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){let n=-1;for(s=r;sa&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;no&&(n=o):n=o;const s=t.length;let i;for(n>s/2&&(n=s/2),i=0;i>8,o=r%256,s.push(o),s.push(n);return s}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+i<=r){let r,n,a,u;switch(i){case 1:t<128&&(s=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,i=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=i}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0);const a=Math.min(s,i),l=this.slice(n,o),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function j(e,t,r,n,o){q(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,r}function U(e,t,r,n,o){q(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=i,i>>=8,e[r+2]=i,i>>=8,e[r+1]=i,i>>=8,e[r]=i,r+8}function L(e,t,r,n,o,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],o=1,s=0;for(;++s>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],o=1,s=0;for(;++s=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=t,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||R(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,n||B(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let o=0,s=1,i=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);B(this,e,t,r,n-1,-n)}let o=r-1,s=1,i=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===i&&0!==this[t+o+1]&&(i=1),this[t+o]=(e/s|0)-i&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,o,s){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,o,s)}function K(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=V(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const s=[];for(let i=0;i55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Q(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},251:(e,t)=>{t.read=function(e,t,r,n,o){var s,i,a=8*o-n-1,u=(1<>1,c=-7,d=r?o-1:0,p=r?-1:1,f=e[t+d];for(d+=p,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+d],d+=p,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=n;c>0;i=256*i+e[t+d],d+=p,c-=8);if(0===s)s=1-l;else{if(s===u)return i?NaN:1/0*(f?-1:1);i+=Math.pow(2,n),s-=l}return(f?-1:1)*i*Math.pow(2,s-n)},t.write=function(e,t,r,n,o,s){var i,a,u,l=8*s-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(i++,u/=2),i+d>=c?(a=0,i=c):i+d>=1?(a=(t*u-1)*Math.pow(2,o),i+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[r+f]=255&a,f+=h,a/=256,o-=8);for(i=i<0;e[r+f]=255&i,f+=h,i/=256,l-=8);e[r+f-h]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(281)})(),e.exports=t()},"./node_modules/@stellar/stellar-base/lib/account.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n,o=(n=r("./node_modules/@stellar/stellar-base/lib/util/bignumber.js"))&&n.__esModule?n:{default:n},s=r("./node_modules/@stellar/stellar-base/lib/strkey.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r("./node_modules/@stellar/stellar-base/lib/strkey.js"),s=(n=r("./node_modules/@stellar/stellar-base/lib/xdr.js"))&&n.__esModule?n:{default:n};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r{"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Asset=void 0;var o,s=r("./node_modules/@stellar/stellar-base/lib/util/util.js"),i=(o=r("./node_modules/@stellar/stellar-base/lib/xdr.js"))&&o.__esModule?o:{default:o},a=r("./node_modules/@stellar/stellar-base/lib/keypair.js"),u=r("./node_modules/@stellar/stellar-base/lib/strkey.js"),l=r("./node_modules/@stellar/stellar-base/lib/hashing.js");function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:i.default.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=i.default.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=i.default.AlphaNum12,t="assetTypeCreditAlphanum12");var n=this.code.length<=4?4:12;return new r(t,new e({assetCode:this.code.padEnd(n,"\0"),issuer:a.Keypair.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:"getCode",value:function(){if(void 0!==this.code)return String(this.code)}},{key:"getIssuer",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:"getAssetType",value:function(){switch(this.getRawAssetType().value){case i.default.AssetType.assetTypeNative().value:return"native";case i.default.AssetType.assetTypeCreditAlphanum4().value:return"credit_alphanum4";case i.default.AssetType.assetTypeCreditAlphanum12().value:return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?i.default.AssetType.assetTypeNative():this.code.length<=4?i.default.AssetType.assetTypeCreditAlphanum4():i.default.AssetType.assetTypeCreditAlphanum12()}},{key:"isNative",value:function(){return!this.issuer}},{key:"equals",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:"toString",value:function(){return this.isNative()?"native":"".concat(this.getCode(),":").concat(this.getIssuer())}}],[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case i.default.AssetType.assetTypeNative():return this.native();case i.default.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case i.default.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=u.StrKey.encodeEd25519PublicKey(t.issuer().ed25519()),new this((0,s.trimEnd)(t.assetCode(),"\0"),r);default:throw new Error("Invalid asset type: ".concat(e.switch().name))}}},{key:"compare",value:function(t,r){if(!(t&&t instanceof e))throw new Error("assetA is invalid");if(!(r&&r instanceof e))throw new Error("assetB is invalid");if(t.equals(r))return 0;var n=t.getRawAssetType().value,o=r.getRawAssetType().value;if(n!==o)return n{"use strict";var n=r("./node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeEntry=y,t.authorizeInvocation=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:u.Networks.FUTURENET,a=i.Keypair.random().rawPublicKey(),l=new s.default.Int64((p=a,p.subarray(0,8).reduce((function(e,t){return e<<8|t}),0))),d=n||e.publicKey();var p;if(!d)throw new Error("authorizeInvocation requires publicKey parameter");return y(new s.default.SorobanAuthorizationEntry({rootInvocation:r,credentials:s.default.SorobanCredentials.sorobanCredentialsAddress(new s.default.SorobanAddressCredentials({address:new c.Address(d).toScAddress(),nonce:l,signatureExpirationLedger:0,signature:s.default.ScVal.scvVec([])}))}),e,t,o)};var o,s=(o=r("./node_modules/@stellar/stellar-base/lib/xdr.js"))&&o.__esModule?o:{default:o},i=r("./node_modules/@stellar/stellar-base/lib/keypair.js"),a=r("./node_modules/@stellar/stellar-base/lib/strkey.js"),u=r("./node_modules/@stellar/stellar-base/lib/network.js"),l=r("./node_modules/@stellar/stellar-base/lib/hashing.js"),c=r("./node_modules/@stellar/stellar-base/lib/address.js"),d=r("./node_modules/@stellar/stellar-base/lib/scval.js");function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(){f=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},i=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var s=t&&t.prototype instanceof b?t:b,i=Object.create(s.prototype),a=new R(n||[]);return o(i,"_invoke",{value:P(e,r,a)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function S(){}var _={};l(_,i,(function(){return this}));var T=Object.getPrototypeOf,E=T&&T(T(B([])));E&&E!==r&&n.call(E,i)&&(_=E);var k=S.prototype=b.prototype=Object.create(_);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,s,i,a){var u=d(e[o],e,s);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==p(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(c).then((function(e){l.value=e,i(l)}),(function(e){return r("throw",e,i,a)}))}a(u.arg)}var s;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return s=s?s.then(o,o):o()}})}function P(t,r,n){var o=h;return function(s,i){if(o===m)throw Error("Generator is already running");if(o===g){if("throw"===s)throw i;return{value:e,done:!0}}for(n.method=s,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?g:y,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=g,n.method="throw",n.arg=l.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var s=d(o,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,v;var i=s.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function B(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o=0;--s){var i=this.tryEntries[s],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:B(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function h(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function y(e,t,r){return m.apply(this,arguments)}function m(){var e;return e=f().mark((function e(t,r,o){var p,h,y,m,g,v,b,w,S,_=arguments;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p=_.length>3&&void 0!==_[3]?_[3]:u.Networks.FUTURENET,t.credentials().switch().value===s.default.SorobanCredentialsType.sorobanCredentialsAddress().value){e.next=3;break}return e.abrupt("return",t);case 3:if(h=s.default.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(y=h.credentials().address()).signatureExpirationLedger(o),m=(0,l.hash)(n.from(p)),g=s.default.HashIdPreimage.envelopeTypeSorobanAuthorization(new s.default.HashIdPreimageSorobanAuthorization({networkId:m,nonce:y.nonce(),invocation:h.rootInvocation(),signatureExpirationLedger:y.signatureExpirationLedger()})),v=(0,l.hash)(g.toXDR()),"function"!=typeof r){e.next=18;break}return e.t0=n,e.next=13,r(g);case 13:e.t1=e.sent,b=e.t0.from.call(e.t0,e.t1),w=c.Address.fromScAddress(y.address()).toString(),e.next=20;break;case 18:b=n.from(r.sign(v)),w=r.publicKey();case 20:if(i.Keypair.fromPublicKey(w).verify(v,b)){e.next=22;break}th