diff --git a/asset-manifest.json b/asset-manifest.json
index 197910e..97c0def 100644
--- a/asset-manifest.json
+++ b/asset-manifest.json
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/allbridge-example-react/static/css/main.520ab86f.css",
- "main.js": "/allbridge-example-react/static/js/main.eb0254f2.js",
+ "main.js": "/allbridge-example-react/static/js/main.6cf217e7.js",
"static/js/453.809a7fa7.chunk.js": "/allbridge-example-react/static/js/453.809a7fa7.chunk.js",
"index.html": "/allbridge-example-react/index.html",
"main.520ab86f.css.map": "/allbridge-example-react/static/css/main.520ab86f.css.map",
- "main.eb0254f2.js.map": "/allbridge-example-react/static/js/main.eb0254f2.js.map",
+ "main.6cf217e7.js.map": "/allbridge-example-react/static/js/main.6cf217e7.js.map",
"453.809a7fa7.chunk.js.map": "/allbridge-example-react/static/js/453.809a7fa7.chunk.js.map"
},
"entrypoints": [
"static/css/main.520ab86f.css",
- "static/js/main.eb0254f2.js"
+ "static/js/main.6cf217e7.js"
]
}
\ No newline at end of file
diff --git a/index.html b/index.html
index 86e8600..5bc443a 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
Allbridge Core SDK Example
\ No newline at end of file
+Allbridge Core SDK Example
\ No newline at end of file
diff --git a/static/js/main.eb0254f2.js b/static/js/main.6cf217e7.js
similarity index 99%
rename from static/js/main.eb0254f2.js
rename to static/js/main.6cf217e7.js
index 2a9842d..f7467b3 100644
--- a/static/js/main.eb0254f2.js
+++ b/static/js/main.6cf217e7.js
@@ -1,3 +1,3 @@
-/*! For license information please see main.eb0254f2.js.LICENSE.txt */
-(()=>{var __webpack_modules__={63920:function(e,t,r){"use strict";var n,o,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.chainProperties=t.ChainDecimalsByType=t.ChainType=t.ChainSymbol=void 0,a(r(22168),t),function(e){e.GRL="GRL",e.SPL="SPL",e.HOL="HOL",e.BSC="BSC",e.ETH="ETH",e.BAS="BAS",e.SOL="SOL",e.TRX="TRX",e.POL="POL",e.MUM="MUM",e.AMO="AMO",e.ARB="ARB",e.CEL="CEL",e.AVA="AVA",e.SRB="SRB",e.STLR="STLR",e.OPT="OPT"}(n=t.ChainSymbol||(t.ChainSymbol={})),function(e){e.EVM="EVM",e.SOLANA="SOLANA",e.TRX="TRX",e.SRB="SRB"}(o=t.ChainType||(t.ChainType={})),t.ChainDecimalsByType={EVM:18,SOLANA:9,TRX:6,SRB:7},t.chainProperties={[n.GRL]:{chainSymbol:n.GRL,chainId:"0x5",name:"Goerli",chainType:o.EVM},[n.SPL]:{chainSymbol:n.SPL,chainId:"0xaa36a7",name:"Sepolia",chainType:o.EVM},[n.HOL]:{chainSymbol:n.HOL,chainId:"0x4268",name:"Hole\u0161ky",chainType:o.EVM},[n.BSC]:{chainSymbol:n.BSC,chainId:"0x38",name:"BNB Chain",chainType:o.EVM},[n.ETH]:{chainSymbol:n.ETH,chainId:"0x1",name:"Ethereum",chainType:o.EVM},[n.BAS]:{chainSymbol:n.BAS,chainId:"0x2105",name:"Base",chainType:o.EVM},[n.ARB]:{chainSymbol:n.ARB,chainId:"0xa4b1",name:"Arbitrum",chainType:o.EVM},[n.AVA]:{chainSymbol:n.AVA,chainId:"0xa86a",name:"Avalanche",chainType:o.EVM},[n.CEL]:{chainSymbol:n.CEL,chainId:"0xa4ec",name:"Celo",chainType:o.EVM},[n.POL]:{chainSymbol:n.POL,chainId:"0x89",name:"Polygon",chainType:o.EVM},[n.MUM]:{chainSymbol:n.MUM,chainId:"0x13881",name:"Mumbai",chainType:o.EVM},[n.AMO]:{chainSymbol:n.AMO,chainId:"0x13882",name:"Amoy",chainType:o.EVM},[n.OPT]:{chainSymbol:n.OPT,chainId:"0xa",name:"OP Mainnet",chainType:o.EVM},[n.SOL]:{chainSymbol:n.SOL,name:"Solana",chainType:o.SOLANA},[n.TRX]:{chainSymbol:n.TRX,name:"Tron",chainType:o.TRX},[n.SRB]:{chainSymbol:n.SRB,name:"Stellar",chainType:o.SRB},[n.STLR]:{chainSymbol:n.STLR,name:"Stellar",chainType:o.SRB}}},22168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27503:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messenger=t.MessengerKeyDTO=t.AddressStatus=void 0,function(e){e.OK="OK",e.INVALID="INVALID",e.FORBIDDEN="FORBIDDEN",e.UNINITIALIZED="UNINITIALIZED",e.CONTRACT_ADDRESS="CONTRACT_ADDRESS",e.WRONG_ASSOCIATED_ACCOUNT_OWNER="WRONG_ASSOCIATED_ACCOUNT_OWNER"}(t.AddressStatus||(t.AddressStatus={})),function(e){e.ALLBRIDGE="allbridge",e.WORMHOLE="wormhole",e.CCTP="cctp"}(t.MessengerKeyDTO||(t.MessengerKeyDTO={})),function(e){e[e.ALLBRIDGE=1]="ALLBRIDGE",e[e.WORMHOLE=2]="WORMHOLE",e[e.CCTP=3]="CCTP"}(t.Messenger||(t.Messenger={}))},31112:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=t.TxTooLargeError=t.CCTPDoesNotSupportedError=t.NodeRpcUrlNotInitializedError=t.TimeoutError=t.ArgumentInvalidDecimalsError=t.ExtraGasMaxLimitExceededError=t.InvalidTxError=t.VerifyTxError=t.MethodNotSupportedError=t.InvalidMessengerOptionError=t.InvalidGasFeePaymentOptionError=t.JupiterError=t.InsufficientPoolLiquidityError=t.AmountNotEnoughError=t.InvalidAmountError=t.SdkError=t.SdkRootError=void 0;class r extends Error{constructor(e,t){super(t),this.errorCode=e}}t.SdkRootError=r;t.SdkError=class extends r{constructor(e){super(n.SDK_ERROR,e)}};t.InvalidAmountError=class extends r{constructor(e){super(n.INVALID_AMOUNT_ERROR,e)}};t.AmountNotEnoughError=class extends r{constructor(e){super(n.AMOUNT_NOT_ENOUGH_ERROR,e)}};t.InsufficientPoolLiquidityError=class extends r{constructor(e){super(n.INSUFFICIENT_POOL_LIQUIDITY_ERROR,e)}};t.JupiterError=class extends r{constructor(e){super(n.JUPITER_ERROR,e)}};t.InvalidGasFeePaymentOptionError=class extends r{constructor(e){super(n.INVALID_GAS_FEE_PAYMENT_OPTION_ERROR,e)}};t.InvalidMessengerOptionError=class extends r{constructor(e){super(n.INVALID_MESSENGER_OPTION_ERROR,e)}};t.MethodNotSupportedError=class extends r{constructor(e){super(n.METHOD_NOT_SUPPORTED_ERROR,e)}};t.VerifyTxError=class extends r{constructor(e){super(n.VERIFY_TX_ERROR,e)}};t.InvalidTxError=class extends r{constructor(e){super(n.INVALID_TX_ERROR,e)}};t.ExtraGasMaxLimitExceededError=class extends r{constructor(e){super(n.EXTRA_GAS_MAX_LIMIT_EXCEEDED_ERROR,e)}};t.ArgumentInvalidDecimalsError=class extends r{constructor(e,t,r){super(n.ARGUMENT_INVALID_DECIMALS_ERROR,"Argument '".concat(e,"' decimals '").concat(t,"' cannot be greater than '").concat(r,"'"))}};t.TimeoutError=class extends r{constructor(e){super(n.TIMEOUT_ERROR,e)}};t.NodeRpcUrlNotInitializedError=class extends r{constructor(e){super(n.NODE_RPC_URL_NOT_INITIALIZED_ERROR,"For chain '".concat(e,"' Node RPC URL not initialized"))}};t.CCTPDoesNotSupportedError=class extends r{constructor(e){super(n.CCTP_DOES_NOT_SUPPORTED_ERROR,e)}};var n;t.TxTooLargeError=class extends r{constructor(){super(n.TX_TOO_LARGE,"Transaction too large: try again later or switch to another messenger or pay relayer fee in native gas currency")}},function(e){e.SDK_ERROR="SdkError",e.INVALID_AMOUNT_ERROR="InvalidAmountError",e.AMOUNT_NOT_ENOUGH_ERROR="AmountNotEnoughError",e.INSUFFICIENT_POOL_LIQUIDITY_ERROR="InsufficientPoolLiquidityError",e.JUPITER_ERROR="JupiterError",e.INVALID_GAS_FEE_PAYMENT_OPTION_ERROR="InvalidGasFeePaymentOptionError",e.INVALID_MESSENGER_OPTION_ERROR="InvalidMessengerOptionError",e.METHOD_NOT_SUPPORTED_ERROR="MethodNotSupportedError",e.VERIFY_TX_ERROR="VerifyTxError",e.INVALID_TX_ERROR="InvalidTxError",e.EXTRA_GAS_MAX_LIMIT_EXCEEDED_ERROR="ExtraGasMaxLimitExceededError",e.ARGUMENT_INVALID_DECIMALS_ERROR="ArgumentInvalidDecimalsError",e.TIMEOUT_ERROR="TimeoutError",e.NODE_RPC_URL_NOT_INITIALIZED_ERROR="NodeRpcUrlNotInitializedError",e.CCTP_DOES_NOT_SUPPORTED_ERROR="CCTPDoesNotSupportedError",e.TX_TOO_LARGE="TxTooLargeError"}(n=t.ErrorCode||(t.ErrorCode={}))},78412:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(31112),t)},85392:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AmountFormat=t.FeePaymentMethod=t.ChainType=t.ChainSymbol=t.AddressStatus=t.Messenger=void 0;var i=r(27503);Object.defineProperty(t,"Messenger",{enumerable:!0,get:function(){return i.Messenger}}),Object.defineProperty(t,"AddressStatus",{enumerable:!0,get:function(){return i.AddressStatus}});var a=r(63920);Object.defineProperty(t,"ChainSymbol",{enumerable:!0,get:function(){return a.ChainSymbol}}),Object.defineProperty(t,"ChainType",{enumerable:!0,get:function(){return a.ChainType}}),o(r(22573),t),o(r(78412),t),function(e){e.WITH_NATIVE_CURRENCY="native",e.WITH_STABLECOIN="stablecoin"}(t.FeePaymentMethod||(t.FeePaymentMethod={})),function(e){e.INT="int",e.FLOAT="float"}(t.AmountFormat||(t.AmountFormat={}))},22573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaAutoTxFee=void 0;var n=r(77756);Object.defineProperty(t,"SolanaAutoTxFee",{enumerable:!0,get:function(){return n.SolanaAutoTxFee}})},77756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaAutoTxFee=void 0,t.SolanaAutoTxFee="AUTO"},51273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n,o=(n=r(1991))&&n.__esModule?n:{default:n},i=r(88602);function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r(88602),i=(n=r(45956))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Asset=void 0;var n,o=r(70443),i=(n=r(45956))&&n.__esModule?n:{default:n},a=r(68141),s=r(88602),u=r(97470);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 l(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()){case i.default.AssetType.assetTypeNative():return"native";case i.default.AssetType.assetTypeCreditAlphanum4():return"credit_alphanum4";case i.default.AssetType.assetTypeCreditAlphanum12():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())}}],n=[{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=s.StrKey.encodeEd25519PublicKey(t.issuer().ed25519()),new this((0,o.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";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeEntry=p,t.authorizeInvocation=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.Networks.FUTURENET,u=i.Keypair.random().rawPublicKey(),l=new o.default.Int64((d=u,d.subarray(0,8).reduce((function(e,t){return e<<8|t}),0))),f=n||e.publicKey();var d;if(!f)throw new Error("authorizeInvocation requires publicKey parameter");return p(new o.default.SorobanAuthorizationEntry({rootInvocation:r,credentials:o.default.SorobanCredentials.sorobanCredentialsAddress(new o.default.SorobanAddressCredentials({address:new c.Address(f).toScAddress(),nonce:l,signatureExpirationLedger:0,signature:o.default.ScVal.scvVec([])}))}),e,t,a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602),s=r(43504),u=r(97470),c=r(70714),l=r(86655);function f(e){return f="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},f(e)}function d(){d=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=h(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==f(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,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===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.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 i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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 new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function h(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function p(e,t,r){return y.apply(this,arguments)}function y(){var e;return e=d().mark((function e(t,r,n){var f,h,p,y,m,g,v,b,w,A=arguments;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=A.length>3&&void 0!==A[3]?A[3]:s.Networks.FUTURENET,t.credentials().switch().value===o.default.SorobanCredentialsType.sorobanCredentialsAddress().value){e.next=3;break}return e.abrupt("return",t);case 3:if(h=o.default.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(p=h.credentials().address()).signatureExpirationLedger(n),y=(0,u.hash)(Buffer.from(f)),m=o.default.HashIdPreimage.envelopeTypeSorobanAuthorization(new o.default.HashIdPreimageSorobanAuthorization({networkId:y,nonce:p.nonce(),invocation:h.rootInvocation(),signatureExpirationLedger:p.signatureExpirationLedger()})),g=(0,u.hash)(m.toXDR()),"function"!==typeof r){e.next=17;break}return e.t0=Buffer,e.next=13,r(m);case 13:e.t1=e.sent,v=e.t0.from.call(e.t0,e.t1),e.next=18;break;case 17:v=Buffer.from(r.sign(g));case 18:if(b=c.Address.fromScAddress(p.address()).toString(),i.Keypair.fromPublicKey(b).verify(g,v)){e.next=21;break}throw new Error("signature doesn't match payload");case 21:return w=(0,l.nativeToScVal)({public_key:a.StrKey.decodeEd25519PublicKey(b),signature:v},{type:{public_key:["symbol",null],signature:["symbol",null]}}),p.signature(o.default.ScVal.scvVec([w])),e.abrupt("return",h);case 24:case"end":return e.stop()}}),e)})),y=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){h(i,n,o,a,s,"next",e)}function s(e){h(i,n,o,a,s,"throw",e)}a(void 0)}))},y.apply(this,arguments)}},79657:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Claimant=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n,o=r(70714),i=r(11647),a=(n=r(45956))&&n.__esModule?n:{default:n},s=r(88602);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1?t-1:0),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.humanizeEvents=function(e){return e.map((function(e){return e instanceof o.default.DiagnosticEvent?s(e.event()):s(e)}))};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(86655);function s(e){return{contractId:null===e.contractId()?"":i.StrKey.encodeContract(e.contractId()),type:e.type().name,topics:e.body().value().topics().map((function(e){return(0,a.scValToNative)(e)})),data:(0,a.scValToNative)(e.body().value().data())}}},78618:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FeeBumpTransaction=void 0;var o,i=(o=r(45956))&&o.__esModule?o:{default:o},a=r(97470),s=r(20502),u=r(23920),c=r(29522);function l(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(75493)).config((function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("PoolId",e.lookup("Hash")),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeEntry",[["ext",e.lookup("ExtensionPoint")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("Hash")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647)}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("Hash"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMeta",[["ext",e.lookup("ExtensionPoint")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("ExtensionPoint")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfBucketList",e.lookup("Uint64")],["evictedTemporaryLedgerKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["evictedPersistentLedgerEntries",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,getPeers:4,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,surveyRequest:14,surveyResponse:15,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{surveyTopology:0}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV0:0,surveyTopologyResponseV1:1}),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("SignedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("SurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("SignedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("SurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.typedef("PeerStatList",e.varArray(e.lookup("PeerStats"),25)),e.struct("TopologyResponseBodyV0",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TopologyResponseBodyV1",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV0","topologyResponseBodyV0"],["surveyTopologyResponseV1","topologyResponseBodyV1"]],arms:{topologyResponseBodyV0:e.lookup("TopologyResponseBodyV0"),topologyResponseBodyV1:e.lookup("TopologyResponseBodyV1")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["getPeers",e.void()],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["surveyRequest","signedSurveyRequestMessage"],["surveyResponse","signedSurveyResponseMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedSurveyRequestMessage:e.lookup("SignedSurveyRequestMessage"),signedSurveyResponseMessage:e.lookup("SignedSurveyResponseMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque()}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["readBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanTransactionData",[["ext",e.lookup("ExtensionPoint")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1}),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("Hash")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"],["scvContractInstance","instance"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),nonceKey:e.lookup("ScNonceKey"),instance:e.lookup("ScContractInstance")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("Uint64")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxReadLedgerEntries",e.lookup("Uint32")],["ledgerMaxReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxReadLedgerEntries",e.lookup("Uint32")],["txMaxReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeRead1Kb",e.lookup("Int64")],["bucketListTargetSizeBytes",e.lookup("Int64")],["writeFee1KbBucketListLow",e.lookup("Int64")],["writeFee1KbBucketListHigh",e.lookup("Int64")],["bucketListWriteFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,computeEcdsaSecp256k1Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["bucketListSizeWindowSampleSize",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint64")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingBucketlistSizeWindow:12,configSettingEvictionIterator:13}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingBucketlistSizeWindow","bucketListSizeWindow"],["configSettingEvictionIterator","evictionIterator"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),bucketListSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator")}})}));t.default=i},33092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolFeeV18=void 0,t.getLiquidityPoolId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,n=t.assetB,u=t.fee;if(!r||!(r instanceof i.Asset))throw new Error("assetA is invalid");if(!n||!(n instanceof i.Asset))throw new Error("assetB is invalid");if(!u||u!==s)throw new Error("fee is invalid");if(-1!==i.Asset.compare(r,n))throw new Error("Assets are not in lexicographic order");var c=o.default.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),l=new o.default.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:n.toXDRObject(),fee:u}).toXDR(),f=Buffer.concat([c,l]);return(0,a.hash)(f)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934),a=r(97470);var s=t.LiquidityPoolFeeV18=30},97470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){var t=new n.sha256;return t.update(e,"utf8"),t.digest()};var n=r(20307)},12034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={xdr:!0,hash:!0,sign:!0,verify:!0,FastSigning:!0,getLiquidityPoolId:!0,LiquidityPoolFeeV18:!0,Keypair:!0,UnsignedHyper:!0,Hyper:!0,TransactionBase:!0,Transaction:!0,FeeBumpTransaction:!0,TransactionBuilder:!0,TimeoutInfinite:!0,BASE_FEE:!0,Asset:!0,LiquidityPoolAsset:!0,LiquidityPoolId:!0,Operation:!0,AuthRequiredFlag:!0,AuthRevocableFlag:!0,AuthImmutableFlag:!0,AuthClawbackEnabledFlag:!0,Account:!0,MuxedAccount:!0,Claimant:!0,Networks:!0,StrKey:!0,SignerKey:!0,Soroban:!0,decodeAddressToMuxedAccount:!0,encodeMuxedAccountToAddress:!0,extractBaseAddress:!0,encodeMuxedAccount:!0,Contract:!0,Address:!0};Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return w.Account}}),Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return O.Address}}),Object.defineProperty(t,"Asset",{enumerable:!0,get:function(){return y.Asset}}),Object.defineProperty(t,"AuthClawbackEnabledFlag",{enumerable:!0,get:function(){return v.AuthClawbackEnabledFlag}}),Object.defineProperty(t,"AuthImmutableFlag",{enumerable:!0,get:function(){return v.AuthImmutableFlag}}),Object.defineProperty(t,"AuthRequiredFlag",{enumerable:!0,get:function(){return v.AuthRequiredFlag}}),Object.defineProperty(t,"AuthRevocableFlag",{enumerable:!0,get:function(){return v.AuthRevocableFlag}}),Object.defineProperty(t,"BASE_FEE",{enumerable:!0,get:function(){return p.BASE_FEE}}),Object.defineProperty(t,"Claimant",{enumerable:!0,get:function(){return S.Claimant}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return P.Contract}}),Object.defineProperty(t,"FastSigning",{enumerable:!0,get:function(){return s.FastSigning}}),Object.defineProperty(t,"FeeBumpTransaction",{enumerable:!0,get:function(){return h.FeeBumpTransaction}}),Object.defineProperty(t,"Hyper",{enumerable:!0,get:function(){return l.Hyper}}),Object.defineProperty(t,"Keypair",{enumerable:!0,get:function(){return c.Keypair}}),Object.defineProperty(t,"LiquidityPoolAsset",{enumerable:!0,get:function(){return m.LiquidityPoolAsset}}),Object.defineProperty(t,"LiquidityPoolFeeV18",{enumerable:!0,get:function(){return u.LiquidityPoolFeeV18}}),Object.defineProperty(t,"LiquidityPoolId",{enumerable:!0,get:function(){return g.LiquidityPoolId}}),Object.defineProperty(t,"MuxedAccount",{enumerable:!0,get:function(){return A.MuxedAccount}}),Object.defineProperty(t,"Networks",{enumerable:!0,get:function(){return k.Networks}}),Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return v.Operation}}),Object.defineProperty(t,"SignerKey",{enumerable:!0,get:function(){return E.SignerKey}}),Object.defineProperty(t,"Soroban",{enumerable:!0,get:function(){return x.Soroban}}),Object.defineProperty(t,"StrKey",{enumerable:!0,get:function(){return _.StrKey}}),Object.defineProperty(t,"TimeoutInfinite",{enumerable:!0,get:function(){return p.TimeoutInfinite}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}}),Object.defineProperty(t,"TransactionBase",{enumerable:!0,get:function(){return f.TransactionBase}}),Object.defineProperty(t,"TransactionBuilder",{enumerable:!0,get:function(){return p.TransactionBuilder}}),Object.defineProperty(t,"UnsignedHyper",{enumerable:!0,get:function(){return l.UnsignedHyper}}),Object.defineProperty(t,"decodeAddressToMuxedAccount",{enumerable:!0,get:function(){return T.decodeAddressToMuxedAccount}}),t.default=void 0,Object.defineProperty(t,"encodeMuxedAccount",{enumerable:!0,get:function(){return T.encodeMuxedAccount}}),Object.defineProperty(t,"encodeMuxedAccountToAddress",{enumerable:!0,get:function(){return T.encodeMuxedAccountToAddress}}),Object.defineProperty(t,"extractBaseAddress",{enumerable:!0,get:function(){return T.extractBaseAddress}}),Object.defineProperty(t,"getLiquidityPoolId",{enumerable:!0,get:function(){return u.getLiquidityPoolId}}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return a.hash}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return s.sign}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return s.verify}}),Object.defineProperty(t,"xdr",{enumerable:!0,get:function(){return i.default}});var o=L(r(1991)),i=L(r(45956)),a=r(97470),s=r(20749),u=r(33092),c=r(68141),l=r(75493),f=r(23920),d=r(20502),h=r(78618),p=r(62642),y=r(5934),m=r(56188),g=r(88347),v=r(11647),b=r(1102);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var w=r(51273),A=r(26961),S=r(79657),k=r(43504),_=r(88602),E=r(28295),x=r(74016),T=r(29522),P=r(60526),O=r(70714),R=r(423);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var I=r(86655);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var C=r(55625);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var M=r(56352);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))}));var B=r(4046);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var N=r(62034);function L(e){return e&&e.__esModule?e:{default:e}}Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===N[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}}))})),o.default.DEBUG=!0;t.default=e.exports},62034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInvocationTree=function e(t){var r=t.function(),a={},s=r.value();switch(r.switch().value){case 0:a.type="execute",a.args={source:o.Address.fromScAddress(s.contractAddress()).toString(),function:s.functionName(),args:s.args().map((function(e){return(0,i.scValToNative)(e)}))};break;case 1:a.type="create",a.args={};var u=[s.executable(),s.contractIdPreimage()],c=u[0],l=u[1];if(!!c.switch().value!==!!l.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(s)," (should be wasm+address or token+asset)"));switch(c.switch().value){case 0:var f=l.fromAddress();a.args.type="wasm",a.args.wasm={salt:f.salt().toString("hex"),hash:c.wasmHash().toString("hex"),address:o.Address.fromScAddress(f.address()).toString()};break;case 1:a.args.type="sac",a.args.asset=n.Asset.fromOperation(l.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(c)))}break;default:throw new Error("unknown invocation type (".concat(r.switch(),"): ").concat(JSON.stringify(r)))}return a.invocations=t.subInvocations().map((function(t){return e(t)})),a},t.walkInvocationTree=function(e,t){a(e,1,t)};var n=r(5934),o=r(70714),i=r(86655);function a(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach((function(n){return a(n,t+1,r,e)}))}},68141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Keypair=void 0;var n=u(r(80504)),o=r(20749),i=r(88602),a=r(97470),s=u(r(45956));function u(e){return e&&e.__esModule?e:{default:e}}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 l(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolAsset=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934),a=r(33092);function s(e){return s="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},s(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolId=void 0;var n,o=(n=r(45956))&&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";Object.defineProperty(t,"__esModule",{value:!0}),t.MemoText=t.MemoReturn=t.MemoNone=t.MemoID=t.MemoHash=t.Memo=void 0;var n=r(75493),o=a(r(1991)),i=a(r(45956));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case l:break;case f:e._validateIdValue(r);break;case d:e._validateTextValue(r);break;case h:case p:e._validateHashValue(r),"string"===typeof r&&(this._value=Buffer.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}var t,r,a;return t=e,a=[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!==typeof e)throw r;try{t=new o.default(e)}catch(n){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!i.default.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null===e||"undefined"===typeof e)throw r;if("string"===typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=Buffer.from(e,"hex")}else{if(!Buffer.isBuffer(e))throw r;t=Buffer.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(l)}},{key:"text",value:function(t){return new e(d,t)}},{key:"id",value:function(t){return new e(f,t)}},{key:"hash",value:function(t){return new e(h,t)}},{key:"return",value:function(t){return new e(p,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if("undefined"===typeof t.value())return e.none();throw new Error("Unknown type")}}],(r=[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case l:return null;case f:case d:return this._value;case h:case p:return Buffer.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case l:return i.default.Memo.memoNone();case f:return i.default.Memo.memoId(n.UnsignedHyper.fromString(this._value));case d:return i.default.Memo.memoText(this._value);case h:return i.default.Memo.memoHash(this._value);case p:return i.default.Memo.memoReturn(this._value);default:return null}}}])&&u(t.prototype,r),a&&u(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}()},26961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MuxedAccount=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(51273),a=r(88602),s=r(29522);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Networks=void 0;t.Networks={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"}},423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Int128",{enumerable:!0,get:function(){return a.Int128}}),Object.defineProperty(t,"Int256",{enumerable:!0,get:function(){return s.Int256}}),Object.defineProperty(t,"ScInt",{enumerable:!0,get:function(){return u.ScInt}}),Object.defineProperty(t,"Uint128",{enumerable:!0,get:function(){return o.Uint128}}),Object.defineProperty(t,"Uint256",{enumerable:!0,get:function(){return i.Uint256}}),Object.defineProperty(t,"XdrLargeInt",{enumerable:!0,get:function(){return n.XdrLargeInt}}),t.scValToBigInt=function(e){var t=n.XdrLargeInt.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new n.XdrLargeInt(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new n.XdrLargeInt(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new n.XdrLargeInt(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}};var n=r(49643),o=r(78590),i=r(44050),a=r(77441),s=r(80037),u=r(22775)},77441:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int128=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int256=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ScInt=void 0;var o=r(49643);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint128=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint256=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XdrLargeInt=void 0;var n,o=r(75493),i=r(78590),a=r(44050),s=r(77441),u=r(80037),c=(n=r(45956))&&n.__esModule?n:{default:n};function l(e){return l="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},l(e)}function f(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER||e>64n),r=BigInt.asUintN(64,e);return c.default.ScVal.scvI128(new c.default.Int128Parts({hi:new c.default.Int64(t),lo:new c.default.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return c.default.ScVal.scvU128(new c.default.UInt128Parts({hi:new c.default.Uint64(BigInt.asUintN(64,e>>64n)),lo:new c.default.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvI256(new c.default.Int256Parts({hiHi:new c.default.Int64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvU256(new c.default.UInt256Parts({hiHi:new c.default.Uint64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}])&&f(t.prototype,r),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},11647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.AuthRevocableFlag=t.AuthRequiredFlag=t.AuthImmutableFlag=t.AuthClawbackEnabledFlag=void 0;var n=r(75493),o=m(r(1991)),i=r(70443),a=r(32013),s=r(5934),u=r(56188),c=r(79657),l=r(88602),f=r(88347),d=m(r(45956)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=g(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(17593)),p=r(29522);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e){return g="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},g(e)}function v(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if("string"!==typeof e)return!1;try{t=new o.default(e)}catch(n){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(w).gt(new o.default("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!==typeof t)switch("string"===typeof t&&(t=parseFloat(t)),!0){case"number"!==typeof t||!Number.isFinite(t)||t%1!==0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new o.default(e).times(w);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new o.default(e).div(w).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new o.default(e.n()).div(new o.default(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new d.default.Price(e);else{var r=(0,a.best_r)(e);t=new d.default.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}],(r=null)&&v(t.prototype,r),h&&v(t,h),Object.defineProperty(t,"prototype",{writable:!1}),e}());function S(e){return l.StrKey.encodeEd25519PublicKey(e.ed25519())}A.accountMerge=h.accountMerge,A.allowTrust=h.allowTrust,A.bumpSequence=h.bumpSequence,A.changeTrust=h.changeTrust,A.createAccount=h.createAccount,A.createClaimableBalance=h.createClaimableBalance,A.claimClaimableBalance=h.claimClaimableBalance,A.clawbackClaimableBalance=h.clawbackClaimableBalance,A.createPassiveSellOffer=h.createPassiveSellOffer,A.inflation=h.inflation,A.manageData=h.manageData,A.manageSellOffer=h.manageSellOffer,A.manageBuyOffer=h.manageBuyOffer,A.pathPaymentStrictReceive=h.pathPaymentStrictReceive,A.pathPaymentStrictSend=h.pathPaymentStrictSend,A.payment=h.payment,A.setOptions=h.setOptions,A.beginSponsoringFutureReserves=h.beginSponsoringFutureReserves,A.endSponsoringFutureReserves=h.endSponsoringFutureReserves,A.revokeAccountSponsorship=h.revokeAccountSponsorship,A.revokeTrustlineSponsorship=h.revokeTrustlineSponsorship,A.revokeOfferSponsorship=h.revokeOfferSponsorship,A.revokeDataSponsorship=h.revokeDataSponsorship,A.revokeClaimableBalanceSponsorship=h.revokeClaimableBalanceSponsorship,A.revokeLiquidityPoolSponsorship=h.revokeLiquidityPoolSponsorship,A.revokeSignerSponsorship=h.revokeSignerSponsorship,A.clawback=h.clawback,A.setTrustLineFlags=h.setTrustLineFlags,A.liquidityPoolDeposit=h.liquidityPoolDeposit,A.liquidityPoolWithdraw=h.liquidityPoolWithdraw,A.invokeHostFunction=h.invokeHostFunction,A.extendFootprintTtl=h.extendFootprintTtl,A.restoreFootprint=h.restoreFootprint,A.createStellarAssetContract=h.createStellarAssetContract,A.invokeContractFunction=h.invokeContractFunction,A.createCustomContract=h.createCustomContract,A.uploadContractWasm=h.uploadContractWasm},54057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountMerge=function(e){var t={};try{t.body=o.default.OperationBody.accountMerge((0,i.decodeAddressToMuxedAccount)(e.destination))}catch(r){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},17197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allowTrust=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"===typeof e.authorize?e.authorize?t.authorize=o.default.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var s=new o.default.AllowTrustOp(t),u={};return u.body=o.default.OperationBody.allowTrust(s),this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602)},85959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new o.default.BeginSponsoringFutureReservesOp({sponsoredId:a.Keypair.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=o.default.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(68141)},83609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bumpSequence=function(e){var t={};if("string"!==typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new o.default(e.bumpTo)}catch(s){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.default.BumpSequenceOp(t),a={};return a.body=i.default.OperationBody.bumpSequence(r),this.setSourceAccount(a,e),new i.default.Operation(a)};var n=r(75493),o=a(r(1991)),i=a(r(45956));function a(e){return e&&e.__esModule?e:{default:e}}},57148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeTrust=function(e){var t={};if(e.asset instanceof a.Asset)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof s.LiquidityPoolAsset))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new o.default(c).toString());e.source&&(t.source=e.source.masterKeypair);var r=new i.default.ChangeTrustOp(t),u={};return u.body=i.default.OperationBody.changeTrust(r),this.setSourceAccount(u,e),new i.default.Operation(u)};var n=r(75493),o=u(r(1991)),i=u(r(45956)),a=r(5934),s=r(56188);function u(e){return e&&e.__esModule?e:{default:e}}var c="9223372036854775807"},89765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(e.balanceId);var t={};t.balanceId=o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new o.default.ClaimClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.validateClaimableBalanceId=i;var n,o=(n=r(45956))&&n.__esModule?n:{default:n};function i(e){if("string"!==typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}},64921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=(0,i.decodeAddressToMuxedAccount)(e.from)}catch(n){throw new Error("from address is invalid")}var r={body:o.default.OperationBody.clawback(new o.default.ClawbackOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},2597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.validateClaimableBalanceId)(e.balanceId);var t={balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:o.default.OperationBody.clawbackClaimableBalance(new o.default.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(89765)},63697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAccount=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=i.Keypair.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new o.default.CreateAccountOp(t),n={};return n.body=o.default.OperationBody.createAccount(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602)},83837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClaimableBalance=function(e){if(!(e.asset instanceof i.Asset))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map((function(e){return e.toXDRObject()}));var r=new o.default.CreateClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934)},71667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new o.default.CreatePassiveSellOfferOp(t),n={};return n.body=o.default.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},58687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},69370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo isn't a ledger quantity (uint32)");var r=new o.default.ExtendFootprintTtlOp({ext:new o.default.ExtensionPoint(0),extendTo:e.extendTo}),n={body:o.default.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},17593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"accountMerge",{enumerable:!0,get:function(){return i.accountMerge}}),Object.defineProperty(t,"allowTrust",{enumerable:!0,get:function(){return a.allowTrust}}),Object.defineProperty(t,"beginSponsoringFutureReserves",{enumerable:!0,get:function(){return w.beginSponsoringFutureReserves}}),Object.defineProperty(t,"bumpSequence",{enumerable:!0,get:function(){return s.bumpSequence}}),Object.defineProperty(t,"changeTrust",{enumerable:!0,get:function(){return u.changeTrust}}),Object.defineProperty(t,"claimClaimableBalance",{enumerable:!0,get:function(){return f.claimClaimableBalance}}),Object.defineProperty(t,"clawback",{enumerable:!0,get:function(){return k.clawback}}),Object.defineProperty(t,"clawbackClaimableBalance",{enumerable:!0,get:function(){return d.clawbackClaimableBalance}}),Object.defineProperty(t,"createAccount",{enumerable:!0,get:function(){return c.createAccount}}),Object.defineProperty(t,"createClaimableBalance",{enumerable:!0,get:function(){return l.createClaimableBalance}}),Object.defineProperty(t,"createCustomContract",{enumerable:!0,get:function(){return T.createCustomContract}}),Object.defineProperty(t,"createPassiveSellOffer",{enumerable:!0,get:function(){return o.createPassiveSellOffer}}),Object.defineProperty(t,"createStellarAssetContract",{enumerable:!0,get:function(){return T.createStellarAssetContract}}),Object.defineProperty(t,"endSponsoringFutureReserves",{enumerable:!0,get:function(){return A.endSponsoringFutureReserves}}),Object.defineProperty(t,"extendFootprintTtl",{enumerable:!0,get:function(){return P.extendFootprintTtl}}),Object.defineProperty(t,"inflation",{enumerable:!0,get:function(){return h.inflation}}),Object.defineProperty(t,"invokeContractFunction",{enumerable:!0,get:function(){return T.invokeContractFunction}}),Object.defineProperty(t,"invokeHostFunction",{enumerable:!0,get:function(){return T.invokeHostFunction}}),Object.defineProperty(t,"liquidityPoolDeposit",{enumerable:!0,get:function(){return E.liquidityPoolDeposit}}),Object.defineProperty(t,"liquidityPoolWithdraw",{enumerable:!0,get:function(){return x.liquidityPoolWithdraw}}),Object.defineProperty(t,"manageBuyOffer",{enumerable:!0,get:function(){return y.manageBuyOffer}}),Object.defineProperty(t,"manageData",{enumerable:!0,get:function(){return p.manageData}}),Object.defineProperty(t,"manageSellOffer",{enumerable:!0,get:function(){return n.manageSellOffer}}),Object.defineProperty(t,"pathPaymentStrictReceive",{enumerable:!0,get:function(){return m.pathPaymentStrictReceive}}),Object.defineProperty(t,"pathPaymentStrictSend",{enumerable:!0,get:function(){return g.pathPaymentStrictSend}}),Object.defineProperty(t,"payment",{enumerable:!0,get:function(){return v.payment}}),Object.defineProperty(t,"restoreFootprint",{enumerable:!0,get:function(){return O.restoreFootprint}}),Object.defineProperty(t,"revokeAccountSponsorship",{enumerable:!0,get:function(){return S.revokeAccountSponsorship}}),Object.defineProperty(t,"revokeClaimableBalanceSponsorship",{enumerable:!0,get:function(){return S.revokeClaimableBalanceSponsorship}}),Object.defineProperty(t,"revokeDataSponsorship",{enumerable:!0,get:function(){return S.revokeDataSponsorship}}),Object.defineProperty(t,"revokeLiquidityPoolSponsorship",{enumerable:!0,get:function(){return S.revokeLiquidityPoolSponsorship}}),Object.defineProperty(t,"revokeOfferSponsorship",{enumerable:!0,get:function(){return S.revokeOfferSponsorship}}),Object.defineProperty(t,"revokeSignerSponsorship",{enumerable:!0,get:function(){return S.revokeSignerSponsorship}}),Object.defineProperty(t,"revokeTrustlineSponsorship",{enumerable:!0,get:function(){return S.revokeTrustlineSponsorship}}),Object.defineProperty(t,"setOptions",{enumerable:!0,get:function(){return b.setOptions}}),Object.defineProperty(t,"setTrustLineFlags",{enumerable:!0,get:function(){return _.setTrustLineFlags}}),Object.defineProperty(t,"uploadContractWasm",{enumerable:!0,get:function(){return T.uploadContractWasm}});var n=r(93752),o=r(71667),i=r(54057),a=r(17197),s=r(83609),u=r(57148),c=r(63697),l=r(83837),f=r(89765),d=r(2597),h=r(24787),p=r(23637),y=r(53264),m=r(10921),g=r(34592),v=r(92423),b=r(16048),w=r(85959),A=r(58687),S=r(11912),k=r(64921),_=r(48094),E=r(1519),x=r(59619),T=r(45729),P=r(69370),O=r(74819)},24787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.inflation(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},45729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomContract=function(e){var t=Buffer.from(e.salt||i.Keypair.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==t.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeCreateContract(new o.default.CreateContractArgs({executable:o.default.ContractExecutable.contractExecutableWasm(Buffer.from(e.wasmHash)),contractIdPreimage:o.default.ContractIdPreimage.contractIdPreimageFromAddress(new o.default.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:t}))}))})},t.createStellarAssetContract=function(e){var t=e.asset;if("string"===typeof t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.split(":"),2),n=r[0],i=r[1];t=new s.Asset(n,i)}if(!(t instanceof s.Asset))throw new TypeError("expected Asset in 'opts.asset', got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeCreateContract(new o.default.CreateContractArgs({executable:o.default.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:o.default.ContractIdPreimage.contractIdPreimageFromAsset(t.toXDRObject())}))})},t.invokeContractFunction=function(e){var t=new a.Address(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeInvokeContract(new o.default.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},t.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));var t=new o.default.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:o.default.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new o.default.Operation(r)},t.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeUploadContractWasm(Buffer.from(e.wasm))})};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(70714),s=r(5934);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,i=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=o.default.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===i)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(i),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new o.default.LiquidityPoolDepositOp(s),c={body:o.default.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new o.default.Operation(c)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},59619:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=o.default.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new o.default.LiquidityPoolWithdrawOp(t),n={body:o.default.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},53264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0";t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageBuyOfferOp(t),n={};return n.body=i.default.OperationBody.manageBuyOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(75493),i=(n=r(45956))&&n.__esModule?n:{default:n}},23637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageData=function(e){var t={};if(!("string"===typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!==typeof e.value&&!Buffer.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");"string"===typeof e.value?t.dataValue=Buffer.from(e.value):t.dataValue=e.value;if(null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new o.default.ManageDataOp(t),n={};return n.body=o.default.OperationBody.manageData(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},93752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0";t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageSellOfferOp(t),n={};return n.body=i.default.OperationBody.manageSellOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(75493),i=(n=r(45956))&&n.__esModule?n:{default:n}},10921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(s){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictReceiveOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},34592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(s){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictSendOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},92423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(a){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new o.default.PaymentOp(t),n={};return n.body=o.default.OperationBody.payment(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},74819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new o.default.RestoreFootprintOp({ext:new o.default.ExtensionPoint(0)}),r={body:o.default.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!==e&&void 0!==e?e:{}),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},11912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=o.default.LedgerKey.account(new o.default.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(e.account).xdrAccountId()})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!==typeof e.balanceId)throw new Error("balanceId is invalid");var t=o.default.LedgerKey.claimableBalance(new o.default.LedgerKeyClaimableBalance({balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!==typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=o.default.LedgerKey.data(new o.default.LedgerKeyData({accountId:a.Keypair.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!==typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=o.default.LedgerKey.liquidityPool(new o.default.LedgerKeyLiquidityPool({liquidityPoolId:o.default.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:o.default.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!==typeof e.offerId)throw new Error("offerId is invalid");var t=o.default.LedgerKey.offer(new o.default.LedgerKeyOffer({sellerId:a.Keypair.fromPublicKey(e.seller).xdrAccountId(),offerId:o.default.Int64.fromString(e.offerId)})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!i.StrKey.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=i.StrKey.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new o.default.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var n;if(n="string"===typeof t.signer.preAuthTx?Buffer.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!Buffer.isBuffer(n)||32!==n.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new o.default.SignerKey.signerKeyTypePreAuthTx(n)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var s;if(s="string"===typeof t.signer.sha256Hash?Buffer.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!Buffer.isBuffer(s)||32!==s.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new o.default.SignerKey.signerKeyTypeHashX(s)}var u=new o.default.RevokeSponsorshipOpSigner({accountId:a.Keypair.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),c=o.default.RevokeSponsorshipOp.revokeSponsorshipSigner(u),l={};return l.body=o.default.OperationBody.revokeSponsorship(c),this.setSourceAccount(l,t),new o.default.Operation(l)},t.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof s.Asset)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof u.LiquidityPoolId))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=o.default.LedgerKey.trustline(new o.default.LedgerKeyTrustLine({accountId:a.Keypair.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),c={};return c.body=o.default.OperationBody.revokeSponsorship(n),this.setSourceAccount(c,t),new o.default.Operation(c)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(68141),s=r(5934),u=r(88347)},16048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setOptions=function(e){var t={};if(e.inflationDest){if(!a.StrKey.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=i.Keypair.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,s),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,s),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,s),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,s),void 0!==e.homeDomain&&"string"!==typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,n=this._checkUnsignedIntValue("signer.weight",e.signer.weight,s),u=0;if(e.signer.ed25519PublicKey){if(!a.StrKey.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var c=a.StrKey.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new o.default.SignerKey.signerKeyTypeEd25519(c),u+=1}if(e.signer.preAuthTx){if("string"===typeof e.signer.preAuthTx&&(e.signer.preAuthTx=Buffer.from(e.signer.preAuthTx,"hex")),!Buffer.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new o.default.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),u+=1}if(e.signer.sha256Hash){if("string"===typeof e.signer.sha256Hash&&(e.signer.sha256Hash=Buffer.from(e.signer.sha256Hash,"hex")),!Buffer.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new o.default.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),u+=1}if(e.signer.ed25519SignedPayload){if(!a.StrKey.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var l=a.StrKey.decodeSignedPayload(e.signer.ed25519SignedPayload),f=o.default.SignerKeyEd25519SignedPayload.fromXDR(l);r=o.default.SignerKey.signerKeyTypeEd25519SignedPayload(f),u+=1}if(1!==u)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new o.default.Signer({key:r,weight:n})}var d=new o.default.SetOptionsOp(t),h={};return h.body=o.default.OperationBody.setOptions(d),this.setSourceAccount(h,e),new o.default.Operation(h)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602);function s(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}},48094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==a(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:o.default.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:o.default.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:o.default.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,s=0;Object.keys(e.flags).forEach((function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var o=e.flags[t],i=r[t].value;!0===o?s|=i:!1===o&&(n|=i)})),t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=s;var u={body:o.default.OperationBody.setTrustLineFlags(new o.default.SetTrustLineFlagsOp(t))};return this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141);function a(e){return a="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},a(e)}},86655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nativeToScVal=function e(t){var r,n,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(l(t)){case"object":if(null===t)return o.default.ScVal.scvVoid();if(t instanceof o.default.ScVal)return t;if(t instanceof i.Address)return t.toScVal();if(t instanceof a.Contract)return t.address().toScVal();if(t instanceof Uint8Array||Buffer.isBuffer(t)){var f,d=Uint8Array.from(t);switch(null!==(f=null===c||void 0===c?void 0:c.type)&&void 0!==f?f:"bytes"){case"bytes":return o.default.ScVal.scvBytes(d);case"symbol":return o.default.ScVal.scvSymbol(d);case"string":return o.default.ScVal.scvString(d);default:throw new TypeError("invalid type (".concat(c.type,") specified for bytes-like value"))}}if(Array.isArray(t)){if(t.length>0&&t.some((function(e){return l(e)!==l(t[0])})))throw new TypeError("array values (".concat(t,") must have the same type (types: ").concat(t.map((function(e){return l(e)})).join(","),")"));return o.default.ScVal.scvVec(t.map((function(t){return e(t,c)})))}var h;if("Object"!==(null!==(r=null===(n=t.constructor)||void 0===n?void 0:n.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(h=t.constructor)||void 0===h?void 0:h.name," value as ScVal (").concat(JSON.stringify(t),")"));return o.default.ScVal.scvMap(Object.entries(t).map((function(t){var r,n,i=u(t,2),a=i[0],s=i[1],l=u(null!==(r=(null!==(n=null===c||void 0===c?void 0:c.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),f=l[0],d=l[1],h=f?{type:f}:{},p=d?{type:d}:{};return new o.default.ScMapEntry({key:e(a,h),val:e(s,p)})})));case"number":case"bigint":switch(null===c||void 0===c?void 0:c.type){case"u32":return o.default.ScVal.scvU32(t);case"i32":return o.default.ScVal.scvI32(t)}return new s.ScInt(t,{type:null===c||void 0===c?void 0:c.type}).toScVal();case"string":var p,y=null!==(p=null===c||void 0===c?void 0:c.type)&&void 0!==p?p:"string";switch(y){case"string":return o.default.ScVal.scvString(t);case"symbol":return o.default.ScVal.scvSymbol(t);case"address":return new i.Address(t).toScVal();default:if(s.XdrLargeInt.isType(y))return new s.XdrLargeInt(y,t).toScVal();throw new TypeError("invalid type (".concat(c.type,") specified for string value"))}case"boolean":return o.default.ScVal.scvBool(t);case"undefined":return o.default.ScVal.scvVoid();case"function":return e(t());default:throw new TypeError("failed to convert typeof ".concat(l(t)," (").concat(t,")"))}},t.scValToNative=function e(t){var r,n;switch(t.switch().value){case o.default.ScValType.scvVoid().value:return null;case o.default.ScValType.scvU64().value:case o.default.ScValType.scvI64().value:return t.value().toBigInt();case o.default.ScValType.scvU128().value:case o.default.ScValType.scvI128().value:case o.default.ScValType.scvU256().value:case o.default.ScValType.scvI256().value:return(0,s.scValToBigInt)(t);case o.default.ScValType.scvVec().value:return(null!==(r=t.vec())&&void 0!==r?r:[]).map(e);case o.default.ScValType.scvAddress().value:return i.Address.fromScVal(t).toString();case o.default.ScValType.scvMap().value:return Object.fromEntries((null!==(n=t.map())&&void 0!==n?n:[]).map((function(t){return[e(t.key()),e(t.val())]})));case o.default.ScValType.scvBool().value:case o.default.ScValType.scvU32().value:case o.default.ScValType.scvI32().value:case o.default.ScValType.scvBytes().value:return t.value();case o.default.ScValType.scvSymbol().value:case o.default.ScValType.scvString().value:var a=t.value();if(Buffer.isBuffer(a)||ArrayBuffer.isView(a))try{return(new TextDecoder).decode(a)}catch(u){return new Uint8Array(a.buffer)}return a;case o.default.ScValType.scvTimepoint().value:case o.default.ScValType.scvDuration().value:return new o.default.Uint64(t.value()).toBigInt();case o.default.ScValType.scvStatus().value:switch(t.value().switch()){case o.default.ScStatusType.sstOk().value:case o.default.ScStatusType.sstUnknownError().value:case o.default.ScStatusType.sstHostValueError().value:case o.default.ScStatusType.sstHostObjectError().value:case o.default.ScStatusType.sstHostFunctionError().value:case o.default.ScStatusType.sstHostStorageError().value:case o.default.ScStatusType.sstHostContextError().value:case o.default.ScStatusType.sstVmError().value:case o.default.ScStatusType.sstContractError().value:case o.default.ScStatusType.sstHostAuthError().value:}default:return t.value()}};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(70714),a=r(60526),s=r(423);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignerKey=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602);function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FastSigning=void 0,t.generate=function(e){return n.generate(e)},t.sign=function(e,t){return n.sign(e,t)},t.verify=function(e,t,r){return n.verify(e,t,r)};var n={};t.FastSigning="undefined"===typeof window?function(){var e;try{e=r(98310)}catch(t){return o()}return Object.keys(e).length?(n.generate=function(t){var r=Buffer.alloc(e.crypto_sign_PUBLICKEYBYTES),n=Buffer.alloc(e.crypto_sign_SECRETKEYBYTES);return e.crypto_sign_seed_keypair(r,n,t),r},n.sign=function(t,r){t=Buffer.from(t);var n=Buffer.alloc(e.crypto_sign_BYTES);return e.crypto_sign_detached(n,t,r),n},n.verify=function(t,r,n){t=Buffer.from(t);try{return e.crypto_sign_verify_detached(r,t,n)}catch(o){return!1}},!0):o()}():o();function o(){var e=r(80504);return n.generate=function(t){var r=new Uint8Array(t),n=e.sign.keyPair.fromSeed(r);return Buffer.from(n.publicKey)},n.sign=function(t,r){t=Buffer.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data);var n=e.sign.detached(t,r);return Buffer.from(n)},n.verify=function(t,r,n){return t=Buffer.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data),n=new Uint8Array(n.toJSON().data),e.sign.detached.verify(t,r,n)},!1}},74016:(e,t)=>{"use strict";function r(e){return r="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},r(e)}function n(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,o=n(e.split(".").slice()),i=o[0],a=o[1];if(o.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(i+(null!==(r=null===a||void 0===a?void 0:a.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}],(r=null)&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},56352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SorobanDataBuilder=void 0;var n,o=(n=r(45956))&&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";Object.defineProperty(t,"__esModule",{value:!0}),t.StrKey=void 0,t.decodeCheck=d,t.encodeCheck=h;var n,o=(n=r(47149))&&n.__esModule?n:{default:n},i=r(36960);function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r165)return!1;break;default:return!1}var r="";try{r=d(e,t)}catch(n){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function d(e,t){if("string"!==typeof t)throw new TypeError("encoded argument must be of type String");var r=o.default.decode(t),n=r[0],a=r.slice(0,-2),s=a.slice(1),u=r.slice(-2);if(t!==o.default.encode(r))throw new Error("invalid encoded string");var l=c[e];if(void 0===l)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));if(n!==l)throw new Error("invalid version byte. expected ".concat(l,", got ").concat(n));var f=p(a);if(!(0,i.verifyChecksum)(f,u))throw new Error("invalid checksum");return Buffer.from(s)}function h(e,t){if(null===t||void 0===t)throw new Error("cannot encode null data");var r=c[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));t=Buffer.from(t);var n=Buffer.from([r]),i=Buffer.concat([n,t]),a=p(i),s=Buffer.concat([i,a]);return o.default.encode(s)}function p(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n>8^e[n]],r&=65535}var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}},20502:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var o,i=(o=r(45956))&&o.__esModule?o:{default:o},a=r(97470),s=r(88602),u=r(11647),c=r(1102),l=r(23920),f=r(29522);function d(e,t){for(var r=0;r=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=u.Operation.createClaimableBalance(t)}catch(c){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(c))}var r=s.StrKey.decodeEd25519PublicKey((0,f.extractBaseAddress)(this.source)),n=i.default.HashIdPreimage.envelopeTypeOpId(new i.default.HashIdPreimageOperationId({sourceAccount:i.default.AccountId.publicKeyTypeEd25519(r),seqNum:i.default.SequenceNumber.fromString(this.sequence),opNum:e})),o=(0,a.hash)(n.toXDR("raw"));return i.default.ClaimableBalanceId.claimableBalanceIdTypeV0(o).toXDR("hex")}}])&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(l.TransactionBase)},23920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBase=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(97470),a=r(68141);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!n||"string"!==typeof n)throw new Error("Invalid signature");if(!r||"string"!==typeof r)throw new Error("Invalid publicKey");var i=Buffer.from(n,"base64");try{t=(e=a.Keypair.fromPublicKey(r)).signatureHint()}catch(s){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),i))throw new Error("Invalid signature");this.signatures.push(new o.default.DecoratedSignature({hint:t,signature:i}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"===typeof e&&(e=Buffer.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=(0,i.hash)(e),n=r.slice(r.length-4);this.signatures.push(new o.default.DecoratedSignature({hint:n,signature:t}))}},{key:"hash",value:function(){return(0,i.hash)(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}],r&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},62642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=t.TimeoutInfinite=t.BASE_FEE=void 0,t.isValidDate=E;var n=r(75493),o=y(r(1991)),i=y(r(45956)),a=r(51273),s=r(26961),u=r(29522),c=r(20502),l=r(78618),f=r(56352),d=r(88602),h=r(28295),p=r(1102);function y(e){return e&&e.__esModule?e:{default:e}}function m(e){return m="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},m(e)}function g(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?w({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?w({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?g(r.extraSigners):null,this.memo=r.memo||p.Memo.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new f.SorobanDataBuilder(r.sorobanData).build():null}var t,r,y;return t=e,y=[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof c.Transaction))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(d.StrKey.isValidMed25519PublicKey(t.source))n=s.MuxedAccount.fromAddress(t.source,o);else{if(!d.StrKey.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new a.Account(t.source,o)}var i=new e(n,w({fee:(parseInt(t.fee,10)/t.operations.length||_).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach((function(e){return i.addOperation(e)})),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var a=r.operations.length,s=new o.default(r.fee).div(a),c=new o.default(t);if(c.lt(s))throw new Error("Invalid baseFee, it should be at least ".concat(s," stroops."));var f=new o.default(_);if(c.lt(f))throw new Error("Invalid baseFee, it should be at least ".concat(f," stroops."));var d,h=r.toEnvelope();if(h.switch()===i.default.EnvelopeType.envelopeTypeTxV0()){var p=h.v0().tx(),y=new i.default.Transaction({sourceAccount:new i.default.MuxedAccount.keyTypeEd25519(p.sourceAccountEd25519()),fee:p.fee(),seqNum:p.seqNum(),cond:i.default.Preconditions.precondTime(p.timeBounds()),memo:p.memo(),operations:p.operations(),ext:new i.default.TransactionExt(0)});h=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:y,signatures:h.v0().signatures()}))}d="string"===typeof e?(0,u.decodeAddressToMuxedAccount)(e):e.xdrMuxedAccount();var m=new i.default.FeeBumpTransaction({feeSource:d,fee:i.default.Int64.fromString(c.times(a+1).toString()),innerTx:i.default.FeeBumpTransactionInnerTx.envelopeTypeTx(h.v1()),ext:new i.default.FeeBumpTransactionExt(0)}),g=new i.default.FeeBumpTransactionEnvelope({tx:m,signatures:[]}),v=new i.default.TransactionEnvelope.envelopeTypeTxFeeBump(g);return new l.FeeBumpTransaction(v,n)}},{key:"fromXDR",value:function(e,t){return"string"===typeof e&&(e=i.default.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.default.EnvelopeType.envelopeTypeTxFeeBump()?new l.FeeBumpTransaction(e,t):new c.Transaction(e,t)}}],(r=[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"===typeof e&&(e=new Date(1e3*e)),"number"===typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!==typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=g(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new f.SorobanDataBuilder(e).build(),this}},{key:"build",value:function(){var e=new o.default(this.source.sequenceNumber()).plus(1),t={fee:new o.default(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.default.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||"undefined"===typeof this.timebounds.minTime||"undefined"===typeof this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");E(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),E(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.default.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var a=null;null!==this.ledgerbounds&&(a=new i.default.LedgerBounds(this.ledgerbounds));var s=this.minAccountSequence||"0";s=i.default.SequenceNumber.fromString(s);var l=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),f=this.minAccountSequenceLedgerGap||0,d=null!==this.extraSigners?this.extraSigners.map(h.SignerKey.decodeAddress):[];t.cond=i.default.Preconditions.precondV2(new i.default.PreconditionsV2({timeBounds:r,ledgerBounds:a,minSeqNum:s,minSeqAge:l,minSeqLedgerGap:f,extraSigners:d}))}else t.cond=i.default.Preconditions.precondTime(r);t.sourceAccount=(0,u.decodeAddressToMuxedAccount)(this.source.accountId()),this.sorobanData?t.ext=new i.default.TransactionExt(1,this.sorobanData):t.ext=new i.default.TransactionExt(0,i.default.Void);var p=new i.default.Transaction(t);p.operations(this.operations);var y=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:p})),m=new c.Transaction(y,this.networkPassphrase);return this.source.incrementSequenceNumber(),m}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}])&&S(t.prototype,r),y&&S(t,y),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e){return e instanceof Date&&!isNaN(e)}},36960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyChecksum=function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.best_r=function(e){var t,r,n=new o.default(e),s=[[new o.default(0),new o.default(1)],[new o.default(1),new o.default(0)]],u=2;for(;!n.gt(a);){t=n.integerValue(o.default.ROUND_FLOOR),r=n.minus(t);var c=t.times(s[u-1][0]).plus(s[u-2][0]),l=t.times(s[u-1][1]).plus(s[u-2][1]);if(c.gt(a)||l.gt(a))break;if(s.push([c,l]),r.eq(0))break;n=new o.default(1).div(r),u+=1}var f=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(s[s.length-1],2),d=f[0],h=f[1];if(d.isZero()||h.isZero())throw new Error("Couldn't find approximation");return[d.toNumber(),h.toNumber()]};var n,o=(n=r(1991))&&n.__esModule?n:{default:n};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAddressToMuxedAccount=a,t.encodeMuxedAccount=function(e,t){if(!i.StrKey.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!==typeof t)throw new Error("id should be a string representing a number (uint64)");return o.default.MuxedAccount.keyTypeMuxedEd25519(new o.default.MuxedAccountMed25519({id:o.default.Uint64.fromString(t),ed25519:i.StrKey.decodeEd25519PublicKey(e)}))},t.encodeMuxedAccountToAddress=s,t.extractBaseAddress=function(e){if(i.StrKey.isValidEd25519PublicKey(e))return e;if(!i.StrKey.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=a(e);return i.StrKey.encodeEd25519PublicKey(t.med25519().ed25519())};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602);function a(e){return i.StrKey.isValidMed25519PublicKey(e)?function(e){var t=i.StrKey.decodeMed25519PublicKey(e);return o.default.MuxedAccount.keyTypeMuxedEd25519(new o.default.MuxedAccountMed25519({id:o.default.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):o.default.MuxedAccount.keyTypeEd25519(i.StrKey.decodeEd25519PublicKey(e))}function s(e){return e.switch().value===o.default.CryptoKeyType.keyTypeMuxedEd25519().value?function(e){if(e.switch()===o.default.CryptoKeyType.keyTypeEd25519())return s(e);var t=e.med25519();return i.StrKey.encodeMed25519PublicKey(Buffer.concat([t.ed25519(),t.id().toXDR("raw")]))}(e):i.StrKey.encodeEd25519PublicKey(e.ed25519())}},70443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimEnd=void 0;t.trimEnd=function(e,t){for(var r="number"===typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n}},45956:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(30036))&&n.__esModule?n:{default:n};t.default=o.default},23107:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>_r,BigNumber:()=>l.gH,Contract:()=>Er,ContractFactory:()=>xr,FixedNumber:()=>Tr.I3,Signer:()=>$e,VoidSigner:()=>et,Wallet:()=>no,Wordlist:()=>nn,constants:()=>o,errors:()=>d.ErrorCode,ethers:()=>u,getDefaultProvider:()=>ts,logger:()=>As,providers:()=>i,utils:()=>s,version:()=>ws,wordlists:()=>un});var n={};r.r(n),r.d(n,{decode:()=>T,encode:()=>_});var o={};r.r(o),r.d(o,{AddressZero:()=>ao,EtherSymbol:()=>uo,HashZero:()=>so.j,MaxInt256:()=>ie,MaxUint256:()=>ne,MinInt256:()=>oe,NegativeOne:()=>J,One:()=>ee,Two:()=>te,WeiPerEther:()=>re,Zero:()=>$});var i={};r.r(i),r.d(i,{AlchemyProvider:()=>sa,AlchemyWebSocketProvider:()=>aa,AnkrProvider:()=>fa,BaseProvider:()=>Ni,CloudflareProvider:()=>pa,EtherscanProvider:()=>Sa,FallbackProvider:()=>Ua,Formatter:()=>si,InfuraProvider:()=>Ha,InfuraWebSocketProvider:()=>qa,IpcProvider:()=>Fa,JsonRpcBatchProvider:()=>Va,JsonRpcProvider:()=>Xi,JsonRpcSigner:()=>Ki,NodesmithProvider:()=>Wa,PocketProvider:()=>Za,Provider:()=>Xe,Resolver:()=>Ci,StaticJsonRpcProvider:()=>ra,UrlJsonRpcProvider:()=>na,Web3Provider:()=>$a,WebSocketProvider:()=>$i,getDefaultProvider:()=>ts,getNetwork:()=>go,isCommunityResourcable:()=>ui,isCommunityResource:()=>ci,showThrottleMessage:()=>fi});var a={};r.r(a),r.d(a,{decode:()=>vo,encode:()=>bo});var s={};r.r(s),r.d(s,{AbiCoder:()=>Ne,ConstructorFragment:()=>_e,ErrorFragment:()=>Te,EventFragment:()=>we,FormatTypes:()=>ye,Fragment:()=>be,FunctionFragment:()=>Ee,HDNode:()=>bn,Indexed:()=>ze,Interface:()=>Ve,LogDescription:()=>Ue,Logger:()=>d.Logger,ParamType:()=>ge,RLP:()=>n,SigningKey:()=>Vt,SupportedAlgorithm:()=>Zr,TransactionDescription:()=>Fe,TransactionTypes:()=>Xt,UnicodeNormalizationForm:()=>F.dz,Utf8ErrorFuncs:()=>F.d5,Utf8ErrorReason:()=>F._E,_TypedDataEncoder:()=>Wr,_fetchData:()=>ei,_toEscapedUtf8String:()=>F.Wj,accessListify:()=>nr,arrayify:()=>c.arrayify,base58:()=>Xr,base64:()=>a,checkProperties:()=>f.checkProperties,checkResultErrors:()=>y,commify:()=>ys,computeAddress:()=>$t,computeHmac:()=>en,computePublicKey:()=>Wt,concat:()=>c.concat,deepCopy:()=>f.deepCopy,defaultAbiCoder:()=>Le,defaultPath:()=>vn,defineReadOnly:()=>f.defineReadOnly,dnsEncode:()=>Go,entropyToMnemonic:()=>Sn,fetchJson:()=>ti,formatBytes32String:()=>ds.R,formatEther:()=>vs,formatUnits:()=>ms,getAccountPath:()=>_n,getAddress:()=>B,getContractAddress:()=>j,getCreate2Address:()=>U,getIcapAddress:()=>L,getJsonWalletAddress:()=>Jn,getStatic:()=>f.getStatic,hashMessage:()=>Or,hexConcat:()=>c.hexConcat,hexDataLength:()=>c.hexDataLength,hexDataSlice:()=>c.hexDataSlice,hexStripZeros:()=>c.hexStripZeros,hexValue:()=>c.hexValue,hexZeroPad:()=>c.hexZeroPad,hexlify:()=>c.hexlify,id:()=>D,isAddress:()=>N,isBytes:()=>c.isBytes,isBytesLike:()=>c.isBytesLike,isHexString:()=>c.isHexString,isValidMnemonic:()=>kn,isValidName:()=>Ko,joinSignature:()=>c.joinSignature,keccak256:()=>b.keccak256,mnemonicToEntropy:()=>An,mnemonicToSeed:()=>wn,namehash:()=>Wo,nameprep:()=>fs.j9,parseBytes32String:()=>ds.V,parseEther:()=>bs,parseTransaction:()=>cr,parseUnits:()=>gs,poll:()=>ri,randomBytes:()=>Pn,recoverAddress:()=>er,recoverPublicKey:()=>Kt,resolveProperties:()=>f.resolveProperties,ripemd160:()=>Yr,serializeTransaction:()=>sr,sha256:()=>Jr,sha512:()=>$r,shallowCopy:()=>f.shallowCopy,shuffled:()=>ka,solidityKeccak256:()=>cs,solidityPack:()=>us,soliditySha256:()=>ls,splitSignature:()=>c.splitSignature,stripZeros:()=>c.stripZeros,toUtf8Bytes:()=>F.YW,toUtf8CodePoints:()=>F.dg,toUtf8String:()=>F._v,verifyMessage:()=>oo,verifyTypedData:()=>io,zeroPad:()=>c.zeroPad});var u={};r.r(u),r.d(u,{BaseContract:()=>_r,BigNumber:()=>l.gH,Contract:()=>Er,ContractFactory:()=>xr,FixedNumber:()=>Tr.I3,Signer:()=>$e,VoidSigner:()=>et,Wallet:()=>no,Wordlist:()=>nn,constants:()=>o,errors:()=>d.ErrorCode,getDefaultProvider:()=>ts,logger:()=>As,providers:()=>i,utils:()=>s,version:()=>ws,wordlists:()=>un});var c=r(89106),l=r(2776),f=r(3678),d=r(14589);const h="abi/5.7.0",p=new d.Logger(h);function y(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(o){t.push({path:a,error:o})}}};return r([],e),t}class m{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){p.throwArgumentError(e,this.localName,t)}}class g{constructor(e){(0,f.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,c.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,c.concat)(e._data))}writeBytes(e){let t=(0,c.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,c.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,c.arrayify)(l.gH.from(e));return t.length>this.wordSize&&p.throwError("value out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,c.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class v{constructor(e,t,r,n){(0,f.defineReadOnly)(this,"_data",(0,c.arrayify)(e)),(0,f.defineReadOnly)(this,"wordSize",t||32),(0,f.defineReadOnly)(this,"_coerceFunc",r),(0,f.defineReadOnly)(this,"allowLoose",n),this._offset=0}get data(){return(0,c.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):v.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:p.throwError("data out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new v(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return l.gH.from(this.readBytes(this.wordSize))}}var b=r(19547);const w=new d.Logger("rlp/5.7.0");function A(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function S(e,t,r){let n=0;for(let o=0;ot+1+n&&w.throwError("child data too short",d.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function x(e,t){if(0===e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&w.throwError("data short segment too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=S(e,t+1,r);return t+1+r+n>e.length&&w.throwError("data long segment too short",d.Logger.errors.BUFFER_OVERRUN,{}),E(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{}),E(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=S(e,t+1,r);t+1+r+n>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:(0,c.hexlify)(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,c.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,c.hexlify)(e[t])}}function T(e){const t=(0,c.arrayify)(e),r=x(t,0);return r.consumed!==t.length&&w.throwArgumentError("invalid rlp data","data",e),r.result}const P=new d.Logger("address/5.7.0");function O(e){(0,c.isHexString)(e,20)||P.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let o=0;o<40;o++)r[o]=t[o].charCodeAt(0);const n=(0,c.arrayify)((0,b.keccak256)(r));for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&n[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}const R={};for(let ks=0;ks<10;ks++)R[String(ks)]=String(ks);for(let ks=0;ks<26;ks++)R[String.fromCharCode(65+ks)]=String(10+ks);const I=Math.floor((C=9007199254740991,Math.log10?Math.log10(C):Math.log(C)/Math.LN10));var C;function M(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>R[e])).join("");for(;t.length>=I;){let e=t.substring(0,I);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function B(e){let t=null;if("string"!==typeof e&&P.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=O(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&P.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==M(e)&&P.throwArgumentError("bad icap checksum","address",e),t=(0,l.Os)(e.substring(4));t.length<40;)t="0"+t;t=O("0x"+t)}else P.throwArgumentError("invalid address","address",e);return t}function N(e){try{return B(e),!0}catch(t){}return!1}function L(e){let t=(0,l.ii)(B(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+M("XE00"+t)+t}function j(e){let t=null;try{t=B(e.from)}catch(n){P.throwArgumentError("missing from address","transaction",e)}const r=(0,c.stripZeros)((0,c.arrayify)(l.gH.from(e.nonce).toHexString()));return B((0,c.hexDataSlice)((0,b.keccak256)(_([t,r])),12))}function U(e,t,r){return 32!==(0,c.hexDataLength)(t)&&P.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,c.hexDataLength)(r)&&P.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),B((0,c.hexDataSlice)((0,b.keccak256)((0,c.concat)(["0xff",B(e),t,r])),12))}var F=r(2614);function D(e){return(0,b.keccak256)((0,F.YW)(e))}class z extends m{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=B(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return B((0,c.hexZeroPad)(e.readValue().toHexString(),20))}}class q extends m{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const H=new d.Logger(h);function V(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||H.throwError("cannot encode object for signature with missing names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&H.throwError("cannot encode object for signature with duplicate names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else H.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&H.throwArgumentError("types/value length mismatch","tuple",r);let o=new g(e.wordSize),i=new g(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(o,r)})),a.forEach((e=>{e(o.length)}));let s=e.appendWriter(o);return s+=e.appendWriter(i),s}function K(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),a=n.subReader(r.toNumber());try{o=t.decode(a)}catch(i){if(i.code===d.Logger.errors.BUFFER_OVERRUN)throw i;o=i,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(i){if(i.code===d.Logger.errors.BUFFER_OVERRUN)throw i;o=i,o.baseType=t.name,o.name=t.localName,o.type=t.type}void 0!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let i=0;i{throw e}})}return Object.freeze(r)}class W extends m{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&H.throwError("insufficient data length",d.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let n=0;n{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return V(e,this.coders,t)}decode(e){return e.coerce(this.name,K(e,this.coders))}}const ce=new d.Logger(h),le={};let fe={calldata:!0,memory:!0,storage:!0},de={calldata:!0,memory:!0};function he(e,t){if("bytes"===e||"string"===e){if(fe[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&de[t])return!0;return(fe[t]||"payable"===t)&&ce.throwArgumentError("invalid modifier","name",t),!1}function pe(e,t){for(let r in t)(0,f.defineReadOnly)(e,r,t[r])}const ye=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),me=new RegExp(/^(.*)\[([0-9]*)\]$/);class ge{constructor(e,t){e!==le&&ce.throwError("use fromString",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),pe(this,t);let r=this.type.match(me);pe(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ge.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ye.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ye.full?", ":",")+")"):t+=this.type,e!==ye.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ye.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"===typeof e?ge.fromString(e,t):ge.fromObject(e)}static fromObject(e){return ge.isParamType(e)?e:new ge(le,{name:e.name||null,type:Pe(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ge.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){ce.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},a=i;for(let s=0;sge.fromString(e,t)))}class be{constructor(e,t){e!==le&&ce.throwError("use a static from method",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),pe(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return be.isFragment(e)?e:"string"===typeof e?be.fromString(e):be.fromObject(e)}static fromObject(e){if(be.isFragment(e))return e;switch(e.type){case"function":return Ee.fromObject(e);case"event":return we.fromObject(e);case"constructor":return _e.fromObject(e);case"error":return Te.fromObject(e);case"fallback":case"receive":return null}return ce.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?we.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ee.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?_e.fromString(e.trim()):"error"===e.split(" ")[0]?Te.fromString(e.substring(5).trim()):ce.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class we extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"===typeof e?we.fromString(e):we.fromObject(e)}static fromObject(e){if(we.isEventFragment(e))return e;"event"!==e.type&&ce.throwArgumentError("invalid event object","value",e);const t={name:Re(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ge.fromObject):[],type:"event"};return new we(le,t)}static fromString(e){let t=e.match(Ie);t||ce.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ce.warn("unknown modifier: "+e)}})),we.fromObject({name:t[1].trim(),anonymous:r,inputs:ve(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ae(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ce.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ce.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=l.gH.from(r[1]),r[0]):e}function Se(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function ke(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ce.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ce.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ce.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ce.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ce.throwArgumentError("unable to determine stateMutability","value",e),t}class _e extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ye.sighash&&ce.throwError("cannot format a constructor for sighash",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"===typeof e?_e.fromString(e):_e.fromObject(e)}static fromObject(e){if(_e.isConstructorFragment(e))return e;"constructor"!==e.type&&ce.throwArgumentError("invalid constructor object","value",e);let t=ke(e);t.constant&&ce.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ge.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?l.gH.from(e.gas):null};return new _e(le,r)}static fromString(e){let t={type:"constructor"},r=(e=Ae(e,t)).match(Ie);return r&&"constructor"===r[1].trim()||ce.throwArgumentError("invalid constructor string","value",e),t.inputs=ve(r[2].trim(),!1),Se(r[3].trim(),t),_e.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ee extends _e{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"===typeof e?Ee.fromString(e):Ee.fromObject(e)}static fromObject(e){if(Ee.isFunctionFragment(e))return e;"function"!==e.type&&ce.throwArgumentError("invalid function object","value",e);let t=ke(e);const r={type:e.type,name:Re(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ge.fromObject):[],outputs:e.outputs?e.outputs.map(ge.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?l.gH.from(e.gas):null};return new Ee(le,r)}static fromString(e){let t={type:"function"},r=(e=Ae(e,t)).split(" returns ");r.length>2&&ce.throwArgumentError("invalid function string","value",e);let n=r[0].match(Ie);if(n||ce.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Re(t.name),t.inputs=ve(n[2],!1),Se(n[3].trim(),t),r.length>1){let n=r[1].match(Ie);""==n[1].trim()&&""==n[3].trim()||ce.throwArgumentError("unexpected tokens","value",e),t.outputs=ve(n[2],!1)}else t.outputs=[];return Ee.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function xe(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ce.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}class Te extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",t.trim()}static from(e){return"string"===typeof e?Te.fromString(e):Te.fromObject(e)}static fromObject(e){if(Te.isErrorFragment(e))return e;"error"!==e.type&&ce.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Re(e.name),inputs:e.inputs?e.inputs.map(ge.fromObject):[]};return xe(new Te(le,t))}static fromString(e){let t={type:"error"},r=e.match(Ie);return r||ce.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Re(t.name),t.inputs=ve(r[2],!1),xe(Te.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Pe(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Oe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Re(e){return e&&e.match(Oe)||ce.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}const Ie=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ce=new d.Logger(h),Me=new RegExp(/^bytes([0-9]*)$/),Be=new RegExp(/^(u?int)([0-9]*)$/);class Ne{constructor(e){(0,f.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new z(e.name);case"bool":return new G(e.name);case"string":return new se(e.name);case"bytes":return new Z(e.name);case"array":return new W(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ue((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Y(e.name)}let t=e.type.match(Be);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!==0)&&Ce.throwArgumentError("invalid "+t[1]+" bit length","param",e),new ae(r/8,"int"===t[1],e.name)}if(t=e.type.match(Me),t){let r=parseInt(t[1]);return(0===r||r>32)&&Ce.throwArgumentError("invalid bytes length","param",e),new Q(r,e.name)}return Ce.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new v(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new g(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ge.from(e))));return new ue(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Ce.throwError("types/values length mismatch",d.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ge.from(e)))),n=new ue(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ge.from(e))));return new ue(n,"_").decode(this._getReader((0,c.arrayify)(t),r))}}const Le=new Ne,je=new d.Logger(h);class Ue extends f.Description{}class Fe extends f.Description{}class De extends f.Description{}class ze extends f.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const qe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function He(e,t){const r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}class Ve{constructor(e){let t=[];t="string"===typeof e?JSON.parse(e):e,(0,f.defineReadOnly)(this,"fragments",t.map((e=>be.from(e))).filter((e=>null!=e))),(0,f.defineReadOnly)(this,"_abiCoder",(0,f.getStatic)(new.target,"getAbiCoder")()),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"errors",{}),(0,f.defineReadOnly)(this,"events",{}),(0,f.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void je.warn("duplicate definition - constructor"):void(0,f.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?je.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,f.defineReadOnly)(this,"deploy",_e.from({payable:!1,type:"constructor"})),(0,f.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=ye.full),e===ye.sighash&&je.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===ye.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Le}static getAddress(e){return B(e)}static getSighash(e){return(0,c.hexDataSlice)(D(e.format()),0,4)}static getEventTopic(e){return D(e.format())}getFunction(e){if((0,c.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];je.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching function","name",t):r.length>1&&je.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ee.fromString(e).format()];return t||je.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,c.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];je.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching event","name",t):r.length>1&&je.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[we.fromString(e).format()];return t||je.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,c.isHexString)(e)){const t=(0,f.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}je.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching error","name",t):r.length>1&&je.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ee.fromString(e).format()];return t||je.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return(0,f.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,f.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"===typeof e&&(e=this.getError(e));const r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&je.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"===typeof e&&(e=this.getFunction(e));const r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&je.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"===typeof e&&(e=this.getFunction(e));let r=(0,c.arrayify)(t),n=null,o="",i=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(u){}break;case 4:{const e=(0,c.hexlify)(r.slice(0,4)),t=qe[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=i[0]),"Error"===a?o="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(o="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(u){}break}}return je.throwError("call revert exception"+o,d.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,c.hexlify)(t),errorArgs:i,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&je.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?D(t):"bytes"===e.type?(0,b.keccak256)((0,c.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=l.gH.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,c.hexZeroPad)((0,c.hexlify)(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?je.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&je.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"===typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&je.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const a=t[i];if(e.indexed)if("string"===e.type)r.push(D(a));else if("bytes"===e.type)r.push((0,b.keccak256)(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),o.push(a)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,c.isHexString)(r[0],32)&&r[0].toLowerCase()===t||je.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ge.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,c.concat)(r)):null,s=this._abiCoder.decode(o,t,!0),u=[],l=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new ze({_isIndexed:!0,hash:null});else if(i[t])u[t]=new ze({_isIndexed:!0,hash:a[f++]});else try{u[t]=a[f++]}catch(r){u[t]=r}else try{u[t]=s[l++]}catch(r){u[t]=r}if(e.name&&null==u[e.name]){const r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw He("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(let c=0;c{throw He("index ".concat(c),e)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Fe({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:l.gH.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Ue({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,c.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new De({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Ke=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const We=new d.Logger("abstract-provider/5.7.0");class Ge extends f.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Xe{constructor(){We.checkAbstract(new.target,Xe),(0,f.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return Ke(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,f.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=l.gH.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Ze=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Qe=new d.Logger("abstract-signer/5.7.0"),Ye=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Je=[d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED];class $e{constructor(){Qe.checkAbstract(new.target,$e),(0,f.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Ze(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Ze(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Ze(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Ze(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const r in e)-1===Ye.indexOf(r)&&Qe.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=(0,f.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Qe.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Ze(this,void 0,void 0,(function*(){const t=yield(0,f.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Ze(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Qe.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Qe.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Qe.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Qe.throwError("network does not support EIP-1559",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Qe.throwError("failed to get consistent fee data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Je.indexOf(e.code)>=0)throw e;return Qe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Qe.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,f.resolveProperties)(t)}))}_checkProvider(e){this.provider||Qe.throwError("missing provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class et extends $e{constructor(e,t){super(),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Qe.throwError(e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new et(this.address,e)}}var tt=r(6373),rt=r.n(tt),nt=r(73697),ot=r.n(nt);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function it(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},e(r,r.exports),r.exports}var at=st;function st(e,t){if(!e)throw new Error(t||"Assertion failed")}st.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ut=it((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),ct=it((function(e,t){var r=t;r.assert=at,r.toArray=ut.toArray,r.zero2=ut.zero2,r.toHex=ut.toHex,r.encode=ut.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<(o>>1)-1?(o>>1)-u:u,i.isubn(s)):s=0,n[a]=s,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(rt())(e,"hex","le")}})),lt=ct.getNAF,ft=ct.getJSF,dt=ct.assert;function ht(e,t){this.type=e,this.p=new(rt())(t.p,16),this.red=t.prime?rt().red(t.prime):rt().mont(this.p),this.zero=new(rt())(0).toRed(this.red),this.one=new(rt())(1).toRed(this.red),this.two=new(rt())(2).toRed(this.red),this.n=t.n&&new(rt())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var pt=ht;function yt(e,t){this.curve=e,this.type=t,this.precomputed=null}ht.prototype.point=function(){throw new Error("Not implemented")},ht.prototype.validate=function(){throw new Error("Not implemented")},ht.prototype._fixedNafMul=function(e,t){dt(e.precomputed);var r=e._getDoubles(),n=lt(t,1,this._bitLength),o=(1<=i;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=o;f>0;f--){for(i=0;i=0;s--){for(var u=0;s>=0&&0===i[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=i[s];dt(0!==c),a="affine"===e.type?c>0?a.mixedAdd(o[c-1>>1]):a.mixedAdd(o[-c-1>>1].neg()):c>0?a.add(o[c-1>>1]):a.add(o[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},ht.prototype._wnafMulAdd=function(e,t,r,n,o){var i,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(i=0;i=1;i-=2){var h=i-1,p=i;if(1===u[h]&&1===u[p]){var y=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(y[1]=t[h].add(t[p]),y[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(y[1]=t[h].toJ().mixedAdd(t[p]),y[2]=t[h].add(t[p].neg())):(y[1]=t[h].toJ().mixedAdd(t[p]),y[2]=t[h].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=ft(r[h],r[p]);for(f=Math.max(g[0].length,f),l[h]=new Array(f),l[p]=new Array(f),a=0;a=0;i--){for(var S=0;i>=0;){var k=!0;for(a=0;a=0&&S++,w=w.dblp(S),i<0)break;for(a=0;a0?s=c[a][_-1>>1]:_<0&&(s=c[a][-_-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},yt.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o=0&&(i=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:n,b:o},{a:i,b:a}]},vt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),u=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},vt.prototype.pointFromX=function(e,t){(e=new(rt())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},vt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},vt.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i":""},wt.prototype.isInfinity=function(){return this.inf},wt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},wt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},wt.prototype.getX=function(){return this.x.fromRed()},wt.prototype.getY=function(){return this.y.fromRed()},wt.prototype.mul=function(e){return e=new(rt())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},wt.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},wt.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},wt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},wt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},wt.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},mt(At,pt.BasePoint),vt.prototype.jpoint=function(e,t,r){return new At(this,e,t,r)},At.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},At.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},At.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),u=i.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},At.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},At.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},At.prototype.inspect=function(){return this.isInfinity()?"":""},At.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var St=it((function(e,t){var r=t;r.base=pt,r.short=bt,r.mont=null,r.edwards=null})),kt=it((function(e,t){var r,n=t,o=ct.assert;function i(e){"short"===e.type?this.curve=new St.short(e):"edwards"===e.type?this.curve=new St.edwards(e):this.curve=new St.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ot().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ot().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ot().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ot().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ot().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ot().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ot().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(s){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ot().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function _t(e){if(!(this instanceof _t))return new _t(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ut.toArray(e.entropy,e.entropyEnc||"hex"),r=ut.toArray(e.nonce,e.nonceEnc||"hex"),n=ut.toArray(e.pers,e.persEnc||"hex");at(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Et=_t;_t.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},_t.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=ut.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"};var Ot=ct.assert;function Rt(e,t){if(e instanceof Rt)return e;this._importDER(e,t)||(Ot(e.r&&e.s,"Signature without r or s"),this.r=new(rt())(e.r,16),this.s=new(rt())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var It=Rt;function Ct(){this.place=0}function Mt(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i>>=0;return!(o<=127)&&(t.place=a,o)}function Bt(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Rt.prototype._importDER=function(e,t){e=ct.toArray(e,t);var r=new Ct;if(48!==e[r.place++])return!1;var n=Mt(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=Mt(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=Mt(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(rt())(i),this.s=new(rt())(s),this.recoveryParam=null,!0},Rt.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Bt(t),r=Bt(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];Nt(n,t.length),(n=n.concat(t)).push(2),Nt(n,r.length);var o=n.concat(r),i=[48];return Nt(i,o.length),i=i.concat(o),ct.encode(i,e)};var Lt=function(){throw new Error("unsupported")},jt=ct.assert;function Ut(e){if(!(this instanceof Ut))return new Ut(e);"string"===typeof e&&(jt(Object.prototype.hasOwnProperty.call(kt,e),"Unknown curve "+e),e=kt[e]),e instanceof kt.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ft=Ut;Ut.prototype.keyPair=function(e){return new Pt(this,e)},Ut.prototype.keyFromPrivate=function(e,t){return Pt.fromPrivate(this,e,t)},Ut.prototype.keyFromPublic=function(e,t){return Pt.fromPublic(this,e,t)},Ut.prototype.genKeyPair=function(e){e||(e={});for(var t=new Et({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Lt(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(rt())(2));;){var o=new(rt())(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},Ut.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ut.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(rt())(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),a=e.toArray("be",o),s=new Et({hash:this.hash,entropy:i,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(rt())(1)),c=0;;c++){var l=n.k?n.k(c):new(rt())(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var d=f.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var p=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),y^=1),new It({r:h,s:p,recoveryParam:y})}}}}}},Ut.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(rt())(e,16)),r=this.keyFromPublic(r,n);var o=(t=new It(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,s=i.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},Ut.prototype.recoverPubKey=function(e,t,r,n){jt((3&r)===r,"The recovery param is more than two bits"),t=new It(t,n);var o=this.n,i=new(rt())(e),a=t.r,s=t.s,u=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(o),f=o.sub(i).mul(l).umod(o),d=s.mul(l).umod(o);return this.g.mulAdd(f,a,d)},Ut.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new It(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var Dt=it((function(e,t){var r=t;r.version="6.5.4",r.utils=ct,r.rand=function(){throw new Error("unsupported")},r.curve=St,r.curves=kt,r.ec=Ft,r.eddsa=null})).ec;const zt=new d.Logger("signing-key/5.7.0");let qt=null;function Ht(){return qt||(qt=new Dt("secp256k1")),qt}class Vt{constructor(e){(0,f.defineReadOnly)(this,"curve","secp256k1"),(0,f.defineReadOnly)(this,"privateKey",(0,c.hexlify)(e)),32!==(0,c.hexDataLength)(this.privateKey)&&zt.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey));(0,f.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,f.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,f.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=Ht().keyFromPublic((0,c.arrayify)(this.publicKey)),r=Ht().keyFromPublic((0,c.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey)),r=(0,c.arrayify)(e);32!==r.length&&zt.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,c.splitSignature)({recoveryParam:n.recoveryParam,r:(0,c.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,c.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey)),r=Ht().keyFromPublic((0,c.arrayify)(Wt(e)));return(0,c.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Kt(e,t){const r=(0,c.splitSignature)(t),n={r:(0,c.arrayify)(r.r),s:(0,c.arrayify)(r.s)};return"0x"+Ht().recoverPubKey((0,c.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function Wt(e,t){const r=(0,c.arrayify)(e);if(32===r.length){const e=new Vt(r);return t?"0x"+Ht().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,c.hexlify)(r):"0x"+Ht().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Ht().keyFromPublic(r).getPublic(!0,"hex"):(0,c.hexlify)(r):zt.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Gt=new d.Logger("transactions/5.7.0");var Xt;function Zt(e){return"0x"===e?null:B(e)}function Qt(e){return"0x"===e?$:l.gH.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Xt||(Xt={}));const Yt=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Jt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function $t(e){const t=Wt(e);return B((0,c.hexDataSlice)((0,b.keccak256)((0,c.hexDataSlice)(t,1)),12))}function er(e,t){return $t(Kt((0,c.arrayify)(e),t))}function tr(e,t){const r=(0,c.stripZeros)(l.gH.from(e).toHexString());return r.length>32&&Gt.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function rr(e,t){return{address:B(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,c.hexDataLength)(t)&&Gt.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase())))}}function nr(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Gt.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),rr(e[0],e[1])):rr(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return rr(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function or(e){return nr(e).map((e=>[e.address,e.storageKeys]))}function ir(e,t){if(null!=e.gasPrice){const t=l.gH.from(e.gasPrice),r=l.gH.from(e.maxFeePerGas||0);t.eq(r)||Gt.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),tr(e.maxFeePerGas||0,"maxFeePerGas"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?B(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",or(e.accessList||[])];if(t){const e=(0,c.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,c.stripZeros)(e.r)),r.push((0,c.stripZeros)(e.s))}return(0,c.hexConcat)(["0x02",_(r)])}function ar(e,t){const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.gasPrice||0,"gasPrice"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?B(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",or(e.accessList||[])];if(t){const e=(0,c.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,c.stripZeros)(e.r)),r.push((0,c.stripZeros)(e.s))}return(0,c.hexConcat)(["0x01",_(r)])}function sr(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Gt.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,f.checkProperties)(e,Jt);const r=[];Yt.forEach((function(t){let n=e[t.name]||[];const o={};t.numeric&&(o.hexPad="left"),n=(0,c.arrayify)((0,c.hexlify)(n,o)),t.length&&n.length!==t.length&&n.length>0&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,c.stripZeros)(n),n.length>t.maxLength&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,c.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!==typeof n&&Gt.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,c.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,c.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return _(r);const o=(0,c.splitSignature)(t);let i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):o.v!==i&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,c.hexlify)(i)),r.push((0,c.stripZeros)((0,c.arrayify)(o.r))),r.push((0,c.stripZeros)((0,c.arrayify)(o.s))),_(r)}(e,t);switch(e.type){case 1:return ar(e,t);case 2:return ir(e,t)}return Gt.throwError("unsupported transaction type: ".concat(e.type),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function ur(e,t,r){try{const r=Qt(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(n){Gt.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,c.hexZeroPad)(t[1],32),e.s=(0,c.hexZeroPad)(t[2],32);try{const t=(0,b.keccak256)(r(e));e.from=er(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(n){}}function cr(e){const t=(0,c.arrayify)(e);if(t[0]>127)return function(e){const t=T(e);9!==t.length&&6!==t.length&&Gt.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Qt(t[0]).toNumber(),gasPrice:Qt(t[1]),gasLimit:Qt(t[2]),to:Zt(t[3]),value:Qt(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=l.gH.from(t[6]).toNumber()}catch(n){return r}if(r.r=(0,c.hexZeroPad)(t[7],32),r.s=(0,c.hexZeroPad)(t[8],32),l.gH.from(r.r).isZero()&&l.gH.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let o=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push((0,c.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),o-=2*r.chainId+8);const a=(0,b.keccak256)(_(i));try{r.from=er(a,{r:(0,c.hexlify)(r.r),s:(0,c.hexlify)(r.s),recoveryParam:o})}catch(n){}r.hash=(0,b.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=T(e.slice(1));8!==t.length&&11!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 1","payload",(0,c.hexlify)(e));const r={type:1,chainId:Qt(t[0]).toNumber(),nonce:Qt(t[1]).toNumber(),gasPrice:Qt(t[2]),gasLimit:Qt(t[3]),to:Zt(t[4]),value:Qt(t[5]),data:t[6],accessList:nr(t[7])};return 8===t.length||(r.hash=(0,b.keccak256)(e),ur(r,t.slice(8),ar)),r}(t);case 2:return function(e){const t=T(e.slice(1));9!==t.length&&12!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 2","payload",(0,c.hexlify)(e));const r=Qt(t[2]),n=Qt(t[3]),o={type:2,chainId:Qt(t[0]).toNumber(),nonce:Qt(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Qt(t[4]),to:Zt(t[5]),value:Qt(t[6]),data:t[7],accessList:nr(t[8])};return 9===t.length||(o.hash=(0,b.keccak256)(e),ur(o,t.slice(9),ir)),o}(t)}return Gt.throwError("unsupported transaction type: ".concat(t[0]),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var lr=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const fr=new d.Logger("contracts/5.7.0"),dr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function hr(e,t){return lr(this,void 0,void 0,(function*(){const r=yield t;"string"!==typeof r&&fr.throwArgumentError("invalid address or ENS name","name",r);try{return B(r)}catch(o){}e||fr.throwError("a provider or signer is needed to resolve ENS names",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&fr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function pr(e,t,r){return lr(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>pr(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield hr(e,t):"tuple"===r.type?yield pr(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>pr(e,t,r.arrayChildren)))):Promise.reject(fr.makeError("invalid value for array",d.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function yr(e,t,r){return lr(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(n=(0,f.shallowCopy)(r.pop())),fr.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,f.resolveProperties)({override:hr(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>lr(this,void 0,void 0,(function*(){return B(e.signer)!==e.override&&fr.throwError("Contract with a Signer cannot override from",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=hr(e.provider,n.from));const o=yield(0,f.resolveProperties)({args:pr(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,f.resolveProperties)(n)||{}}),i=e.interface.encodeFunctionData(t,o.args),a={data:i,to:o.address},s=o.overrides;if(null!=s.nonce&&(a.nonce=l.gH.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=l.gH.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=l.gH.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=l.gH.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=l.gH.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=nr(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=(0,c.arrayify)(i);for(let t=0;tnull!=n[e]));return u.length&&fr.throwError("cannot override ".concat(u.map((e=>JSON.stringify(e))).join(",")),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function mr(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,f.deepCopy)(r),o=null;try{o=e.interface.parseLog(r)}catch(i){}return o&&(n.args=o.args,n.decode=(t,r)=>e.interface.decodeEventLog(o.eventFragment,t,r),n.event=o.name,n.eventSignature=o.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function gr(e,t,r){const n=e.signer||e.provider;return function(){for(var o=arguments.length,i=new Array(o),a=0;aArray.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class wr{constructor(e,t){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Ar extends wr{constructor(){super("error",null)}}class Sr extends wr{constructor(e,t,r,n){const o={address:e};let i=t.getEventTopic(r);n?(i!==n[0]&&fr.throwArgumentError("topic mismatch","topics",n),o.topics=n.slice()):o.topics=[i],super(br(o),o),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t),(0,f.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=y(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class kr extends wr{constructor(e,t){super("*",{address:e}),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(t){}}}class _r{constructor(e,t,r){var n=this;(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(t)),null==r?((0,f.defineReadOnly)(this,"provider",null),(0,f.defineReadOnly)(this,"signer",null)):$e.isSigner(r)?((0,f.defineReadOnly)(this,"provider",r.provider||null),(0,f.defineReadOnly)(this,"signer",r)):Xe.isProvider(r)?((0,f.defineReadOnly)(this,"provider",r),(0,f.defineReadOnly)(this,"signer",null)):fr.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,f.defineReadOnly)(this,"callStatic",{}),(0,f.defineReadOnly)(this,"estimateGas",{}),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"populateTransaction",{}),(0,f.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,f.defineReadOnly)(this.filters,t,(function(){for(var e=arguments.length,t=new Array(e),o=0;o{const r=e[t];1===r.length?(0,f.defineReadOnly)(this.filters,t,this.filters[r[0]]):fr.warn("Duplicate definition of ".concat(t," (").concat(r.join(", "),")"))}))}if((0,f.defineReadOnly)(this,"_runningEvents",{}),(0,f.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&fr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,f.defineReadOnly)(this,"address",e),this.provider)(0,f.defineReadOnly)(this,"resolvedAddress",hr(this.provider,e));else try{(0,f.defineReadOnly)(this,"resolvedAddress",Promise.resolve(B(e)))}catch(a){fr.throwError("provider is required to use ENS name as contract address",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const o={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])fr.warn("Duplicate ABI entry for ".concat(JSON.stringify(e)));else{i[e]=!0;{const r=t.name;o["%".concat(r)]||(o["%".concat(r)]=[]),o["%".concat(r)].push(e)}null==this[e]&&(0,f.defineReadOnly)(this,e,vr(this,t,!0)),null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,vr(this,t,!1)),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,gr(this,t,!0)),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o{const t=o[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,f.defineReadOnly)(this,e,this[r])}catch(n){}null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,f.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return j(e)}static getInterface(e){return Ve.isInterface(e)?e:new Ve(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&fr.throwError("contract not deployed",d.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||fr.throwError("sending a transactions require a signer",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,f.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&fr.throwError("cannot override "+e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"===typeof e&&(e=new et(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,f.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return ze.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new Ar);if("event"===e)return this._normalizeRunningEvent(new wr("event",null));if("*"===e)return this._normalizeRunningEvent(new kr(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Sr(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!==typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Sr(this.address,this.interface,r,e.topics))}catch(t){}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new wr(br(r),r))}return this._normalizeRunningEvent(new kr(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=(0,f.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||fr.throwError("events require a provider or a signer with a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(o){n.decodeError=o.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),o=(0,f.shallowCopy)(n.filter);return"string"===typeof t&&(0,c.isHexString)(t,32)?(null!=r&&fr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e){if(!this.provider)return!1;const t=this._getRunningEvent(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o0;return this._checkRunningEvents(t),i}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Er extends _r{}class xr{constructor(e,t,r){let n=null;n="string"===typeof t?t:(0,c.isBytes)(t)?(0,c.hexlify)(t):t&&"string"===typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,c.isHexString)(n)||n.length%2)&&fr.throwArgumentError("invalid bytecode","bytecode",t),r&&!$e.isSigner(r)&&fr.throwArgumentError("invalid signer","signer",r),(0,f.defineReadOnly)(this,"bytecode",n),(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(e)),(0,f.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(){let e={};for(var t=arguments.length,r=new Array(t),n=0;n{null!=e[t]&&fr.throwError("cannot override "+t,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){l.gH.from(e.value).isZero()||this.interface.deploy.payable||fr.throwError("non-payable constructor cannot override value",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return fr.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,c.hexlify)((0,c.concat)([this.bytecode,this.interface.encodeDeploy(r)])),e}deploy(){for(var e=arguments.length,t=new Array(e),r=0;r256||t[2]&&t[2]!==String(n))&&Cr.throwArgumentError("invalid numeric width","type",e);const o=jr.mask(r?n-1:n),i=r?o.add(Lr).mul(Br):Nr;return function(t){const r=l.gH.from(t);return(r.lt(i)||r.gt(o))&&Cr.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,c.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Cr.throwArgumentError("invalid bytes width","type",e),function(t){return(0,c.arrayify)(t).length!==r&&Cr.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){const t=(0,c.arrayify)(e),r=t.length%32;return r?(0,c.hexConcat)([t,Mr.slice(r)]):(0,c.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,c.hexZeroPad)(B(e),32)};case"bool":return function(e){return e?Ur:Fr};case"bytes":return function(e){return(0,b.keccak256)(e)};case"string":return function(e){return D(e)}}return null}function Kr(e,t){return"".concat(e,"(").concat(t.map((e=>{let{name:t,type:r}=e;return r+" "+t})).join(","),")")}class Wr{constructor(e){(0,f.defineReadOnly)(this,"types",Object.freeze((0,f.deepCopy)(e))),(0,f.defineReadOnly)(this,"_encoderCache",{}),(0,f.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const i in e){const n={};e[i].forEach((o=>{n[o.name]&&Cr.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(i)),"types",e),n[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===i&&Cr.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e);Vr(a)||(r[a]||Cr.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),r[a].push(i),t[i][a]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?Cr.throwArgumentError("missing primary type","types",e):o.length>1&&Cr.throwArgumentError("ambiguous primary types or unused types: ".concat(o.map((e=>JSON.stringify(e))).join(", ")),"types",e),(0,f.defineReadOnly)(this,"primaryType",o[0]),function o(i,a){a[i]&&Cr.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",e),a[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[i]}(this.primaryType,{});for(const i in n){const t=Object.keys(n[i]);t.sort(),this._types[i]=Kr(i,e[i])+t.map((t=>Kr(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Vr(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(b.keccak256)),(0,b.keccak256)((0,c.hexConcat)(o))}}const r=this.types[e];if(r){const t=D(this._types[e]);return e=>{const n=r.map((t=>{let{name:r,type:n}=t;const o=this.getEncoder(n)(e[r]);return this._types[n]?(0,b.keccak256)(o):o}));return n.unshift(t),(0,c.hexConcat)(n)}}return Cr.throwArgumentError("unknown type: ".concat(e),"type",e)}encodeType(e){const t=this._types[e];return t||Cr.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,b.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Vr(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&Cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,n)=>{let{name:o,type:i}=n;return e[o]=this._visit(i,t[o],r),e}),{}):Cr.throwArgumentError("unknown type: ".concat(e),"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Wr(e)}static getPrimaryType(e){return Wr.from(e).primaryType}static hashStruct(e,t,r){return Wr.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=Dr[r];n||Cr.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>zr.indexOf(e.name)-zr.indexOf(t.name))),Wr.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,c.hexConcat)(["0x1901",Wr.hashDomain(e),Wr.from(t).hash(r)])}static hash(e,t,r){return(0,b.keccak256)(Wr.encode(e,t,r))}static resolveNames(e,t,r,n){return Ir(this,void 0,void 0,(function*(){e=(0,f.shallowCopy)(e);const o={};e.verifyingContract&&!(0,c.isHexString)(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=Wr.from(t);i.visit(r,((e,t)=>("address"!==e||(0,c.isHexString)(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Wr.hashDomain(e);const n={},o=[];zr.forEach((t=>{const r=e[t];null!=r&&(n[t]=Hr[t](r),o.push({name:t,type:Dr[t]}))}));const i=Wr.from(t),a=(0,f.shallowCopy)(t);return a.EIP712Domain?Cr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=o,i.encode(r),{types:a,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,c.hexlify)((0,c.arrayify)(t));if(e.match(/^u?int/))return l.gH.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&Cr.throwArgumentError("invalid string","value",t),t}return Cr.throwArgumentError("unsupported type","type",e)}))}}}class Gr{constructor(e){(0,f.defineReadOnly)(this,"alphabet",e),(0,f.defineReadOnly)(this,"base",e.length),(0,f.defineReadOnly)(this,"_alphabetMap",{}),(0,f.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(e%this.base),e=e/this.base|0}let n="";for(let o=0;0===t[o]&&o=0;--o)n+=this.alphabet[r[o]];return n}decode(e){if("string"!==typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=255&d;let h=(0,c.arrayify)(en(o,e,u));i||(i=h.length,f=new Uint8Array(i),a=Math.ceil(n/i),l=n-(a-1)*i),f.set(h);for(let t=1;t=256)throw new Error("Depth too large!");return yn((0,c.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,c.hexlify)(this.depth),this.parentFingerprint,(0,c.hexZeroPad)((0,c.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,c.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new bn(gn,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~dn));const r=new Uint8Array(37);if(e&dn){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,c.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,c.arrayify)(this.publicKey));for(let c=24;c>=0;c-=8)r[33+(c>>3)]=e>>24-c&255;const n=(0,c.arrayify)(en(Zr.sha512,this.chainCode,r)),o=n.slice(0,32),i=n.slice(32);let a=null,s=null;if(this.privateKey)a=pn(l.gH.from(o).add(this.privateKey).mod(ln));else{s=new Vt((0,c.hexlify)(o))._addPoint(this.publicKey)}let u=t;const f=this.mnemonic;return f&&(u=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new bn(gn,a,s,this.fingerprint,pn(i),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n=dn)throw new Error("invalid path index - "+e);r=r._derive(dn+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=dn)throw new Error("invalid path index - "+e);r=r._derive(t)}}}return r}static _fromSeed(e,t){const r=(0,c.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,c.arrayify)(en(Zr.sha512,fn,r));return new bn(gn,pn(n.slice(0,32)),null,"0x00000000",pn(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Sn(An(e,r=mn(r)),r),bn._fromSeed(wn(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return bn._fromSeed(e,null)}static fromExtendedKey(e){const t=Xr.decode(e);82===t.length&&yn(t.slice(0,78))===e||cn.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=(0,c.hexlify)(t.slice(5,9)),o=parseInt((0,c.hexlify)(t.slice(9,13)).substring(2),16),i=(0,c.hexlify)(t.slice(13,45)),a=t.slice(45,78);switch((0,c.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new bn(gn,null,(0,c.hexlify)(a),n,i,o,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new bn(gn,(0,c.hexlify)(a.slice(1)),null,n,i,o,r,null)}return cn.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function wn(e,t){t||(t="");const r=(0,F.YW)("mnemonic"+t,F.dz.NFKD);return tn((0,F.YW)(e,F.dz.NFKD),r,2048,64,"sha512")}function An(e,t){t=mn(t),cn.checkNormalize();const r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=(0,c.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let s=0;s>3]|=1<<7-o%8),o++}const i=32*r.length/3,a=hn(r.length/3);if(((0,c.arrayify)(Jr(n.slice(0,i/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,c.hexlify)(n.slice(0,i/8))}function Sn(e,t){if(t=mn(t),(e=(0,c.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let a=0;a8?(r[r.length-1]<<=8,r[r.length-1]|=e[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[a]>>8-n,r.push(e[a]&(1<<8-n)-1),n+=3);const o=e.length/4,i=(0,c.arrayify)(Jr(e))[0]&hn(o);return r[r.length-1]<<=o,r[r.length-1]|=i>>8-o,t.join(r.map((e=>t.getWord(e))))}function kn(e,t){try{return An(e,t),!0}catch(r){}return!1}function _n(e){return("number"!==typeof e||e<0||e>=dn||e%1)&&cn.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}const En=new d.Logger("random/5.7.0");const xn=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}();let Tn=xn.crypto||xn.msCrypto;function Pn(e){(e<=0||e>1024||e%1||e!=e)&&En.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Tn.getRandomValues(t),(0,c.arrayify)(t)}Tn&&Tn.getRandomValues||(En.warn("WARNING: Missing strong random number source"),Tn={getRandomValues:function(e){return En.throwError("no secure random source avaialble",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var On=r(63651),Rn=r.n(On),In=r(64874),Cn=r.n(In);function Mn(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,c.arrayify)(e)}function Bn(e,t){for(e=String(e);e.lengtht)),(0,f.defineReadOnly)(this,"address",$t(this.publicKey)),this.address!==B(e.address)&&ro.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,f.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||vn,locale:t.locale||"en"})));const r=this.mnemonic;$t(bn.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ro.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,f.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(Vt.isSigningKey(e))"secp256k1"!==e.curve&&ro.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,f.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new Vt(e);(0,f.defineReadOnly)(this,"_signingKey",(()=>t))}(0,f.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,f.defineReadOnly)(this,"address",$t(this.publicKey))}var r;t&&!Xe.isProvider(t)&&ro.throwArgumentError("invalid provider","provider",t),(0,f.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new no(this,e)}signTransaction(e){return(0,f.resolveProperties)(e).then((t=>{null!=t.from&&(B(t.from)!==this.address&&ro.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,b.keccak256)(sr(t)));return sr(t,r)}))}signMessage(e){return to(this,void 0,void 0,(function*(){return(0,c.joinSignature)(this._signingKey().signDigest(Or(e)))}))}_signTypedData(e,t,r){return to(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>(null==this.provider&&ro.throwError("cannot resolve ENS names without a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,c.joinSignature)(this._signingKey().signDigest(Wr.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(B(e.address)!==$t(e.privateKey))throw new Error("address/privateKey mismatch");if(zn(e)){const t=e.mnemonic;if(bn.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||vn).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(g){return Promise.reject(g)}"function"!==typeof r||n||(n=r,r={}),r||(r={});const o=(0,c.arrayify)(e.privateKey),i=Nn(t);let a=null,s=null,u=null;if(zn(e)){const t=e.mnemonic;a=(0,c.arrayify)(An(t.phrase,t.locale||"en")),s=t.path||vn,u=t.locale||"en"}let l=r.client;l||(l="ethers.js");let f=null;f=r.salt?(0,c.arrayify)(r.salt):Pn(32);let d=null;if(r.iv){if(d=(0,c.arrayify)(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Pn(16);let h=null;if(r.uuid){if(h=(0,c.arrayify)(r.uuid),16!==h.length)throw new Error("invalid uuid")}else h=Pn(16);let p=1<<17,y=8,m=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(y=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Cn().scrypt(i,f,p,y,m,64,n).then((t=>{const r=(t=(0,c.arrayify)(t)).slice(0,16),n=t.slice(16,32),i=t.slice(32,64),g=new(Rn().Counter)(d),v=new(Rn().ModeOfOperation.ctr)(r,g),w=(0,c.arrayify)(v.encrypt(o)),A=(0,b.keccak256)((0,c.concat)([n,w])),S={address:e.address.substring(2).toLowerCase(),id:jn(h),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(d).substring(2)},ciphertext:(0,c.hexlify)(w).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(f).substring(2),n:p,dklen:32,p:m,r:y},mac:A.substring(2)}};if(a){const e=Pn(16),t=new(Rn().Counter)(e),r=new(Rn().ModeOfOperation.ctr)(i,t),n=(0,c.arrayify)(r.encrypt(a)),o=new Date,f=o.getUTCFullYear()+"-"+Bn(o.getUTCMonth()+1,2)+"-"+Bn(o.getUTCDate(),2)+"T"+Bn(o.getUTCHours(),2)+"-"+Bn(o.getUTCMinutes(),2)+"-"+Bn(o.getUTCSeconds(),2)+".0Z";S["x-ethers"]={client:l,gethFilename:"UTC--"+f+"--"+S.address,mnemonicCounter:(0,c.hexlify)(e).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(S)}))}(this,e,t,r)}static createRandom(e){let t=Pn(16);e||(e={}),e.extraEntropy&&(t=(0,c.arrayify)((0,c.hexDataSlice)((0,b.keccak256)((0,c.concat)([t,e.extraEntropy])),0,16)));const r=Sn(t,e.locale);return no.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return $n(e,t,r).then((e=>new no(e)))}static fromEncryptedJsonSync(e,t){return new no(eo(e,t))}static fromMnemonic(e,t,r){return t||(t=vn),new no(bn.fromMnemonic(e,null,r).derivePath(t))}}function oo(e,t){return er(Or(e),t)}function io(e,t,r,n){return er(Wr.hash(e,t,r),n)}const ao="0x0000000000000000000000000000000000000000";var so=r(1953);const uo="\u039e",co=new d.Logger("networks/5.7.1");function lo(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(o){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(o){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(o){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(o){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(o){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(o){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return lo(e)},t}function fo(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return fo(e,t)},r}const ho={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:lo("homestead")},po={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:lo("ropsten")},yo={chainId:63,name:"classicMordor",_defaultProvider:fo("https://www.ethercluster.com/mordor","classicMordor")},mo={unspecified:{chainId:0,name:"unspecified"},homestead:ho,mainnet:ho,morden:{chainId:2,name:"morden"},ropsten:po,testnet:po,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:lo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:lo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:lo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:lo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:fo("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:yo,classicTestnet:yo,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:fo("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:lo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:lo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function go(e){if(null==e)return null;if("number"===typeof e){for(const t in mo){const r=mo[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){const t=mo[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=mo[e.name];if(!t)return"number"!==typeof e.chainId&&co.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&co.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"===typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function vo(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function Ao(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let w=1;w>--u&1}const f=Math.pow(2,31),d=f>>>1,h=d>>1,p=f-1;let y=0;for(let w=0;w<31;w++)y=y<<1|l();let m=[],g=0,v=f;for(;;){let e=Math.floor(((y-g+1)*o-1)/v),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|l(),a=a<<1^d,s=(s^d)<<1|d|1;g=a,v=1+s-a}let b=n-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return b+256+(e[s++]<<8|e[s++]);case 1:return b+e[s++];default:return t-1}}))}(e))}function So(e){return 1&e?~e>>1:e>>1}function ko(e,t){let r=Array(e);for(let n=0,o=-1;nt[e])):r}function xo(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;on[t].push(e)));return n}function To(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wo(xo(o.length,1+e,t).map(((e,t)=>{const i=e[0],a=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,a.map((e=>e+o))]}))})))}function Po(e,t){return xo(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Oo=Ao(vo("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Ro=new Set(Eo(Oo)),Io=new Set(Eo(Oo)),Co=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(To(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Po(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let o=Eo(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let a=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:a,save:1==o,check:2==o}}()}(Oo),Bo=45,No=95;function Lo(e){return(0,F.dg)(e)}function jo(e){return e.filter((e=>65039!=e))}function Uo(e){for(let r of e.split(".")){let e=Lo(r);try{for(let t=e.lastIndexOf(No)-1;t>=0;t--)if(e[t]!==No)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Bo&&e[3]===Bo)throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(r,'": ').concat(t.message))}}return e}function Fo(e){return Uo(function(e,t){let r=Lo(e).reverse(),n=[];for(;r.length;){let e=Do(r);if(e){n.push(...t(e));continue}let o=r.pop();if(Ro.has(o)){n.push(o);continue}if(Io.has(o))continue;let i=Co[o];if(!i)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push(...i)}return Uo((o=String.fromCodePoint(...n),o.normalize("NFC")));var o}(e,jo))}function Do(e,t){var r;let n,o,i=Mo,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(i=null===(r=i.branches.find((e=>e.set.has(u))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=u;else if(i.check&&u===o)break;a.push(u),i.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),i.valid&&(n=a.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const zo=new d.Logger(Rr),qo=new Uint8Array(32);function Ho(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Vo(e){const t=(0,F.YW)(Fo(e)),r=[];if(0===e.length)return r;let n=0;for(let o=0;o=t.length)throw new Error("invalid ENS name; empty component");return r.push(Ho(t.slice(n))),r}function Ko(e){try{return 0!==Vo(e).length}catch(t){}return!1}function Wo(e){"string"!==typeof e&&zo.throwArgumentError("invalid ENS name; not a string","name",e);let t=qo;const r=Vo(e);for(;r.length;)t=(0,b.keccak256)((0,c.concat)([t,(0,b.keccak256)(r.pop())]));return(0,c.hexlify)(t)}function Go(e){return(0,c.hexlify)((0,c.concat)(Vo(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}qo.fill(0);var Xo=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Zo(e,t){return Xo(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:(0,c.arrayify)(new Uint8Array(o))}}))}var Qo=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Yo=new d.Logger("web/5.7.1");function Jo(e){return new Promise((t=>{setTimeout(t,e)}))}function $o(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,c.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,F._v)(e)}catch(r){}return(0,c.hexlify)(e)}return e}function ei(e,t,r){const n="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Yo.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"===typeof e?e.throttleCallback:null,i="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Yo.assertArgument(i>0&&i%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const a="object"===typeof e&&!!e.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,h=12e4;if("string"===typeof e)u=e;else if("object"===typeof e){if(null!=e&&null!=e.url||Yo.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"===typeof e.timeout&&e.timeout>0&&(h=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Yo.throwError("basic authentication requires a secure https url",d.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+bo((0,F.YW)(t))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=(0,f.shallowCopy)(e.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=u?u.match(p):null;if(y)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?vo(y[3]):(m=y[3],(0,F.YW)(m.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(w){Yo.throwError("processing response error",d.Logger.errors.SERVER_ERROR,{body:$o(y[1],y[2]),error:w,requestBody:null,requestMethod:"GET",url:u})}var m;t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const g={};Object.keys(s).forEach((e=>{const t=s[e];g[t.key]=t.value})),c.headers=g;const v=function(){let e=null;return{promise:new Promise((function(t,r){h&&(e=setTimeout((()=>{null!=e&&(e=null,r(Yo.makeError("timeout",d.Logger.errors.TIMEOUT,{requestBody:$o(c.body,g["content-type"]),requestMethod:c.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),b=function(){return Qo(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(v.cancel(),Yo.throwError("bad response",d.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:$o(s,t.headers?t.headers["content-type"]:null),requestBody:$o(c.body,g["content-type"]),requestMethod:c.method,url:u})),r)try{const e=yield r(s,t);return v.cancel(),e}catch(w){if(w.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=(0,f.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return ei(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,F._v)(e))}catch(o){Yo.throwError("invalid JSON",d.Logger.errors.SERVER_ERROR,{body:e,error:o})}return r&&(n=r(n,t)),n}))}function ri(e,t){return t||(t={}),null==(t=(0,f.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const a=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function o(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(u++,u>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));et.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){a()&&n(e)}))}()}))}var ni=r(72943),oi=r.n(ni);const ii="providers/5.7.2",ai=new d.Logger(ii);class si{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:i,type:u,accessList:si.allowNull(this.accessList.bind(this),null),blockHash:si.allowNull(i,null),blockNumber:si.allowNull(s,null),transactionIndex:si.allowNull(s,null),confirmations:si.allowNull(s,null),from:t,gasPrice:si.allowNull(r),maxPriorityFeePerGas:si.allowNull(r),maxFeePerGas:si.allowNull(r),gasLimit:r,to:si.allowNull(t,null),value:r,nonce:s,data:o,r:si.allowNull(this.uint256),s:si.allowNull(this.uint256),v:si.allowNull(s),creates:si.allowNull(t,null),raw:si.allowNull(o)},e.transactionRequest={from:si.allowNull(t),nonce:si.allowNull(s),gasLimit:si.allowNull(r),gasPrice:si.allowNull(r),maxPriorityFeePerGas:si.allowNull(r),maxFeePerGas:si.allowNull(r),to:si.allowNull(t),value:si.allowNull(r),data:si.allowNull((e=>this.data(e,!0))),type:si.allowNull(s),accessList:si.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:i,address:t,topics:si.arrayOf(i),data:o,logIndex:s,blockHash:i},e.receipt={to:si.allowNull(this.address,null),from:si.allowNull(this.address,null),contractAddress:si.allowNull(t,null),transactionIndex:s,root:si.allowNull(a),gasUsed:r,logsBloom:si.allowNull(o),blockHash:i,transactionHash:i,logs:si.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:si.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:si.allowNull(r),status:si.allowNull(s),type:u},e.block={hash:si.allowNull(i),parentHash:i,number:s,timestamp:s,nonce:si.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:si.allowNull(t),extraData:o,transactions:si.allowNull(si.arrayOf(i)),baseFeePerGas:si.allowNull(r)},e.blockWithTransactions=(0,f.shallowCopy)(e.block),e.blockWithTransactions.transactions=si.allowNull(si.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:si.allowNull(n,void 0),toBlock:si.allowNull(n,void 0),blockHash:si.allowNull(i,void 0),address:si.allowNull(t,void 0),topics:si.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:si.allowNull(s),blockHash:si.allowNull(i),transactionIndex:s,removed:si.allowNull(this.boolean.bind(this)),address:t,data:si.allowFalsish(o,"0x"),topics:si.arrayOf(i),transactionHash:i,logIndex:s},e}accessList(e){return nr(e||[])}number(e){return"0x"===e?0:l.gH.from(e).toNumber()}type(e){return"0x"===e||null==e?0:l.gH.from(e).toNumber()}bigNumber(e){return l.gH.from(e)}boolean(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,c.isHexString)(e))?e.toLowerCase():ai.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return B(e)}callAddress(e){if(!(0,c.isHexString)(e,32))return null;const t=B((0,c.hexDataSlice)(e,12));return t===ao?null:t}contractAddress(e){return j(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,c.isHexString)(e))return(0,c.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,c.hexDataLength)(r)?ai.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=l.gH.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!(0,c.isHexString)(e))throw new Error("invalid uint256");return(0,c.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=si.check(t,e);return n._difficulty=null==r?null:l.gH.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return si.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&l.gH.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=si.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,c.isHexString)(r)&&(r=l.gH.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,c.isHexString)(r)&&(r=l.gH.from(r).toNumber()),"number"!==typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!==typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return cr(e)}receiptLog(e){return si.check(this.formats.receiptLog,e)}receipt(e){const t=si.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=l.gH.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ai.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ai.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ai.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return si.check(this.formats.filter,e)}filterLog(e){return si.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const o in e)try{const n=e[o](t[o]);void 0!==n&&(r[o]=n)}catch(n){throw n.checkKey=o,n.checkValue=t[o],n}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function ui(e){return e&&"function"===typeof e.isCommunityResource}function ci(e){return ui(e)&&e.isCommunityResource()}let li=!1;function fi(){li||(li=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var di=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const hi=new d.Logger(ii);function pi(e){return null==e?"null":(32!==(0,c.hexDataLength)(e)&&hi.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function yi(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[pi(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return pi(e)})).join("&")}function mi(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,c.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+yi(e);if(Ge.isForkEvent(e))throw hi.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+yi(e.topics||[])}throw new Error("invalid event - "+e)}function gi(){return(new Date).getTime()}function vi(e){return new Promise((t=>{setTimeout(t,e)}))}const bi=["block","network","pending","poll"];class wi{constructor(e,t,r){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"listener",t),(0,f.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||bi.indexOf(this.tag)>=0}}const Ai={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Si(e){return(0,c.hexZeroPad)(l.gH.from(e).toHexString(),32)}function ki(e){return Xr.encode((0,c.concat)([e,(0,c.hexDataSlice)(Jr(Jr(e)),0,4)]))}const _i=new RegExp("^(ipfs)://(.*)$","i"),Ei=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),_i,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function xi(e,t){try{return(0,F._v)(Ti(e,t))}catch(r){}return null}function Ti(e,t){if("0x"===e)return null;const r=l.gH.from((0,c.hexDataSlice)(e,t,t+32)).toNumber(),n=l.gH.from((0,c.hexDataSlice)(e,r,r+32)).toNumber();return(0,c.hexDataSlice)(e,r+32,r+32+n)}function Pi(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):hi.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Oi(e){const t=(0,c.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Ri(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ii(e){const t=[];let r=0;for(let n=0;nl.gH.from(e).eq(1))).catch((e=>{if(e.code===d.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return di(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,c.hexConcat)([e,Wo(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,c.hexConcat)(["0x9061b923",Ii([Go(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,c.arrayify)(e).length%32===4&&hi.throwError("resolver threw error",d.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Ti(e,0)),e}catch(o){if(o.code===d.Logger.errors.CALL_EXCEPTION)return null;throw o}}))}_fetchBytes(e,t){return di(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Ti(r,0):null}))}_getAddress(e,t){const r=Ai[String(e)];if(null==r&&hi.throwError("unsupported coin type: ".concat(e),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,c.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ki((0,c.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ki((0,c.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=oi().toWords(n.slice(2));return e.unshift(t),oi().encode(r.prefix,e)}}return null}getAddress(e){return di(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===so.j?null:this.provider.formatter.callAddress(e)}catch(n){if(n.code===d.Logger.errors.CALL_EXCEPTION)return null;throw n}const t=yield this._fetchBytes("0xf1cb7e06",Si(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&hi.throwError("invalid or unsupported coin data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:t}),r}))}getAvatar(){return di(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return hi.throwError("invalid or unsupported content hash data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return di(this,void 0,void 0,(function*(){let t=(0,F.YW)(e);t=(0,c.concat)([Si(64),Si(t.length),t]),t.length%32!==0&&(t=(0,c.concat)([t,(0,c.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,c.hexlify)(t));return null==r||"0x"===r?null:(0,F._v)(r)}))}}let Mi=null,Bi=1;class Ni extends Xe{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,f.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,f.getStatic)(new.target,"getNetwork")(e);t?((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):hi.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return di(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||hi.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return ri((()=>this._ready().then((e=>e),(e=>{if(e.code!==d.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Mi&&(Mi=new si),Mi}static getNetwork(e){return go(null==e?"homestead":e)}ccipReadFetch(e,t,r){return di(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e=0?null:JSON.stringify({data:o,sender:n}),u=yield ti({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return hi.throwError("response not found during CCIP fetch: ".concat(c),d.Logger.errors.SERVER_ERROR,{url:t,errorMessage:c});i.push(c)}return hi.throwError("error encountered during CCIP fetch: ".concat(i.map((e=>JSON.stringify(e))).join(", ")),d.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return di(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(gi()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}const t=gi(),r=(0,f.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((e=>{let{blockNumber:n,networkError:o}=e;if(o)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),o;const i=gi();return n=l.gH.from(n).toNumber(),n{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return di(this,void 0,void 0,(function*(){const e=Bi++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){return void this.emit("error",n)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)hi.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",hi.makeError("network block skew detected",d.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return di(this,void 0,void 0,(function*(){return hi.throwError("provider does not support network detection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return di(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield vi(0),this._network;const r=hi.makeError("underlying network changed",d.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=gi();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&ðis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return di(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return di(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},c=e=>{e.confirmations{this.removeListener(e,c)})),n){let r=n.startBlock,o=null;const c=a=>di(this,void 0,void 0,(function*(){s||(yield vi(1e3),this.getTransactionCount(n.from).then((l=>di(this,void 0,void 0,(function*(){if(!s){if(l<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"===typeof r&&r>0){const e=setTimeout((()=>{u()||i(hi.makeError("timeout exceeded",d.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return di(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return l.gH.from(e)}catch(t){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return l.gH.from(n)}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o})}}))}getTransactionCount(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return l.gH.from(n).toNumber()}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o})}}))}getCode(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,c.hexlify)(n)}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:o})}}))}getStorageAt(e,t,r){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>(0,c.hexValue)(e)))}),o=yield this.perform("getStorageAt",n);try{return(0,c.hexlify)(o)}catch(i){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:i})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,c.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&hi.throwError("Transaction hash mismatch from Provider.sendTransaction.",d.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>di(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&hi.throwError("transaction failed",d.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,c.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}}))}_getTransactionRequest(e){return di(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?l.gH.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,c.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,f.resolveProperties)(r))}))}_getFilter(e){return di(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,f.resolveProperties)(t))}))}_call(e,t,r){return di(this,void 0,void 0,(function*(){r>=10&&hi.throwError("CCIP read exceeded maximum redirections",d.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&(0,c.hexDataLength)(o)%32===4)try{const i=(0,c.hexDataSlice)(o,4),a=(0,c.hexDataSlice)(i,0,32);l.gH.from(a).eq(n)||hi.throwError("CCIP Read sender did not match",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const s=[],u=l.gH.from((0,c.hexDataSlice)(i,32,64)).toNumber(),f=l.gH.from((0,c.hexDataSlice)(i,u,u+32)).toNumber(),h=(0,c.hexDataSlice)(i,u+32);for(let t=0;tdi(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ri((()=>di(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ri((()=>di(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,f.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),si.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return di(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return di(this,void 0,void 0,(function*(){if("number"===typeof(e=yield e)&&e<0){e%1&&hi.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return di(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Ci(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return di(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||hi.throwError("network does not support ENS",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Wo(e).substring(2)});return this.formatter.callAddress(t)}catch(n){}return null}))}resolveName(e){return di(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if((0,c.isHexString)(e))throw r}"string"!==typeof e&&hi.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return di(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=xi(yield this.call({to:r,data:"0x691f3431"+Wo(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return di(this,void 0,void 0,(function*(){let t=null;if((0,c.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(r,"getAvatar");if(!o)return null;t=new Ci(this,o,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n}try{const e=xi(yield this.call({to:o,data:"0x691f3431"+Wo(r).substring(2)}),0);t=yield this.getResolver(e)}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return hi.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new wi(mi(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;ne.tag!==a||(setTimeout((()=>{e.listener.apply(this,r)}),0),o=!0,!e.once||(i.push(e),!1)))),i.forEach((e=>{this._stopEvent(e)})),o}listenerCount(e){if(!e)return this._events.length;let t=mi(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=mi(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=mi(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=mi(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Li=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ji=new d.Logger(ii),Ui=["call","estimateGas"];function Fi(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){const r=(0,c.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===typeof e){for(const r in e){const n=Fi(e[r],t);if(n)return n}return null}if("string"===typeof e)try{return Fi(JSON.parse(e),t)}catch(r){}return null}function Di(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Fi(t,!0);if(e)return e.data;ji.throwError("missing revert data in call exception; Transaction reverted without a reason string",d.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Fi(t.body,!1);null==r&&(r=Fi(t,!1)),r&&ji.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?o=t.error.message:"string"===typeof t.body?o=t.body:"string"===typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ji.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&ji.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ji.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&ji.throwError("legacy pre-eip-155 transactions not supported",d.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Ui.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ji.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function zi(e){return new Promise((function(t){setTimeout(t,e)}))}function qi(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Hi(e){return e?e.toLowerCase():e}const Vi={};class Ki extends $e{constructor(e,t,r){if(super(),e!==Vi)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,f.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"===typeof r?((0,f.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,f.defineReadOnly)(this,"_index",null)):"number"===typeof r?((0,f.defineReadOnly)(this,"_index",r),(0,f.defineReadOnly)(this,"_address",null)):ji.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ji.throwError("cannot alter JSON-RPC Signer connection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Wi(Vi,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&ji.throwError("unknown account #"+this._index,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,f.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=(0,f.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Li(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ji.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,f.resolveProperties)({tx:(0,f.resolveProperties)(e),sender:t}).then((t=>{let{tx:r,sender:n}=t;null!=r.from?r.from.toLowerCase()!==n&&ji.throwArgumentError("from address mismatch","transaction",e):r.from=n;const o=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then((e=>e),(e=>("string"===typeof e.message&&e.message.match(/user denied/i)&&ji.throwError("user rejected transaction",d.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),Di("sendTransaction",e,o))))}))}signTransaction(e){return ji.throwError("signing transactions is unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Li(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield ri((()=>Li(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}}))}signMessage(e){return Li(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,F.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,c.hexlify)(t),r.toLowerCase()])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),n}}))}_legacySignMessage(e){return Li(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,F.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,c.hexlify)(t)])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),n}}))}_signTypedData(e,t,r){return Li(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Wr.getPayload(n.domain,t,n.value))])}catch(i){throw"string"===typeof i.message&&i.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),i}}))}unlock(e){return Li(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Wi extends Ki{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Gi={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Xi extends Ni{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,f.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof e?(0,f.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,f.defineReadOnly)(this,"connection",Object.freeze((0,f.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Li(this,void 0,void 0,(function*(){yield zi(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const r=(0,f.getStatic)(this.constructor,"getNetwork");try{return r(l.gH.from(e).toNumber())}catch(t){return ji.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ji.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Ki(Vi,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,f.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=ti(this.connection,JSON.stringify(r),qi).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hi(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hi(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Hi(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hi(t.address),(0,c.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Hi(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Li(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&l.gH.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,f.shallowCopy)(t)).transaction=(0,f.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ji.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(n){return Di(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return zi(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,f.shallowCopy)(Gi);if(t)for(const o in t)t[o]&&(r[o]=!0);(0,f.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,c.hexValue)(l.gH.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,c.hexlify)(e[t]))})),e.accessList&&(n.accessList=nr(e.accessList)),n}}let Zi=null;try{if(Zi=WebSocket,null==Zi)throw new Error("inject please")}catch(Ss){const e=new d.Logger(ii);Zi=function(){e.throwError("WebSockets not supported in this environment",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Qi=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Yi=new d.Logger(ii);let Ji=1;class $i extends Xi{constructor(e,t){"any"===t&&Yi.throwError("WebSocketProvider does not support 'any' network yet",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"===typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"===typeof e?(0,f.defineReadOnly)(this,"_websocket",new Zi(this.connection.url)):(0,f.defineReadOnly)(this,"_websocket",e),(0,f.defineReadOnly)(this,"_requests",{}),(0,f.defineReadOnly)(this,"_subs",{}),(0,f.defineReadOnly)(this,"_subIds",{}),(0,f.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,f.defineReadOnly)(e,"code",r.error.code||null),(0,f.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Yi.throwError("cannot reset events block on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Yi.throwError("cannot set polling interval on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Qi(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Yi.throwError("cannot set polling on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=Ji++;return new Promise(((n,o)=>{const i=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(i),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?o(e):n(t)},payload:i},this._wsReady&&this.websocket.send(i)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return Qi(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const o=yield n;this._subs[o]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=l.gH.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Qi(this,void 0,void 0,(function*(){this.websocket.readyState===Zi.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var ea=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ta=new d.Logger(ii);class ra extends Xi{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return ea(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||ta.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t}))}}class na extends ra{constructor(e,t){ta.checkAbstract(new.target,na),e=(0,f.getStatic)(new.target,"getNetwork")(e),t=(0,f.getStatic)(new.target,"getApiKey")(t);super((0,f.getStatic)(new.target,"getUrl")(e,t),e),"string"===typeof t?(0,f.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,f.defineReadOnly)(this,e,t[e])}))}_startPending(){ta.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return ta.throwError("API provider does not support signing",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return ta.throwError("not implemented; sub-classes must override getUrl",d.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const oa=new d.Logger(ii),ia="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class aa extends $i{constructor(e,t){const r=new sa(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,f.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===ia}}class sa extends na{static getWebSocketProvider(e,t){return new aa(e,t)}static getApiKey(e){return null==e?ia:(e&&"string"!==typeof e&&oa.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:oa.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===ia&&fi(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===ia}}const ua=new d.Logger(ii),ca="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function la(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return ua.throwArgumentError("unsupported network","name",e)}class fa extends na{isCommunityResource(){return this.apiKey===ca}static getApiKey(e){return null==e?ca:e}static getUrl(e,t){null==t&&(t=ca);const r={allowGzip:!0,url:"https://"+la(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===ca&&fi(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}var da=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ha=new d.Logger(ii);class pa extends na{static getApiKey(e){return null!=e&&ha.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else ha.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return da(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,e,t)}))}}var ya=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ma=new d.Logger(ii);function ga(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,c.hexValue)((0,c.hexlify)(n)):"accessList"===r?"["+nr(n).map((e=>'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}'))).join(",")+"]":(0,c.hexlify)(n),t[r]=n)}return t}function va(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function ba(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function wa(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Aa(e,t,r){if("call"===e&&t.code===d.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,c.isHexString)(r))return r;ma.throwError("missing revert data in call exception",d.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?n=t.error.message:"string"===typeof t.body?n=t.body:"string"===typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ma.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ma.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&ma.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ma.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Sa extends Ni{constructor(e,t){super(e),(0,f.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,f.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ma.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}getPostUrl(){return"".concat(this.baseUrl,"/api")}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return ya(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,i="proxy"===e?ba:va;this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&fi(),Promise.resolve(!0))};let s=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(o).map((e=>"".concat(e,"=").concat(o[e]))).join("&"));const u=yield ti(a,s,i||ba);return this.emit("debug",{action:"response",request:n,response:(0,f.deepCopy)(u),provider:this}),u}))}detectNetwork(){return ya(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return ya(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>Aa("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=ga(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(Ss){return Aa("call",Ss,t.transaction)}}case"estimateGas":{const e=ga(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(Ss){return Aa("estimateGas",Ss,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=wa(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=wa(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ma.throwError("unsupported topic count",d.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"===typeof r&&66===r.length||ma.throwError("unsupported topic format",d.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let t=0;t{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}function ka(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var _a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Ea=new d.Logger(ii);function xa(){return(new Date).getTime()}function Ta(e){let t=null;for(let r=0;rt?null:(n+o)/2}function Oa(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(l.gH.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Oa(e))));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"===typeof r?"[function]":Oa(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Ra=1;function Ia(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const Ca=[d.Logger.errors.CALL_EXCEPTION,d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED,d.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Ma=["address","args","errorArgs","errorSignature","method","transaction"];function Ba(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Na(e,t,r){let n=Oa;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=Pa(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Pa(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).confirmations=-1,Oa(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,f.shallowCopy)(e)).confirmations=-1,e))),Oa(e))}:function(e){return null==e?null:Oa(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const o=Object.keys(n);for(let e=0;e=t)return r.result}}}(n,e.quorum)}function La(e,t){return _a(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:ri((()=>new Promise(((n,o)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function ja(e,t,r,n){return _a(this,void 0,void 0,(function*(){let o=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return o[r]();case"getEtherPrice":if(o.getEtherPrice)return o.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),"call"===r&&n.blockTag?o[r](n.transaction,n.blockTag):o[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return o[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,c.isHexString)(r.fromBlock)||r.toBlock&&(0,c.isHexString)(r.toBlock))&&(o=yield La(e,t)),o.getLogs(r)}}return Ea.throwError("unknown method error",d.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Ua extends Ni{constructor(e,t){0===e.length&&Ea.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(Xe.isProvider(e)){const t=ci(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,f.shallowCopy)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=ci(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Ea.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&Ea.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let o=Ta(r.map((e=>e.provider.network)));null==o&&(o=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(o),(0,f.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,f.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return _a(this,void 0,void 0,(function*(){return Ta(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return _a(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;te.priority-t.priority));const o=this._highestBlockNumber;let i=0,a=!0;for(;;){const s=xa();let u=n.filter((e=>e.runner&&s-e.starte+t.weight),0);for(;u{r.staller=null})),r.runner=ja(r,o,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,xa()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,xa()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,null),request:{method:e,params:(0,f.deepCopy)(t)},provider:this}),u+=r.weight}const c=[];n.forEach((e=>{!e.done&&e.runner&&(c.push(e.runner),e.staller&&c.push(e.staller.getPromise()))})),c.length&&(yield Promise.race(c));const l=n.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=r(l);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield Ia(100).getPromise()),a=!1}const d=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Ca.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,o={};Ma.forEach((e=>{null!=r[e]&&(o[e]=r[e])})),Ea.throwError(r.reason||r.message,e,o)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),Ea.throwError("failed to meet quorum",d.Logger.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ba(e))),provider:this})}))}}const Fa=null,Da=new d.Logger(ii),za="84842078b09946638c03157f83405213";class qa extends $i{constructor(e,t){const r=new Ha(e,t),n=r.connection;n.password&&Da.throwError("INFURA WebSocket project secrets unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,f.defineReadOnly)(this,"apiKey",r.projectId),(0,f.defineReadOnly)(this,"projectId",r.projectId),(0,f.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===za}}class Ha extends na{static getWebSocketProvider(e,t){return new qa(e,t)}static getApiKey(e){const t={apiKey:za,projectId:za,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(Da.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Da.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Da.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===za&&fi(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===za}}class Va extends Xi{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},o=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,f.deepCopy)(t),provider:this}),ti(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),o}}const Ka=new d.Logger(ii);class Wa extends na{static getApiKey(e){return e&&"string"!==typeof e&&Ka.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Ka.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ka.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Ga=new d.Logger(ii),Xa="62e1ad51b37b8e00394bda3b";class Za extends na{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Xa:"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Ga.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Ga.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(t.applicationId)};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===Xa}}const Qa=new d.Logger(ii);let Ya=1;function Ja(e,t){const r="Web3LegacyFetcher";return function(e,n){const o={method:e,params:n,id:Ya++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,f.deepCopy)(o),provider:this}),t(o,((t,i)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:i,provider:this}),i.error){const e=new Error(i.error.message);return e.code=i.error.code,e.data=i.error.data,n(e)}e(i.result)}))}))}}class $a extends Xi{constructor(e,t){null==e&&Qa.throwArgumentError("missing provider","provider",e);let r=null,n=null,o=null;"function"===typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),o=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,f.deepCopy)(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=Ja(0,e.sendAsync.bind(e)):e.send?n=Ja(0,e.send.bind(e)):Qa.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,f.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,f.defineReadOnly)(this,"provider",o)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const es=new d.Logger(ii);function ts(e,t){if(null==e&&(e="homestead"),"string"===typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new Xi(e);case"ws":case"wss":return new $i(e);default:es.throwArgumentError("unsupported URL scheme","network",e)}}const r=go(e);return r&&r._defaultProvider||es.throwError("unsupported getDefaultProvider network",d.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Ua,AlchemyProvider:sa,AnkrProvider:fa,CloudflareProvider:pa,EtherscanProvider:Sa,InfuraProvider:Ha,JsonRpcProvider:Xi,NodesmithProvider:Wa,PocketProvider:Za,Web3Provider:$a,IpcProvider:Fa},t)}const rs=new RegExp("^bytes([0-9]+)$"),ns=new RegExp("^(u?int)([0-9]*)$"),os=new RegExp("^(.*)\\[([0-9]*)\\]$"),is="0000000000000000000000000000000000000000000000000000000000000000",as=new d.Logger("solidity/5.7.0");function ss(e,t,r){switch(e){case"address":return r?(0,c.zeroPad)(t,32):(0,c.arrayify)(t);case"string":return(0,F.YW)(t);case"bytes":return(0,c.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,c.zeroPad)(t,32):(0,c.arrayify)(t)}let n=e.match(ns);if(n){let o=parseInt(n[2]||"256");return(n[2]&&String(o)!==n[2]||o%8!==0||0===o||o>256)&&as.throwArgumentError("invalid number type","type",e),r&&(o=256),t=l.gH.from(t).toTwos(o),(0,c.zeroPad)(t,o/8)}if(n=e.match(rs),n){const o=parseInt(n[1]);return(String(o)!==n[1]||0===o||o>32)&&as.throwArgumentError("invalid bytes type","type",e),(0,c.arrayify)(t).byteLength!==o&&as.throwArgumentError("invalid value for ".concat(e),"value",t),r?(0,c.arrayify)((t+is).substring(0,66)):t}if(n=e.match(os),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&as.throwArgumentError("invalid array length for ".concat(e),"value",t);const o=[];return t.forEach((function(e){o.push(ss(r,e,!0))})),(0,c.concat)(o)}return as.throwArgumentError("invalid type","type",e)}function us(e,t){e.length!=t.length&&as.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(ss(e,t[n]))})),(0,c.hexlify)((0,c.concat)(r))}function cs(e,t){return(0,b.keccak256)(us(e,t))}function ls(e,t){return Jr(us(e,t))}var fs=r(72680),ds=r(82844);const hs=new d.Logger("units/5.7.0"),ps=["wei","kwei","mwei","gwei","szabo","finney","ether"];function ys(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&hs.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let o="";for(2===t.length&&(o="."+(t[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const i=[];for(;r.length;){if(r.length<=3){i.unshift(r);break}{const e=r.length-3;i.unshift(r.substring(e)),r=r.substring(0,e)}}return n+i.join(",")+o}function ms(e,t){if("string"===typeof t){const e=ps.indexOf(t);-1!==e&&(t=3*e)}return(0,Tr.gn)(e,null!=t?t:18)}function gs(e,t){if("string"!==typeof e&&hs.throwArgumentError("value must be a string","value",e),"string"===typeof t){const e=ps.indexOf(t);-1!==e&&(t=3*e)}return(0,Tr.gs)(e,null!=t?t:18)}function vs(e){return ms(e,18)}function bs(e){return gs(e,18)}const ws="ethers/5.7.2",As=new d.Logger(ws);try{const e=window;null==e._ethers&&(e._ethers=u)}catch(Ss){}},89262:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o{var r;t=e.exports=J,r="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:"/allbridge-example-react",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:"/allbridge-example-react",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=n-6,a=t.re=[],s=t.safeRe=[],u=t.src=[],c=0,l="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",n],[l,i]];function d(e){for(var t=0;t)?=?)";var O=c++;u[O]=u[p]+"|x|X|\\*";var R=c++;u[R]=u[h]+"|x|X|\\*";var I=c++;u[I]="[v=\\s]*("+u[R]+")(?:\\.("+u[R]+")(?:\\.("+u[R]+")(?:"+u[w]+")?"+u[k]+"?)?)?";var C=c++;u[C]="[v=\\s]*("+u[O]+")(?:\\.("+u[O]+")(?:\\.("+u[O]+")(?:"+u[A]+")?"+u[k]+"?)?)?";var M=c++;u[M]="^"+u[P]+"\\s*"+u[I]+"$";var B=c++;u[B]="^"+u[P]+"\\s*"+u[C]+"$";var N=c++;u[N]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var L=c++;u[L]="(?:~>?)";var j=c++;u[j]="(\\s*)"+u[L]+"\\s+",a[j]=new RegExp(u[j],"g"),s[j]=new RegExp(d(u[j]),"g");var U=c++;u[U]="^"+u[L]+u[I]+"$";var F=c++;u[F]="^"+u[L]+u[C]+"$";var D=c++;u[D]="(?:\\^)";var z=c++;u[z]="(\\s*)"+u[D]+"\\s+",a[z]=new RegExp(u[z],"g"),s[z]=new RegExp(d(u[z]),"g");var q=c++;u[q]="^"+u[D]+u[I]+"$";var H=c++;u[H]="^"+u[D]+u[C]+"$";var V=c++;u[V]="^"+u[P]+"\\s*("+x+")$|^$";var K=c++;u[K]="^"+u[P]+"\\s*("+E+")$|^$";var W=c++;u[W]="(\\s*)"+u[P]+"\\s*("+x+"|"+u[I]+")",a[W]=new RegExp(u[W],"g"),s[W]=new RegExp(d(u[W]),"g");var G=c++;u[G]="^\\s*("+u[I]+")\\s+-\\s+("+u[I]+")\\s*$";var X=c++;u[X]="^\\s*("+u[C]+")\\s+-\\s+("+u[C]+")\\s*$";var Z=c++;u[Z]="(<|>)?=?\\s*\\*";for(var Q=0;Q<35;Q++)r(Q,u[Q]),a[Q]||(a[Q]=new RegExp(u[Q]),s[Q]=new RegExp(d(u[Q])));function Y(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J)return e;if("string"!==typeof e)return null;if(e.length>n)return null;if(!(t.loose?s[T]:s[_]).test(e))return null;try{return new J(e,t)}catch(r){return null}}function J(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J){if(e.loose===t.loose)return e;e=e.version}else if("string"!==typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof J))return new J(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?s[T]:s[_]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"===typeof r&&(n=r,r=void 0);try{return new J(e,r).inc(t,n).version}catch(o){return null}},t.diff=function(e,t){if(oe(e,t))return null;var r=Y(e),n=Y(t),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return o+a;return i},t.compareIdentifiers=ee;var $=/^[0-9]+$/;function ee(e,t){var r=$.test(e),n=$.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function ne(e,t,r){return te(e,t,r)<0}function oe(e,t,r){return 0===te(e,t,r)}function ie(e,t,r){return 0!==te(e,t,r)}function ae(e,t,r){return te(e,t,r)>=0}function se(e,t,r){return te(e,t,r)<=0}function ue(e,t,r,n){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e===r;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return oe(e,r,n);case"!=":return ie(e,r,n);case">":return re(e,r,n);case">=":return ae(e,r,n);case"<":return ne(e,r,n);case"<=":return se(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function ce(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ce){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof ce))return new ce(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===le?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return ee(t,e)},t.major=function(e,t){return new J(e,t).major},t.minor=function(e,t){return new J(e,t).minor},t.patch=function(e,t){return new J(e,t).patch},t.compare=te,t.compareLoose=function(e,t){return te(e,t,!0)},t.rcompare=function(e,t,r){return te(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compare(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.rcompare(e,n,r)}))},t.gt=re,t.lt=ne,t.eq=oe,t.neq=ie,t.gte=ae,t.lte=se,t.cmp=ue,t.Comparator=ce;var le={};function fe(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof fe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new fe(e.raw,t);if(e instanceof ce)return new fe(e.value,t);if(!(this instanceof fe))return new fe(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function de(e){return!e||"x"===e.toLowerCase()||"*"===e}function he(e,t,r,n,o,i,a,s,u,c,l,f,d){return((t=de(r)?"":de(n)?">="+r+".0.0":de(o)?">="+r+"."+n+".0":">="+t)+" "+(s=de(u)?"":de(c)?"<"+(+u+1)+".0.0":de(l)?"<"+u+"."+(+c+1)+".0":f?"<="+u+"."+c+"."+l+"-"+f:"<="+s)).trim()}function pe(e,t,n){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function ye(e,t,r){try{t=new fe(t,r)}catch(n){return!1}return t.test(e)}function me(e,t,r,n){var o,i,a,s,u;switch(e=new J(e,n),t=new fe(t,n),r){case">":o=re,i=se,a=ne,s=">",u=">=";break;case"<":o=ne,i=ae,a=re,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ye(e,t,n))return!1;for(var c=0;c=0.0.0")),f=f||e,d=d||e,o(e.semver,f.semver,n)?f=e:a(e.semver,d.semver,n)&&(d=e)})),f.operator===s||f.operator===u)return!1;if((!d.operator||d.operator===s)&&i(e,d.semver))return!1;if(d.operator===u&&a(e,d.semver))return!1}return!0}ce.prototype.parse=function(e){var t=this.options.loose?s[V]:s[K],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new J(r[2],this.options.loose):this.semver=le},ce.prototype.toString=function(){return this.value},ce.prototype.test=function(e){return r("Comparator.test",e,this.options.loose),this.semver===le||("string"===typeof e&&(e=new J(e,this.options)),ue(e,this.operator,this.semver,this.options))},ce.prototype.intersects=function(e,t){if(!(e instanceof ce))throw new TypeError("a Comparator is required");var r;if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return r=new fe(e.value,t),ye(this.value,r,t);if(""===e.operator)return r=new fe(this.value,t),ye(e.semver,r,t);var n=(">="===this.operator||">"===this.operator)&&(">="===e.operator||">"===e.operator),o=("<="===this.operator||"<"===this.operator)&&("<="===e.operator||"<"===e.operator),i=this.semver.version===e.semver.version,a=(">="===this.operator||"<="===this.operator)&&(">="===e.operator||"<="===e.operator),s=ue(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=ue(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&a||s||u},t.Range=fe,fe.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},fe.prototype.toString=function(){return this.range},fe.prototype.parseRange=function(e){var t=this.options.loose,n=t?s[X]:s[G];e=e.replace(n,he),r("hyphen replace",e),e=e.replace(s[W],"$1$2$3"),r("comparator trim",e,s[W]),e=(e=e.replace(s[j],"$1~")).replace(s[z],"$1^");var o=t?s[V]:s[K],i=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?s[H]:s[q];return e.replace(n,(function(t,n,o,i,a){var s;return r("caret",e,t,n,o,i,a),de(n)?s="":de(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":de(i)?s="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),r("caret return",s),s}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?s[F]:s[U];return e.replace(n,(function(t,n,o,i,a){var s;return r("tilde",e,t,n,o,i,a),de(n)?s="":de(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":de(i)?s=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(r("replaceTilde pr",a),s=">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0"):s=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",r("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?s[B]:s[M];return e.replace(n,(function(t,n,o,i,a,s){r("xRange",e,t,n,o,i,a,s);var u=de(o),c=u||de(i),l=c||de(a);return"="===n&&l&&(n=""),u?t=">"===n||"<"===n?"<0.0.0":"*":n&&l?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),t=n+o+"."+i+"."+a):c?t=">="+o+".0.0 <"+(+o+1)+".0.0":l&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),r("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(s[Z],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(o)}))),i=i.map((function(e){return new ce(e,this.options)}),this)},fe.prototype.intersects=function(e,t){if(!(e instanceof fe))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return e.set.some((function(e){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new fe(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},fe.prototype.test=function(e){if(!e)return!1;"string"===typeof e&&(e=new J(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!re(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new fe(e,t).range||"*"}catch(r){return null}},t.ltr=function(e,t,r){return me(e,t,"<",r)},t.gtr=function(e,t,r){return me(e,t,">",r)},t.outside=me,t.prerelease=function(e,t){var r=Y(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new fe(e,r),t=new fe(t,r),e.intersects(t)},t.coerce=function(e){if(e instanceof J)return e;if("string"!==typeof e)return null;var t=e.match(s[N]);if(null==t)return null;return Y(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},31752:(e,t,r)=>{var n,o=r(43693).default;self,n=()=>(()=>{var e={6263:function(e){var t;t=()=>(()=>{var e={899:(e,t,r)=>{const n=r(10);e.exports=n},10:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>F,Bool:()=>C,Double:()=>R,Enum:()=>H,Float:()=>O,Hyper:()=>E,Int:()=>A,LargeInt:()=>_,Opaque:()=>L,Option:()=>z,Quadruple:()=>I,Reference:()=>V,String:()=>B,Struct:()=>K,Union:()=>G,UnsignedHyper:()=>P,UnsignedInt:()=>T,VarArray:()=>D,VarOpaque:()=>U,Void:()=>q,config:()=>re});class n extends TypeError{constructor(e){super("XDR Write Error: ".concat(e))}}class i extends TypeError{constructor(e){super("XDR Read Error: ".concat(e))}}class a extends TypeError{constructor(e){super("XDR Type Definition Error: ".concat(e))}}class s extends a{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var u=r(764).lW;class c{constructor(e){if(o(this,"_buffer",void 0),o(this,"_length",void 0),o(this,"_index",void 0),!u.isBuffer(e)){if(!(e instanceof Array))throw new i("source not specified");e=u.from(e)}this._buffer=e,this._length=e.length,this._index=0}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)}}o(d,"bufferChunkSize",f);var h=r(764).lW;class p{toXDR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,e);const t=new d;return this.write(this,t),v(t.finalize(),e)}fromXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(e,t);const r=new c(b(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";const r=new d;return this.write(e,r),v(r.finalize(),t)}static fromXDR(e){const t=new c(b(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw")),r=this.read(t);return t.ensureInputConsumed(),r}static validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class y extends p{static read(e){throw new s}static write(e,t){throw new s}static isValid(e){return!1}}class m extends p{isValid(e){return!1}}class g extends TypeError{constructor(e){super("Invalid format ".concat(e,', must be one of "raw", "hex", "base64"'))}}function v(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new g(t)}}function b(e,t){switch(t){case"raw":return e;case"hex":return h.from(e,"hex");case"base64":return h.from(e,"base64");default:throw new g(t)}}const w=2147483647;class A extends y{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<=w}}function S(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 (".concat(e,") and slice size (").concat(t," -> ").concat(r,") combination"));const o=BigInt(r),i=new Array(n);for(let a=0;a>=o;return i}function k(e,t){if(t)return[0n,(1n<=i&&o<=a)return o;throw new TypeError("bigint values [".concat(e,"] for ").concat(function(e,t){return"".concat(t?"u":"i").concat(e)}(t,r)," out of range [").concat(i,", ").concat(a,"]: ").concat(o))}(e,this.size,this.unsigned)}get unsigned(){throw new s}get size(){throw new s}slice(e){return S(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)}}E.defineIntBoundaries();const x=4294967295;class T extends y{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}}T.MAX_VALUE=x,T.MIN_VALUE=0;class P extends _{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}P.defineIntBoundaries();class O extends y{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 R extends y{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 I extends y{static read(){throw new a("quadruple not supported")}static write(){throw new a("quadruple not supported")}static isValid(){return!1}}class C extends y{static read(e){const t=A.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new i("got ".concat(t," when trying to read a bool"))}}static write(e,t){const r=e?1:0;A.write(r,t)}static isValid(e){return"boolean"==typeof e}}var M=r(764).lW;class B extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length String, max allowed is ").concat(this._maxLength));return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?M.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?M.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||M.isBuffer(e))&&e.length<=this._maxLength}}var N=r(764).lW;class L extends m{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 ".concat(e.length," bytes, expected ").concat(this._length));t.write(e,r)}isValid(e){return N.isBuffer(e)&&e.length===this._length}}var j=r(764).lW;class U extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarOpaque, max allowed is ").concat(this._maxLength));return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return j.isBuffer(e)&&e.length<=this._maxLength}}class F extends m{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:T.MAX_VALUE;super(),this._childType=e,this._maxLength=t}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarArray, max allowed is ").concat(this._maxLength));const r=new Array(t);for(let n=0;nthis._maxLength)throw new n("got array of size ".concat(e.length,", max allowed is ").concat(this._maxLength));T.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 z extends y{constructor(e){super(),this._childType=e}read(e){if(C.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;C.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class q extends y{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 H extends y{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=A.read(e),r=this._byValue[t];if(void 0===r)throw new i("unknown ".concat(this.enumName," member for value ").concat(t));return r}static write(e,t){if(!(e instanceof this))throw new n("unknown ".concat(e," is not a ").concat(this.enumName));A.write(e.value,t)}static isValid(e){return e instanceof 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("".concat(e," is not a member of ").concat(this.enumName));return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError("".concat(e," is not a value of any member of ").concat(this.enumName));return t}static create(e,t,r){const n=class extends H{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[o,i]of Object.entries(r)){const e=new n(o,i);n._members[o]=e,n._byValue[i]=e,n[o]=()=>e}return n}}class V extends y{resolve(){throw new a('"resolve" method should be implemented in the descendant class')}}class K 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(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.structName));for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends K{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:this._arm;if(this._arm!==q&&this._arm!==e)throw new TypeError("".concat(e," not set"));return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError("Bad union switch: ".concat(e))}static armTypeForArm(e){return e===q?q:this._arms[e]}static read(e){const t=this._switchOn.read(e),r=this.armForSwitch(t),n=r===q?q:this._arms[r];let o;return o=void 0!==n?n.read(e):r.read(e),new this(t,o)}static write(e,t){if(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.unionName));this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends G{};n.unionName=t,e.results[t]=n,r.switchOn instanceof V?n._switchOn=r.switchOn.resolve(e):n._switchOn=r.switchOn,n._switches=new Map,n._arms={};let o=r.defaultArm;o instanceof V&&(o=o.resolve(e)),n._defaultArm=o;for(const[i,a]of r.switches){const e="string"==typeof i?n._switchOn.fromName(i):i;n._switches.set(e,a)}if(void 0!==n._switchOn.values)for(const i of n._switchOn.values())n[i.name]=function(e){return new n(i,e)},n.prototype[i.name]=function(e){return this.set(i,e)};if(r.arms)for(const[i,a]of Object.entries(r.arms))n._arms[i]=a instanceof V?a.resolve(e):a,a!==q&&(n.prototype[i]=function(){return this.get(i)});return n}}class X extends V{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class Z extends V{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.childReference=e,this.length=t,this.variable=r}resolve(e){let t=this.childReference,r=this.length;return t instanceof V&&(t=t.resolve(e)),r instanceof V&&(r=r.resolve(e)),this.variable?new D(t,r):new F(t,r)}}class Q extends V{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof V&&(t=t.resolve(e)),new z(t)}}class Y extends V{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof V&&(t=t.resolve(e)),new this.sizedType(t)}}class J{constructor(e,t,r){this.constructor=e,this.name=t,this.config=r}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function $(e,t,r){return r instanceof V&&(r=r.resolve(e)),e.results[t]=r,r}function ee(e,t,r){return e.results[t]=r,r}class te{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const r=new J(H.create,e,t);this.define(e,r)}struct(e,t){const r=new J(K.create,e,t);this.define(e,r)}union(e,t){const r=new J(G.create,e,t);this.define(e,r)}typedef(e,t){const r=new J($,e,t);this.define(e,r)}const(e,t){const r=new J(ee,e,t);this.define(e,r)}void(){return q}bool(){return C}int(){return A}hyper(){return E}uint(){return T}uhyper(){return P}float(){return O}double(){return R}quadruple(){return I}string(e){return new Y(B,e)}opaque(e){return new Y(L,e)}varOpaque(e){return new Y(U,e)}array(e,t){return new Z(e,t)}varArray(e,t){return new Z(e,t,!0)}option(e){return new Q(e)}define(e,t){if(void 0!==this._destination[e])throw new a("".concat(e," is already defined"));this._definitions[e]=t}lookup(e){return new X(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){const r=new te(t);e(r),r.resolve()}return t}},742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(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,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(e,t,r)=>{"use strict";const n=r(742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const a=2147483647;function s(e){if(e>a)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 f(e)}return c(e,t,r)}function c(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=s(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(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(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(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(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|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(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 l(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 f(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(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 W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:W(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 R(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(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),Q(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 i,a=1,s=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;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(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+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=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)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=T)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+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(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 i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let u=0;u>>=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 i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=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 i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){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 B(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||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||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||C(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||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(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||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(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||V(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||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(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||C(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||C(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||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(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||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(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||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(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||M(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||M(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||M(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||M(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){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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);M(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(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||M(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||M(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||M(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||M(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){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(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="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function q(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ").concat(8*(i+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(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",">= ".concat(r?1:0," and <= ").concat(t),e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=z(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=z(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o),n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(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?$:e}function $(){throw new Error("BigInt not supported")}},645:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.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(899)})(),e.exports=t()},3217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n,o=(n=r(4431))&&n.__esModule?n:{default:n},i=r(8385);function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r(8385),i=(n=r(4081))&&n.__esModule?n:{default:n};function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Asset=void 0;var o,i=r(6006),a=(o=r(4081))&&o.__esModule?o:{default:o},s=r(6437),u=r(8385),c=r(9622);function l(e){return l="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},l(e)}function f(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:a.default.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=a.default.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=a.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:s.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()){case a.default.AssetType.assetTypeNative():return"native";case a.default.AssetType.assetTypeCreditAlphanum4():return"credit_alphanum4";case a.default.AssetType.assetTypeCreditAlphanum12():return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?a.default.AssetType.assetTypeNative():this.code.length<=4?a.default.AssetType.assetTypeCreditAlphanum4():a.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())}}],o=[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case a.default.AssetType.assetTypeNative():return this.native();case a.default.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case a.default.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=u.StrKey.encodeEd25519PublicKey(t.issuer().ed25519()),new this((0,i.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(8764).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,s=a.Keypair.random().rawPublicKey(),c=new i.default.Int64(s.subarray(0,8).reduce((function(e,t){return e<<8|t}),0)),f=n||e.publicKey();if(!f)throw new Error("authorizeInvocation requires publicKey parameter");return y(new i.default.SorobanAuthorizationEntry({rootInvocation:r,credentials:i.default.SorobanCredentials.sorobanCredentialsAddress(new i.default.SorobanAddressCredentials({address:new l.Address(f).toScAddress(),nonce:c,signatureExpirationLedger:0,signature:i.default.ScVal.scvVec([])}))}),e,t,o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(8385),u=r(2844),c=r(9622),l=r(3471),f=r(5567);function d(e){return d="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},d(e)}function h(){h=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==d(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,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===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.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 i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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 new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function p(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.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=h().mark((function e(t,r,o){var d,p,y,m,g,v,b,w,A,S=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=S.length>3&&void 0!==S[3]?S[3]:u.Networks.FUTURENET,t.credentials().switch().value===i.default.SorobanCredentialsType.sorobanCredentialsAddress().value){e.next=3;break}return e.abrupt("return",t);case 3:if(p=i.default.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(y=p.credentials().address()).signatureExpirationLedger(o),m=(0,c.hash)(n.from(d)),g=i.default.HashIdPreimage.envelopeTypeSorobanAuthorization(new i.default.HashIdPreimageSorobanAuthorization({networkId:m,nonce:y.nonce(),invocation:p.rootInvocation(),signatureExpirationLedger:y.signatureExpirationLedger()})),v=(0,c.hash)(g.toXDR()),"function"!=typeof r){e.next=17;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),e.next=18;break;case 17:b=n.from(r.sign(v));case 18:if(w=l.Address.fromScAddress(y.address()).toString(),a.Keypair.fromPublicKey(w).verify(v,b)){e.next=21;break}throw new Error("signature doesn't match payload");case 21:return A=(0,f.nativeToScVal)({public_key:s.StrKey.decodeEd25519PublicKey(w),signature:b},{type:{public_key:["symbol",null],signature:["symbol",null]}}),y.signature(i.default.ScVal.scvVec([A])),e.abrupt("return",p);case 24:case"end":return e.stop()}}),e)})),m=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,s,"next",e)}function s(e){p(i,n,o,a,s,"throw",e)}a(void 0)}))},m.apply(this,arguments)}},1842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Claimant=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n,o=r(3471),i=r(4585),a=(n=r(4081))&&n.__esModule?n:{default:n},s=r(8385);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1?t-1:0),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.humanizeEvents=function(e){return e.map((function(e){return e instanceof o.default.DiagnosticEvent?s(e.event()):s(e)}))};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385),a=r(5567);function s(e){return{contractId:null===e.contractId()?"":i.StrKey.encodeContract(e.contractId()),type:e.type().name,topics:e.body().value().topics().map((function(e){return(0,a.scValToNative)(e)})),data:(0,a.scValToNative)(e.body().value().data())}}},1462:(e,t,r)=>{"use strict";var n=r(8764).Buffer;function o(e){return o="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},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FeeBumpTransaction=void 0;var i,a=(i=r(4081))&&i.__esModule?i:{default:i},s=r(9622),u=r(1388),c=r(1065),l=r(6880);function f(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(6263)).config((function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("PoolId",e.lookup("Hash")),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeEntry",[["ext",e.lookup("ExtensionPoint")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("Hash")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647)}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("Hash"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMeta",[["ext",e.lookup("ExtensionPoint")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("ExtensionPoint")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfBucketList",e.lookup("Uint64")],["evictedTemporaryLedgerKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["evictedPersistentLedgerEntries",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,getPeers:4,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,surveyRequest:14,surveyResponse:15,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{surveyTopology:0}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV0:0,surveyTopologyResponseV1:1}),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("SignedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("SurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("SignedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("SurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.typedef("PeerStatList",e.varArray(e.lookup("PeerStats"),25)),e.struct("TopologyResponseBodyV0",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TopologyResponseBodyV1",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV0","topologyResponseBodyV0"],["surveyTopologyResponseV1","topologyResponseBodyV1"]],arms:{topologyResponseBodyV0:e.lookup("TopologyResponseBodyV0"),topologyResponseBodyV1:e.lookup("TopologyResponseBodyV1")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["getPeers",e.void()],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["surveyRequest","signedSurveyRequestMessage"],["surveyResponse","signedSurveyResponseMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedSurveyRequestMessage:e.lookup("SignedSurveyRequestMessage"),signedSurveyResponseMessage:e.lookup("SignedSurveyResponseMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque()}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["readBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanTransactionData",[["ext",e.lookup("ExtensionPoint")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1}),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("Hash")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"],["scvContractInstance","instance"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),nonceKey:e.lookup("ScNonceKey"),instance:e.lookup("ScContractInstance")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("Uint64")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxReadLedgerEntries",e.lookup("Uint32")],["ledgerMaxReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxReadLedgerEntries",e.lookup("Uint32")],["txMaxReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeRead1Kb",e.lookup("Int64")],["bucketListTargetSizeBytes",e.lookup("Int64")],["writeFee1KbBucketListLow",e.lookup("Int64")],["writeFee1KbBucketListHigh",e.lookup("Int64")],["bucketListWriteFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,computeEcdsaSecp256k1Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["bucketListSizeWindowSampleSize",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint64")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingBucketlistSizeWindow:12,configSettingEvictionIterator:13}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingBucketlistSizeWindow","bucketListSizeWindow"],["configSettingEvictionIterator","evictionIterator"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),bucketListSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator")}})}));t.default=i},9396:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolFeeV18=void 0,t.getLiquidityPoolId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,o=t.assetB,c=t.fee;if(!(r&&r instanceof a.Asset))throw new Error("assetA is invalid");if(!(o&&o instanceof a.Asset))throw new Error("assetB is invalid");if(!c||c!==u)throw new Error("fee is invalid");if(-1!==a.Asset.compare(r,o))throw new Error("Assets are not in lexicographic order");var l=i.default.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),f=new i.default.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:o.toXDRObject(),fee:c}).toXDR(),d=n.concat([l,f]);return(0,s.hash)(d)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(3469),s=r(9622),u=t.LiquidityPoolFeeV18=30},9622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){var t=new n.sha256;return t.update(e,"utf8"),t.digest()};var n=r(9072)},4172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={xdr:!0,hash:!0,sign:!0,verify:!0,FastSigning:!0,getLiquidityPoolId:!0,LiquidityPoolFeeV18:!0,Keypair:!0,UnsignedHyper:!0,Hyper:!0,TransactionBase:!0,Transaction:!0,FeeBumpTransaction:!0,TransactionBuilder:!0,TimeoutInfinite:!0,BASE_FEE:!0,Asset:!0,LiquidityPoolAsset:!0,LiquidityPoolId:!0,Operation:!0,AuthRequiredFlag:!0,AuthRevocableFlag:!0,AuthImmutableFlag:!0,AuthClawbackEnabledFlag:!0,Account:!0,MuxedAccount:!0,Claimant:!0,Networks:!0,StrKey:!0,SignerKey:!0,Soroban:!0,decodeAddressToMuxedAccount:!0,encodeMuxedAccountToAddress:!0,extractBaseAddress:!0,encodeMuxedAccount:!0,Contract:!0,Address:!0};Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return w.Account}}),Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return O.Address}}),Object.defineProperty(t,"Asset",{enumerable:!0,get:function(){return y.Asset}}),Object.defineProperty(t,"AuthClawbackEnabledFlag",{enumerable:!0,get:function(){return v.AuthClawbackEnabledFlag}}),Object.defineProperty(t,"AuthImmutableFlag",{enumerable:!0,get:function(){return v.AuthImmutableFlag}}),Object.defineProperty(t,"AuthRequiredFlag",{enumerable:!0,get:function(){return v.AuthRequiredFlag}}),Object.defineProperty(t,"AuthRevocableFlag",{enumerable:!0,get:function(){return v.AuthRevocableFlag}}),Object.defineProperty(t,"BASE_FEE",{enumerable:!0,get:function(){return p.BASE_FEE}}),Object.defineProperty(t,"Claimant",{enumerable:!0,get:function(){return S.Claimant}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return P.Contract}}),Object.defineProperty(t,"FastSigning",{enumerable:!0,get:function(){return s.FastSigning}}),Object.defineProperty(t,"FeeBumpTransaction",{enumerable:!0,get:function(){return h.FeeBumpTransaction}}),Object.defineProperty(t,"Hyper",{enumerable:!0,get:function(){return l.Hyper}}),Object.defineProperty(t,"Keypair",{enumerable:!0,get:function(){return c.Keypair}}),Object.defineProperty(t,"LiquidityPoolAsset",{enumerable:!0,get:function(){return m.LiquidityPoolAsset}}),Object.defineProperty(t,"LiquidityPoolFeeV18",{enumerable:!0,get:function(){return u.LiquidityPoolFeeV18}}),Object.defineProperty(t,"LiquidityPoolId",{enumerable:!0,get:function(){return g.LiquidityPoolId}}),Object.defineProperty(t,"MuxedAccount",{enumerable:!0,get:function(){return A.MuxedAccount}}),Object.defineProperty(t,"Networks",{enumerable:!0,get:function(){return k.Networks}}),Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return v.Operation}}),Object.defineProperty(t,"SignerKey",{enumerable:!0,get:function(){return E.SignerKey}}),Object.defineProperty(t,"Soroban",{enumerable:!0,get:function(){return x.Soroban}}),Object.defineProperty(t,"StrKey",{enumerable:!0,get:function(){return _.StrKey}}),Object.defineProperty(t,"TimeoutInfinite",{enumerable:!0,get:function(){return p.TimeoutInfinite}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}}),Object.defineProperty(t,"TransactionBase",{enumerable:!0,get:function(){return f.TransactionBase}}),Object.defineProperty(t,"TransactionBuilder",{enumerable:!0,get:function(){return p.TransactionBuilder}}),Object.defineProperty(t,"UnsignedHyper",{enumerable:!0,get:function(){return l.UnsignedHyper}}),Object.defineProperty(t,"decodeAddressToMuxedAccount",{enumerable:!0,get:function(){return T.decodeAddressToMuxedAccount}}),t.default=void 0,Object.defineProperty(t,"encodeMuxedAccount",{enumerable:!0,get:function(){return T.encodeMuxedAccount}}),Object.defineProperty(t,"encodeMuxedAccountToAddress",{enumerable:!0,get:function(){return T.encodeMuxedAccountToAddress}}),Object.defineProperty(t,"extractBaseAddress",{enumerable:!0,get:function(){return T.extractBaseAddress}}),Object.defineProperty(t,"getLiquidityPoolId",{enumerable:!0,get:function(){return u.getLiquidityPoolId}}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return a.hash}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return s.sign}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return s.verify}}),Object.defineProperty(t,"xdr",{enumerable:!0,get:function(){return i.default}});var o=L(r(4431)),i=L(r(4081)),a=r(9622),s=r(5687),u=r(9396),c=r(6437),l=r(6263),f=r(1065),d=r(1388),h=r(1462),p=r(624),y=r(3469),m=r(1486),g=r(7287),v=r(4585),b=r(4856);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var w=r(3217),A=r(9022),S=r(1842),k=r(2844),_=r(8385),E=r(5822),x=r(251),T=r(6880),P=r(5618),O=r(3471),R=r(3180);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var I=r(5567);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var C=r(3761);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var M=r(5096);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))}));var B=r(1687);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var N=r(3812);function L(e){return e&&e.__esModule?e:{default:e}}Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===N[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}}))})),o.default.DEBUG=!0,t.default=e.exports},3812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInvocationTree=function e(t){var r=t.function(),a={},s=r.value();switch(r.switch().value){case 0:a.type="execute",a.args={source:o.Address.fromScAddress(s.contractAddress()).toString(),function:s.functionName(),args:s.args().map((function(e){return(0,i.scValToNative)(e)}))};break;case 1:a.type="create",a.args={};var u=[s.executable(),s.contractIdPreimage()],c=u[0],l=u[1];if(!!c.switch().value!=!!l.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(s)," (should be wasm+address or token+asset)"));switch(c.switch().value){case 0:var f=l.fromAddress();a.args.type="wasm",a.args.wasm={salt:f.salt().toString("hex"),hash:c.wasmHash().toString("hex"),address:o.Address.fromScAddress(f.address()).toString()};break;case 1:a.args.type="sac",a.args.asset=n.Asset.fromOperation(l.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(c)))}break;default:throw new Error("unknown invocation type (".concat(r.switch(),"): ").concat(JSON.stringify(r)))}return a.invocations=t.subInvocations().map((function(t){return e(t)})),a},t.walkInvocationTree=function(e,t){a(e,1,t)};var n=r(3469),o=r(3471),i=r(5567);function a(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach((function(n){return a(n,t+1,r,e)}))}},6437:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Keypair=void 0;var o=c(r(7586)),i=r(5687),a=r(8385),s=r(9622),u=c(r(4081));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="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},l(e)}function f(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolAsset=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3469),a=r(9396);function s(e){return s="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},s(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolId=void 0;var n,o=(n=r(4081))&&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(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MemoText=t.MemoReturn=t.MemoNone=t.MemoID=t.MemoHash=t.Memo=void 0;var o=r(6263),i=s(r(4431)),a=s(r(4081));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case l:break;case f:e._validateIdValue(r);break;case d:e._validateTextValue(r);break;case h:case p:e._validateHashValue(r),"string"==typeof r&&(this._value=n.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}var t,r,s;return t=e,s=[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!=typeof e)throw r;try{t=new i.default(e)}catch(e){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!a.default.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null==e)throw r;if("string"==typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=n.from(e,"hex")}else{if(!n.isBuffer(e))throw r;t=n.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(l)}},{key:"text",value:function(t){return new e(d,t)}},{key:"id",value:function(t){return new e(f,t)}},{key:"hash",value:function(t){return new e(h,t)}},{key:"return",value:function(t){return new e(p,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if(void 0===t.value())return e.none();throw new Error("Unknown type")}}],(r=[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case l:return null;case f:case d:return this._value;case h:case p:return n.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case l:return a.default.Memo.memoNone();case f:return a.default.Memo.memoId(o.UnsignedHyper.fromString(this._value));case d:return a.default.Memo.memoText(this._value);case h:return a.default.Memo.memoHash(this._value);case p:return a.default.Memo.memoReturn(this._value);default:return null}}}])&&c(t.prototype,r),s&&c(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MuxedAccount=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3217),a=r(8385),s=r(6880);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Networks=void 0,t.Networks={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"}},3180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Int128",{enumerable:!0,get:function(){return a.Int128}}),Object.defineProperty(t,"Int256",{enumerable:!0,get:function(){return s.Int256}}),Object.defineProperty(t,"ScInt",{enumerable:!0,get:function(){return u.ScInt}}),Object.defineProperty(t,"Uint128",{enumerable:!0,get:function(){return o.Uint128}}),Object.defineProperty(t,"Uint256",{enumerable:!0,get:function(){return i.Uint256}}),Object.defineProperty(t,"XdrLargeInt",{enumerable:!0,get:function(){return n.XdrLargeInt}}),t.scValToBigInt=function(e){var t=n.XdrLargeInt.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new n.XdrLargeInt(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new n.XdrLargeInt(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new n.XdrLargeInt(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}};var n=r(6836),o=r(4006),i=r(7882),a=r(9982),s=r(7292),u=r(883)},9982:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int128=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int256=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ScInt=void 0;var o=r(6836);function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}t.ScInt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(n,e);var t,r=a(n);function n(e,t){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var i=e<0,a=null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"";if(a.startsWith("u")&&i)throw TypeError("specified type ".concat(t.type," yet negative (").concat(e,")"));if(""===a){a=i?"i":"u";var s=function(e){var t,r=e.toString(2).length;return null!==(t=[64,128,256].find((function(e){return r<=e})))&&void 0!==t?t:r}(e);switch(s){case 64:case 128:case 256:a+=s.toString();break;default:throw RangeError("expected 64/128/256 bits for input (".concat(e,"), got ").concat(s))}}return r.call(this,a,e)}return t=n,Object.defineProperty(t,"prototype",{writable:!1}),t}(o.XdrLargeInt)},4006:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint128=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint256=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XdrLargeInt=void 0;var n,o=r(6263),i=r(4006),a=r(7882),s=r(9982),u=r(7292),c=(n=r(4081))&&n.__esModule?n:{default:n};function l(e){return l="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},l(e)}function f(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER||e>64n),r=BigInt.asUintN(64,e);return c.default.ScVal.scvI128(new c.default.Int128Parts({hi:new c.default.Int64(t),lo:new c.default.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return c.default.ScVal.scvU128(new c.default.UInt128Parts({hi:new c.default.Uint64(BigInt.asUintN(64,e>>64n)),lo:new c.default.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvI256(new c.default.Int256Parts({hiHi:new c.default.Int64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvU256(new c.default.UInt256Parts({hiHi:new c.default.Uint64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}])&&f(t.prototype,r),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},4585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.AuthRevocableFlag=t.AuthRequiredFlag=t.AuthImmutableFlag=t.AuthClawbackEnabledFlag=void 0;var n=r(6263),o=m(r(4431)),i=r(6006),a=r(5908),s=r(3469),u=r(1486),c=r(1842),l=r(8385),f=r(7287),d=m(r(4081)),h=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=g(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(1138)),p=r(6880);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e){return g="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},g(e)}function v(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)return!1;try{t=new o.default(e)}catch(e){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(b).gt(new o.default("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==t)switch("string"==typeof t&&(t=parseFloat(t)),!0){case"number"!=typeof t||!Number.isFinite(t)||t%1!=0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new o.default(e).times(b);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new o.default(e).div(b).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new o.default(e.n()).div(new o.default(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new d.default.Price(e);else{var r=(0,a.best_r)(e);t=new d.default.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}],r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}());function A(e){return l.StrKey.encodeEd25519PublicKey(e.ed25519())}w.accountMerge=h.accountMerge,w.allowTrust=h.allowTrust,w.bumpSequence=h.bumpSequence,w.changeTrust=h.changeTrust,w.createAccount=h.createAccount,w.createClaimableBalance=h.createClaimableBalance,w.claimClaimableBalance=h.claimClaimableBalance,w.clawbackClaimableBalance=h.clawbackClaimableBalance,w.createPassiveSellOffer=h.createPassiveSellOffer,w.inflation=h.inflation,w.manageData=h.manageData,w.manageSellOffer=h.manageSellOffer,w.manageBuyOffer=h.manageBuyOffer,w.pathPaymentStrictReceive=h.pathPaymentStrictReceive,w.pathPaymentStrictSend=h.pathPaymentStrictSend,w.payment=h.payment,w.setOptions=h.setOptions,w.beginSponsoringFutureReserves=h.beginSponsoringFutureReserves,w.endSponsoringFutureReserves=h.endSponsoringFutureReserves,w.revokeAccountSponsorship=h.revokeAccountSponsorship,w.revokeTrustlineSponsorship=h.revokeTrustlineSponsorship,w.revokeOfferSponsorship=h.revokeOfferSponsorship,w.revokeDataSponsorship=h.revokeDataSponsorship,w.revokeClaimableBalanceSponsorship=h.revokeClaimableBalanceSponsorship,w.revokeLiquidityPoolSponsorship=h.revokeLiquidityPoolSponsorship,w.revokeSignerSponsorship=h.revokeSignerSponsorship,w.clawback=h.clawback,w.setTrustLineFlags=h.setTrustLineFlags,w.liquidityPoolDeposit=h.liquidityPoolDeposit,w.liquidityPoolWithdraw=h.liquidityPoolWithdraw,w.invokeHostFunction=h.invokeHostFunction,w.extendFootprintTtl=h.extendFootprintTtl,w.restoreFootprint=h.restoreFootprint,w.createStellarAssetContract=h.createStellarAssetContract,w.invokeContractFunction=h.invokeContractFunction,w.createCustomContract=h.createCustomContract,w.uploadContractWasm=h.uploadContractWasm},7703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountMerge=function(e){var t={};try{t.body=o.default.OperationBody.accountMerge((0,i.decodeAddressToMuxedAccount)(e.destination))}catch(e){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},6583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allowTrust=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"==typeof e.authorize?e.authorize?t.authorize=o.default.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var s=new o.default.AllowTrustOp(t),u={};return u.body=o.default.OperationBody.allowTrust(s),this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385)},6318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new o.default.BeginSponsoringFutureReservesOp({sponsoredId:a.Keypair.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=o.default.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385),a=r(6437)},3593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bumpSequence=function(e){var t={};if("string"!=typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new o.default(e.bumpTo)}catch(e){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.default.BumpSequenceOp(t),a={};return a.body=i.default.OperationBody.bumpSequence(r),this.setSourceAccount(a,e),new i.default.Operation(a)};var n=r(6263),o=a(r(4431)),i=a(r(4081));function a(e){return e&&e.__esModule?e:{default:e}}},3960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeTrust=function(e){var t={};if(e.asset instanceof a.Asset)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof s.LiquidityPoolAsset))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new o.default(c).toString()),e.source&&(t.source=e.source.masterKeypair);var r=new i.default.ChangeTrustOp(t),u={};return u.body=i.default.OperationBody.changeTrust(r),this.setSourceAccount(u,e),new i.default.Operation(u)};var n=r(6263),o=u(r(4431)),i=u(r(4081)),a=r(3469),s=r(1486);function u(e){return e&&e.__esModule?e:{default:e}}var c="9223372036854775807"},57:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(e.balanceId);var t={};t.balanceId=o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new o.default.ClaimClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.validateClaimableBalanceId=i;var n,o=(n=r(4081))&&n.__esModule?n:{default:n};function i(e){if("string"!=typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}},6015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=(0,i.decodeAddressToMuxedAccount)(e.from)}catch(e){throw new Error("from address is invalid")}var r={body:o.default.OperationBody.clawback(new o.default.ClawbackOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},4283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.validateClaimableBalanceId)(e.balanceId);var t={balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:o.default.OperationBody.clawbackClaimableBalance(new o.default.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(57)},7861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAccount=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=i.Keypair.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new o.default.CreateAccountOp(t),n={};return n.body=o.default.OperationBody.createAccount(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385)},9471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClaimableBalance=function(e){if(!(e.asset instanceof i.Asset))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map((function(e){return e.toXDRObject()}));var r=new o.default.CreateClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3469)},3427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new o.default.CreatePassiveSellOfferOp(t),n={};return n.body=o.default.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},4774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo isn't a ledger quantity (uint32)");var r=new o.default.ExtendFootprintTtlOp({ext:new o.default.ExtensionPoint(0),extendTo:e.extendTo}),n={body:o.default.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"accountMerge",{enumerable:!0,get:function(){return i.accountMerge}}),Object.defineProperty(t,"allowTrust",{enumerable:!0,get:function(){return a.allowTrust}}),Object.defineProperty(t,"beginSponsoringFutureReserves",{enumerable:!0,get:function(){return w.beginSponsoringFutureReserves}}),Object.defineProperty(t,"bumpSequence",{enumerable:!0,get:function(){return s.bumpSequence}}),Object.defineProperty(t,"changeTrust",{enumerable:!0,get:function(){return u.changeTrust}}),Object.defineProperty(t,"claimClaimableBalance",{enumerable:!0,get:function(){return f.claimClaimableBalance}}),Object.defineProperty(t,"clawback",{enumerable:!0,get:function(){return k.clawback}}),Object.defineProperty(t,"clawbackClaimableBalance",{enumerable:!0,get:function(){return d.clawbackClaimableBalance}}),Object.defineProperty(t,"createAccount",{enumerable:!0,get:function(){return c.createAccount}}),Object.defineProperty(t,"createClaimableBalance",{enumerable:!0,get:function(){return l.createClaimableBalance}}),Object.defineProperty(t,"createCustomContract",{enumerable:!0,get:function(){return T.createCustomContract}}),Object.defineProperty(t,"createPassiveSellOffer",{enumerable:!0,get:function(){return o.createPassiveSellOffer}}),Object.defineProperty(t,"createStellarAssetContract",{enumerable:!0,get:function(){return T.createStellarAssetContract}}),Object.defineProperty(t,"endSponsoringFutureReserves",{enumerable:!0,get:function(){return A.endSponsoringFutureReserves}}),Object.defineProperty(t,"extendFootprintTtl",{enumerable:!0,get:function(){return P.extendFootprintTtl}}),Object.defineProperty(t,"inflation",{enumerable:!0,get:function(){return h.inflation}}),Object.defineProperty(t,"invokeContractFunction",{enumerable:!0,get:function(){return T.invokeContractFunction}}),Object.defineProperty(t,"invokeHostFunction",{enumerable:!0,get:function(){return T.invokeHostFunction}}),Object.defineProperty(t,"liquidityPoolDeposit",{enumerable:!0,get:function(){return E.liquidityPoolDeposit}}),Object.defineProperty(t,"liquidityPoolWithdraw",{enumerable:!0,get:function(){return x.liquidityPoolWithdraw}}),Object.defineProperty(t,"manageBuyOffer",{enumerable:!0,get:function(){return y.manageBuyOffer}}),Object.defineProperty(t,"manageData",{enumerable:!0,get:function(){return p.manageData}}),Object.defineProperty(t,"manageSellOffer",{enumerable:!0,get:function(){return n.manageSellOffer}}),Object.defineProperty(t,"pathPaymentStrictReceive",{enumerable:!0,get:function(){return m.pathPaymentStrictReceive}}),Object.defineProperty(t,"pathPaymentStrictSend",{enumerable:!0,get:function(){return g.pathPaymentStrictSend}}),Object.defineProperty(t,"payment",{enumerable:!0,get:function(){return v.payment}}),Object.defineProperty(t,"restoreFootprint",{enumerable:!0,get:function(){return O.restoreFootprint}}),Object.defineProperty(t,"revokeAccountSponsorship",{enumerable:!0,get:function(){return S.revokeAccountSponsorship}}),Object.defineProperty(t,"revokeClaimableBalanceSponsorship",{enumerable:!0,get:function(){return S.revokeClaimableBalanceSponsorship}}),Object.defineProperty(t,"revokeDataSponsorship",{enumerable:!0,get:function(){return S.revokeDataSponsorship}}),Object.defineProperty(t,"revokeLiquidityPoolSponsorship",{enumerable:!0,get:function(){return S.revokeLiquidityPoolSponsorship}}),Object.defineProperty(t,"revokeOfferSponsorship",{enumerable:!0,get:function(){return S.revokeOfferSponsorship}}),Object.defineProperty(t,"revokeSignerSponsorship",{enumerable:!0,get:function(){return S.revokeSignerSponsorship}}),Object.defineProperty(t,"revokeTrustlineSponsorship",{enumerable:!0,get:function(){return S.revokeTrustlineSponsorship}}),Object.defineProperty(t,"setOptions",{enumerable:!0,get:function(){return b.setOptions}}),Object.defineProperty(t,"setTrustLineFlags",{enumerable:!0,get:function(){return _.setTrustLineFlags}}),Object.defineProperty(t,"uploadContractWasm",{enumerable:!0,get:function(){return T.uploadContractWasm}});var n=r(9606),o=r(3427),i=r(7703),a=r(6583),s=r(3593),u=r(3960),c=r(7861),l=r(9471),f=r(57),d=r(4283),h=r(6804),p=r(3941),y=r(6e3),m=r(4),g=r(8778),v=r(7937),b=r(6106),w=r(6318),A=r(729),S=r(6416),k=r(6015),_=r(1214),E=r(2205),x=r(9401),T=r(9456),P=r(4774),O=r(2671)},6804:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.inflation(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},9456:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomContract=function(e){var t=n.from(e.salt||a.Keypair.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==t.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeCreateContract(new i.default.CreateContractArgs({executable:i.default.ContractExecutable.contractExecutableWasm(n.from(e.wasmHash)),contractIdPreimage:i.default.ContractIdPreimage.contractIdPreimageFromAddress(new i.default.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:t}))}))})},t.createStellarAssetContract=function(e){var t,r=e.asset;if("string"==typeof r){var n=function(e){if(Array.isArray(e))return e}(t=r.split(":"))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{for(i=(r=r.call(e)).next;!(u=(n=i.call(r)).done)&&(s.push(n.value),2!==s.length);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[0],a=n[1];r=new u.Asset(o,a)}if(!(r instanceof u.Asset))throw new TypeError("expected Asset in 'opts.asset', got ".concat(r));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeCreateContract(new i.default.CreateContractArgs({executable:i.default.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:i.default.ContractIdPreimage.contractIdPreimageFromAsset(r.toXDRObject())}))})},t.invokeContractFunction=function(e){var t=new s.Address(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeInvokeContract(new i.default.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},t.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));var t=new i.default.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:i.default.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new i.default.Operation(r)},t.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeUploadContractWasm(n.from(e.wasm))})};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(3471),u=r(3469);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,i=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=o.default.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===i)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(i),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new o.default.LiquidityPoolDepositOp(s),c={body:o.default.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new o.default.Operation(c)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},9401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=o.default.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new o.default.LiquidityPoolWithdrawOp(t),n={body:o.default.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},6e3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageBuyOfferOp(t),n={};return n.body=i.default.OperationBody.manageBuyOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(6263),i=(n=r(4081))&&n.__esModule?n:{default:n}},3941:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.manageData=function(e){var t={};if(!("string"==typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!=typeof e.value&&!n.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");if("string"==typeof e.value?t.dataValue=n.from(e.value):t.dataValue=e.value,null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new i.default.ManageDataOp(t),o={};return o.body=i.default.OperationBody.manageData(r),this.setSourceAccount(o,e),new i.default.Operation(o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o}},9606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageSellOfferOp(t),n={};return n.body=i.default.OperationBody.manageSellOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(6263),i=(n=r(4081))&&n.__esModule?n:{default:n}},4:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictReceiveOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},8778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictSendOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},7937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new o.default.PaymentOp(t),n={};return n.body=o.default.OperationBody.payment(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},2671:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new o.default.RestoreFootprintOp({ext:new o.default.ExtensionPoint(0)}),r={body:o.default.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!=e?e:{}),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},6416:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=i.default.LedgerKey.account(new i.default.LedgerKeyAccount({accountId:s.Keypair.fromPublicKey(e.account).xdrAccountId()})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.balanceId)throw new Error("balanceId is invalid");var t=i.default.LedgerKey.claimableBalance(new i.default.LedgerKeyClaimableBalance({balanceId:i.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!=typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=i.default.LedgerKey.data(new i.default.LedgerKeyData({accountId:s.Keypair.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=i.default.LedgerKey.liquidityPool(new i.default.LedgerKeyLiquidityPool({liquidityPoolId:i.default.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:i.default.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!=typeof e.offerId)throw new Error("offerId is invalid");var t=i.default.LedgerKey.offer(new i.default.LedgerKeyOffer({sellerId:s.Keypair.fromPublicKey(e.seller).xdrAccountId(),offerId:i.default.Int64.fromString(e.offerId)})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!a.StrKey.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=a.StrKey.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new i.default.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var o;if(o="string"==typeof t.signer.preAuthTx?n.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!n.isBuffer(o)||32!==o.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new i.default.SignerKey.signerKeyTypePreAuthTx(o)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var u;if(u="string"==typeof t.signer.sha256Hash?n.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!n.isBuffer(u)||32!==u.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new i.default.SignerKey.signerKeyTypeHashX(u)}var c=new i.default.RevokeSponsorshipOpSigner({accountId:s.Keypair.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),l=i.default.RevokeSponsorshipOp.revokeSponsorshipSigner(c),f={};return f.body=i.default.OperationBody.revokeSponsorship(l),this.setSourceAccount(f,t),new i.default.Operation(f)},t.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof u.Asset)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof c.LiquidityPoolId))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=i.default.LedgerKey.trustline(new i.default.LedgerKeyTrustLine({accountId:s.Keypair.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),o={};return o.body=i.default.OperationBody.revokeSponsorship(n),this.setSourceAccount(o,t),new i.default.Operation(o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(8385),s=r(6437),u=r(3469),c=r(7287)},6106:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.setOptions=function(e){var t={};if(e.inflationDest){if(!s.StrKey.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=a.Keypair.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,u),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,u),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,u),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,u),void 0!==e.homeDomain&&"string"!=typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,o=this._checkUnsignedIntValue("signer.weight",e.signer.weight,u),c=0;if(e.signer.ed25519PublicKey){if(!s.StrKey.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var l=s.StrKey.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new i.default.SignerKey.signerKeyTypeEd25519(l),c+=1}if(e.signer.preAuthTx){if("string"==typeof e.signer.preAuthTx&&(e.signer.preAuthTx=n.from(e.signer.preAuthTx,"hex")),!n.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new i.default.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),c+=1}if(e.signer.sha256Hash){if("string"==typeof e.signer.sha256Hash&&(e.signer.sha256Hash=n.from(e.signer.sha256Hash,"hex")),!n.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new i.default.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),c+=1}if(e.signer.ed25519SignedPayload){if(!s.StrKey.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var f=s.StrKey.decodeSignedPayload(e.signer.ed25519SignedPayload),d=i.default.SignerKeyEd25519SignedPayload.fromXDR(f);r=i.default.SignerKey.signerKeyTypeEd25519SignedPayload(d),c+=1}if(1!==c)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new i.default.Signer({key:r,weight:o})}var h=new i.default.SetOptionsOp(t),p={};return p.body=i.default.OperationBody.setOptions(h),this.setSourceAccount(p,e),new i.default.Operation(p)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(8385);function u(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}},1214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==a(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:o.default.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:o.default.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:o.default.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,s=0;Object.keys(e.flags).forEach((function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var o=e.flags[t],i=r[t].value;!0===o?s|=i:!1===o&&(n|=i)})),t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=s;var u={body:o.default.OperationBody.setTrustLineFlags(new o.default.SetTrustLineFlagsOp(t))};return this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437);function a(e){return a="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},a(e)}},5567:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.nativeToScVal=function e(t){var r,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(f(t)){case"object":if(null===t)return i.default.ScVal.scvVoid();if(t instanceof i.default.ScVal)return t;if(t instanceof a.Address)return t.toScVal();if(t instanceof s.Contract)return t.address().toScVal();if(t instanceof Uint8Array||n.isBuffer(t)){var d,h=Uint8Array.from(t);switch(null!==(d=null==l?void 0:l.type)&&void 0!==d?d:"bytes"){case"bytes":return i.default.ScVal.scvBytes(h);case"symbol":return i.default.ScVal.scvSymbol(h);case"string":return i.default.ScVal.scvString(h);default:throw new TypeError("invalid type (".concat(l.type,") specified for bytes-like value"))}}if(Array.isArray(t)){if(t.length>0&&t.some((function(e){return f(e)!==f(t[0])})))throw new TypeError("array values (".concat(t,") must have the same type (types: ").concat(t.map((function(e){return f(e)})).join(","),")"));return i.default.ScVal.scvVec(t.map((function(t){return e(t,l)})))}var p;if("Object"!==(null!==(r=null===(o=t.constructor)||void 0===o?void 0:o.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(p=t.constructor)||void 0===p?void 0:p.name," value as ScVal (").concat(JSON.stringify(t),")"));return i.default.ScVal.scvMap(Object.entries(t).map((function(t){var r,n,o=c(t,2),a=o[0],s=o[1],u=c(null!==(r=(null!==(n=null==l?void 0:l.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),f=u[0],d=u[1],h=f?{type:f}:{},p=d?{type:d}:{};return new i.default.ScMapEntry({key:e(a,h),val:e(s,p)})})));case"number":case"bigint":switch(null==l?void 0:l.type){case"u32":return i.default.ScVal.scvU32(t);case"i32":return i.default.ScVal.scvI32(t)}return new u.ScInt(t,{type:null==l?void 0:l.type}).toScVal();case"string":var y,m=null!==(y=null==l?void 0:l.type)&&void 0!==y?y:"string";switch(m){case"string":return i.default.ScVal.scvString(t);case"symbol":return i.default.ScVal.scvSymbol(t);case"address":return new a.Address(t).toScVal();default:if(u.XdrLargeInt.isType(m))return new u.XdrLargeInt(m,t).toScVal();throw new TypeError("invalid type (".concat(l.type,") specified for string value"))}case"boolean":return i.default.ScVal.scvBool(t);case"undefined":return i.default.ScVal.scvVoid();case"function":return e(t());default:throw new TypeError("failed to convert typeof ".concat(f(t)," (").concat(t,")"))}},t.scValToNative=function e(t){var r,o;switch(t.switch().value){case i.default.ScValType.scvVoid().value:return null;case i.default.ScValType.scvU64().value:case i.default.ScValType.scvI64().value:return t.value().toBigInt();case i.default.ScValType.scvU128().value:case i.default.ScValType.scvI128().value:case i.default.ScValType.scvU256().value:case i.default.ScValType.scvI256().value:return(0,u.scValToBigInt)(t);case i.default.ScValType.scvVec().value:return(null!==(r=t.vec())&&void 0!==r?r:[]).map(e);case i.default.ScValType.scvAddress().value:return a.Address.fromScVal(t).toString();case i.default.ScValType.scvMap().value:return Object.fromEntries((null!==(o=t.map())&&void 0!==o?o:[]).map((function(t){return[e(t.key()),e(t.val())]})));case i.default.ScValType.scvBool().value:case i.default.ScValType.scvU32().value:case i.default.ScValType.scvI32().value:case i.default.ScValType.scvBytes().value:return t.value();case i.default.ScValType.scvSymbol().value:case i.default.ScValType.scvString().value:var s=t.value();if(n.isBuffer(s)||ArrayBuffer.isView(s))try{return(new TextDecoder).decode(s)}catch(e){return new Uint8Array(s.buffer)}return s;case i.default.ScValType.scvTimepoint().value:case i.default.ScValType.scvDuration().value:return new i.default.Uint64(t.value()).toBigInt();case i.default.ScValType.scvStatus().value:switch(t.value().switch()){case i.default.ScStatusType.sstOk().value:case i.default.ScStatusType.sstUnknownError().value:case i.default.ScStatusType.sstHostValueError().value:case i.default.ScStatusType.sstHostObjectError().value:case i.default.ScStatusType.sstHostFunctionError().value:case i.default.ScStatusType.sstHostStorageError().value:case i.default.ScStatusType.sstHostContextError().value:case i.default.ScStatusType.sstVmError().value:case i.default.ScStatusType.sstContractError().value:case i.default.ScStatusType.sstHostAuthError().value:}default:return t.value()}};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(3471),s=r(5618),u=r(3180);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignerKey=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385);function a(e){return a="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},a(e)}function s(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.FastSigning=void 0,t.generate=function(e){return o.generate(e)},t.sign=function(e,t){return o.sign(e,t)},t.verify=function(e,t,r){return o.verify(e,t,r)};var o={};function i(){var e=r(7586);return o.generate=function(t){var r=new Uint8Array(t),o=e.sign.keyPair.fromSeed(r);return n.from(o.publicKey)},o.sign=function(t,r){t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data);var o=e.sign.detached(t,r);return n.from(o)},o.verify=function(t,r,o){return t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data),o=new Uint8Array(o.toJSON().data),e.sign.detached.verify(t,r,o)},!1}t.FastSigning="undefined"==typeof window?function(){var e;try{e=r(Object(function(){var e=new Error("Cannot find module 'sodium-native'");throw e.code="MODULE_NOT_FOUND",e}()))}catch(e){return i()}return Object.keys(e).length?(o.generate=function(t){var r=n.alloc(e.crypto_sign_PUBLICKEYBYTES),o=n.alloc(e.crypto_sign_SECRETKEYBYTES);return e.crypto_sign_seed_keypair(r,o,t),r},o.sign=function(t,r){t=n.from(t);var o=n.alloc(e.crypto_sign_BYTES);return e.crypto_sign_detached(o,t,r),o},o.verify=function(t,r,o){t=n.from(t);try{return e.crypto_sign_verify_detached(r,t,o)}catch(e){return!1}},!0):i()}():i()},251:(e,t)=>{"use strict";function r(e){return r="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},r(e)}function n(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,o=n(e.split(".").slice()),i=o[0],a=o[1];if(o.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(i+(null!==(r=null==a?void 0:a.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SorobanDataBuilder=void 0;var n,o=(n=r(4081))&&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(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.StrKey=void 0,t.decodeCheck=d,t.encodeCheck=h;var o,i=(o=r(6906))&&o.__esModule?o:{default:o},a=r(9449);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r165)return!1;break;default:return!1}var r="";try{r=d(e,t)}catch(e){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function d(e,t){if("string"!=typeof t)throw new TypeError("encoded argument must be of type String");var r=i.default.decode(t),o=r[0],s=r.slice(0,-2),u=s.slice(1),l=r.slice(-2);if(t!==i.default.encode(r))throw new Error("invalid encoded string");var f=c[e];if(void 0===f)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));if(o!==f)throw new Error("invalid version byte. expected ".concat(f,", got ").concat(o));var d=p(s);if(!(0,a.verifyChecksum)(d,l))throw new Error("invalid checksum");return n.from(u)}function h(e,t){if(null==t)throw new Error("cannot encode null data");var r=c[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));t=n.from(t);var o=n.from([r]),a=n.concat([o,t]),s=p(a),u=n.concat([a,s]);return i.default.encode(u)}function p(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n>8^e[n]],r&=65535;var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}t.StrKey=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"encodeEd25519PublicKey",value:function(e){return h("ed25519PublicKey",e)}},{key:"decodeEd25519PublicKey",value:function(e){return d("ed25519PublicKey",e)}},{key:"isValidEd25519PublicKey",value:function(e){return f("ed25519PublicKey",e)}},{key:"encodeEd25519SecretSeed",value:function(e){return h("ed25519SecretSeed",e)}},{key:"decodeEd25519SecretSeed",value:function(e){return d("ed25519SecretSeed",e)}},{key:"isValidEd25519SecretSeed",value:function(e){return f("ed25519SecretSeed",e)}},{key:"encodeMed25519PublicKey",value:function(e){return h("med25519PublicKey",e)}},{key:"decodeMed25519PublicKey",value:function(e){return d("med25519PublicKey",e)}},{key:"isValidMed25519PublicKey",value:function(e){return f("med25519PublicKey",e)}},{key:"encodePreAuthTx",value:function(e){return h("preAuthTx",e)}},{key:"decodePreAuthTx",value:function(e){return d("preAuthTx",e)}},{key:"encodeSha256Hash",value:function(e){return h("sha256Hash",e)}},{key:"decodeSha256Hash",value:function(e){return d("sha256Hash",e)}},{key:"encodeSignedPayload",value:function(e){return h("signedPayload",e)}},{key:"decodeSignedPayload",value:function(e){return d("signedPayload",e)}},{key:"isValidSignedPayload",value:function(e){return f("signedPayload",e)}},{key:"encodeContract",value:function(e){return h("contract",e)}},{key:"decodeContract",value:function(e){return d("contract",e)}},{key:"isValidContract",value:function(e){return f("contract",e)}},{key:"getVersionByteForPrefix",value:function(e){return l[e[0]]}}],r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1388:(e,t,r)=>{"use strict";var n=r(8764).Buffer;function o(e){return o="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},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i,a=(i=r(4081))&&i.__esModule?i:{default:i},s=r(9622),u=r(8385),c=r(4585),l=r(4856),f=r(1065),d=r(6880);function h(e,t){for(var r=0;r=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=c.Operation.createClaimableBalance(t)}catch(e){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(e))}var r=u.StrKey.decodeEd25519PublicKey((0,d.extractBaseAddress)(this.source)),n=a.default.HashIdPreimage.envelopeTypeOpId(new a.default.HashIdPreimageOperationId({sourceAccount:a.default.AccountId.publicKeyTypeEd25519(r),seqNum:a.default.SequenceNumber.fromString(this.sequence),opNum:e})),o=(0,s.hash)(n.toXDR("raw"));return a.default.ClaimableBalanceId.claimableBalanceIdTypeV0(o).toXDR("hex")}}])&&h(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(f.TransactionBase)},1065:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBase=void 0;var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(9622),s=r(6437);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!o||"string"!=typeof o)throw new Error("Invalid signature");if(!r||"string"!=typeof r)throw new Error("Invalid publicKey");var a=n.from(o,"base64");try{t=(e=s.Keypair.fromPublicKey(r)).signatureHint()}catch(e){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),a))throw new Error("Invalid signature");this.signatures.push(new i.default.DecoratedSignature({hint:t,signature:a}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"==typeof e&&(e=n.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=(0,a.hash)(e),o=r.slice(r.length-4);this.signatures.push(new i.default.DecoratedSignature({hint:o,signature:t}))}},{key:"hash",value:function(){return(0,a.hash)(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}],r&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=t.TimeoutInfinite=t.BASE_FEE=void 0,t.isValidDate=E;var n=r(6263),o=y(r(4431)),i=y(r(4081)),a=r(3217),s=r(9022),u=r(6880),c=r(1388),l=r(1462),f=r(5096),d=r(8385),h=r(5822),p=r(4856);function y(e){return e&&e.__esModule?e:{default:e}}function m(e){return m="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},m(e)}function g(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?w({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?w({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?g(r.extraSigners):null,this.memo=r.memo||p.Memo.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new f.SorobanDataBuilder(r.sorobanData).build():null}var t,r,y;return t=e,y=[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof c.Transaction))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(d.StrKey.isValidMed25519PublicKey(t.source))n=s.MuxedAccount.fromAddress(t.source,o);else{if(!d.StrKey.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new a.Account(t.source,o)}var i=new e(n,w({fee:(parseInt(t.fee,10)/t.operations.length||_).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach((function(e){return i.addOperation(e)})),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var a=r.operations.length,s=new o.default(r.fee).div(a),c=new o.default(t);if(c.lt(s))throw new Error("Invalid baseFee, it should be at least ".concat(s," stroops."));var f=new o.default(_);if(c.lt(f))throw new Error("Invalid baseFee, it should be at least ".concat(f," stroops."));var d,h=r.toEnvelope();if(h.switch()===i.default.EnvelopeType.envelopeTypeTxV0()){var p=h.v0().tx(),y=new i.default.Transaction({sourceAccount:new i.default.MuxedAccount.keyTypeEd25519(p.sourceAccountEd25519()),fee:p.fee(),seqNum:p.seqNum(),cond:i.default.Preconditions.precondTime(p.timeBounds()),memo:p.memo(),operations:p.operations(),ext:new i.default.TransactionExt(0)});h=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:y,signatures:h.v0().signatures()}))}d="string"==typeof e?(0,u.decodeAddressToMuxedAccount)(e):e.xdrMuxedAccount();var m=new i.default.FeeBumpTransaction({feeSource:d,fee:i.default.Int64.fromString(c.times(a+1).toString()),innerTx:i.default.FeeBumpTransactionInnerTx.envelopeTypeTx(h.v1()),ext:new i.default.FeeBumpTransactionExt(0)}),g=new i.default.FeeBumpTransactionEnvelope({tx:m,signatures:[]}),v=new i.default.TransactionEnvelope.envelopeTypeTxFeeBump(g);return new l.FeeBumpTransaction(v,n)}},{key:"fromXDR",value:function(e,t){return"string"==typeof e&&(e=i.default.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.default.EnvelopeType.envelopeTypeTxFeeBump()?new l.FeeBumpTransaction(e,t):new c.Transaction(e,t)}}],(r=[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!=typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=g(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new f.SorobanDataBuilder(e).build(),this}},{key:"build",value:function(){var e=new o.default(this.source.sequenceNumber()).plus(1),t={fee:new o.default(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.default.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||void 0===this.timebounds.minTime||void 0===this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");E(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),E(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.default.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var a=null;null!==this.ledgerbounds&&(a=new i.default.LedgerBounds(this.ledgerbounds));var s=this.minAccountSequence||"0";s=i.default.SequenceNumber.fromString(s);var l=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),f=this.minAccountSequenceLedgerGap||0,d=null!==this.extraSigners?this.extraSigners.map(h.SignerKey.decodeAddress):[];t.cond=i.default.Preconditions.precondV2(new i.default.PreconditionsV2({timeBounds:r,ledgerBounds:a,minSeqNum:s,minSeqAge:l,minSeqLedgerGap:f,extraSigners:d}))}else t.cond=i.default.Preconditions.precondTime(r);t.sourceAccount=(0,u.decodeAddressToMuxedAccount)(this.source.accountId()),this.sorobanData?t.ext=new i.default.TransactionExt(1,this.sorobanData):t.ext=new i.default.TransactionExt(0,i.default.Void);var p=new i.default.Transaction(t);p.operations(this.operations);var y=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:p})),m=new c.Transaction(y,this.networkPassphrase);return this.source.incrementSequenceNumber(),m}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}])&&S(t.prototype,r),y&&S(t,y),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9449:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyChecksum=function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.best_r=function(e){for(var t,r,n=new o.default(e),s=[[new o.default(0),new o.default(1)],[new o.default(1),new o.default(0)]],u=2;!n.gt(a);){t=n.integerValue(o.default.ROUND_FLOOR),r=n.minus(t);var c=t.times(s[u-1][0]).plus(s[u-2][0]),l=t.times(s[u-1][1]).plus(s[u-2][1]);if(c.gt(a)||l.gt(a))break;if(s.push([c,l]),r.eq(0))break;n=new o.default(1).div(r),u+=1}var f=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{for(i=(r=r.call(e)).next;!(u=(n=i.call(r)).done)&&(s.push(n.value),2!==s.length);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(s[s.length-1]),d=f[0],h=f[1];if(d.isZero()||h.isZero())throw new Error("Couldn't find approximation");return[d.toNumber(),h.toNumber()]};var n,o=(n=r(4431))&&n.__esModule?n:{default:n};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAddressToMuxedAccount=s,t.encodeMuxedAccount=function(e,t){if(!a.StrKey.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!=typeof t)throw new Error("id should be a string representing a number (uint64)");return i.default.MuxedAccount.keyTypeMuxedEd25519(new i.default.MuxedAccountMed25519({id:i.default.Uint64.fromString(t),ed25519:a.StrKey.decodeEd25519PublicKey(e)}))},t.encodeMuxedAccountToAddress=function e(t){return t.switch().value===i.default.CryptoKeyType.keyTypeMuxedEd25519().value?function(t){if(t.switch()===i.default.CryptoKeyType.keyTypeEd25519())return e(t);var r=t.med25519();return a.StrKey.encodeMed25519PublicKey(n.concat([r.ed25519(),r.id().toXDR("raw")]))}(t):a.StrKey.encodeEd25519PublicKey(t.ed25519())},t.extractBaseAddress=function(e){if(a.StrKey.isValidEd25519PublicKey(e))return e;if(!a.StrKey.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=s(e);return a.StrKey.encodeEd25519PublicKey(t.med25519().ed25519())};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(8385);function s(e){return a.StrKey.isValidMed25519PublicKey(e)?function(e){var t=a.StrKey.decodeMed25519PublicKey(e);return i.default.MuxedAccount.keyTypeMuxedEd25519(new i.default.MuxedAccountMed25519({id:i.default.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):i.default.MuxedAccount.keyTypeEd25519(a.StrKey.decodeEd25519PublicKey(e))}},6006:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimEnd=void 0,t.trimEnd=function(e,t){for(var r="number"==typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n}},4081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(7701))&&n.__esModule?n:{default:n};t.default=o.default},7586:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,o){var i,a=0;for(i=0;i>>8)-1}function m(e,t,r,n){return y(e,t,r,n,16)}function g(e,t,r,n){return y(e,t,r,n,32)}function v(e,t,r,n){!function(e,t,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=i,S=a,k=s,_=u,E=c,x=l,T=f,P=d,O=h,R=p,I=y,C=m,M=g,B=v,N=b,L=w,j=0;j<20;j+=2)A^=(o=(M^=(o=(O^=(o=(E^=(o=A+M|0)<<7|o>>>25)+A|0)<<9|o>>>23)+E|0)<<13|o>>>19)+O|0)<<18|o>>>14,x^=(o=(S^=(o=(B^=(o=(R^=(o=x+S|0)<<7|o>>>25)+x|0)<<9|o>>>23)+R|0)<<13|o>>>19)+B|0)<<18|o>>>14,I^=(o=(T^=(o=(k^=(o=(N^=(o=I+T|0)<<7|o>>>25)+I|0)<<9|o>>>23)+N|0)<<13|o>>>19)+k|0)<<18|o>>>14,L^=(o=(C^=(o=(P^=(o=(_^=(o=L+C|0)<<7|o>>>25)+L|0)<<9|o>>>23)+_|0)<<13|o>>>19)+P|0)<<18|o>>>14,A^=(o=(_^=(o=(k^=(o=(S^=(o=A+_|0)<<7|o>>>25)+A|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,x^=(o=(E^=(o=(P^=(o=(T^=(o=x+E|0)<<7|o>>>25)+x|0)<<9|o>>>23)+T|0)<<13|o>>>19)+P|0)<<18|o>>>14,I^=(o=(R^=(o=(O^=(o=(C^=(o=I+R|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+O|0)<<18|o>>>14,L^=(o=(N^=(o=(B^=(o=(M^=(o=L+N|0)<<7|o>>>25)+L|0)<<9|o>>>23)+M|0)<<13|o>>>19)+B|0)<<18|o>>>14;A=A+i|0,S=S+a|0,k=k+s|0,_=_+u|0,E=E+c|0,x=x+l|0,T=T+f|0,P=P+d|0,O=O+h|0,R=R+p|0,I=I+y|0,C=C+m|0,M=M+g|0,B=B+v|0,N=N+b|0,L=L+w|0,e[0]=A>>>0&255,e[1]=A>>>8&255,e[2]=A>>>16&255,e[3]=A>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=k>>>0&255,e[9]=k>>>8&255,e[10]=k>>>16&255,e[11]=k>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=T>>>0&255,e[25]=T>>>8&255,e[26]=T>>>16&255,e[27]=T>>>24&255,e[28]=P>>>0&255,e[29]=P>>>8&255,e[30]=P>>>16&255,e[31]=P>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=R>>>0&255,e[37]=R>>>8&255,e[38]=R>>>16&255,e[39]=R>>>24&255,e[40]=I>>>0&255,e[41]=I>>>8&255,e[42]=I>>>16&255,e[43]=I>>>24&255,e[44]=C>>>0&255,e[45]=C>>>8&255,e[46]=C>>>16&255,e[47]=C>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=N>>>0&255,e[57]=N>>>8&255,e[58]=N>>>16&255,e[59]=N>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function b(e,t,r,n){!function(e,t,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=0;A<20;A+=2)i^=(o=(g^=(o=(h^=(o=(c^=(o=i+g|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+h|0)<<18|o>>>14,l^=(o=(a^=(o=(v^=(o=(p^=(o=l+a|0)<<7|o>>>25)+l|0)<<9|o>>>23)+p|0)<<13|o>>>19)+v|0)<<18|o>>>14,y^=(o=(f^=(o=(s^=(o=(b^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+b|0)<<13|o>>>19)+s|0)<<18|o>>>14,w^=(o=(m^=(o=(d^=(o=(u^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+u|0)<<13|o>>>19)+d|0)<<18|o>>>14,i^=(o=(u^=(o=(s^=(o=(a^=(o=i+u|0)<<7|o>>>25)+i|0)<<9|o>>>23)+a|0)<<13|o>>>19)+s|0)<<18|o>>>14,l^=(o=(c^=(o=(d^=(o=(f^=(o=l+c|0)<<7|o>>>25)+l|0)<<9|o>>>23)+f|0)<<13|o>>>19)+d|0)<<18|o>>>14,y^=(o=(p^=(o=(h^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+h|0)<<18|o>>>14,w^=(o=(b^=(o=(v^=(o=(g^=(o=w+b|0)<<7|o>>>25)+w|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(e,t,r,n,o,i,a){var s,u,c=new Uint8Array(16),l=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=i[u];for(;o>=64;){for(v(l,c,a,w),u=0;u<64;u++)e[t+u]=r[n+u]^l[u];for(s=1,u=8;u<16;u++)s=s+(255&c[u])|0,c[u]=255&s,s>>>=8;o-=64,t+=64,n+=64}if(o>0)for(v(l,c,a,w),u=0;u=64;){for(v(u,s,o,w),a=0;a<64;a++)e[t+a]=u[a];for(i=1,a=8;a<16;a++)i=i+(255&s[a])|0,s[a]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(v(u,s,o,w),a=0;a>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),o=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|o<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,o,i){var a=new E(i);return a.update(r,n,o),a.finish(e,t),0}function T(e,t,r,n,o,i){var a=new Uint8Array(16);return x(a,0,r,n,o,i),m(e,t,a,0)}function P(e,t,r,n,o){var i;if(r<32)return-1;for(_(e,0,t,0,r,n,o),x(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function O(e,t,r,n,o){var i,a=new Uint8Array(32);if(r<32)return-1;if(k(a,0,32,n,o),0!==T(t,16,t,32,r-32,a))return-1;for(_(e,0,t,0,r,n,o),i=0;i<32;i++)e[i]=0;return 0}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function I(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function C(e,t,r){for(var n,o=~(r-1),i=0;i<16;i++)n=o&(e[i]^t[i]),e[i]^=n,t[i]^=n}function M(e,r){var n,o,i,a=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(I(s),I(s),I(s),o=0;o<2;o++){for(a[0]=s[0]-65517,n=1;n<15;n++)a[n]=s[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,C(s,a,1-i)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function B(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return M(r,e),M(n,t),g(r,0,n,0)}function N(e){var t=new Uint8Array(32);return M(t,e),1&t[0]}function L(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function j(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function F(e,t,r){var n,o,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,y=0,m=0,g=0,v=0,b=0,w=0,A=0,S=0,k=0,_=0,E=0,x=0,T=0,P=0,O=0,R=0,I=0,C=0,M=0,B=0,N=0,L=r[0],j=r[1],U=r[2],F=r[3],D=r[4],z=r[5],q=r[6],H=r[7],V=r[8],K=r[9],W=r[10],G=r[11],X=r[12],Z=r[13],Q=r[14],Y=r[15];i+=(n=t[0])*L,a+=n*j,s+=n*U,u+=n*F,c+=n*D,l+=n*z,f+=n*q,d+=n*H,h+=n*V,p+=n*K,y+=n*W,m+=n*G,g+=n*X,v+=n*Z,b+=n*Q,w+=n*Y,a+=(n=t[1])*L,s+=n*j,u+=n*U,c+=n*F,l+=n*D,f+=n*z,d+=n*q,h+=n*H,p+=n*V,y+=n*K,m+=n*W,g+=n*G,v+=n*X,b+=n*Z,w+=n*Q,A+=n*Y,s+=(n=t[2])*L,u+=n*j,c+=n*U,l+=n*F,f+=n*D,d+=n*z,h+=n*q,p+=n*H,y+=n*V,m+=n*K,g+=n*W,v+=n*G,b+=n*X,w+=n*Z,A+=n*Q,S+=n*Y,u+=(n=t[3])*L,c+=n*j,l+=n*U,f+=n*F,d+=n*D,h+=n*z,p+=n*q,y+=n*H,m+=n*V,g+=n*K,v+=n*W,b+=n*G,w+=n*X,A+=n*Z,S+=n*Q,k+=n*Y,c+=(n=t[4])*L,l+=n*j,f+=n*U,d+=n*F,h+=n*D,p+=n*z,y+=n*q,m+=n*H,g+=n*V,v+=n*K,b+=n*W,w+=n*G,A+=n*X,S+=n*Z,k+=n*Q,_+=n*Y,l+=(n=t[5])*L,f+=n*j,d+=n*U,h+=n*F,p+=n*D,y+=n*z,m+=n*q,g+=n*H,v+=n*V,b+=n*K,w+=n*W,A+=n*G,S+=n*X,k+=n*Z,_+=n*Q,E+=n*Y,f+=(n=t[6])*L,d+=n*j,h+=n*U,p+=n*F,y+=n*D,m+=n*z,g+=n*q,v+=n*H,b+=n*V,w+=n*K,A+=n*W,S+=n*G,k+=n*X,_+=n*Z,E+=n*Q,x+=n*Y,d+=(n=t[7])*L,h+=n*j,p+=n*U,y+=n*F,m+=n*D,g+=n*z,v+=n*q,b+=n*H,w+=n*V,A+=n*K,S+=n*W,k+=n*G,_+=n*X,E+=n*Z,x+=n*Q,T+=n*Y,h+=(n=t[8])*L,p+=n*j,y+=n*U,m+=n*F,g+=n*D,v+=n*z,b+=n*q,w+=n*H,A+=n*V,S+=n*K,k+=n*W,_+=n*G,E+=n*X,x+=n*Z,T+=n*Q,P+=n*Y,p+=(n=t[9])*L,y+=n*j,m+=n*U,g+=n*F,v+=n*D,b+=n*z,w+=n*q,A+=n*H,S+=n*V,k+=n*K,_+=n*W,E+=n*G,x+=n*X,T+=n*Z,P+=n*Q,O+=n*Y,y+=(n=t[10])*L,m+=n*j,g+=n*U,v+=n*F,b+=n*D,w+=n*z,A+=n*q,S+=n*H,k+=n*V,_+=n*K,E+=n*W,x+=n*G,T+=n*X,P+=n*Z,O+=n*Q,R+=n*Y,m+=(n=t[11])*L,g+=n*j,v+=n*U,b+=n*F,w+=n*D,A+=n*z,S+=n*q,k+=n*H,_+=n*V,E+=n*K,x+=n*W,T+=n*G,P+=n*X,O+=n*Z,R+=n*Q,I+=n*Y,g+=(n=t[12])*L,v+=n*j,b+=n*U,w+=n*F,A+=n*D,S+=n*z,k+=n*q,_+=n*H,E+=n*V,x+=n*K,T+=n*W,P+=n*G,O+=n*X,R+=n*Z,I+=n*Q,C+=n*Y,v+=(n=t[13])*L,b+=n*j,w+=n*U,A+=n*F,S+=n*D,k+=n*z,_+=n*q,E+=n*H,x+=n*V,T+=n*K,P+=n*W,O+=n*G,R+=n*X,I+=n*Z,C+=n*Q,M+=n*Y,b+=(n=t[14])*L,w+=n*j,A+=n*U,S+=n*F,k+=n*D,_+=n*z,E+=n*q,x+=n*H,T+=n*V,P+=n*K,O+=n*W,R+=n*G,I+=n*X,C+=n*Z,M+=n*Q,B+=n*Y,w+=(n=t[15])*L,a+=38*(S+=n*U),s+=38*(k+=n*F),u+=38*(_+=n*D),c+=38*(E+=n*z),l+=38*(x+=n*q),f+=38*(T+=n*H),d+=38*(P+=n*V),h+=38*(O+=n*K),p+=38*(R+=n*W),y+=38*(I+=n*G),m+=38*(C+=n*X),g+=38*(M+=n*Z),v+=38*(B+=n*Q),b+=38*(N+=n*Y),i=(n=(i+=38*(A+=n*j))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),i=(n=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),i+=o-1+37*(o-1),e[0]=i,e[1]=a,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=y,e[11]=m,e[12]=g,e[13]=v,e[14]=b,e[15]=w}function D(e,t){F(e,t,t)}function z(e,r){var n,o=t();for(n=0;n<16;n++)o[n]=r[n];for(n=253;n>=0;n--)D(o,o),2!==n&&4!==n&&F(o,o,r);for(n=0;n<16;n++)e[n]=o[n]}function q(e,r){var n,o=t();for(n=0;n<16;n++)o[n]=r[n];for(n=250;n>=0;n--)D(o,o),1!==n&&F(o,o,r);for(n=0;n<16;n++)e[n]=o[n]}function H(e,r,n){var o,i,a=new Uint8Array(32),s=new Float64Array(80),c=t(),l=t(),f=t(),d=t(),h=t(),p=t();for(i=0;i<31;i++)a[i]=r[i];for(a[31]=127&r[31]|64,a[0]&=248,L(s,n),i=0;i<16;i++)l[i]=s[i],d[i]=c[i]=f[i]=0;for(c[0]=d[0]=1,i=254;i>=0;--i)C(c,l,o=a[i>>>3]>>>(7&i)&1),C(f,d,o),j(h,c,f),U(c,c,f),j(f,l,d),U(l,l,d),D(d,h),D(p,c),F(c,f,c),F(f,l,h),j(h,c,f),U(c,c,f),D(l,c),U(f,d,p),F(c,f,u),j(c,c,d),F(f,f,c),F(c,d,p),F(d,l,s),D(l,h),C(c,l,o),C(f,d,o);for(i=0;i<16;i++)s[i+16]=c[i],s[i+32]=f[i],s[i+48]=l[i],s[i+64]=d[i];var y=s.subarray(32),m=s.subarray(16);return z(y,y),F(m,m,y),M(e,m),0}function V(e,t){return H(e,t,i)}function K(e,t){return n(t,32),V(e,t)}function W(e,t,r){var n=new Uint8Array(32);return H(n,r,t),b(e,o,n,w)}E.prototype.blocks=function(e,t,r){for(var n,o,i,a,s,u,c,l,f,d,h,p,y,m,g,v,b,w,A,S=this.fin?0:2048,k=this.h[0],_=this.h[1],E=this.h[2],x=this.h[3],T=this.h[4],P=this.h[5],O=this.h[6],R=this.h[7],I=this.h[8],C=this.h[9],M=this.r[0],B=this.r[1],N=this.r[2],L=this.r[3],j=this.r[4],U=this.r[5],F=this.r[6],D=this.r[7],z=this.r[8],q=this.r[9];r>=16;)d=f=0,d+=(k+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*M,d+=(_+=8191&(n>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),d+=(E+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*z),d+=(x+=8191&(i>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*D),f=(d+=(T+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*F))>>>13,d&=8191,d+=(P+=s>>>1&8191)*(5*U),d+=(O+=8191&(s>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*j),d+=(R+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),d+=(I+=8191&(c>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*N),h=f+=(d+=(C+=l>>>5|S)*(5*B))>>>13,h+=k*B,h+=_*M,h+=E*(5*q),h+=x*(5*z),f=(h+=T*(5*D))>>>13,h&=8191,h+=P*(5*F),h+=O*(5*U),h+=R*(5*j),h+=I*(5*L),f+=(h+=C*(5*N))>>>13,h&=8191,p=f,p+=k*N,p+=_*B,p+=E*M,p+=x*(5*q),f=(p+=T*(5*z))>>>13,p&=8191,p+=P*(5*D),p+=O*(5*F),p+=R*(5*U),p+=I*(5*j),y=f+=(p+=C*(5*L))>>>13,y+=k*L,y+=_*N,y+=E*B,y+=x*M,f=(y+=T*(5*q))>>>13,y&=8191,y+=P*(5*z),y+=O*(5*D),y+=R*(5*F),y+=I*(5*U),m=f+=(y+=C*(5*j))>>>13,m+=k*j,m+=_*L,m+=E*N,m+=x*B,f=(m+=T*M)>>>13,m&=8191,m+=P*(5*q),m+=O*(5*z),m+=R*(5*D),m+=I*(5*F),g=f+=(m+=C*(5*U))>>>13,g+=k*U,g+=_*j,g+=E*L,g+=x*N,f=(g+=T*B)>>>13,g&=8191,g+=P*M,g+=O*(5*q),g+=R*(5*z),g+=I*(5*D),v=f+=(g+=C*(5*F))>>>13,v+=k*F,v+=_*U,v+=E*j,v+=x*L,f=(v+=T*N)>>>13,v&=8191,v+=P*B,v+=O*M,v+=R*(5*q),v+=I*(5*z),b=f+=(v+=C*(5*D))>>>13,b+=k*D,b+=_*F,b+=E*U,b+=x*j,f=(b+=T*L)>>>13,b&=8191,b+=P*N,b+=O*B,b+=R*M,b+=I*(5*q),w=f+=(b+=C*(5*z))>>>13,w+=k*z,w+=_*D,w+=E*F,w+=x*U,f=(w+=T*j)>>>13,w&=8191,w+=P*L,w+=O*N,w+=R*B,w+=I*M,A=f+=(w+=C*(5*q))>>>13,A+=k*q,A+=_*z,A+=E*D,A+=x*F,f=(A+=T*U)>>>13,A&=8191,A+=P*j,A+=O*L,A+=R*N,A+=I*B,k=d=8191&(f=(f=((f+=(A+=C*M)>>>13)<<2)+f|0)+(d&=8191)|0),_=h+=f>>>=13,E=p&=8191,x=y&=8191,T=m&=8191,P=g&=8191,O=v&=8191,R=b&=8191,I=w&=8191,C=A&=8191,t+=16,r-=16;this.h[0]=k,this.h[1]=_,this.h[2]=E,this.h[3]=x,this.h[4]=T,this.h[5]=P,this.h[6]=O,this.h[7]=R,this.h[8]=I,this.h[9]=C},E.prototype.finish=function(e,t){var r,n,o,i,a=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,i=1;i<10;i++)a[i]=this.h[i]+r,r=a[i]>>>13,a[i]&=8191;for(a[9]-=8192,n=(1^r)-1,i=0;i<10;i++)a[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|a[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var n,o;if(this.leftover){for((o=16-this.leftover)>r&&(o=r),n=0;n=16&&(o=r-r%16,this.blocks(e,t,o),t+=o,r-=o),r){for(n=0;n=128;){for(S=0;S<16;S++)k=8*S+X,R[S]=r[k+0]<<24|r[k+1]<<16|r[k+2]<<8|r[k+3],I[S]=r[k+4]<<24|r[k+5]<<16|r[k+6]<<8|r[k+7];for(S=0;S<80;S++)if(o=C,i=M,a=B,s=N,u=L,c=j,l=U,d=D,h=z,p=q,y=H,m=V,g=K,v=W,x=65535&(E=G),T=E>>>16,P=65535&(_=F),O=_>>>16,x+=65535&(E=(V>>>14|L<<18)^(V>>>18|L<<14)^(L>>>9|V<<23)),T+=E>>>16,P+=65535&(_=(L>>>14|V<<18)^(L>>>18|V<<14)^(V>>>9|L<<23)),O+=_>>>16,x+=65535&(E=V&K^~V&W),T+=E>>>16,P+=65535&(_=L&j^~L&U),O+=_>>>16,_=Z[2*S],x+=65535&(E=Z[2*S+1]),T+=E>>>16,P+=65535&_,O+=_>>>16,_=R[S%16],T+=(E=I[S%16])>>>16,P+=65535&_,O+=_>>>16,P+=(T+=(x+=65535&E)>>>16)>>>16,x=65535&(E=A=65535&x|T<<16),T=E>>>16,P=65535&(_=w=65535&P|(O+=P>>>16)<<16),O=_>>>16,x+=65535&(E=(D>>>28|C<<4)^(C>>>2|D<<30)^(C>>>7|D<<25)),T+=E>>>16,P+=65535&(_=(C>>>28|D<<4)^(D>>>2|C<<30)^(D>>>7|C<<25)),O+=_>>>16,T+=(E=D&z^D&q^z&q)>>>16,P+=65535&(_=C&M^C&B^M&B),O+=_>>>16,f=65535&(P+=(T+=(x+=65535&E)>>>16)>>>16)|(O+=P>>>16)<<16,b=65535&x|T<<16,x=65535&(E=y),T=E>>>16,P=65535&(_=s),O=_>>>16,T+=(E=A)>>>16,P+=65535&(_=w),O+=_>>>16,M=o,B=i,N=a,L=s=65535&(P+=(T+=(x+=65535&E)>>>16)>>>16)|(O+=P>>>16)<<16,j=u,U=c,F=l,C=f,z=d,q=h,H=p,V=y=65535&x|T<<16,K=m,W=g,G=v,D=b,S%16==15)for(k=0;k<16;k++)_=R[k],x=65535&(E=I[k]),T=E>>>16,P=65535&_,O=_>>>16,_=R[(k+9)%16],x+=65535&(E=I[(k+9)%16]),T+=E>>>16,P+=65535&_,O+=_>>>16,w=R[(k+1)%16],x+=65535&(E=((A=I[(k+1)%16])>>>1|w<<31)^(A>>>8|w<<24)^(A>>>7|w<<25)),T+=E>>>16,P+=65535&(_=(w>>>1|A<<31)^(w>>>8|A<<24)^w>>>7),O+=_>>>16,w=R[(k+14)%16],T+=(E=((A=I[(k+14)%16])>>>19|w<<13)^(w>>>29|A<<3)^(A>>>6|w<<26))>>>16,P+=65535&(_=(w>>>19|A<<13)^(A>>>29|w<<3)^w>>>6),O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,R[k]=65535&P|O<<16,I[k]=65535&x|T<<16;x=65535&(E=D),T=E>>>16,P=65535&(_=C),O=_>>>16,_=e[0],T+=(E=t[0])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[0]=C=65535&P|O<<16,t[0]=D=65535&x|T<<16,x=65535&(E=z),T=E>>>16,P=65535&(_=M),O=_>>>16,_=e[1],T+=(E=t[1])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[1]=M=65535&P|O<<16,t[1]=z=65535&x|T<<16,x=65535&(E=q),T=E>>>16,P=65535&(_=B),O=_>>>16,_=e[2],T+=(E=t[2])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[2]=B=65535&P|O<<16,t[2]=q=65535&x|T<<16,x=65535&(E=H),T=E>>>16,P=65535&(_=N),O=_>>>16,_=e[3],T+=(E=t[3])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[3]=N=65535&P|O<<16,t[3]=H=65535&x|T<<16,x=65535&(E=V),T=E>>>16,P=65535&(_=L),O=_>>>16,_=e[4],T+=(E=t[4])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[4]=L=65535&P|O<<16,t[4]=V=65535&x|T<<16,x=65535&(E=K),T=E>>>16,P=65535&(_=j),O=_>>>16,_=e[5],T+=(E=t[5])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[5]=j=65535&P|O<<16,t[5]=K=65535&x|T<<16,x=65535&(E=W),T=E>>>16,P=65535&(_=U),O=_>>>16,_=e[6],T+=(E=t[6])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[6]=U=65535&P|O<<16,t[6]=W=65535&x|T<<16,x=65535&(E=G),T=E>>>16,P=65535&(_=F),O=_>>>16,_=e[7],T+=(E=t[7])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[7]=F=65535&P|O<<16,t[7]=G=65535&x|T<<16,X+=128,n-=128}return n}function Y(e,t,r){var n,o=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),s=r;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(o,i,t,r),r%=128,n=0;n=0;--o)$(e,t,n=r[o/8|0]>>(7&o)&1),J(t,e),J(e,e),$(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];R(n[0],f),R(n[1],d),R(n[2],s),F(n[3],f,d),te(e,n,r)}function ne(e,r,o){var i,a=new Uint8Array(64),s=[t(),t(),t(),t()];for(o||n(r,32),Y(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),ee(e,s),i=0;i<32;i++)r[i+32]=e[i];return 0}var oe=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o>4)*oe[o],r=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=r*oe[o];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ae(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,r)}function se(e,r,n,o){var i,a,s=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),l=new Float64Array(64),f=[t(),t(),t(),t()];Y(s,o,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=n+64;for(i=0;i>7&&U(e[0],a,e[0]),F(e[3],e[0],e[1]),0)}(d,o))return-1;for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r{"use strict";r.r(t),r.d(t,{StellarBase:()=>i,axios:()=>a.Z,default:()=>s});var n=r(8026),o={};for(const u in n)["default","StellarBase","axios"].indexOf(u)<0&&(o[u]=()=>n[u]);r.d(t,o);var i=r(4172),a=r(1257);const s=(e=r.hmd(e)).exports},7939:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){for(var r=0;ru});var a={allowHttp:!1,timeout:0},s=Object.assign({},a),u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"setAllowHttp",value:function(e){s.allowHttp=e}},{key:"setTimeout",value:function(e){s.timeout=e}},{key:"isAllowHttp",value:function(){return s.allowHttp}},{key:"getTimeout",value:function(){return s.timeout}},{key:"setDefault",value:function(){s=Object.assign({},a)}}],r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},936:(e,t,r)=>{"use strict";r.d(t,{o:()=>y});var n=r(8026),o=r(8764).Buffer;function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function u(e){return u="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},u(e)}function c(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)throw new Error("Multiple outputs not supported");var a=o[0];return a.switch().value===n.xdr.ScSpecType.scSpecTypeResult().value?this.scValToNative(r,a.result().okType()):this.scValToNative(r,a)}},{key:"findEntry",value:function(e){var t=this.entries.find((function(t){return t.value().name().toString()===e}));if(!t)throw new Error("no such entry: ".concat(e));return t}},{key:"nativeToScVal",value:function(e,t){var r=this,i=t.switch(),a=i.value;if(i.value===n.xdr.ScSpecType.scSpecTypeUdt().value){var s=t.udt();return this.nativeToUdt(e,s.name().toString())}if(a===n.xdr.ScSpecType.scSpecTypeOption().value){var c=t.option();return void 0===e?n.xdr.ScVal.scvVoid():this.nativeToScVal(e,c.valueType())}switch(u(e)){case"object":var l,f,h;if(null===e){if(a===n.xdr.ScSpecType.scSpecTypeVoid().value)return n.xdr.ScVal.scvVoid();throw new TypeError("Type ".concat(t," was not void, but value was null"))}if(e instanceof n.xdr.ScVal)return e;if(e instanceof n.Address){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.toScVal()}if(e instanceof n.Contract){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.address().toScVal()}if(e instanceof Uint8Array||o.isBuffer(e)){var p=Uint8Array.from(e);switch(a){case n.xdr.ScSpecType.scSpecTypeBytesN().value:var y=t.bytesN();if(p.length!==y.n())throw new TypeError("expected ".concat(y.n()," bytes, but got ").concat(p.length));return n.xdr.ScVal.scvBytes(p);case n.xdr.ScSpecType.scSpecTypeBytes().value:return n.xdr.ScVal.scvBytes(p);default:throw new TypeError("invalid type (".concat(t,") specified for Bytes and BytesN"))}}if(Array.isArray(e))switch(a){case n.xdr.ScSpecType.scSpecTypeVec().value:var m=t.vec().elementType();return n.xdr.ScVal.scvVec(e.map((function(e){return r.nativeToScVal(e,m)})));case n.xdr.ScSpecType.scSpecTypeTuple().value:var g=t.tuple().valueTypes();if(e.length!==g.length)throw new TypeError("Tuple expects ".concat(g.length," values, but ").concat(e.length," were provided"));return n.xdr.ScVal.scvVec(e.map((function(e,t){return r.nativeToScVal(e,g[t])})));case n.xdr.ScSpecType.scSpecTypeMap().value:var v=t.map(),b=v.keyType(),w=v.valueType();return n.xdr.ScVal.scvMap(e.map((function(e){var t=r.nativeToScVal(e[0],b),o=r.nativeToScVal(e[1],w);return new n.xdr.ScMapEntry({key:t,val:o})})));default:throw new TypeError("Type ".concat(t," was not vec, but value was Array"))}if(e.constructor===Map){if(a!==n.xdr.ScSpecType.scSpecTypeMap().value)throw new TypeError("Type ".concat(t," was not map, but value was Map"));for(var A=t.map(),S=[],k=e.entries(),_=k.next();!_.done;){var E=d(_.value,2),x=E[0],T=E[1],P=this.nativeToScVal(x,A.keyType()),O=this.nativeToScVal(T,A.valueType());S.push(new n.xdr.ScMapEntry({key:P,val:O})),_=k.next()}return n.xdr.ScVal.scvMap(S)}if("Object"!==(null!==(l=null===(f=e.constructor)||void 0===f?void 0:f.name)&&void 0!==l?l:""))throw new TypeError("cannot interpret ".concat(null===(h=e.constructor)||void 0===h?void 0:h.name," value as ScVal (").concat(JSON.stringify(e),")"));throw new TypeError("Received object ".concat(e," did not match the provided type ").concat(t));case"number":case"bigint":switch(a){case n.xdr.ScSpecType.scSpecTypeU32().value:return n.xdr.ScVal.scvU32(e);case n.xdr.ScSpecType.scSpecTypeI32().value:return n.xdr.ScVal.scvI32(e);case n.xdr.ScSpecType.scSpecTypeU64().value:case n.xdr.ScSpecType.scSpecTypeI64().value:case n.xdr.ScSpecType.scSpecTypeU128().value:case n.xdr.ScSpecType.scSpecTypeI128().value:case n.xdr.ScSpecType.scSpecTypeU256().value:case n.xdr.ScSpecType.scSpecTypeI256().value:var R=i.name.substring(10).toLowerCase();return new n.XdrLargeInt(R,e).toScVal();default:throw new TypeError("invalid type (".concat(t,") specified for integer"))}case"string":return function(e,t){switch(t.value){case n.xdr.ScSpecType.scSpecTypeString().value:return n.xdr.ScVal.scvString(e);case n.xdr.ScSpecType.scSpecTypeSymbol().value:return n.xdr.ScVal.scvSymbol(e);case n.xdr.ScSpecType.scSpecTypeAddress().value:var r=n.Address.fromString(e);return n.xdr.ScVal.scvAddress(r.toScAddress());case n.xdr.ScSpecType.scSpecTypeU64().value:return new n.XdrLargeInt("u64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI64().value:return new n.XdrLargeInt("i64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU128().value:return new n.XdrLargeInt("u128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI128().value:return new n.XdrLargeInt("i128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU256().value:return new n.XdrLargeInt("u256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI256().value:return new n.XdrLargeInt("i256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeBytes().value:case n.xdr.ScSpecType.scSpecTypeBytesN().value:return n.xdr.ScVal.scvBytes(o.from(e,"base64"));default:throw new TypeError("invalid type ".concat(t.name," specified for string value"))}}(e,i);case"boolean":if(a!==n.xdr.ScSpecType.scSpecTypeBool().value)throw TypeError("Type ".concat(t," was not bool, but value was bool"));return n.xdr.ScVal.scvBool(e);case"undefined":if(!t)return n.xdr.ScVal.scvVoid();switch(a){case n.xdr.ScSpecType.scSpecTypeVoid().value:case n.xdr.ScSpecType.scSpecTypeOption().value:return n.xdr.ScVal.scvVoid();default:throw new TypeError("Type ".concat(t," was not void, but value was undefined"))}case"function":return this.nativeToScVal(e(),t);default:throw new TypeError("failed to convert typeof ".concat(u(e)," (").concat(e,")"))}}},{key:"nativeToUdt",value:function(e,t){var r=this.findEntry(t);switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():if("number"!=typeof e)throw new TypeError("expected number for enum ".concat(t,", but got ").concat(u(e)));return this.nativeToEnum(e,r.udtEnumV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.nativeToStruct(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.nativeToUnion(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t))}}},{key:"nativeToUnion",value:function(e,t){var r=this,o=e.tag,i=t.cases().find((function(e){return e.value().name().toString()===o}));if(!i)throw new TypeError("no such enum entry: ".concat(o," in ").concat(t));var a=n.xdr.ScVal.scvSymbol(o);switch(i.switch()){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():return n.xdr.ScVal.scvVec([a]);case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var s=i.tupleCase().type();if(Array.isArray(e.values)){if(e.values.length!=s.length)throw new TypeError("union ".concat(t," expects ").concat(s.length," values, but got ").concat(e.values.length));var u=e.values.map((function(e,t){return r.nativeToScVal(e,s[t])}));return u.unshift(a),n.xdr.ScVal.scvVec(u)}throw new Error("failed to parse union case ".concat(i," with ").concat(e));default:throw new Error("failed to parse union ".concat(t," with ").concat(e))}}},{key:"nativeToStruct",value:function(e,t){var r=this,o=t.fields();if(o.some(m)){if(!o.every(m))throw new Error("mixed numeric and non-numeric field names are not allowed");return n.xdr.ScVal.scvVec(o.map((function(t,n){return r.nativeToScVal(e[n],o[n].type())})))}return n.xdr.ScVal.scvMap(o.map((function(t){var o=t.name().toString();return new n.xdr.ScMapEntry({key:r.nativeToScVal(o,n.xdr.ScSpecTypeDef.scSpecTypeSymbol()),val:r.nativeToScVal(e[o],t.type())})})))}},{key:"nativeToEnum",value:function(e,t){if(t.cases().some((function(t){return t.value()===e})))return n.xdr.ScVal.scvU32(e);throw new TypeError("no such enum entry: ".concat(e," in ").concat(t))}},{key:"scValStrToNative",value:function(e,t){return this.scValToNative(n.xdr.ScVal.fromXDR(e,"base64"),t)}},{key:"scValToNative",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(i===n.xdr.ScSpecType.scSpecTypeUdt().value)return this.scValUdtToNative(e,t.udt());switch(e.switch().value){case n.xdr.ScValType.scvVoid().value:return;case n.xdr.ScValType.scvU64().value:case n.xdr.ScValType.scvI64().value:case n.xdr.ScValType.scvU128().value:case n.xdr.ScValType.scvI128().value:case n.xdr.ScValType.scvU256().value:case n.xdr.ScValType.scvI256().value:return(0,n.scValToBigInt)(e);case n.xdr.ScValType.scvVec().value:if(i==n.xdr.ScSpecType.scSpecTypeVec().value){var a,s=t.vec();return(null!==(a=e.vec())&&void 0!==a?a:[]).map((function(e){return r.scValToNative(e,s.elementType())}))}if(i==n.xdr.ScSpecType.scSpecTypeTuple().value){var u,c=t.tuple().valueTypes();return(null!==(u=e.vec())&&void 0!==u?u:[]).map((function(e,t){return r.scValToNative(e,c[t])}))}throw new TypeError("Type ".concat(t," was not vec, but ").concat(e," is"));case n.xdr.ScValType.scvAddress().value:return n.Address.fromScVal(e).toString();case n.xdr.ScValType.scvMap().value:var l,f=null!==(l=e.map())&&void 0!==l?l:[];if(i==n.xdr.ScSpecType.scSpecTypeMap().value){var d=t.map(),h=d.keyType(),p=d.valueType();return f.map((function(e){return[r.scValToNative(e.key(),h),r.scValToNative(e.val(),p)]}))}throw new TypeError("ScSpecType ".concat(o.name," was not map, but ").concat(JSON.stringify(e,null,2)," is"));case n.xdr.ScValType.scvBool().value:case n.xdr.ScValType.scvU32().value:case n.xdr.ScValType.scvI32().value:case n.xdr.ScValType.scvBytes().value:return e.value();case n.xdr.ScValType.scvString().value:case n.xdr.ScValType.scvSymbol().value:var y;if(i!==n.xdr.ScSpecType.scSpecTypeString().value&&i!==n.xdr.ScSpecType.scSpecTypeSymbol().value)throw new Error("ScSpecType ".concat(o.name," was not string or symbol, but ").concat(JSON.stringify(e,null,2)," is"));return null===(y=e.value())||void 0===y?void 0:y.toString();case n.xdr.ScValType.scvTimepoint().value:case n.xdr.ScValType.scvDuration().value:return(0,n.scValToBigInt)(n.xdr.ScVal.scvU64(e.u64()));default:throw new TypeError("failed to convert ".concat(JSON.stringify(e,null,2)," to native type from type ").concat(o.name))}}},{key:"scValUdtToNative",value:function(e,t){var r=this.findEntry(t.name().toString());switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.enumToNative(e);case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.structToNative(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.unionToNative(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t.name().toString(),": ").concat(r))}}},{key:"unionToNative",value:function(e,t){var r=this,o=e.vec();if(!o)throw new Error("".concat(JSON.stringify(e,null,2)," is not a vec"));if(0===o.length&&0!==t.cases.length)throw new Error("".concat(e," has length 0, but the there are at least one case in the union"));var i=o[0].sym().toString();if(o[0].switch().value!=n.xdr.ScValType.scvSymbol().value)throw new Error("{vec[0]} is not a symbol");var a=t.cases().find(function(e){return function(t){switch(t.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:return t.tupleCase().name().toString()===e;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:return t.voidCase().name().toString()===e;default:return!1}}}(i));if(!a)throw new Error("failed to find entry ".concat(i," in union {udt.name().toString()}"));var s={tag:i};if(a.switch().value===n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value){var u=a.tupleCase().type().map((function(e,t){return r.scValToNative(o[t+1],e)}));s.values=u}return s}},{key:"structToNative",value:function(e,t){var r,n,o=this,i={},a=t.fields();return a.some(m)?null===(n=e.vec())||void 0===n?void 0:n.map((function(e,t){return o.scValToNative(e,a[t].type())})):(null===(r=e.map())||void 0===r||r.forEach((function(e,t){var r=a[t];i[r.name().toString()]=o.scValToNative(e.val(),r.type())})),i)}},{key:"enumToNative",value:function(e){if(e.switch().value!==n.xdr.ScValType.scvU32().value)throw new Error("Enum must have a u32 value");return e.u32()}},{key:"jsonSchema",value:function(e){var t,r={},o=s(this.entries);try{for(o.s();!(t=o.n()).done;){var i=t.value;switch(i.switch().value){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:var u=i.udtEnumV0();r[u.name().toString()]=k(u);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:var c=i.udtStructV0();r[c.name().toString()]=b(c);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:var l=i.udtUnionV0();r[l.name().toString()]=S(l);break;case n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:var f=i.functionV0(),d=f.name().toString(),h=A(f).input;r[d]=h;case n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:}}}catch(e){o.e(e)}finally{o.f()}var p={$schema:"http://json-schema.org/draft-07/schema#",definitions:a(a({},g),r)};return e&&(p.$ref="#/definitions/".concat(e)),p}}])&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function m(e){return/^\d+$/.test(e.name().toString())}var g={U32:{type:"integer",minimum:0,maximum:4294967295},I32:{type:"integer",minimum:-2147483648,maximum:2147483647},U64:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:20},I64:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:21},U128:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:39},I128:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:40},U256:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:78},I256:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:79},Address:{type:"string",format:"address",description:"Address can be a public key or contract id"},ScString:{type:"string",description:"ScString is a string"},ScSymbol:{type:"string",description:"ScString is a string"},DataUrl:{type:"string",pattern:"^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$"}};function v(e){var t;switch(e.switch().value){case n.xdr.ScSpecType.scSpecTypeVal().value:t="Val";break;case n.xdr.ScSpecType.scSpecTypeBool().value:return{type:"boolean"};case n.xdr.ScSpecType.scSpecTypeVoid().value:return{type:"null"};case n.xdr.ScSpecType.scSpecTypeError().value:t="Error";break;case n.xdr.ScSpecType.scSpecTypeU32().value:t="U32";break;case n.xdr.ScSpecType.scSpecTypeI32().value:t="I32";break;case n.xdr.ScSpecType.scSpecTypeU64().value:t="U64";break;case n.xdr.ScSpecType.scSpecTypeI64().value:t="I64";break;case n.xdr.ScSpecType.scSpecTypeTimepoint().value:throw new Error("Timepoint type not supported");case n.xdr.ScSpecType.scSpecTypeDuration().value:throw new Error("Duration not supported");case n.xdr.ScSpecType.scSpecTypeU128().value:t="U128";break;case n.xdr.ScSpecType.scSpecTypeI128().value:t="I128";break;case n.xdr.ScSpecType.scSpecTypeU256().value:t="U256";break;case n.xdr.ScSpecType.scSpecTypeI256().value:t="I256";break;case n.xdr.ScSpecType.scSpecTypeBytes().value:t="DataUrl";break;case n.xdr.ScSpecType.scSpecTypeString().value:t="ScString";break;case n.xdr.ScSpecType.scSpecTypeSymbol().value:t="ScSymbol";break;case n.xdr.ScSpecType.scSpecTypeAddress().value:t="Address";break;case n.xdr.ScSpecType.scSpecTypeOption().value:return v(e.option().valueType());case n.xdr.ScSpecType.scSpecTypeResult().value:break;case n.xdr.ScSpecType.scSpecTypeVec().value:return{type:"array",items:v(e.vec().elementType())};case n.xdr.ScSpecType.scSpecTypeMap().value:var r=e.map();return{type:"array",items:{type:"array",items:[v(r.keyType()),v(r.valueType())],minItems:2,maxItems:2}};case n.xdr.ScSpecType.scSpecTypeTuple().value:var o=e.tuple(),i=o.valueTypes().length,a=i;return{type:"array",items:o.valueTypes().map(v),minItems:i,maxItems:a};case n.xdr.ScSpecType.scSpecTypeBytesN().value:return{$ref:"#/definitions/DataUrl",maxLength:e.bytesN().n()};case n.xdr.ScSpecType.scSpecTypeUdt().value:t=e.udt().name().toString()}return{$ref:"#/definitions/".concat(t)}}function b(e){var t=e.fields();if(t.some(m)){if(!t.every(m))throw new Error("mixed numeric and non-numeric field names are not allowed");return{type:"array",items:t.map((function(e,r){return v(t[r].type())})),minItems:t.length,maxItems:t.length}}var r=e.doc().toString(),n=w(t),o=n.properties,i=n.required;return o.additionalProperties=!1,{description:r,properties:o,required:i,type:"object"}}function w(e){var t,r={},o=[],i=s(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,u=a.type(),c=a.name().toString();r[c]=v(u),u.switch().value!=n.xdr.ScSpecType.scSpecTypeOption().value&&o.push(c)}}catch(e){i.e(e)}finally{i.f()}var l={properties:r};return o.length>0&&(l.required=o),l}function A(e){var t=w(e.inputs()),r=t.properties,o=t.required,i={additionalProperties:!1,properties:r,type:"object"};(null==o?void 0:o.length)>0&&(i.required=o);var a={properties:{args:i}},s=e.outputs(),u=s.length>0?v(s[0]):v(n.xdr.ScSpecTypeDef.scSpecTypeVoid()),c=e.doc().toString();return c.length>0&&(a.description=c),a.additionalProperties=!1,u.additionalProperties=!1,{input:a,output:u}}function S(e){var t,r=e.doc().toString(),o=[],i=s(e.cases());try{for(i.s();!(t=i.n()).done;){var a=t.value;switch(a.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:var u=a.voidCase().name().toString();o.push({type:"object",title:u,properties:{tag:u},additionalProperties:!1,required:["tag"]});break;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:var c=a.tupleCase(),l=c.name().toString();o.push({type:"object",title:l,properties:{tag:l,values:{type:"array",items:c.type().map(v)}},required:["tag","values"],additionalProperties:!1})}}}catch(e){i.e(e)}finally{i.f()}var f={oneOf:o};return r.length>0&&(f.description=r),f}function k(e){var t,r=e.doc().toString(),n=[],o=s(e.cases());try{for(o.s();!(t=o.n()).done;){var i=t.value,a=i.name().toString(),u=i.doc().toString();n.push({description:u,title:a,enum:[i.value()],type:"number"})}}catch(e){o.e(e)}finally{o.f()}var c={oneOf:n};return r.length>0&&(c.description=r),c}},6086:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;ry,Fz:()=>v,dR:()=>m,hs:()=>b,oY:()=>g});var y=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e)).__proto__=a,i.constructor=r,i.response=n,i}return a(r,[{key:"getResponse",value:function(){return this.response}}]),r}(l(Error)),m=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="NotFoundError",i}return a(r)}(y),g=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="BadRequestError",i}return a(r)}(y),v=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="BadResponseError",i}return a(r)}(y),b=function(e){u(r,e);var t=c(r);function r(e,n,i){var a;o(this,r);var s=(this instanceof r?this.constructor:void 0).prototype;return(a=t.call(this,e)).__proto__=s,a.constructor=r,a.name="AccountRequiresMemoError",a.accountId=n,a.operationIndex=i,a}return a(r)}(l(Error))},2761:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>n,FEDERATION_RESPONSE_MAX_SIZE:()=>b,Server:()=>w});var n={};r.r(n),r.d(n,{Api:()=>{}});var o=r(1257),i=r(4172),a=r(4998),s=r.n(a),u=r(7939),c=r(6086),l=r(4700);function f(e){return f="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},f(e)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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 new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function y(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)}))}}function g(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=s()(t),this.domain=r;var o=void 0===n.allowHttp?u.D.isAllowHttp():n.allowHttp;if(this.timeout=void 0===n.timeout?u.D.getTimeout():n.timeout,"https"!==this.serverURL.protocol()&&!o)throw new Error("Cannot connect to insecure federation server")}var t,r,n,a,f,h,y,v,w;return t=e,r=[{key:"resolveAddress",value:(w=m(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,!(t.indexOf("*")<0)){e.next=5;break}if(this.domain){e.next=4;break}return e.abrupt("return",Promise.reject(new Error("Unknown domain. Make sure `address` contains a domain (ex. `bob*stellar.org`) or pass `domain` parameter when instantiating the server object.")));case 4:r="".concat(t,"*").concat(this.domain);case 5:return n=this.serverURL.query({type:"name",q:r}),e.abrupt("return",this._sendRequest(n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"resolveAccountId",value:(v=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.serverURL.query({type:"id",q:t}),e.abrupt("return",this._sendRequest(r));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"resolveTransactionId",value:(y=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.serverURL.query({type:"txid",q:t}),e.abrupt("return",this._sendRequest(r));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_sendRequest",value:(h=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.timeout,e.abrupt("return",o.Z.get(t.toString(),{maxContentLength:b,timeout:r}).then((function(e){if(void 0!==e.data.memo&&"string"!=typeof e.data.memo)throw new Error("memo value should be of type string");return e.data})).catch((function(e){if(e instanceof Error){if(e.message.match(/^maxContentLength size/))throw new Error("federation response exceeds allowed size of ".concat(b));return Promise.reject(e)}return Promise.reject(new c.Fz("Server query failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})}],n=[{key:"resolve",value:(f=m(p().mark((function t(r){var n,o,a,s,u,c=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:{},!(r.indexOf("*")<0)){t.next=5;break}if(i.StrKey.isValidEd25519PublicKey(r)){t.next=4;break}return t.abrupt("return",Promise.reject(new Error("Invalid Account ID")));case 4:return t.abrupt("return",Promise.resolve({account_id:r}));case 5:if(o=r.split("*"),a=d(o,2),s=a[1],2===o.length&&s){t.next=9;break}return t.abrupt("return",Promise.reject(new Error("Invalid Stellar address")));case 9:return t.next=11,e.createForDomain(s,n);case 11:return u=t.sent,t.abrupt("return",u.resolveAddress(r));case 13:case"end":return t.stop()}}),t)}))),function(e){return f.apply(this,arguments)})},{key:"createForDomain",value:(a=m(p().mark((function t(r){var n,o,i=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,l.Resolver.resolve(r,n);case 3:if((o=t.sent).FEDERATION_SERVER){t.next=6;break}return t.abrupt("return",Promise.reject(new Error("stellar.toml does not contain FEDERATION_SERVER field")));case 6:return t.abrupt("return",new e(o.FEDERATION_SERVER,r,n));case 7:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)})}],r&&g(t.prototype,r),n&&g(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},197:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{}})},6881:(e,t,r)=>{"use strict";var n,o;r.r(t),r.d(t,{AccountResponse:()=>l,AxiosClient:()=>z,HorizonApi:()=>n,SERVER_TIME_MAP:()=>U,Server:()=>Kt,ServerApi:()=>o,default:()=>Wt,getCurrentServerTime:()=>q}),function(e){var t=function(e){return e.constantProduct="constant_product",e}({});e.LiquidityPoolType=t;var r=function(e){return e.createAccount="create_account",e.payment="payment",e.pathPayment="path_payment_strict_receive",e.createPassiveOffer="create_passive_sell_offer",e.manageOffer="manage_sell_offer",e.setOptions="set_options",e.changeTrust="change_trust",e.allowTrust="allow_trust",e.accountMerge="account_merge",e.inflation="inflation",e.manageData="manage_data",e.bumpSequence="bump_sequence",e.manageBuyOffer="manage_buy_offer",e.pathPaymentStrictSend="path_payment_strict_send",e.createClaimableBalance="create_claimable_balance",e.claimClaimableBalance="claim_claimable_balance",e.beginSponsoringFutureReserves="begin_sponsoring_future_reserves",e.endSponsoringFutureReserves="end_sponsoring_future_reserves",e.revokeSponsorship="revoke_sponsorship",e.clawback="clawback",e.clawbackClaimableBalance="clawback_claimable_balance",e.setTrustLineFlags="set_trust_line_flags",e.liquidityPoolDeposit="liquidity_pool_deposit",e.liquidityPoolWithdraw="liquidity_pool_withdraw",e.invokeHostFunction="invoke_host_function",e.bumpFootprintExpiration="bump_footprint_expiration",e.restoreFootprint="restore_footprint",e}({});e.OperationResponseType=r;var n=function(e){return e[e.createAccount=0]="createAccount",e[e.payment=1]="payment",e[e.pathPayment=2]="pathPayment",e[e.createPassiveOffer=3]="createPassiveOffer",e[e.manageOffer=4]="manageOffer",e[e.setOptions=5]="setOptions",e[e.changeTrust=6]="changeTrust",e[e.allowTrust=7]="allowTrust",e[e.accountMerge=8]="accountMerge",e[e.inflation=9]="inflation",e[e.manageData=10]="manageData",e[e.bumpSequence=11]="bumpSequence",e[e.manageBuyOffer=12]="manageBuyOffer",e[e.pathPaymentStrictSend=13]="pathPaymentStrictSend",e[e.createClaimableBalance=14]="createClaimableBalance",e[e.claimClaimableBalance=15]="claimClaimableBalance",e[e.beginSponsoringFutureReserves=16]="beginSponsoringFutureReserves",e[e.endSponsoringFutureReserves=17]="endSponsoringFutureReserves",e[e.revokeSponsorship=18]="revokeSponsorship",e[e.clawback=19]="clawback",e[e.clawbackClaimableBalance=20]="clawbackClaimableBalance",e[e.setTrustLineFlags=21]="setTrustLineFlags",e[e.liquidityPoolDeposit=22]="liquidityPoolDeposit",e[e.liquidityPoolWithdraw=23]="liquidityPoolWithdraw",e[e.invokeHostFunction=24]="invokeHostFunction",e[e.bumpFootprintExpiration=25]="bumpFootprintExpiration",e[e.restoreFootprint=26]="restoreFootprint",e}({});e.OperationResponseTypeI=n;var o=function(e){return e.TX_FAILED="tx_failed",e.TX_BAD_SEQ="tx_bad_seq",e.TX_BAD_AUTH="tx_bad_auth",e.TX_BAD_AUTH_EXTRA="tx_bad_auth_extra",e.TX_FEE_BUMP_INNER_SUCCESS="tx_fee_bump_inner_success",e.TX_FEE_BUMP_INNER_FAILED="tx_fee_bump_inner_failed",e.TX_NOT_SUPPORTED="tx_not_supported",e.TX_SUCCESS="tx_success",e.TX_TOO_EARLY="tx_too_early",e.TX_TOO_LATE="tx_too_late",e.TX_MISSING_OPERATION="tx_missing_operation",e.TX_INSUFFICIENT_BALANCE="tx_insufficient_balance",e.TX_NO_SOURCE_ACCOUNT="tx_no_source_account",e.TX_INSUFFICIENT_FEE="tx_insufficient_fee",e.TX_INTERNAL_ERROR="tx_internal_error",e}({});e.TransactionFailedResultCodes=o}(n||(n={})),function(e){var t=function(e){return e.all="all",e.liquidityPools="liquidity_pool",e.orderbook="orderbook",e}({});e.TradeType=t,n.OperationResponseType,n.OperationResponseTypeI}(o||(o={}));var i=r(4172);function a(e){return a="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},a(e)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0||e===t?t:t-1}function k(e){for(var t,r,n=1,o=e.length,i=e[0]+"";nc^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;ai[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function E(e,t,r,n){if(er||e!==h(e))throw Error(p+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return S(e.e/g)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function P(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tj?p.c=p.e=null:e.e=10;u/=10,s++);return void(s>j?p.c=p.e=null:(p.e=s,p.c=[e]))}d=String(e)}else{if(!f.test(d=String(e)))return o(p,d,c);p.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(u=d.search(/e/i))>0?(s<0&&(s=u),s+=+d.slice(u+1),d=d.substring(0,u)):s<0&&(s=d.length)}else{if(E(t,2,q.length,"Base"),10==t&&H)return X(p=new V(e),C+p.e+1,M);if(d=String(e),c="number"==typeof e){if(0*e!=0)return o(p,d,c,t);if(p.s=1/e<0?(d=d.slice(1),-1):1,V.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(y+e)}else p.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=q.slice(0,t),s=u=0,l=d.length;us){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(d=n(d,t,10,p.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(u=0;48===d.charCodeAt(u);u++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(u,++l)){if(l-=u,c&&V.DEBUG&&l>15&&(e>v||e!==h(e)))throw Error(y+p.s*e);if((s=s-u-1)>j)p.c=p.e=null;else if(s=N)?T(u,a):P(u,a,"0");else if(i=(e=X(new V(e),t,r)).e,s=(u=k(e.c)).length,1==n||2==n&&(t<=i||i<=B)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function W(e,t){for(var r,n,o=1,i=new V(e[0]);o=10;o/=10,n++);return(r=n+r*g-1)>j?e.c=e.e=null:r=10;s/=10,o++);if((i=t-o)<0)i+=g,a=t,u=f[c=0],l=h(u/p[o-a-1]%10);else if((c=d((i+1)/g))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=g)-g+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=g)-g+o)<0?0:h(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(g-t%g)%g],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[g-i],f[c]=a>0?h(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==m&&(f[0]=1));break}if(f[c]+=s,f[c]!=m)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>j?e.c=e.e=null:e.e=N?T(t,r):P(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(p+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(E(r=e[t],0,A,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(E(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(E(r[0],-A,0,t),E(r[1],0,A,t),B=r[0],N=r[1]):(E(r,-A,A,t),B=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)E(r[0],-A,-1,t),E(r[1],1,A,t),L=r[0],j=r[1];else{if(E(r,-A,A,t),!r)throw Error(p+t+" cannot be zero: "+r);L=-(j=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(p+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(p+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(E(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(E(r=e[t],0,A,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(p+t+" not an object: "+r);z=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(p+t+" invalid: "+r);H="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:M,EXPONENTIAL_AT:[B,N],RANGE:[L,j],CRYPTO:U,MODULO_MODE:F,POW_PRECISION:D,FORMAT:z,ALPHABET:q}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-A&&o<=A&&o===h(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%g)<1&&(t+=g),String(n[0]).length==t){for(t=0;t=m||r!==h(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(p+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return W(arguments,-1)},V.minimum=V.min=function(){return W(arguments,1)},V.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return h(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new V(I);if(null==e?e=C:E(e,0,A),o=d(e/g),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw U=!1,Error(p+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!U)for(;s=10;i/=10,s++);sr-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,d,h,p,y,m=n.indexOf("."),g=C,v=M;for(m>=0&&(f=D,D=0,n=n.replace(".",""),h=(y=new V(o)).pow(n.length-m),D=f,y.c=t(P(k(h.c),h.e,"0"),10,i,e),y.e=y.c.length),l=f=(p=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=r(h,y,g,v,i)).c,d=h.r,l=h.e),m=p[c=l+g+1],f=i/2,d=d||c<0||null!=p[c+1],d=v<4?(null!=m||d)&&(0==v||v==(h.s<0?3:2)):m>f||m==f&&(4==v||d||6==v&&1&p[c-1]||v==(h.s<0?8:7)),c<1||!p[0])n=d?P(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(p.length=c,d)for(--i;++p[--c]>i;)p[c]=0,c||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=u.charAt(p[m++]));n=P(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%w,l=t/w|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%w)+(n=l*i+(a=e[u]/w|0)*c)%w*w+s)/r|0)+(n/w|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,d,p,y,v,b,w,A,k,_,E,x,T,P,O=n.s==o.s?1:-1,R=n.c,I=o.c;if(!(R&&R[0]&&I&&I[0]))return new V(n.s&&o.s&&(R?!I||R[0]!=I[0]:I)?R&&0==R[0]||!I?0*O:O/0:NaN);for(b=(v=new V(O)).c=[],O=i+(c=n.e-o.e)+1,s||(s=m,c=S(n.e/g)-S(o.e/g),O=O/g|0),l=0;I[l]==(R[l]||0);l++);if(I[l]>(R[l]||0)&&c--,O<0)b.push(1),f=!0;else{for(E=R.length,T=I.length,l=0,O+=2,(d=h(s/(I[0]+1)))>1&&(I=e(I,d,s),R=e(R,d,s),T=I.length,E=R.length),_=T,A=(w=R.slice(0,T)).length;A=s/2&&x++;do{if(d=0,(u=t(I,w,T,A))<0){if(k=w[0],T!=A&&(k=k*s+(w[1]||0)),(d=h(k/x))>1)for(d>=s&&(d=s-1),y=(p=e(I,d,s)).length,A=w.length;1==t(p,w,y,A);)d--,r(p,T=10;O/=10,l++);X(v,i+(v.e=l+c*g-1)+1,a,f)}else v.e=c,v.r=+f;return v}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(O,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new V(i,o);if(V.DEBUG)throw Error(p+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,t){return _(this,new V(e,t))},R.decimalPlaces=R.dp=function(e,t){var r,n,o,i=this;if(null!=e)return E(e,0,A),null==t?t=M:E(t,0,8),X(new V(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-S(this.e/g))*g,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},R.dividedBy=R.div=function(e,t){return r(this,new V(e,t),C,M)},R.dividedToIntegerBy=R.idiv=function(e,t){return r(this,new V(e,t),0,1)},R.exponentiatedBy=R.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new V(e)).c&&!e.isInteger())throw Error(p+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new V(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new V(Math.pow(+Z(l),a?e.s*(2-x(e)):+Z(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&x(e)?-0:0,l.e>-1&&(i=1/i),new V(s?1/i:i);D&&(i=d(D/g+2))}for(a?(r=new V(.5),s&&(e.s=1),u=x(e)):u=(o=Math.abs(+Z(e)))%2,c=new V(I);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=h(o/2)))break;u=o%2}else if(X(e=e.times(r),e.e+1,1),e.e>14)u=x(e);else{if(0===(o=+Z(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=I.div(c)),t?c.mod(t):i?X(c,D,M,void 0):c)},R.integerValue=function(e){var t=new V(this);return null==e?e=M:E(e,0,8),X(t,t.e+1,e)},R.isEqualTo=R.eq=function(e,t){return 0===_(this,new V(e,t))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,t){return _(this,new V(e,t))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,t){return 1===(t=_(this,new V(e,t)))||0===t},R.isInteger=function(){return!!this.c&&S(this.e/g)>this.c.length-2},R.isLessThan=R.lt=function(e,t){return _(this,new V(e,t))<0},R.isLessThanOrEqualTo=R.lte=function(e,t){return-1===(t=_(this,new V(e,t)))||0===t},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new V(e,t)).s,!s||!t)return new V(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/g,c=e.e/g,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new V(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new V(l[0]?a:3==M?-0:0)}if(u=S(u),c=S(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t0)for(;t--;l[r++]=0);for(t=m-1;n>s;){if(l[--n]=0;){for(r=0,d=k[o]%v,h=k[o]/v|0,i=o+(a=u);i>o;)r=((c=d*(c=A[--a]%v)+(s=h*c+(l=A[a]/v|0)*d)%v*v+p[i]+r)/y|0)+(s/v|0)+h*l,p[i--]=c%y;p[i]=r}return r?++n:p.splice(0,1),G(e,p,n)},R.negated=function(){var e=new V(this);return e.s=-e.s||null,e},R.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/g,a=e.e/g,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new V(o/0);if(!s[0]||!u[0])return u[0]?e:new V(s[0]?n:0*o)}if(i=S(i),a=S(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/m|0,s[t]=m===s[t]?0:s[t]%m;return o&&(s=[o].concat(s),++a),G(e,s,a)},R.precision=R.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return E(e,1,A),null==t?t=M:E(t,0,8),X(new V(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*g+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},R.shiftedBy=function(e){return E(e,-9007199254740991,v),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=C+4,f=new V("0.5");if(1!==u||!s||!s[0])return new V(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Z(a)))||u==1/0?(((t=k(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=S((c+1)/2)-(c<0||c%2),n=new V(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new V(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),k(i.c).slice(0,u)===(t=k(n.c)).slice(0,u)){if(n.e0&&y>0){for(i=y%s||s,l=h.substr(0,i);i0&&(l+=c+h.slice(i)),d&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},R.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,d,h,y=this,m=y.c;if(null!=e&&(!(u=new V(e)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(p+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Z(u));if(!m)return new V(y);for(t=new V(I),l=n=new V(I),o=c=new V(I),h=k(m),a=t.e=h.length-y.e-1,t.c[0]=b[(s=a%g)<0?g+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=j,j=1/0,u=new V(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=y.s,d=r(l,o,a*=2,M).minus(y).abs().comparedTo(r(c,n,a,M).minus(y).abs())<1?[l,o]:[c,n],j=s,d},R.toNumber=function(){return+Z(this)},R.toPrecision=function(e,t){return null!=e&&E(e,1,A),K(this,e,t,2)},R.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=B||i>=N?T(k(r.c),i):P(k(r.c),i,"0"):10===e&&H?t=P(k((r=X(new V(r),C+i+1,M)).c),r.e,"0"):(E(e,2,q.length,"Base"),t=n(P(k(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},R.valueOf=R.toJSON=function(){return Z(this)},R._isBigNumber=!0,R[Symbol.toStringTag]="BigNumber",R[Symbol.for("nodejs.util.inspect.custom")]=R.valueOf,null!=t&&V.set(t),V}();const R=O;var I=r(4998),C=r.n(I),M=r(1950),B=r.n(M),N=r(6086),L=r(1257),j=r(4147).i8,U={},F=L.Z.create({headers:{"X-Client-Name":"js-stellar-sdk","X-Client-Version":j}});function D(e){return Math.floor(e/1e3)}F.interceptors.response.use((function(e){var t=C()(e.config.url).hostname(),r=D(Date.parse(e.headers.date)),n=D((new Date).getTime());return isNaN(r)||(U[t]={serverTime:r,localTimeRecorded:n}),e}));const z=F;function q(e){var t=U[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var r=t.serverTime,n=t.localTimeRecorded,o=D((new Date).getTime());return o-n>300?null:o-n+r}function H(e){return H="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},H(e)}var V,K,W;function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),s=new R(n||[]);return o(a,"_invoke",{value:x(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function v(){}function b(){}var w={};c(w,a,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var k=b.prototype=g.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==H(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(t,r,n){var o=d;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function T(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,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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),O(r),m}},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;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function X(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Z(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){X(i,n,o,a,s,"next",e)}function s(e){X(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Q(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r}var t,r,n,o;return t=e,r=[{key:"call",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then((function(t){return e._parseResponse(t)}))}},{key:"stream",value:function(){var e,t,r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.checkFilter(),this.url.setQuery("X-Client-Name","js-stellar-sdk"),this.url.setQuery("X-Client-Version",j);var o=function(){t=setTimeout((function(){var t;null===(t=e)||void 0===t||t.close(),e=i()}),n.reconnectTimeout||15e3)},i=function i(){try{e=new ee(r.url.toString())}catch(e){n.onerror&&n.onerror(e)}if(o(),!e)return e;var a=!1,s=function(){a||(clearTimeout(t),e.close(),i(),a=!0)},u=function(e){if("close"!==e.type){var i=e.data?r._parseRecord(JSON.parse(e.data)):e;i.paging_token&&r.url.setQuery("cursor",i.paging_token),clearTimeout(t),o(),void 0!==n.onmessage&&n.onmessage(i)}else s()},c=function(e){n.onerror&&n.onerror(e)};return e.addEventListener?(e.addEventListener("message",u.bind(r)),e.addEventListener("error",c.bind(r)),e.addEventListener("close",s.bind(r))):(e.onmessage=u.bind(r),e.onerror=c.bind(r)),e};return i(),function(){var r;clearTimeout(t),null===(r=e)||void 0===r||r.close()}}},{key:"cursor",value:function(e){return this.url.setQuery("cursor",e),this}},{key:"limit",value:function(e){return this.url.setQuery("limit",e.toString()),this}},{key:"order",value:function(e){return this.url.setQuery("order",e),this}},{key:"join",value:function(e){return this.url.setQuery("join",e),this}},{key:"forEndpoint",value:function(e,t){if(""===this.neighborRoot)throw new Error("Invalid usage: neighborRoot not set in constructor");return this.filter.push([e,t,this.neighborRoot]),this}},{key:"checkFilter",value:function(){if(this.filter.length>=2)throw new N.oY("Too many filters specified",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:"_requestFnForLink",value:function(e){var t=this;return Z(G().mark((function r(){var n,o,i,a,s=arguments;return G().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},e.templated?(i=B()(e.href),o=C()(i.expand(n))):o=C()(e.href),r.next=4,t._sendNormalRequest(o);case 4:return a=r.sent,r.abrupt("return",t._parseResponse(a));case 6:case"end":return r.stop()}}),r)})))}},{key:"_parseRecord",value:function(e){var t=this;if(!e._links)return e;for(var r=function(){var r=o[n],i=e._links[r],a=!1;if(void 0!==e[r]&&(e["".concat(r,"_attr")]=e[r],a=!0),a&&J.indexOf(r)>=0){var s=t._parseRecord(e[r]);e[r]=Z(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s);case 1:case"end":return e.stop()}}),e)})))}else e[r]=t._requestFnForLink(i)},n=0,o=Object.keys(e._links);nt||e>=24*r||e%r!=0)}}])&&wt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),o}(te);function xt(e){return xt="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},xt(e)}function Tt(e,t){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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),O(r),m}},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;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Dt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function zt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Dt(i,n,o,a,s,"next",e)}function s(e){Dt(i,n,o,a,s,"throw",e)}a(void 0)}))}}function qt(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=C()(t);var n=void 0===r.allowHttp?re.D.isAllowHttp():r.allowHttp,o={};if(r.appName&&(o["X-App-Name"]=r.appName),r.appVersion&&(o["X-App-Version"]=r.appVersion),r.authToken&&(o["X-Auth-Token"]=r.authToken),Object.keys(o).length>0&&z.interceptors.request.use((function(e){return e.headers=Object.assign(e.headers,o),e})),"https"!==this.serverURL.protocol()&&!n)throw new Error("Cannot connect to insecure horizon server")}var t,r,n,o,a,s,u,c;return t=e,r=[{key:"fetchTimebounds",value:(c=zt(Ft().mark((function e(t){var r,n,o=arguments;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],!(n=q(this.serverURL.hostname()))){e.next=4;break}return e.abrupt("return",{minTime:0,maxTime:n+t});case 4:if(!r){e.next=6;break}return e.abrupt("return",{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 6:return e.next=8,z.get(C()(this.serverURL).toString());case 8:return e.next=10,this.fetchTimebounds(t,!0);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"fetchBaseFee",value:(u=zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.feeStats();case 2:return t=e.sent,e.abrupt("return",parseInt(t.last_ledger_base_fee,10)||100);case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"feeStats",value:(s=zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new te(C()(this.serverURL))).filter.push(["fee_stats"]),e.abrupt("return",t.call());case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"submitTransaction",value:(a=zt(Ft().mark((function e(t){var r,n=arguments;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.next=4;break}return e.next=4,this.checkMemoRequired(t);case 4:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.abrupt("return",z.post(C()(this.serverURL).segment("transactions").toString(),"tx=".concat(r),{timeout:6e4}).then((function(e){if(!e.data.result_xdr)return e.data;var t,r,n=i.xdr.TransactionResult.fromXDR(e.data.result_xdr,"base64").result().value();return n.length&&(t=n.map((function(e,t){if("manageBuyOffer"!==e.value().switch().name&&"manageSellOffer"!==e.value().switch().name)return null;r=!0;var n,o=new R(0),a=new R(0),s=e.value().value().success(),u=s.offersClaimed().map((function(e){var t=e.value(),r="";switch(e.switch()){case i.xdr.ClaimAtomType.claimAtomTypeV0():r=i.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case i.xdr.ClaimAtomType.claimAtomTypeOrderBook():r=i.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error("Invalid offer result type: "+e.switch())}var n=new R(t.amountBought().toString()),s=new R(t.amountSold().toString());o=o.plus(s),a=a.plus(n);var u=i.Asset.fromOperation(t.assetSold()),c=i.Asset.fromOperation(t.assetBought()),l={type:u.getAssetType(),assetCode:u.getCode(),issuer:u.getIssuer()},f={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()};return{sellerId:r,offerId:t.offerId().toString(),assetSold:l,amountSold:Vt(s),assetBought:f,amountBought:Vt(n)}})),c=s.offer().switch().name;if("function"==typeof s.offer().value&&s.offer().value()){var l=s.offer().value();n={offerId:l.offerId().toString(),selling:{},buying:{},amount:Vt(l.amount().toString()),price:{n:l.price().n(),d:l.price().d()}};var f=i.Asset.fromOperation(l.selling());n.selling={type:f.getAssetType(),assetCode:f.getCode(),issuer:f.getIssuer()};var d=i.Asset.fromOperation(l.buying());n.buying={type:d.getAssetType(),assetCode:d.getCode(),issuer:d.getIssuer()}}return{offersClaimed:u,effect:c,operationIndex:t,currentOffer:n,amountBought:Vt(o),amountSold:Vt(a),isFullyOpen:!u.length&&"manageOfferDeleted"!==c,wasPartiallyFilled:!!u.length&&"manageOfferDeleted"!==c,wasImmediatelyFilled:!!u.length&&"manageOfferDeleted"===c,wasImmediatelyDeleted:!u.length&&"manageOfferDeleted"===c}})).filter((function(e){return!!e}))),Object.assign({},e.data,{offerResults:r?t:void 0})})).catch((function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new N.Fz("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"accounts",value:function(){return new ue(C()(this.serverURL))}},{key:"claimableBalances",value:function(){return new we(C()(this.serverURL))}},{key:"ledgers",value:function(){return new Le(C()(this.serverURL))}},{key:"transactions",value:function(){return new jt(C()(this.serverURL))}},{key:"offers",value:function(){return new Xe(C()(this.serverURL))}},{key:"orderbook",value:function(e,t){return new ot(C()(this.serverURL),e,t)}},{key:"trades",value:function(){return new It(C()(this.serverURL))}},{key:"operations",value:function(){return new et(C()(this.serverURL))}},{key:"liquidityPools",value:function(){return new qe(C()(this.serverURL))}},{key:"strictReceivePaths",value:function(e,t,r){return new pt(C()(this.serverURL),e,t,r)}},{key:"strictSendPaths",value:function(e,t,r){return new vt(C()(this.serverURL),e,t,r)}},{key:"payments",value:function(){return new lt(C()(this.serverURL))}},{key:"effects",value:function(){return new xe(C()(this.serverURL))}},{key:"friendbot",value:function(e){return new Re(C()(this.serverURL),e)}},{key:"assets",value:function(){return new pe(C()(this.serverURL))}},{key:"loadAccount",value:(o=zt(Ft().mark((function e(t){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.accounts().accountId(t).call();case 2:return r=e.sent,e.abrupt("return",new l(r));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"tradeAggregation",value:function(e,t,r,n,o,i){return new Et(C()(this.serverURL),e,t,r,n,o,i)}},{key:"checkMemoRequired",value:(n=zt(Ft().mark((function e(t){var r,n,o,a;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t instanceof i.FeeBumpTransaction&&(t=t.innerTransaction),"none"===t.memo.type){e.next=3;break}return e.abrupt("return");case 3:r=new Set,n=0;case 5:if(!(n{"use strict";r.r(t),r.d(t,{AccountRequiresMemoError:()=>n.hs,BadRequestError:()=>n.oY,BadResponseError:()=>n.Fz,Config:()=>o.D,ContractSpec:()=>d.o,Federation:()=>s,Friendbot:()=>c,Horizon:()=>l,NetworkError:()=>n.F7,NotFoundError:()=>n.dR,SorobanRpc:()=>f,StellarToml:()=>a,Utils:()=>i.c,WebAuth:()=>u,default:()=>y});var n=r(6086),o=r(7939),i=r(1557),a=r(4700),s=r(2761),u=r(273),c=r(197),l=r(6881),f=r(8491),d=r(936),h=r(4172),p={};for(const m in h)["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","SorobanRpc","ContractSpec","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(m)<0&&(p[m]=()=>h[m]);r.d(t,p);const y=(e=r.hmd(e)).exports},8491:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Api:()=>n,AxiosClient:()=>c,Durability:()=>F,Server:()=>D,assembleTransaction:()=>T,default:()=>q,parseRawEvents:()=>_,parseRawSimulation:()=>x}),function(e){var t=function(e){return e.SUCCESS="SUCCESS",e.NOT_FOUND="NOT_FOUND",e.FAILED="FAILED",e}({});function r(e){return"transactionData"in e}e.GetTransactionStatus=t,e.isSimulationError=function(e){return"error"in e},e.isSimulationSuccess=r,e.isSimulationRestore=function(e){return r(e)&&"restorePreamble"in e&&!!e.restorePreamble.transactionData},e.isSimulationRaw=function(e){return!e._parsed}}(n||(n={}));var o=r(4998),i=r.n(o),a=r(4172),s=r(1257),u=r(4147).i8;const c=s.Z.create({headers:{"X-Client-Name":"js-soroban-client","X-Client-Version":u}});function l(e){return l="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},l(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},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=h(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==l(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,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===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.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 i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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 new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function d(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){d(i,n,o,a,s,"next",e)}function s(e){d(i,n,o,a,s,"throw",e)}a(void 0)}))}}function p(e,t){return y.apply(this,arguments)}function y(){return y=h(f().mark((function e(t,r){var n,o,i,a,s,u=arguments;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=u.length,o=new Array(n>2?n-2:0),i=2;i0?l:o.result.auth}))}return u}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 O(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){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),R(r),m}},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;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function N(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function L(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){N(i,n,o,a,s,"next",e)}function s(e){N(i,n,o,a,s,"throw",e)}a(void 0)}))}}function j(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),r.headers&&0===Object.keys(r.headers).length&&c.interceptors.request.use((function(e){return e.headers=Object.assign(e.headers,r.headers),e})),"https"!==this.serverURL.protocol()&&!r.allowHttp)throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set")}var t,r,o,s,u,l,f,d,h,y,g,v,b,w,A,S,P,O,R;return t=e,r=[{key:"getAccount",value:(R=L(B().mark((function e(t){var r,n,o;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.xdr.LedgerKey.account(new a.xdr.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(t).xdrPublicKey()})),e.next=3,this.getLedgerEntries(r);case 3:if(0!==(n=e.sent).entries.length){e.next=6;break}return e.abrupt("return",Promise.reject({code:404,message:"Account not found: ".concat(t)}));case 6:return o=n.entries[0].val.account(),e.abrupt("return",new a.Account(t,o.seqNum().toString()));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"getHealth",value:(O=L(B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p(this.serverURL.toString(),"getHealth"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"getContractData",value:(P=L(B().mark((function e(t,r){var n,o,i,s,u=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:F.Persistent,"string"!=typeof t){e.next=5;break}o=new a.Contract(t).address().toScAddress(),e.next=14;break;case 5:if(!(t instanceof a.Address)){e.next=9;break}o=t.toScAddress(),e.next=14;break;case 9:if(!(t instanceof a.Contract)){e.next=13;break}o=t.address().toScAddress(),e.next=14;break;case 13:throw new TypeError("unknown contract type: ".concat(t));case 14:e.t0=n,e.next=e.t0===F.Temporary?17:e.t0===F.Persistent?19:21;break;case 17:return i=a.xdr.ContractDataDurability.temporary(),e.abrupt("break",22);case 19:return i=a.xdr.ContractDataDurability.persistent(),e.abrupt("break",22);case 21:throw new TypeError("invalid durability: ".concat(n));case 22:return s=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({key:r,contract:o,durability:i})),e.abrupt("return",this.getLedgerEntries(s).then((function(e){return 0===e.entries.length?Promise.reject({code:404,message:"Contract data not found. Contract: ".concat(a.Address.fromScAddress(o).toString(),", Key: ").concat(r.toXDR("base64"),", Durability: ").concat(n)}):e.entries[0]})));case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getLedgerEntries",value:(S=L(B().mark((function e(){var t=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getLedgerEntries.apply(this,t).then(E));case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"_getLedgerEntries",value:(A=L(B().mark((function e(){var t,r,n,o=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=o.length,r=new Array(t),n=0;n{"use strict";r.r(t),r.d(t,{Api:()=>{},Resolver:()=>p,STELLAR_TOML_MAX_SIZE:()=>d});var n=r(1257),o=r(5424),i=r.n(o),a=r(7939);function s(e){return s="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},s(e)}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};f(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,u){var c=h(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==s(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,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===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.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 i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o