UNPKG

@minswap/sdk

Version:

Query Minswap data and build transactions

1,437 lines (1,430 loc) 330 kB
import { BlockfrostServerError } from '@blockfrost/blockfrost-js'; import invariant from '@minswap/tiny-invariant'; import Big from 'big.js'; import BigNumber from 'bignumber.js'; import { zipWith } from 'remeda'; import { Constr, Addresses, Utils, Hasher, stakeCredentialOf, Crypto, Blockfrost, Lucid, Maestro, Data } from '@spacebudz/lucid'; import { SHA3 } from 'sha3'; import JSONBig from 'json-bigint'; var NetworkId = /* @__PURE__ */ ((NetworkId2) => { NetworkId2[NetworkId2["TESTNET"] = 0] = "TESTNET"; NetworkId2[NetworkId2["MAINNET"] = 1] = "MAINNET"; return NetworkId2; })(NetworkId || {}); var NetworkEnvironment = /* @__PURE__ */ ((NetworkEnvironment2) => { NetworkEnvironment2[NetworkEnvironment2["MAINNET"] = 764824073] = "MAINNET"; NetworkEnvironment2[NetworkEnvironment2["TESTNET_PREVIEW"] = 2] = "TESTNET_PREVIEW"; NetworkEnvironment2[NetworkEnvironment2["TESTNET_PREPROD"] = 1] = "TESTNET_PREPROD"; return NetworkEnvironment2; })(NetworkEnvironment || {}); var LucidCredential; ((LucidCredential2) => { function toPlutusData(data) { const constructor = data.type === "Key" ? 0 : 1; return new Constr(constructor, [data.hash]); } LucidCredential2.toPlutusData = toPlutusData; function fromPlutusData(data) { switch (data.index) { case 0: { return { type: "Key", hash: data.fields[0] }; } case 1: { return { type: "Script", hash: data.fields[0] }; } default: { throw new Error( `Index of Credentail must be 0 or 1, actual: ${data.index}` ); } } } LucidCredential2.fromPlutusData = fromPlutusData; })(LucidCredential || (LucidCredential = {})); var AddressPlutusData; ((AddressPlutusData2) => { function toPlutusData(address) { const addressDetails = Addresses.inspect(address); if (addressDetails.type === "Base") { invariant( addressDetails.payment && addressDetails.delegation, "baseAddress must have both paymentCredential and stakeCredential" ); return new Constr(0, [ LucidCredential.toPlutusData(addressDetails.payment), new Constr(0, [ new Constr(0, [ LucidCredential.toPlutusData(addressDetails.delegation) ]) ]) ]); } if (addressDetails.type === "Enterprise") { invariant( addressDetails.payment, "EnterpriseAddress must has paymentCredential" ); return new Constr(0, [ LucidCredential.toPlutusData(addressDetails.payment), new Constr(1, []) ]); } throw new Error("only supports base address, enterprise address"); } AddressPlutusData2.toPlutusData = toPlutusData; function fromPlutusData(networkId, data) { switch (data.index) { case 0: { const paymentCredential = LucidCredential.fromPlutusData( data.fields[0] ); const maybeStakeCredentialConstr = data.fields[1]; switch (maybeStakeCredentialConstr.index) { case 0: { const stakeCredentialConstr = maybeStakeCredentialConstr.fields[0]; switch (stakeCredentialConstr.index) { case 0: { const stakeCredential = LucidCredential.fromPlutusData( stakeCredentialConstr.fields[0] ); return Addresses.credentialToAddress( networkId === NetworkId.MAINNET ? "Mainnet" : "Preprod", paymentCredential, stakeCredential ); } case 1: { throw new Error(`Pointer Address has not been supported yet`); } default: { throw new Error( `Index of StakeCredentail must be 0 or 1, actual: ${stakeCredentialConstr.index}` ); } } } case 1: { return Addresses.credentialToAddress( networkId === NetworkId.MAINNET ? "Mainnet" : "Preprod", paymentCredential ); } default: { throw new Error( `Index of Maybe Stake Credentail must be 0 or 1, actual: ${maybeStakeCredentialConstr.index}` ); } } } default: { throw new Error(`Index of Address must be 0, actual: ${data.index}`); } } } AddressPlutusData2.fromPlutusData = fromPlutusData; })(AddressPlutusData || (AddressPlutusData = {})); var StringUtils; ((StringUtils2) => { function compare(s1, s2) { if (s1 < s2) { return -1; } if (s1 === s2) { return 0; } return 1; } StringUtils2.compare = compare; })(StringUtils || (StringUtils = {})); const ADA = { policyId: "", tokenName: "" }; var Asset; ((Asset2) => { function fromString(s) { if (s === "lovelace") { return { policyId: "", tokenName: "" }; } const policyId = s.slice(0, 56); const tokenName = s.slice(56); return { policyId, tokenName }; } Asset2.fromString = fromString; function toString(asset) { const { policyId, tokenName } = asset; if (policyId === "" && tokenName === "") { return "lovelace"; } return policyId + tokenName; } Asset2.toString = toString; function toPlutusData(asset) { const { policyId, tokenName } = asset; return new Constr(0, [ policyId, tokenName ]); } Asset2.toPlutusData = toPlutusData; function fromPlutusData(data) { if (data.index !== 0) { throw new Error(`Index of Asset must be 0, actual: ${data.index}`); } invariant( data.fields.length === 2, `Asset fields length must be 2, actual: ${data.fields.length}` ); return { policyId: data.fields[0], tokenName: data.fields[1] }; } Asset2.fromPlutusData = fromPlutusData; function compare(a1, a2) { if (a1.policyId === a2.policyId) { return StringUtils.compare(a1.tokenName, a2.tokenName); } return StringUtils.compare(a1.policyId, a2.policyId); } Asset2.compare = compare; function equals(a1, a2) { return a1.policyId === a2.policyId && a1.tokenName === a2.tokenName; } Asset2.equals = equals; })(Asset || (Asset = {})); var __defProp$c = Object.defineProperty; var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value); var OrderV1; ((OrderV12) => { ((StepType2) => { StepType2[StepType2["SWAP_EXACT_IN"] = 0] = "SWAP_EXACT_IN"; StepType2[StepType2["SWAP_EXACT_OUT"] = 1] = "SWAP_EXACT_OUT"; StepType2[StepType2["DEPOSIT"] = 2] = "DEPOSIT"; StepType2[StepType2["WITHDRAW"] = 3] = "WITHDRAW"; StepType2[StepType2["ZAP_IN"] = 4] = "ZAP_IN"; })(OrderV12.StepType || (OrderV12.StepType = {})); ((Datum2) => { function toPlutusData(datum) { const { sender, receiver, receiverDatumHash, step, batcherFee, depositADA } = datum; const senderConstr = AddressPlutusData.toPlutusData(sender); const receiverConstr = AddressPlutusData.toPlutusData(receiver); const receiverDatumHashConstr = receiverDatumHash ? new Constr(0, [receiverDatumHash]) : new Constr(1, []); let datumConstr; switch (step.type) { case 0 /* SWAP_EXACT_IN */: { datumConstr = new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, new Constr(0 /* SWAP_EXACT_IN */, [ Asset.toPlutusData(step.desiredAsset), step.minimumReceived ]), batcherFee, depositADA ]); break; } case 1 /* SWAP_EXACT_OUT */: { datumConstr = new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, new Constr(1 /* SWAP_EXACT_OUT */, [ Asset.toPlutusData(step.desiredAsset), step.expectedReceived ]), batcherFee, depositADA ]); break; } case 2 /* DEPOSIT */: { datumConstr = new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, new Constr(2 /* DEPOSIT */, [step.minimumLP]), batcherFee, depositADA ]); break; } case 3 /* WITHDRAW */: { datumConstr = new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, new Constr(3 /* WITHDRAW */, [ step.minimumAssetA, step.minimumAssetB ]), batcherFee, depositADA ]); break; } case 4 /* ZAP_IN */: { datumConstr = new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, new Constr(4 /* ZAP_IN */, [ Asset.toPlutusData(step.desiredAsset), step.minimumLP ]), batcherFee, depositADA ]); break; } } return datumConstr; } Datum2.toPlutusData = toPlutusData; function fromPlutusData(networkId, data) { if (data.index !== 0) { throw new Error( `Index of Order Datum must be 0, actual: ${data.index}` ); } const sender = AddressPlutusData.fromPlutusData( networkId, data.fields[0] ); const receiver = AddressPlutusData.fromPlutusData( networkId, data.fields[1] ); let receiverDatumHash = void 0; const maybeReceiverDatumHash = data.fields[2]; switch (maybeReceiverDatumHash.index) { case 0: { receiverDatumHash = maybeReceiverDatumHash.fields[0]; break; } case 1: { receiverDatumHash = void 0; break; } default: { throw new Error( `Index of Receiver Datum Hash must be 0 or 1, actual: ${maybeReceiverDatumHash.index}` ); } } let step; const orderStepConstr = data.fields[3]; switch (orderStepConstr.index) { case 0 /* SWAP_EXACT_IN */: { step = { type: 0 /* SWAP_EXACT_IN */, desiredAsset: Asset.fromPlutusData( orderStepConstr.fields[0] ), minimumReceived: orderStepConstr.fields[1] }; break; } case 1 /* SWAP_EXACT_OUT */: { step = { type: 1 /* SWAP_EXACT_OUT */, desiredAsset: Asset.fromPlutusData( orderStepConstr.fields[0] ), expectedReceived: orderStepConstr.fields[1] }; break; } case 2 /* DEPOSIT */: { step = { type: 2 /* DEPOSIT */, minimumLP: orderStepConstr.fields[0] }; break; } case 3 /* WITHDRAW */: { step = { type: 3 /* WITHDRAW */, minimumAssetA: orderStepConstr.fields[0], minimumAssetB: orderStepConstr.fields[1] }; break; } case 4 /* ZAP_IN */: { step = { type: 4 /* ZAP_IN */, desiredAsset: Asset.fromPlutusData( orderStepConstr.fields[0] ), minimumLP: orderStepConstr.fields[1] }; break; } default: { throw new Error( `Index of Order Step must be in 0-4, actual: ${orderStepConstr.index}` ); } } const batcherFee = data.fields[4]; const depositADA = data.fields[5]; return { sender, receiver, receiverDatumHash, step, batcherFee, depositADA }; } Datum2.fromPlutusData = fromPlutusData; })(OrderV12.Datum || (OrderV12.Datum = {})); ((Redeemer2) => { Redeemer2[Redeemer2["APPLY_ORDER"] = 0] = "APPLY_ORDER"; Redeemer2[Redeemer2["CANCEL_ORDER"] = 1] = "CANCEL_ORDER"; })(OrderV12.Redeemer || (OrderV12.Redeemer = {})); })(OrderV1 || (OrderV1 = {})); var StableOrder; ((StableOrder2) => { ((StepType2) => { StepType2[StepType2["SWAP"] = 0] = "SWAP"; StepType2[StepType2["DEPOSIT"] = 1] = "DEPOSIT"; StepType2[StepType2["WITHDRAW"] = 2] = "WITHDRAW"; StepType2[StepType2["WITHDRAW_IMBALANCE"] = 3] = "WITHDRAW_IMBALANCE"; StepType2[StepType2["ZAP_OUT"] = 4] = "ZAP_OUT"; })(StableOrder2.StepType || (StableOrder2.StepType = {})); ((Datum2) => { function toPlutusData(datum) { const { sender, receiver, receiverDatumHash, step, batcherFee, depositADA } = datum; const senderConstr = AddressPlutusData.toPlutusData(sender); const receiverConstr = AddressPlutusData.toPlutusData(receiver); const receiverDatumHashConstr = receiverDatumHash ? new Constr(0, [receiverDatumHash]) : new Constr(1, []); let stepConstr; switch (step.type) { case 0 /* SWAP */: { stepConstr = new Constr(0 /* SWAP */, [ step.assetInIndex, step.assetOutIndex, step.minimumAssetOut ]); break; } case 1 /* DEPOSIT */: { stepConstr = new Constr(1 /* DEPOSIT */, [step.minimumLP]); break; } case 2 /* WITHDRAW */: { stepConstr = new Constr(2 /* WITHDRAW */, [step.minimumAmounts]); break; } case 3 /* WITHDRAW_IMBALANCE */: { stepConstr = new Constr(3 /* WITHDRAW_IMBALANCE */, [ step.withdrawAmounts ]); break; } case 4 /* ZAP_OUT */: { stepConstr = new Constr(4 /* ZAP_OUT */, [ step.assetOutIndex, step.minimumAssetOut ]); break; } } return new Constr(0, [ senderConstr, receiverConstr, receiverDatumHashConstr, stepConstr, batcherFee, depositADA ]); } Datum2.toPlutusData = toPlutusData; function fromPlutusData(networkId, data) { if (data.index !== 0) { throw new Error( `Index of Order Datum must be 0, actual: ${data.index}` ); } const sender = AddressPlutusData.fromPlutusData( networkId, data.fields[0] ); const receiver = AddressPlutusData.fromPlutusData( networkId, data.fields[1] ); let receiverDatumHash = void 0; const maybeReceiverDatumHash = data.fields[2]; switch (maybeReceiverDatumHash.index) { case 0: { receiverDatumHash = maybeReceiverDatumHash.fields[0]; break; } case 1: { receiverDatumHash = void 0; break; } default: { throw new Error( `Index of Receiver Datum Hash must be 0 or 1, actual: ${maybeReceiverDatumHash.index}` ); } } let step; const orderStepConstr = data.fields[3]; switch (orderStepConstr.index) { case 0 /* SWAP */: { step = { type: 0 /* SWAP */, assetInIndex: orderStepConstr.fields[0], assetOutIndex: orderStepConstr.fields[1], minimumAssetOut: orderStepConstr.fields[2] }; break; } case 1 /* DEPOSIT */: { step = { type: 1 /* DEPOSIT */, minimumLP: orderStepConstr.fields[0] }; break; } case 2 /* WITHDRAW */: { step = { type: 2 /* WITHDRAW */, minimumAmounts: orderStepConstr.fields[0] }; break; } case 3 /* WITHDRAW_IMBALANCE */: { step = { type: 3 /* WITHDRAW_IMBALANCE */, withdrawAmounts: orderStepConstr.fields[0] }; break; } case 4 /* ZAP_OUT */: { step = { type: 4 /* ZAP_OUT */, assetOutIndex: orderStepConstr.fields[0], minimumAssetOut: orderStepConstr.fields[1] }; break; } default: { throw new Error( `Index of Order Step must be in 0-4, actual: ${orderStepConstr.index}` ); } } const batcherFee = data.fields[4]; const depositADA = data.fields[5]; return { sender, receiver, receiverDatumHash, step, batcherFee, depositADA }; } Datum2.fromPlutusData = fromPlutusData; })(StableOrder2.Datum || (StableOrder2.Datum = {})); ((Redeemer2) => { Redeemer2[Redeemer2["APPLY_ORDER"] = 0] = "APPLY_ORDER"; Redeemer2[Redeemer2["CANCEL_ORDER"] = 1] = "CANCEL_ORDER"; })(StableOrder2.Redeemer || (StableOrder2.Redeemer = {})); })(StableOrder || (StableOrder = {})); var OrderV2; ((OrderV22) => { ((AuthorizationMethodType2) => { AuthorizationMethodType2[AuthorizationMethodType2["SIGNATURE"] = 0] = "SIGNATURE"; AuthorizationMethodType2[AuthorizationMethodType2["SPEND_SCRIPT"] = 1] = "SPEND_SCRIPT"; AuthorizationMethodType2[AuthorizationMethodType2["WITHDRAW_SCRIPT"] = 2] = "WITHDRAW_SCRIPT"; AuthorizationMethodType2[AuthorizationMethodType2["MINT_SCRIPT"] = 3] = "MINT_SCRIPT"; })(OrderV22.AuthorizationMethodType || (OrderV22.AuthorizationMethodType = {})); let AuthorizationMethod; ((AuthorizationMethod2) => { function fromPlutusData(data) { let type; if (data.fields.length !== 1) { throw Error( `Field length of AuthorizationMethod must be in 1, actual: ${data.fields.length}` ); } switch (data.index) { case 0 /* SIGNATURE */: { type = 0 /* SIGNATURE */; break; } case 1 /* SPEND_SCRIPT */: { type = 1 /* SPEND_SCRIPT */; break; } case 2 /* WITHDRAW_SCRIPT */: { type = 2 /* WITHDRAW_SCRIPT */; break; } case 3 /* MINT_SCRIPT */: { type = 3 /* MINT_SCRIPT */; break; } default: { throw new Error( `Index of AuthorizationMethod must be in 0-3, actual: ${data.index}` ); } } return { type, hash: data.fields[0] }; } AuthorizationMethod2.fromPlutusData = fromPlutusData; function toPlutusData(method) { return new Constr(method.type, [method.hash]); } AuthorizationMethod2.toPlutusData = toPlutusData; })(AuthorizationMethod = OrderV22.AuthorizationMethod || (OrderV22.AuthorizationMethod = {})); let Direction; ((Direction2) => { Direction2[Direction2["B_TO_A"] = 0] = "B_TO_A"; Direction2[Direction2["A_TO_B"] = 1] = "A_TO_B"; })(Direction = OrderV22.Direction || (OrderV22.Direction = {})); ((Direction2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* B_TO_A */: { return 0 /* B_TO_A */; } case 1 /* A_TO_B */: { return 1 /* A_TO_B */; } default: { throw new Error( `Index of Direction must be in 0-1, actual: ${data.index}` ); } } } Direction2.fromPlutusData = fromPlutusData; function toPlutusData(direction) { return new Constr(direction, []); } Direction2.toPlutusData = toPlutusData; })(Direction = OrderV22.Direction || (OrderV22.Direction = {})); let Killable; ((Killable2) => { Killable2[Killable2["PENDING_ON_FAILED"] = 0] = "PENDING_ON_FAILED"; Killable2[Killable2["KILL_ON_FAILED"] = 1] = "KILL_ON_FAILED"; })(Killable = OrderV22.Killable || (OrderV22.Killable = {})); ((Killable2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* PENDING_ON_FAILED */: { return 0 /* PENDING_ON_FAILED */; } case 1 /* KILL_ON_FAILED */: { return 1 /* KILL_ON_FAILED */; } default: { throw new Error( `Index of Killable must be in 0-1, actual: ${data.index}` ); } } } Killable2.fromPlutusData = fromPlutusData; function toPlutusData(killable) { return new Constr(killable, []); } Killable2.toPlutusData = toPlutusData; })(Killable = OrderV22.Killable || (OrderV22.Killable = {})); ((AmountType2) => { AmountType2[AmountType2["SPECIFIC_AMOUNT"] = 0] = "SPECIFIC_AMOUNT"; AmountType2[AmountType2["ALL"] = 1] = "ALL"; })(OrderV22.AmountType || (OrderV22.AmountType = {})); let DepositAmount; ((DepositAmount2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* SPECIFIC_AMOUNT */: { return { type: 0 /* SPECIFIC_AMOUNT */, depositAmountA: data.fields[0], depositAmountB: data.fields[1] }; } case 1 /* ALL */: { return { type: 1 /* ALL */, deductedAmountA: data.fields[0], deductedAmountB: data.fields[1] }; } default: { throw new Error( `Index of DepositAmount must be in 0-1, actual: ${data.index}` ); } } } DepositAmount2.fromPlutusData = fromPlutusData; function toPlutusData(amount) { switch (amount.type) { case 0 /* SPECIFIC_AMOUNT */: { return new Constr(0 /* SPECIFIC_AMOUNT */, [ amount.depositAmountA, amount.depositAmountB ]); } case 1 /* ALL */: { return new Constr(1 /* ALL */, [ amount.deductedAmountA, amount.deductedAmountB ]); } } } DepositAmount2.toPlutusData = toPlutusData; })(DepositAmount = OrderV22.DepositAmount || (OrderV22.DepositAmount = {})); let SwapAmount; ((SwapAmount2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* SPECIFIC_AMOUNT */: { return { type: 0 /* SPECIFIC_AMOUNT */, swapAmount: data.fields[0] }; } case 1 /* ALL */: { return { type: 1 /* ALL */, deductedAmount: data.fields[0] }; } default: { throw new Error( `Index of SwapAmount must be in 0-1, actual: ${data.index}` ); } } } SwapAmount2.fromPlutusData = fromPlutusData; function toPlutusData(amount) { switch (amount.type) { case 0 /* SPECIFIC_AMOUNT */: { return new Constr(0 /* SPECIFIC_AMOUNT */, [amount.swapAmount]); } case 1 /* ALL */: { return new Constr(1 /* ALL */, [amount.deductedAmount]); } } } SwapAmount2.toPlutusData = toPlutusData; })(SwapAmount = OrderV22.SwapAmount || (OrderV22.SwapAmount = {})); let WithdrawAmount; ((WithdrawAmount2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* SPECIFIC_AMOUNT */: { return { type: 0 /* SPECIFIC_AMOUNT */, withdrawalLPAmount: data.fields[0] }; } case 1 /* ALL */: { return { type: 1 /* ALL */, deductedLPAmount: data.fields[0] }; } default: { throw new Error( `Index of WithdrawAmount must be in 0-1, actual: ${data.index}` ); } } } WithdrawAmount2.fromPlutusData = fromPlutusData; function toPlutusData(amount) { switch (amount.type) { case 0 /* SPECIFIC_AMOUNT */: { return new Constr(0 /* SPECIFIC_AMOUNT */, [ amount.withdrawalLPAmount ]); } case 1 /* ALL */: { return new Constr(1 /* ALL */, [amount.deductedLPAmount]); } } } WithdrawAmount2.toPlutusData = toPlutusData; })(WithdrawAmount = OrderV22.WithdrawAmount || (OrderV22.WithdrawAmount = {})); let Route; ((Route2) => { function fromPlutusData(data) { if (data.index !== 0) { throw new Error( `Index of Order Route must be 0, actual: ${data.index}` ); } return { lpAsset: Asset.fromPlutusData(data.fields[0]), direction: Direction.fromPlutusData(data.fields[1]) }; } Route2.fromPlutusData = fromPlutusData; function toPlutusData(route) { return new Constr(0, [ Asset.toPlutusData(route.lpAsset), Direction.toPlutusData(route.direction) ]); } Route2.toPlutusData = toPlutusData; })(Route = OrderV22.Route || (OrderV22.Route = {})); ((StepType2) => { StepType2[StepType2["SWAP_EXACT_IN"] = 0] = "SWAP_EXACT_IN"; StepType2[StepType2["STOP"] = 1] = "STOP"; StepType2[StepType2["OCO"] = 2] = "OCO"; StepType2[StepType2["SWAP_EXACT_OUT"] = 3] = "SWAP_EXACT_OUT"; StepType2[StepType2["DEPOSIT"] = 4] = "DEPOSIT"; StepType2[StepType2["WITHDRAW"] = 5] = "WITHDRAW"; StepType2[StepType2["ZAP_OUT"] = 6] = "ZAP_OUT"; StepType2[StepType2["PARTIAL_SWAP"] = 7] = "PARTIAL_SWAP"; StepType2[StepType2["WITHDRAW_IMBALANCE"] = 8] = "WITHDRAW_IMBALANCE"; StepType2[StepType2["SWAP_ROUTING"] = 9] = "SWAP_ROUTING"; StepType2[StepType2["DONATION"] = 10] = "DONATION"; })(OrderV22.StepType || (OrderV22.StepType = {})); let Step; ((Step2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* SWAP_EXACT_IN */: { return { type: 0 /* SWAP_EXACT_IN */, direction: Direction.fromPlutusData(data.fields[0]), swapAmount: SwapAmount.fromPlutusData( data.fields[1] ), minimumReceived: data.fields[2], killable: Killable.fromPlutusData(data.fields[3]) }; } case 1 /* STOP */: { return { type: 1 /* STOP */, direction: Direction.fromPlutusData(data.fields[0]), swapAmount: SwapAmount.fromPlutusData( data.fields[1] ), stopReceived: data.fields[2] }; } case 2 /* OCO */: { return { type: 2 /* OCO */, direction: Direction.fromPlutusData(data.fields[0]), swapAmount: SwapAmount.fromPlutusData( data.fields[1] ), minimumReceived: data.fields[2], stopReceived: data.fields[3] }; } case 3 /* SWAP_EXACT_OUT */: { return { type: 3 /* SWAP_EXACT_OUT */, direction: Direction.fromPlutusData(data.fields[0]), maximumSwapAmount: SwapAmount.fromPlutusData( data.fields[1] ), expectedReceived: data.fields[2], killable: Killable.fromPlutusData(data.fields[3]) }; } case 4 /* DEPOSIT */: { return { type: 4 /* DEPOSIT */, depositAmount: DepositAmount.fromPlutusData( data.fields[0] ), minimumLP: data.fields[1], killable: Killable.fromPlutusData(data.fields[2]) }; } case 5 /* WITHDRAW */: { return { type: 5 /* WITHDRAW */, withdrawalAmount: WithdrawAmount.fromPlutusData( data.fields[0] ), minimumAssetA: data.fields[1], minimumAssetB: data.fields[2], killable: Killable.fromPlutusData(data.fields[3]) }; } case 6 /* ZAP_OUT */: { return { type: 6 /* ZAP_OUT */, direction: Direction.fromPlutusData(data.fields[0]), withdrawalAmount: WithdrawAmount.fromPlutusData( data.fields[1] ), minimumReceived: data.fields[2], killable: Killable.fromPlutusData(data.fields[3]) }; } case 7 /* PARTIAL_SWAP */: { return { type: 7 /* PARTIAL_SWAP */, direction: Direction.fromPlutusData(data.fields[0]), totalSwapAmount: data.fields[1], ioRatioNumerator: data.fields[2], ioRatioDenominator: data.fields[3], hops: data.fields[4], minimumSwapAmountRequired: data.fields[5], maxBatcherFeeEachTime: data.fields[6] }; } case 8 /* WITHDRAW_IMBALANCE */: { return { type: 8 /* WITHDRAW_IMBALANCE */, withdrawalAmount: WithdrawAmount.fromPlutusData( data.fields[0] ), ratioAssetA: data.fields[1], ratioAssetB: data.fields[2], minimumAssetA: data.fields[3], killable: Killable.fromPlutusData(data.fields[4]) }; } case 9 /* SWAP_ROUTING */: { return { type: 9 /* SWAP_ROUTING */, routings: data.fields[0].map( Route.fromPlutusData ), swapAmount: SwapAmount.fromPlutusData( data.fields[1] ), minimumReceived: data.fields[2] }; } case 10 /* DONATION */: { return { type: 10 /* DONATION */ }; } default: { throw new Error( `Index of Step must be in 0-10, actual: ${data.index}` ); } } } Step2.fromPlutusData = fromPlutusData; function toPlutusData(step) { switch (step.type) { case 0 /* SWAP_EXACT_IN */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), SwapAmount.toPlutusData(step.swapAmount), step.minimumReceived, Killable.toPlutusData(step.killable) ]); } case 1 /* STOP */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), SwapAmount.toPlutusData(step.swapAmount), step.stopReceived ]); } case 2 /* OCO */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), SwapAmount.toPlutusData(step.swapAmount), step.minimumReceived, step.stopReceived ]); } case 3 /* SWAP_EXACT_OUT */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), SwapAmount.toPlutusData(step.maximumSwapAmount), step.expectedReceived, Killable.toPlutusData(step.killable) ]); } case 4 /* DEPOSIT */: { return new Constr(step.type, [ DepositAmount.toPlutusData(step.depositAmount), step.minimumLP, Killable.toPlutusData(step.killable) ]); } case 5 /* WITHDRAW */: { return new Constr(step.type, [ WithdrawAmount.toPlutusData(step.withdrawalAmount), step.minimumAssetA, step.minimumAssetB, Killable.toPlutusData(step.killable) ]); } case 6 /* ZAP_OUT */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), WithdrawAmount.toPlutusData(step.withdrawalAmount), step.minimumReceived, Killable.toPlutusData(step.killable) ]); } case 7 /* PARTIAL_SWAP */: { return new Constr(step.type, [ Direction.toPlutusData(step.direction), step.totalSwapAmount, step.ioRatioNumerator, step.ioRatioDenominator, step.hops, step.minimumSwapAmountRequired, step.maxBatcherFeeEachTime ]); } case 8 /* WITHDRAW_IMBALANCE */: { return new Constr(step.type, [ WithdrawAmount.toPlutusData(step.withdrawalAmount), step.ratioAssetA, step.ratioAssetB, step.minimumAssetA, Killable.toPlutusData(step.killable) ]); } case 9 /* SWAP_ROUTING */: { return new Constr(step.type, [ step.routings.map(Route.toPlutusData), SwapAmount.toPlutusData(step.swapAmount), step.minimumReceived ]); } case 10 /* DONATION */: { return new Constr(step.type, []); } } } Step2.toPlutusData = toPlutusData; })(Step = OrderV22.Step || (OrderV22.Step = {})); ((ExtraDatumType2) => { ExtraDatumType2[ExtraDatumType2["NO_DATUM"] = 0] = "NO_DATUM"; ExtraDatumType2[ExtraDatumType2["DATUM_HASH"] = 1] = "DATUM_HASH"; ExtraDatumType2[ExtraDatumType2["INLINE_DATUM"] = 2] = "INLINE_DATUM"; })(OrderV22.ExtraDatumType || (OrderV22.ExtraDatumType = {})); let ExtraDatum; ((ExtraDatum2) => { function fromPlutusData(data) { switch (data.index) { case 0 /* NO_DATUM */: { invariant( data.fields.length === 0, `Field Length of ExtraDatum.NO_DATUM must be 0, actually ${data.fields.length}` ); return { type: 0 /* NO_DATUM */ }; } case 1 /* DATUM_HASH */: { invariant( data.fields.length === 1, `Field Length of ExtraDatum.DATUM_HASH must be 1, actually ${data.fields.length}` ); return { type: 1 /* DATUM_HASH */, hash: data.fields[0] }; } case 2 /* INLINE_DATUM */: { invariant( data.fields.length === 1, `Field Length of ExtraDatum.INLINE_DATUM must be 1, actually ${data.fields.length}` ); return { type: 2 /* INLINE_DATUM */, hash: data.fields[0] }; } default: { throw new Error( `Index of ExtraDatum must be in 0-2, actual: ${data.index}` ); } } } ExtraDatum2.fromPlutusData = fromPlutusData; function toPlutusData(extraDatum) { switch (extraDatum.type) { case 0 /* NO_DATUM */: { return new Constr(extraDatum.type, []); } case 1 /* DATUM_HASH */: { return new Constr(extraDatum.type, [extraDatum.hash]); } case 2 /* INLINE_DATUM */: { return new Constr(extraDatum.type, [extraDatum.hash]); } } } ExtraDatum2.toPlutusData = toPlutusData; })(ExtraDatum = OrderV22.ExtraDatum || (OrderV22.ExtraDatum = {})); let Datum; ((Datum2) => { function fromPlutusData(networkId, data) { if (data.index !== 0) { throw new Error( `Index of Order Datum must be 0, actual: ${data.index}` ); } if (data.fields.length !== 9) { throw new Error( `Fields Length of Order Datum must be 9, actual: ${data.index}` ); } const maybeExpiry = data.fields[8]; let expiry; switch (maybeExpiry.index) { case 0: { if (maybeExpiry.fields.length !== 1) { throw new Error( `Order maybeExpiry length must have 1 field, actual: ${maybeExpiry.fields.length}` ); } if (!Array.isArray(maybeExpiry.fields[0]) || maybeExpiry.fields[0].length !== 2) { throw new Error( `maybeExpiry field0's length must be 2-element array, actual: ${maybeExpiry.fields[0]}` ); } expiry = maybeExpiry.fields[0]; break; } case 1: { expiry = void 0; if (maybeExpiry.fields.length !== 0) { throw new Error( `Order undefined Expiry must have 0 elements, actual: ${maybeExpiry.fields.length}` ); } break; } default: { throw new Error( `Index of Maybe Expiry must be 0 or 1, actual: ${maybeExpiry.index}` ); } } return { canceller: AuthorizationMethod.fromPlutusData( data.fields[0] ), refundReceiver: AddressPlutusData.fromPlutusData( networkId, data.fields[1] ), refundReceiverDatum: ExtraDatum.fromPlutusData( data.fields[2] ), successReceiver: AddressPlutusData.fromPlutusData( networkId, data.fields[3] ), successReceiverDatum: ExtraDatum.fromPlutusData( data.fields[4] ), lpAsset: Asset.fromPlutusData(data.fields[5]), step: Step.fromPlutusData(data.fields[6]), maxBatcherFee: data.fields[7], expiredOptions: expiry ? { expiredTime: expiry[0], maxCancellationTip: expiry[1] } : void 0 }; } Datum2.fromPlutusData = fromPlutusData; function toPlutusData(datum) { return new Constr(0, [ AuthorizationMethod.toPlutusData(datum.canceller), AddressPlutusData.toPlutusData(datum.refundReceiver), ExtraDatum.toPlutusData(datum.refundReceiverDatum), AddressPlutusData.toPlutusData(datum.successReceiver), ExtraDatum.toPlutusData(datum.successReceiverDatum), Asset.toPlutusData(datum.lpAsset), Step.toPlutusData(datum.step), datum.maxBatcherFee, datum.expiredOptions ? new Constr(0, [ [ datum.expiredOptions.expiredTime, datum.expiredOptions.maxCancellationTip ] ]) : new Constr(1, []) ]); } Datum2.toPlutusData = toPlutusData; })(Datum = OrderV22.Datum || (OrderV22.Datum = {})); ((Redeemer2) => { Redeemer2[Redeemer2["APPLY_ORDER"] = 0] = "APPLY_ORDER"; Redeemer2[Redeemer2["CANCEL_ORDER_BY_OWNER"] = 1] = "CANCEL_ORDER_BY_OWNER"; Redeemer2[Redeemer2["CANCEL_EXPIRED_ORDER_BY_ANYONE"] = 2] = "CANCEL_EXPIRED_ORDER_BY_ANYONE"; })(OrderV22.Redeemer || (OrderV22.Redeemer = {})); class State { constructor(networkId, address, txIn, value, datum) { __publicField$c(this, "address"); __publicField$c(this, "txIn"); __publicField$c(this, "value"); __publicField$c(this, "datumCbor"); __publicField$c(this, "datum"); this.address = address; this.txIn = txIn; this.value = value; this.datumCbor = datum; this.datum = Datum.fromPlutusData(networkId, DataObject.from(datum)); } } OrderV22.State = State; })(OrderV2 || (OrderV2 = {})); function sha3(hex) { const hash = new SHA3(256); hash.update(hex, "hex"); return hash.digest("hex"); } var DexV1Constant; ((DexV1Constant2) => { DexV1Constant2.ORDER_BASE_ADDRESS = { [NetworkId.TESTNET]: "addr_test1zzn9efv2f6w82hagxqtn62ju4m293tqvw0uhmdl64ch8uwurajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upq932hcy", [NetworkId.MAINNET]: "addr1zxn9efv2f6w82hagxqtn62ju4m293tqvw0uhmdl64ch8uw6j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq6s3z70" }; DexV1Constant2.POOL_SCRIPT_HASH = "script1uychk9f04tqngfhx4qlqdlug5ntzen3uzc62kzj7cyesjk0d9me"; DexV1Constant2.FACTORY_POLICY_ID = "13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f"; DexV1Constant2.FACTORY_ASSET_NAME = "4d494e53574150"; DexV1Constant2.LP_POLICY_ID = "e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d86"; DexV1Constant2.POOL_NFT_POLICY_ID = "0be55d262b29f564998ff81efe21bdc0022621c12f15af08d0f2ddb1"; DexV1Constant2.ORDER_SCRIPT = { type: "PlutusV1", script: "59014f59014c01000032323232323232322223232325333009300e30070021323233533300b3370e9000180480109118011bae30100031225001232533300d3300e22533301300114a02a66601e66ebcc04800400c5288980118070009bac3010300c300c300c300c300c300c300c007149858dd48008b18060009baa300c300b3754601860166ea80184ccccc0288894ccc04000440084c8c94ccc038cd4ccc038c04cc030008488c008dd718098018912800919b8f0014891ce1317b152faac13426e6a83e06ff88a4d62cce3c1634ab0a5ec133090014a0266008444a00226600a446004602600a601a00626600a008601a006601e0026ea8c03cc038dd5180798071baa300f300b300e3754601e00244a0026eb0c03000c92616300a001375400660106ea8c024c020dd5000aab9d5744ae688c8c0088cc0080080048c0088cc00800800555cf2ba15573e6e1d200201" }; })(DexV1Constant || (DexV1Constant = {})); var StableswapConstant; ((StableswapConstant2) => { StableswapConstant2.CONFIG = { [NetworkId.TESTNET]: [ { orderAddress: "addr_test1zq8spknltt6yyz2505rhc5lqw89afc4anhu4u0347n5dz8urajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upqa63kst", poolAddress: "addr_test1zr3hs60rn9x49ahuduuzmnlhnema0jsl4d3ujrf3cmurhmvrajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upqcgz9yc", nftAsset: "06fe1ba957728130154154d5e5b25a7b533ebe6c4516356c0aa69355646a65642d697573642d76312e342d6c70", lpAsset: "d16339238c9e1fb4d034b6a48facb2f97794a9cdb7bc049dd7c49f54646a65642d697573642d76312e342d6c70", assets: [ "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed7274444a4544", "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed727469555344" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr_test1zp3mf7r63u8km2d69kh6v2axlvl04yunmmj67vprljuht4urajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upqhelj6n", poolAddress: "addr_test1zzc8ar93kgntz3lv95uauhe29kj4yj84mxhg5v9dqj4k7p5rajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upqujv25l", nftAsset: "06fe1ba957728130154154d5e5b25a7b533ebe6c4516356c0aa69355757364632d757364742d76312e342d6c70", lpAsset: "8db03e0cc042a5f82434123a0509f590210996f1c7410c94f913ac48757364632d757364742d76312e342d6c70", assets: [ "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed727455534443", "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed727455534454" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr_test1zqpmw0kkgm6fp9x0asq5vwuaccweeqdv3edhwckqr2gnvzurajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upq9z8vxj", poolAddress: "addr_test1zqh2uv0wvrtt579e92q35ktkzcj3lj3nzdm3xjpsdack3q5rajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upqud27a8", nftAsset: "06fe1ba957728130154154d5e5b25a7b533ebe6c4516356c0aa69355646a65642d697573642d6461692d76312e342d6c70", lpAsset: "492fd7252d5914c9f5acb7eeb6b905b3a65b9a952c2300de34eb86c5646a65642d697573642d6461692d76312e342d6c70", assets: [ "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed7274444a4544", "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed727469555344", "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed7274444149" ], multiples: [1n, 1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n } ], [NetworkId.MAINNET]: [ { orderAddress: "addr1w9xy6edqv9hkptwzewns75ehq53nk8t73je7np5vmj3emps698n9g", poolAddress: "addr1wy7kkcpuf39tusnnyga5t2zcul65dwx9yqzg7sep3cjscesx2q5m5", nftAsset: "5d4b6afd3344adcf37ccef5558bb87f522874578c32f17160512e398444a45442d695553442d534c50", lpAsset: "2c07095028169d7ab4376611abef750623c8f955597a38cd15248640444a45442d695553442d534c50", assets: [ "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344", "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1w93d8cuht3hvqt2qqfjqgyek3gk5d6ss2j93e5sh505m0ng8cmze2", poolAddress: "addr1wx8d45xlfrlxd7tctve8xgdtk59j849n00zz2pgyvv47t8sxa6t53", nftAsset: "d97fa91daaf63559a253970365fb219dc4364c028e5fe0606cdbfff9555344432d444a45442d534c50", lpAsset: "ac49e0969d76ed5aa9e9861a77be65f4fc29e9a979dc4c37a99eb8f4555344432d444a45442d534c50", assets: [ "25c5de5f5b286073c593edfd77b48abc7a48e5a4f3d4cd9d428ff93555534443", "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344" ], multiples: [1n, 100n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1wxtv9k2lcum5pmcc4wu44a5tufulszahz84knff87wcawycez9lug", poolAddress: "addr1w9520fyp6g3pjwd0ymfy4v2xka54ek6ulv4h8vce54zfyfcm2m0sm", nftAsset: "96402c6f5e7a04f16b4d6f500ab039ff5eac5d0226d4f88bf5523ce85553444d2d695553442d534c50", lpAsset: "31f92531ac9f1af3079701fab7c66ce997eb07988277ee5b9d6403015553444d2d695553442d534c50", assets: [ "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad0014df105553444d", "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1wxr9ppdymqgw6g0hvaaa7wc6j0smwh730ujx6lczgdynehsguav8d", poolAddress: "addr1wxxdvtj6y4fut4tmu796qpvy2xujtd836yg69ahat3e6jjcelrf94", nftAsset: "07b0869ed7488657e24ac9b27b3f0fb4f76757f444197b2a38a15c3c444a45442d5553444d2d534c50", lpAsset: "5b042cf53c0b2ce4f30a9e743b4871ad8c6dcdf1d845133395f55a8e444a45442d5553444d2d534c50", assets: [ "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344", "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad0014df105553444d" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1w9ksys0l07s9933kgkn4uxylsss5k6lqvt6e66kfc7am9sgtwqgv0", poolAddress: "addr1wx87yvnhj78yehh64unc7hr02dx73vmpedktz79xy2n3xxgs3t38l", nftAsset: "4e73e9cf8fd73e74956c67fa3a01486f02ab612ee580dc27755b8d57444a45442d4d795553442d534c50", lpAsset: "b69f5d48c91297142c46b764b69ab57844e3e7af9d7ba9bc63c3c517444a45442d4d795553442d534c50", assets: [ "8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344", "92776616f1f32c65a173392e4410a3d8c39dcf6ef768c73af164779c4d79555344" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1w8akt26kwj9kc2y56p8x3s9e9lp2qqtcxql0rmnz55u6lks99kkjc", poolAddress: "addr1wxcsnc9wzuczcmcctzpl9c0w4r84f73rsmwl8ce8d9n54ygep9znj", nftAsset: "1d4c43ac86463f93c4cba60c28f143b2781d7f7328b18d8e68298e614d795553442d5553444d2d534c50", lpAsset: "5827249dcaf49ce7ccae2e0577fd9bf9514a4c34adabc7eb57e192594d795553442d5553444d2d534c50", assets: [ "92776616f1f32c65a173392e4410a3d8c39dcf6ef768c73af164779c4d79555344", "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad0014df105553444d" ], multiples: [1n, 1n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1w86a53qhsmh0qszg486ell6nchy77yq6txksfz8p4z4r39cd4e04m", poolAddress: "addr1wytm0yuffszdzkme56mlm07htw388vkny2wy49ch7c3p57s4wwk57", nftAsset: "3ff28ad0d4788f24619746cc86b774495ed4727634b61710d2bb7ed5555344432d695553442d534c50", lpAsset: "40b6f8a17ba5d9bab02fc776c9677212b40bfc3df77346f0b1edcba6555344432d695553442d534c50", assets: [ "25c5de5f5b286073c593edfd77b48abc7a48e5a4f3d4cd9d428ff93555534443", "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344" ], multiples: [1n, 100n], fee: 1000000n, adminFee: 5000000000n, feeDenominator: 10000000000n }, { orderAddress: "addr1wy42rt3rdptdaa2lwlntkx49ksuqrmqqjlu7pf5l5f8upmgj3gq2m", poolAddress: "addr1wx4w03kq5tfhaad2fmglefgejj0anajcsvvg88w96lrmylc7mx5rm", nftAsset: "739150a2612da82e16adc2a3a1f88b256202d8415df0c5b7a2ff93fb555344432d695553442d302e312d534c50", lpAsset: "48bee898de501ff287165fdfc5be34818f3a41e474ae8f47f8c59f7a555344432d695553442d302e312d534c50", assets: [ "25c5de5f5b286073c593edfd77b48abc7a48e5a4f3d4cd9d428ff93555534443", "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344" ], multiples: [1n, 100n], fee: 10000000n, adminFee: 500000000n, feeDenominator: 10000000000n } ] }; StableswapConstant2.DEPLOYED_SCRIPTS = { [NetworkId.TESTNET]: { "06fe1ba957728130154154d5e5b25a7b533ebe6c4516356c0aa69355646a65642d697573642d76312e342d6c70": { order: { txHash: "527e421bc3eb8b9e5ec0a9ad214bb9b76148f57b9a5a8cbd83a51264f943e91d", outputIndex: 0 }, pool: { txHash: "527e421bc3eb8b9e5ec0a9ad214bb9b76148f57b9a5a8cbd83a51264f943e91d", outputIndex: 1 }, lp: { txHash: "527e421bc3eb8b9e5ec0a9ad214bb9b76148f57b9a5a8cbd83a51264f943e91d", outputIndex: 2 }, poolBatching: { txHash: "527e421bc3eb8b9e5ec0a9ad214bb9b76148f57b9a5a8cbd83a51264f943e91d", outputIndex: 3 } }, "06fe1ba957728130154154d5e5b25a7b533ebe6c4516356c0aa69355757364632d757364742d76312e342d6c70": { order: { txHash: "cf699550642c8ffc1673d1e5