From 716114851d5e78818b3607fabe317cab2a7c4a89 Mon Sep 17 00:00:00 2001 From: Franco Luque Date: Wed, 19 Feb 2025 17:08:15 -0300 Subject: [PATCH 01/19] feat: code for deploying asteria in preview --- sdk/lucid/examples/deploy.ts | 125 +++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sdk/lucid/examples/deploy.ts diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts new file mode 100644 index 0000000..74d34f5 --- /dev/null +++ b/sdk/lucid/examples/deploy.ts @@ -0,0 +1,125 @@ +import { fromText, Data } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { + AsteriaAsteriaSpend, + AsteriaTypesAssetClass, + AsteriaTypesSpeed, + DeployDeploySpend, + PelletPelletSpend, + SpacetimeSpacetimeSpend, +} from "../../../onchain/src/plutus.ts"; +import { lucidBase } from "../src/utils.ts"; + +console.log("DEPLOYING ASTERIA"); + +// +// CONFIGURATION +// +const admin_token: AsteriaTypesAssetClass = { + policy: "0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64", + name: "0014df105af4eb1811a74ad4e61c45362f84cf69835d2740f9f54019b1e13a07", +}; +const ship_mint_lovelace_fee = 1_000_000n; +const max_asteria_mining = 50n; +const max_speed: AsteriaTypesSpeed = { + distance: 1n, + time: 30n * 1000n, // milliseconds (30 seconds) +}; +const max_ship_fuel = 100n; +const fuel_per_step = 1n; +const initial_fuel = 30n; +const min_asteria_distance = 10n; + +// +// VALIDATORS INSTANTIATION +// +const lucid = await lucidBase(); + +const deployValidator = new DeployDeploySpend( + admin_token, +); +const deployAddress = lucid.newScript(deployValidator).toAddress(); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); +const pelletAddress = lucid.newScript(pelletValidator).toAddress(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +const spacetimeValidator = new SpacetimeSpacetimeSpend( + pelletHash, + asteriaHash, + admin_token, + max_speed, + max_ship_fuel, + fuel_per_step, +); +const spacetimeHash = lucid.newScript(spacetimeValidator).toHash(); +const spacetimeAddress = lucid.newScript(spacetimeValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); +console.log("SPACETIME SCRIPT ADDRESS:", { spacetimeAddress, spacetimeHash }); +console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); + +// +// ASTERIA +// +const adminToken = admin_token.policy + admin_token.name; +const asteriaDatum = { + shipCounter: 0n, + shipyardPolicy: spacetimeHash, +}; + +// +// DEPLOYMENT TX (REFERENCE SCRIPTS AND ASTERIA) +// +const tx = await lucid + .newTx() + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: asteriaValidator, + }, + {} + ) + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: spacetimeValidator, + }, + {} + ) + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: pelletValidator, + }, + {} + ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + } + ) + .commit(); + +const signedTx = await tx.sign().commit(); +// console.log(signedTx.toString()); +// const txHash = await signedTx.submit(); +const txHash = "fee59afa92a0eff4d8b7532917ea514cee26fd22924c246072891ea741cdfb15"; +console.log("DEPLOYMENT TXHASH:", txHash); From 4f449faf1751a9f914c6ed95c0863d38a33c0b60 Mon Sep 17 00:00:00 2001 From: Franco Luque Date: Wed, 19 Feb 2025 17:08:27 -0300 Subject: [PATCH 02/19] feat: code for creating ship in preview --- sdk/lucid/examples/create-ship.ts | 165 ++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 sdk/lucid/examples/create-ship.ts diff --git a/sdk/lucid/examples/create-ship.ts b/sdk/lucid/examples/create-ship.ts new file mode 100644 index 0000000..826874f --- /dev/null +++ b/sdk/lucid/examples/create-ship.ts @@ -0,0 +1,165 @@ +import { fromText, Data } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { + AsteriaAsteriaSpend, + AsteriaTypesAssetClass, + AsteriaTypesSpeed, + DeployDeploySpend, + PelletPelletSpend, + SpacetimeSpacetimeSpend, + SpacetimeSpacetimeMint, + PelletPelletMint +} from "../../../onchain/src/plutus.ts"; +import { lucidBase } from "../src/utils.ts"; + +console.log("CREATING SHIP"); + +// +// CONFIGURATION +// +const admin_token: AsteriaTypesAssetClass = { + policy: "0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64", + name: "0014df105af4eb1811a74ad4e61c45362f84cf69835d2740f9f54019b1e13a07", +}; +const ship_mint_lovelace_fee = 1_000_000n; +const max_asteria_mining = 50n; +const max_speed: AsteriaTypesSpeed = { + distance: 1n, + time: 30n * 1000n, // milliseconds (30 seconds) +}; +const max_ship_fuel = 100n; +const fuel_per_step = 1n; +const initial_fuel = 30n; +const min_asteria_distance = 10n; + +// +// VALIDATORS INSTANTIATION +// +const lucid = await lucidBase(); + +const deployValidator = new DeployDeploySpend( + admin_token, +); +const deployAddress = lucid.newScript(deployValidator).toAddress(); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); +const pelletAddress = lucid.newScript(pelletValidator).toAddress(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +const spacetimeValidator = new SpacetimeSpacetimeSpend( + pelletHash, + asteriaHash, + admin_token, + max_speed, + max_ship_fuel, + fuel_per_step, +); +const spacetimeHash = lucid.newScript(spacetimeValidator).toHash(); +const spacetimeAddress = lucid.newScript(spacetimeValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); +console.log("SPACETIME SCRIPT ADDRESS:", { spacetimeAddress, spacetimeHash }); +console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); + +// +// UTXO QUERIES +// +const deployTxHash = "fee59afa92a0eff4d8b7532917ea514cee26fd22924c246072891ea741cdfb15"; +// TODO: can we do this shorter? +const [asteriaRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 0, +}]); +const [spacetimeRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 1, +}]); +const [pelletRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 2, +}]); + +const [asteria] = await lucid.utxosAt(asteriaAddress); +// TODO: check admin token +const asteriaDatum = Data.from(asteria.datum, AsteriaAsteriaSpend.datum); +// console.log(asteriaDatum); + +// +// SHIP CREATION TX +// +const adminToken = admin_token.policy + admin_token.name; +const fuelToken = pelletHash + fromText("FUEL"); +const shipToken = spacetimeHash + fromText("SHIP" + asteriaDatum.shipCounter); +const pilotToken = spacetimeHash + fromText("PILOT" + asteriaDatum.shipCounter); + +const ttl = Date.now() + 10 * 60 * 1000; // now + 10 minutes (in miliseconds) +// console.log("NOW:", ttl); + +const shipDatum = { + posX: 20n, + posY: 20n, + shipTokenName: fromText("SHIP" + asteriaDatum.shipCounter), + pilotTokenName: fromText("PILOT" + asteriaDatum.shipCounter), + lastMoveLatestTime: BigInt(ttl), +}; +const asteriaDatum2 = { + shipCounter: asteriaDatum.shipCounter + 1n, + shipyardPolicy: asteriaDatum.shipyardPolicy, +}; + +const tx = await lucid + .newTx() + .validTo(ttl) // beware: this number gets rounded down + .readFrom([asteriaRef, spacetimeRef, pelletRef]) + .collectFrom( + [asteria], + Data.to("AddNewShip", AsteriaAsteriaSpend.redeemer) + ) + .mint( + { + [shipToken]: 1n, + [pilotToken]: 1n, + }, + Data.to("MintShip", SpacetimeSpacetimeMint.redeemer) + ) + .mint( + { + [fuelToken]: initial_fuel, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + spacetimeAddress, + { Inline: Data.to(shipDatum, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel, + } + ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum2, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + lovelace: asteria.assets.lovelace + ship_mint_lovelace_fee, + } + ) + // .toInstructions(); + .commit(); + +const signedTx = await tx.sign().commit(); +// console.log(signedTx.toString()); +const txHash = await signedTx.submit(); +console.log("CREATE SHIP TXHASH:", txHash); From eb51396a306c7fd10970edd4750d027c1d4a2e0c Mon Sep 17 00:00:00 2001 From: Franco Luque Date: Wed, 19 Feb 2025 17:09:39 -0300 Subject: [PATCH 03/19] feat: missing utils module --- sdk/lucid/src/utils.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sdk/lucid/src/utils.ts diff --git a/sdk/lucid/src/utils.ts b/sdk/lucid/src/utils.ts new file mode 100644 index 0000000..2e9cb47 --- /dev/null +++ b/sdk/lucid/src/utils.ts @@ -0,0 +1,18 @@ +import { Lucid, Blockfrost } from "https://deno.land/x/lucid@0.20.5/mod.ts"; + +const lucidBase = async (): Promise => { + const lucid = new Lucid({ + provider: new Blockfrost( + "https://cardano-preview.blockfrost.io/api/v0", + Deno.env.get("BLOCKFROST_PROJECT_ID") + ) + }); + const seed = Deno.env.get("SEED"); + if (!seed) { + throw Error("Unable to read wallet's seed from env"); + } + lucid.selectWalletFromSeed(seed); + return lucid; +}; + +export { lucidBase }; From 22b4fa358a5d5a66ee878b50ba87ab9f9c51984f Mon Sep 17 00:00:00 2001 From: Franco Luque Date: Wed, 23 Jul 2025 18:42:43 -0300 Subject: [PATCH 04/19] more useful lucid pallas code --- sdk/lucid/examples/emulator.ts | 441 ++++++++++++++++++++++++++++++ sdk/lucid/examples/my_emulator.ts | 405 +++++++++++++++++++++++++++ sdk/lucid/src/configurations.ts | 42 +++ 3 files changed, 888 insertions(+) create mode 100644 sdk/lucid/examples/emulator.ts create mode 100644 sdk/lucid/examples/my_emulator.ts create mode 100644 sdk/lucid/src/configurations.ts diff --git a/sdk/lucid/examples/emulator.ts b/sdk/lucid/examples/emulator.ts new file mode 100644 index 0000000..084ae6d --- /dev/null +++ b/sdk/lucid/examples/emulator.ts @@ -0,0 +1,441 @@ +import { + fromText, + Addresses, + Crypto, + Data, + Emulator, + Lucid +} from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { + AsteriaAsteriaSpend, + DeployDeploySpend, + PelletPelletSpend, + SpacetimeSpacetimeSpend, + SpacetimeSpacetimeMint, + PelletPelletMint, + AsteriaTypesShipRedeemer, + AsteriaTypesSpeed, + AsteriaTypesPelletRedeemer, +} from "../../../onchain/src/plutus.ts"; +import { + admin_token, + ship_mint_lovelace_fee, + // initial_fuel, + max_asteria_mining, + min_asteria_distance, + // max_speed, + max_ship_fuel, + fuel_per_step +} from "../src/configurations.ts" + +// override max speed to allow distance 40 in 10 minutes +const max_speed: AsteriaTypesSpeed = { + distance: 2n, + time: 30n * 1000n, // milliseconds (30 seconds) +}; + +// override initial fuel to have enough +const initial_fuel = 40n + + +console.log("CREATING EMULATOR"); + +const adminToken = admin_token.policy + admin_token.name; +const presentToken = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + fromText("gold ring"); +const presentToken2 = "feeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + fromText("fart"); + +// https://github.com/spacebudz/lucid/blob/main/examples/emulate_something.ts +const privateKey = Crypto.generatePrivateKey(); +const address = Addresses.credentialToAddress( + { Emulator: 0 }, + Crypto.privateKeyToDetails(privateKey).credential, +); +const { payment } = Addresses.inspect(address); +const emulator = new Emulator([{ + address, + assets: { + lovelace: 3000000000n, + [adminToken]: 1000n, + [presentToken]: 10n, + [presentToken2]: 10n, + } +}]); +const lucid = new Lucid({ + provider: emulator, + wallet: { PrivateKey: privateKey }, +}); +const slotZeroTime = emulator.now(); + +console.log("SLOT ZERO TIME:", slotZeroTime); + +console.log("DEPLOYING ASTERIA"); + +// +// VALIDATORS INSTANTIATION +// +const deployValidator = new DeployDeploySpend( + admin_token, +); +const deployAddress = lucid.newScript(deployValidator).toAddress(); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); +const pelletAddress = lucid.newScript(pelletValidator).toAddress(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +const spacetimeValidator = new SpacetimeSpacetimeSpend( + pelletHash, + asteriaHash, + admin_token, + max_speed, + max_ship_fuel, + fuel_per_step, +); +const spacetimeHash = lucid.newScript(spacetimeValidator).toHash(); +const spacetimeAddress = lucid.newScript(spacetimeValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); +console.log("SPACETIME SCRIPT ADDRESS:", { spacetimeAddress, spacetimeHash }); +console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); + +// +// ASTERIA +// +const asteriaDatum = { + shipCounter: 0n, + shipyardPolicy: spacetimeHash, +}; + +// +// DEPLOYMENT TX 1 (REFERENCE SCRIPTS AND ASTERIA) +// +const deployTx1 = await lucid + .newTx() + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: asteriaValidator, + }, + {} + ) + // .payToContract( + // deployAddress, + // { + // Inline: Data.void(), + // scriptRef: spacetimeValidator, + // }, + // {} + // ) + // .payToContract( + // deployAddress, + // { + // Inline: Data.void(), + // scriptRef: pelletValidator, + // }, + // {} + // ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + } + ) + .commit(); + +const signedDeployTx1 = await deployTx1.sign().commit(); +const deployTxHash1 = await signedDeployTx1.submit(); +emulator.awaitTx(deployTxHash1); +console.log("DEPLOYMENT TXHASH:", deployTxHash1); + +// +// DEPLOYMENT TX 2 (REFERENCE SCRIPTS AND ASTERIA) +// +const deployTx2 = await lucid + .newTx() + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: spacetimeValidator, + }, + {} + ) + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: pelletValidator, + }, + {} + ) + .commit(); + +const signedDeployTx2 = await deployTx2.sign().commit(); +const deployTxHash2 = await signedDeployTx2.submit(); +emulator.awaitTx(deployTxHash2); +console.log("DEPLOYMENT TXHASH:", deployTxHash2); + +// +// UTXO QUERIES +// +const [asteriaRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash1, + outputIndex: 0, +}]); +const [spacetimeRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash2, + outputIndex: 0, +}]); +const [pelletRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash2, + outputIndex: 1, +}]); + +const [asteria] = await lucid.utxosAt(asteriaAddress); +// TODO: check admin token +const asteriaDatum2 = Data.from(asteria.datum, AsteriaAsteriaSpend.datum); +// console.log(asteriaDatum2); + +// +// CREATE PELLET +// +const fuelToken = pelletHash + fromText("FUEL"); +const pelletDatum = { + posX: 20n, + posY: 20n, + shipyardPolicy: spacetimeHash, +}; +const pelletTx = await lucid + .newTx() + .readFrom([pelletRef]) + .mint( + { + [fuelToken]: 1000n, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + pelletAddress, + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + { + // pellets can work without an admin token: + // [adminToken]: 1n, + [fuelToken]: 1000n, + [presentToken]: 5n, + } + ) + .commit(); + +const signedPelletTx = await pelletTx.sign().commit(); +const pelletTxHash = await signedPelletTx.submit(); +emulator.awaitTx(pelletTxHash); +console.log("PELLET TXHASH:", pelletTxHash); + +// +// SHIP CREATION TX +// +const shipToken = spacetimeHash + fromText("SHIP" + asteriaDatum.shipCounter); +const pilotToken = spacetimeHash + fromText("PILOT" + asteriaDatum.shipCounter); + +const ttl = emulator.now() + 10 * 60 * 1000; // now + 10 minutes (in miliseconds) + +const shipDatum = { + posX: 20n, + posY: 20n, + shipTokenName: fromText("SHIP" + asteriaDatum.shipCounter), + pilotTokenName: fromText("PILOT" + asteriaDatum.shipCounter), + lastMoveLatestTime: BigInt(ttl), +}; +const asteriaDatum3 = { + shipCounter: asteriaDatum.shipCounter + 1n, + shipyardPolicy: asteriaDatum.shipyardPolicy, +}; + +const createShipTx = await lucid + .newTx() + .validTo(ttl) // beware: this number gets rounded down + .readFrom([asteriaRef, spacetimeRef, pelletRef]) + .collectFrom( + [asteria], + Data.to("AddNewShip", AsteriaAsteriaSpend.redeemer) + ) + .mint( + { + [shipToken]: 1n, + [pilotToken]: 1n, + }, + Data.to("MintShip", SpacetimeSpacetimeMint.redeemer) + ) + .mint( + { + [fuelToken]: initial_fuel, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + spacetimeAddress, + { Inline: Data.to(shipDatum, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel, + } + ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum3, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + lovelace: asteria.assets.lovelace + ship_mint_lovelace_fee, + } + ) + .commit(); + +const signedCreateShipTx = await createShipTx.sign().commit(); +const createShipTxHash = await signedCreateShipTx.submit(); +emulator.awaitTx(createShipTxHash); +console.log("CREATE SHIP TXHASH:", createShipTxHash); + +// +// GATHER FUEL TX +// +const [ship] = await lucid.utxosByOutRef([{ + txHash: createShipTxHash, + outputIndex: 0, // the ship is always the first output +}]); +const [pellet] = await lucid.utxosByOutRef([{ + txHash: pelletTxHash, + outputIndex: 0, +}]); + +const gatherRedeemer : AsteriaTypesShipRedeemer = { + GatherFuel: { amount: 22n } +}; +const gatherRedeemerData = Data.to(gatherRedeemer, SpacetimeSpacetimeSpend.redeemer); + +const pelletRedeemer : AsteriaTypesPelletRedeemer = { + Provide: { amount: 22n } +}; +const pelletRedeemerData = Data.to(pelletRedeemer, PelletPelletSpend.redeemer); + +// one minute later after create ship ttl (slot = seconds = ms / 1000) +const slot = (ttl - slotZeroTime) / 1000 + 60; +emulator.awaitSlot(slot); + +const now = emulator.now(); + +const gatherTx = await lucid + .newTx() + .validFrom(now - 60 * 1000) // now - 1 minutes (in miliseconds) + .readFrom([spacetimeRef, pelletRef]) + .collectFrom([ship], gatherRedeemerData) + .collectFrom([pellet], pelletRedeemerData) + .payToContract( + spacetimeAddress, + // reuse shipDatum + { Inline: Data.to(shipDatum, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel + 22n, + } + ) + .payToContract( + pelletAddress, + // reuse pelletDatum + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + { + lovelace: pellet.assets.lovelace, // can't touch locked lovelace + // [adminToken]: 1n, + [fuelToken]: 1000n - 22n, + [presentToken]: 3n, // take two present tokens + // [presentToken]: 7n, // add present tokens (should fail) + // [presentToken2]: 1n, // add strange token (should fail)s + } + ) + .payTo(await lucid.wallet.address(), { + [pilotToken]: 1n, + // [presentToken]: 5n, + // [presentToken2]: 5n, + }) + .commit(); + +const signedGatherTx = await gatherTx.sign().commit(); +const gatherTxHash = await signedGatherTx.submit(); +emulator.awaitTx(gatherTxHash); +console.log("GATHER FUEL TXHASH:", gatherTxHash); + +// +// MOVE SHIP TX +// +const [ship2] = await lucid.utxosByOutRef([{ + txHash: gatherTxHash, + outputIndex: 0, // the ship is always the first output +}]); + +const moveRedeemer : AsteriaTypesShipRedeemer = { + MoveShip: { + deltaX: -20n, + deltaY: -20n, + } +}; +const moveRedeemerData = Data.to(moveRedeemer, SpacetimeSpacetimeSpend.redeemer); + +// const slot2 = (now - slotZeroTime) / 1000; +// emulator.awaitSlot(slot2); + +const ttl3 = emulator.now() + 10 * 60 * 1000; // now + 10 minutes (in miliseconds) + +const shipDatum2 = { + posX: 0n, + posY: 0n, + shipTokenName: fromText("SHIP" + asteriaDatum.shipCounter), + pilotTokenName: fromText("PILOT" + asteriaDatum.shipCounter), + lastMoveLatestTime: BigInt(ttl3 + 1), +}; + +const moveTx = await lucid + .newTx() + .validFrom(ttl3 - 10 * 60 * 1000) // 10 minutes before TTL + .validTo(ttl3) + .readFrom([spacetimeRef, pelletRef]) + .collectFrom([ship2], moveRedeemerData) + .payToContract( + spacetimeAddress, + { Inline: Data.to(shipDatum2, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel + 22n - 40n, + } + ) + .payTo(await lucid.wallet.address(), { + [pilotToken]: 1n, + }) + .mint( + { + [fuelToken]: -40n, + }, + Data.to("BurnFuel", PelletPelletMint.redeemer) + ) + .commit(); + +const signedMoveTx = await moveTx.sign().commit(); +const moveTxHash = await signedMoveTx.submit(); +emulator.awaitTx(moveTxHash); +console.log("MOVE SHIP TXHASH:", moveTxHash); + +// +// TODO: MINE ASTERIA +// diff --git a/sdk/lucid/examples/my_emulator.ts b/sdk/lucid/examples/my_emulator.ts new file mode 100644 index 0000000..3105fa7 --- /dev/null +++ b/sdk/lucid/examples/my_emulator.ts @@ -0,0 +1,405 @@ +import { + fromText, + Addresses, + Crypto, + Data, + Emulator, + Lucid +} from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { + AsteriaAsteriaSpend, + AsteriaTypesAssetClass, + AsteriaTypesSpeed, + DeployDeploySpend, + PelletPelletSpend, + SpacetimeSpacetimeSpend, + SpacetimeSpacetimeMint, + PelletPelletMint, + AsteriaTypesShipRedeemer, + AsteriaTypesPelletRedeemer, +} from "../../../onchain/src/plutus.ts"; + +console.log("CREATING EMULATOR"); + +const admin_token: AsteriaTypesAssetClass = { + policy: "0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64", + name: "0014df105af4eb1811a74ad4e61c45362f84cf69835d2740f9f54019b1e13a07", +}; +const adminToken = admin_token.policy + admin_token.name; + +// https://github.com/spacebudz/lucid/blob/main/examples/emulate_something.ts +const privateKey = Crypto.generatePrivateKey(); +const address = Addresses.credentialToAddress( + { Emulator: 0 }, + Crypto.privateKeyToDetails(privateKey).credential, +); +const { payment } = Addresses.inspect(address); // TODO: unused! +const emulator = new Emulator([{ + address, + assets: { + lovelace: 3000000000n, + [adminToken]: 1000n, + } +}]); +const lucid = new Lucid({ + provider: emulator, + wallet: { PrivateKey: privateKey }, +}); +const slotZeroTime = emulator.now(); + +console.log("SLOT ZERO TIME:", slotZeroTime); + +console.log("DEPLOYING ASTERIA"); + +// +// CONFIGURATION +// +const ship_mint_lovelace_fee = 1_000_000n; +const max_asteria_mining = 50n; +const max_speed: AsteriaTypesSpeed = { + distance: 1n, + time: 30n * 1000n, // milliseconds (30 seconds) +}; +const max_ship_fuel = 100n; +const fuel_per_step = 1n; +const initial_fuel = 30n; +const min_asteria_distance = 0n; + +// +// VALIDATORS INSTANTIATION +// +const deployValidator = new DeployDeploySpend( + admin_token, +); +const deployAddress = lucid.newScript(deployValidator).toAddress(); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); +const pelletAddress = lucid.newScript(pelletValidator).toAddress(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +const spacetimeValidator = new SpacetimeSpacetimeSpend( + pelletHash, + asteriaHash, + admin_token, + max_speed, + max_ship_fuel, + fuel_per_step, +); +const spacetimeHash = lucid.newScript(spacetimeValidator).toHash(); +const spacetimeAddress = lucid.newScript(spacetimeValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); +console.log("SPACETIME SCRIPT ADDRESS:", { spacetimeAddress, spacetimeHash }); +console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); + +// +// ASTERIA +// +const asteriaDatum = { + shipCounter: 0n, + shipyardPolicy: spacetimeHash, +}; + +// +// DEPLOYMENT TX (REFERENCE SCRIPTS AND ASTERIA) +// +const deployTx = await lucid + .newTx() + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: asteriaValidator, + }, + {} + ) + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: spacetimeValidator, + }, + {} + ) + .payToContract( + deployAddress, + { + Inline: Data.void(), + scriptRef: pelletValidator, + }, + {} + ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + } + ) + .commit(); + +const signedDeployTx = await deployTx.sign().commit(); +const deployTxHash = await signedDeployTx.submit(); +emulator.awaitTx(deployTxHash); +console.log("DEPLOYMENT TXHASH:", deployTxHash); + +// +// UTXO QUERIES +// +// TODO: can we do this shorter? +const [asteriaRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 0, +}]); +const [spacetimeRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 1, +}]); +const [pelletRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 2, +}]); + +const [asteria] = await lucid.utxosAt(asteriaAddress); +// TODO: check admin token +const asteriaDatum2 = Data.from(asteria.datum, AsteriaAsteriaSpend.datum); +// console.log(asteriaDatum2); + +// +// CREATE PELLET +// +const fuelToken = pelletHash + fromText("FUEL"); +const pelletDatum = { + posX: 0n, + posY: 0n, + shipyardPolicy: spacetimeHash, +}; +const pelletTx = await lucid + .newTx() + .readFrom([pelletRef]) + .mint( + { + [fuelToken]: 1000n, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + pelletAddress, + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + { + [adminToken]: 1n, + [fuelToken]: 1000n, + } + ) + .commit(); + +const signedPelletTx = await pelletTx.sign().commit(); +const pelletTxHash = await signedPelletTx.submit(); +emulator.awaitTx(pelletTxHash); +console.log("PELLET TXHASH:", pelletTxHash); + +// +// SHIP CREATION TX +// +// const fuelToken = pelletHash + fromText("FUEL"); +const shipToken = spacetimeHash + fromText("SHIP" + asteriaDatum.shipCounter); +const pilotToken = spacetimeHash + fromText("PILOT" + asteriaDatum.shipCounter); + +const ttl = emulator.now() + 10 * 60 * 1000; // now + 10 minutes (in miliseconds) +console.log("NOW:", ttl); + +const shipDatum = { + posX: 0n, + posY: 0n, + shipTokenName: fromText("SHIP" + asteriaDatum.shipCounter), + pilotTokenName: fromText("PILOT" + asteriaDatum.shipCounter), + lastMoveLatestTime: BigInt(ttl), +}; +const asteriaDatum3 = { + shipCounter: asteriaDatum.shipCounter + 1n, + shipyardPolicy: asteriaDatum.shipyardPolicy, +}; + +const createShipTx = await lucid + .newTx() + .validTo(ttl) // beware: this number gets rounded down + .readFrom([asteriaRef, spacetimeRef, pelletRef]) + .collectFrom( + [asteria], + Data.to("AddNewShip", AsteriaAsteriaSpend.redeemer) + ) + .mint( + { + [shipToken]: 1n, + [pilotToken]: 1n, + }, + Data.to("MintShip", SpacetimeSpacetimeMint.redeemer) + ) + .mint( + { + [fuelToken]: initial_fuel, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + spacetimeAddress, + { Inline: Data.to(shipDatum, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel, + } + ) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum3, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + lovelace: asteria.assets.lovelace + ship_mint_lovelace_fee, + } + ) + .commit(); + +const signedCreateShipTx = await createShipTx.sign().commit(); +const createShipTxHash = await signedCreateShipTx.submit(); +emulator.awaitTx(createShipTxHash); +console.log("CREATE SHIP TXHASH:", createShipTxHash); + +// +// GATHER FUEL TX +// +const [ship] = await lucid.utxosByOutRef([{ + txHash: createShipTxHash, + outputIndex: 0, // the ship is always the first output +}]); +const [pellet] = await lucid.utxosByOutRef([{ + txHash: pelletTxHash, + outputIndex: 0, +}]); + +const gatherRedeemer : AsteriaTypesShipRedeemer = { + GatherFuel: { amount: 22n } +}; +const gatherRedeemerData = Data.to(gatherRedeemer, SpacetimeSpacetimeSpend.redeemer); +console.log("gatherRedeemerData:", gatherRedeemerData); + +const pelletRedeemer : AsteriaTypesPelletRedeemer = { + Provide: { amount: 22n } +}; +const pelletRedeemerData = Data.to(pelletRedeemer, PelletPelletSpend.redeemer); +console.log("pelletRedeemerData:", pelletRedeemerData); + +// one minute later after create ship ttl (slot = seconds = ms / 1000) +const slot = (ttl - slotZeroTime) / 1000 + 60; +console.log("SLOT:", slot); +emulator.awaitSlot(slot); +console.log("TIMESTAMP:", slot * 1000 + slotZeroTime); +console.log("emulator now:", emulator.now()); + +// const ttl2 = emulator.now() - 10 * 60 * 1000; // now - 10 minutes (in miliseconds) +const ttl2 = emulator.now() - 60 * 1000; // now - 1 minutes (in miliseconds) +console.log("NOW2:", ttl2); + +const gatherTx = await lucid + .newTx() + .validFrom(ttl2) + .readFrom([spacetimeRef, pelletRef]) + .collectFrom([ship], gatherRedeemerData) + .collectFrom([pellet], pelletRedeemerData) + .payToContract( + spacetimeAddress, + // reuse shipDatum + { Inline: Data.to(shipDatum, SpacetimeSpacetimeSpend.datum) }, + { + [shipToken]: 1n, + [fuelToken]: initial_fuel + 22n, + } + ) + .payToContract( + pelletAddress, + // reuse pelletDatum + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + { + [adminToken]: 1n, + [fuelToken]: 1000n - 22n, + } + ) + .payTo(await lucid.wallet.address(), { + [pilotToken]: 1n, + }) + .commit(); + +const signedGatherTx = await gatherTx.sign().commit(); +const gatherTxHash = await signedGatherTx.submit(); +emulator.awaitTx(gatherTxHash); +console.log("GATHER FUEL TXHASH:", gatherTxHash); + +// +// MINE ASTERIA TX +// +const [ship2] = await lucid.utxosByOutRef([{ + txHash: gatherTxHash, + outputIndex: 0, // the ship is always the first output +}]); +const [asteria2] = await lucid.utxosByOutRef([{ + txHash: createShipTxHash, + outputIndex: 1, // Asteria is always the second output +}]); + +// one minute later after gather ttl (slot = seconds = ms / 1000) +const slot2 = (ttl2 - slotZeroTime) / 1000 + 60; +console.log("SLOT:", slot2); +emulator.awaitSlot(slot2); +console.log("TIMESTAMP:", slot2 * 1000 + slotZeroTime); +console.log("emulator now:", emulator.now()); + +const ttl3 = emulator.now() + 10 * 60 * 1000; // now + 10 minutes (in miliseconds) +console.log("NOW3:", ttl3); + +const mineTx = await lucid + .newTx() + // XXX: validFrom in the future. is this right? + .validFrom(ttl3) + .readFrom([spacetimeRef, asteriaRef, pelletRef]) + .collectFrom([ship], Data.to("MineAsteria", SpacetimeSpacetimeSpend.redeemer)) + .collectFrom([asteria2], Data.to("Mine", AsteriaAsteriaSpend.redeemer)) + .mint( + { + [shipToken]: -1n, + }, + Data.to("BurnShip", SpacetimeSpacetimeMint.redeemer) + ) + .mint( + { + [fuelToken]: -initial_fuel, + }, + Data.to("BurnFuel", PelletPelletMint.redeemer) + ) + .payToContract( + asteriaAddress, + // reusing asteriaDatum3 here: + { Inline: Data.to(asteriaDatum3, AsteriaAsteriaSpend.datum) }, + { + [adminToken]: 1n, + lovelace: asteria2.assets.lovelace, // rewards - minedRewards, + } + ) + .payTo(await lucid.wallet.address(), { + [pilotToken]: 1n, + }) +// .toInstructions(); + .commit(); + +console.log(mineTx); diff --git a/sdk/lucid/src/configurations.ts b/sdk/lucid/src/configurations.ts new file mode 100644 index 0000000..d0b1812 --- /dev/null +++ b/sdk/lucid/src/configurations.ts @@ -0,0 +1,42 @@ +import { + AsteriaTypesAssetClass, + AsteriaTypesSpeed +} from "../../../onchain/src/plutus.ts"; + +// +// CONFIGURATION + +// tAXO token +const admin_token: AsteriaTypesAssetClass = { + policy: "63f9a5fc96d4f87026e97af4569975016b50eef092a46859b61898e5", + name: "0014df1041584f", +}; +const adminToken = admin_token.policy + admin_token.name; + + +const ship_mint_lovelace_fee = 1_000_000n; +const max_asteria_mining = 50n; +const max_speed: AsteriaTypesSpeed = { + distance: 1n, + time: 30n * 1000n, // milliseconds (30 seconds) +}; + +const max_ship_fuel = 100n; +const fuel_per_step = 1n; +const initial_fuel = 30n; +const min_asteria_distance = 10n; + +const deployTxHash = "dcb9e38dfe85706d966d094fc132d0857ab72d967112c9bbf0f4c75e45ae1f1b"; + +export { + admin_token, + adminToken, + deployTxHash, + ship_mint_lovelace_fee, + max_asteria_mining, + max_speed, + max_ship_fuel, + fuel_per_step, + initial_fuel, + min_asteria_distance +} \ No newline at end of file From 61b7e26960b59287cd4dead8a97438277423d6a5 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 17:44:54 -0300 Subject: [PATCH 05/19] fix: update parameter descriptions for getRingAreaSample function --- offchain/tests/admin/pellets/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/offchain/tests/admin/pellets/utils.ts b/offchain/tests/admin/pellets/utils.ts index c91ecbd..3ec6e87 100644 --- a/offchain/tests/admin/pellets/utils.ts +++ b/offchain/tests/admin/pellets/utils.ts @@ -137,11 +137,11 @@ function getRingAreaCoordinates(inner_r: number, outer_r: number): Coordinates { /** * Returns an array with a random sample of pellet parameters over the area * between two circles with radii inner_r and outer_r respectively. - * @param inner_r Inner diamond diagonal. Must be greater than or equal to 0. - * @param outer_r Outer diamond diagonal. Must be greater than or equal to inner_r. + * @param inner_r Inner circle radius. Must be greater than or equal to 0. + * @param outer_r Outer circle radius. Must be greater than or equal to inner_r. * @param min_fuel Minimum fuel held by the sample pellets. Must be greater than or equal to 0. * @param max_fuel Maximum fuel held by the sample pellets. Must be greater than or equal to min_fuel. - * @param density Density of the sample: equals 1 if every diamond point is taken. Must be in the range 0 - 1, inclusive. + * @param density Density of the sample: equals 1 if every ring area point is taken. Must be in the range 0 - 1, inclusive. */ function getRingAreaSample( inner_r: number, From f7c00a491d24333f0bc37b9de9bab8d6c26631a1 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 19:24:57 -0300 Subject: [PATCH 06/19] feat: update pellets CSV handling to include prize-related fields --- offchain/tests/admin/pellets/pellets.csv | 129 +---------------------- offchain/tests/admin/pellets/utils.ts | 9 +- 2 files changed, 11 insertions(+), 127 deletions(-) diff --git a/offchain/tests/admin/pellets/pellets.csv b/offchain/tests/admin/pellets/pellets.csv index 06a6a1d..8c44b8e 100644 --- a/offchain/tests/admin/pellets/pellets.csv +++ b/offchain/tests/admin/pellets/pellets.csv @@ -1,124 +1,5 @@ -fuel,x,y -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 -36,-4,-17 -68,19,-10 -90,12,-35 -40,-8,3 -25,20,16 \ No newline at end of file +fuel,x,y,prize_policy,prize_name,prize_amount +90,12,-35,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,2 +40,-8,3,,, +25,20,16,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,3 +36,-4,-17,,, diff --git a/offchain/tests/admin/pellets/utils.ts b/offchain/tests/admin/pellets/utils.ts index 3ec6e87..a0eb2c9 100644 --- a/offchain/tests/admin/pellets/utils.ts +++ b/offchain/tests/admin/pellets/utils.ts @@ -165,7 +165,7 @@ function getRingAreaSample( function writePelletsCSV(pellets: PelletParams, path: string) { const csv = stringify(pellets, { - columns: ["fuel", "pos_x", "pos_y"], + columns: ["fuel", "pos_x", "pos_y", "prize_policy", "prize_name", "prize_amount"], }); Deno.writeTextFileSync(path, csv); } @@ -174,13 +174,16 @@ async function readPelletsCSV(path: string) { const text = await Deno.readTextFile(path); const data = parse(text, { skipFirstRow: true, - columns: ["fuel", "pos_x", "pos_y"], + columns: ["fuel", "pos_x", "pos_y", "prize_policy", "prize_name", "prize_amount"], }); - const params: { fuel: bigint; pos_x: bigint; pos_y: bigint }[] = data.map( + const params: { fuel: bigint; pos_x: bigint; pos_y: bigint; prize_policy: string | null; prize_name: string | null; prize_amount: bigint | null }[] = data.map( (p) => ({ fuel: BigInt(p.fuel), pos_x: BigInt(p.pos_x), pos_y: BigInt(p.pos_y), + prize_policy: p.prize_policy || null, + prize_name: p.prize_name || null, + prize_amount: BigInt(p.prize_amount) || null, }) ); return params; From ab44857f80ab556cef58d0b0365d8b7424d4ea96 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 19:32:32 -0300 Subject: [PATCH 07/19] script for deployment and Asteria creation --- onchain/src/plutus.ts | 486 ++++++++++++++++++++++++++ sdk/lucid/examples/deploy.ts | 35 +- sdk/lucid/examples/deploy_params.json | 16 + 3 files changed, 521 insertions(+), 16 deletions(-) create mode 100644 onchain/src/plutus.ts create mode 100644 sdk/lucid/examples/deploy_params.json diff --git a/onchain/src/plutus.ts b/onchain/src/plutus.ts new file mode 100644 index 0000000..9aa1e8f --- /dev/null +++ b/onchain/src/plutus.ts @@ -0,0 +1,486 @@ +// deno-lint-ignore-file +import { + applyParamsToScript, + Data, + Script, +} from "https://deno.land/x/lucid@0.20.11/mod.ts"; + +export type AssetName = string; +export type Data = Data; +export type Int = bigint; +export type PolicyId = string; +export type PosixTime = bigint; +export type ScriptHash = string; +export type AsteriaTypesAssetClass = { policy: PolicyId; name: AssetName }; +export type AsteriaTypesAsteriaDatum = { + shipCounter: Int; + shipyardPolicy: PolicyId; +}; +export type AsteriaTypesAsteriaRedeemer = + | "AddNewShip" + | "Mine" + | "ConsumeAsteria"; +export type AsteriaTypesFuelRedeemer = "MintFuel" | "BurnFuel"; +export type AsteriaTypesPelletDatum = { + posX: Int; + posY: Int; + shipyardPolicy: PolicyId; +}; +export type AsteriaTypesPelletRedeemer = + | { Provide: { amount: Int } } + | "ConsumePellet"; +export type AsteriaTypesShipDatum = { + posX: Int; + posY: Int; + shipTokenName: AssetName; + pilotTokenName: AssetName; + lastMoveLatestTime: PosixTime; +}; +export type AsteriaTypesShipRedeemer = + | { MoveShip: { deltaX: Int; deltaY: Int } } + | { GatherFuel: { amount: Int } } + | "MineAsteria" + | "Quit"; +export type AsteriaTypesShipyardRedeemer = "MintShip" | "BurnShip"; +export type AsteriaTypesSpeed = { distance: Int; time: Int }; + +const definitions = { + "AssetName": { "title": "AssetName", "dataType": "bytes" }, + "Data": { "title": "Data", "description": "Any Plutus data." }, + "Int": { "dataType": "integer" }, + "PolicyId": { "title": "PolicyId", "dataType": "bytes" }, + "PosixTime": { "title": "PosixTime", "dataType": "integer" }, + "ScriptHash": { "title": "ScriptHash", "dataType": "bytes" }, + "asteria/types/AssetClass": { + "title": "AssetClass", + "anyOf": [{ + "title": "AssetClass", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "policy", "$ref": "#/definitions/PolicyId" }, { + "title": "name", + "$ref": "#/definitions/AssetName", + }], + }], + }, + "asteria/types/AsteriaDatum": { + "title": "AsteriaDatum", + "anyOf": [{ + "title": "AsteriaDatum", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "shipCounter", "$ref": "#/definitions/Int" }, { + "title": "shipyardPolicy", + "$ref": "#/definitions/PolicyId", + }], + }], + }, + "asteria/types/AsteriaRedeemer": { + "title": "AsteriaRedeemer", + "anyOf": [ + { + "title": "AddNewShip", + "dataType": "constructor", + "index": 0, + "fields": [], + }, + { "title": "Mine", "dataType": "constructor", "index": 1, "fields": [] }, + { + "title": "ConsumeAsteria", + "dataType": "constructor", + "index": 2, + "fields": [], + }, + ], + }, + "asteria/types/FuelRedeemer": { + "title": "FuelRedeemer", + "anyOf": [{ + "title": "MintFuel", + "dataType": "constructor", + "index": 0, + "fields": [], + }, { + "title": "BurnFuel", + "dataType": "constructor", + "index": 1, + "fields": [], + }], + }, + "asteria/types/PelletDatum": { + "title": "PelletDatum", + "anyOf": [{ + "title": "PelletDatum", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "posX", "$ref": "#/definitions/Int" }, { + "title": "posY", + "$ref": "#/definitions/Int", + }, { "title": "shipyardPolicy", "$ref": "#/definitions/PolicyId" }], + }], + }, + "asteria/types/PelletRedeemer": { + "title": "PelletRedeemer", + "anyOf": [{ + "title": "Provide", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "amount", "$ref": "#/definitions/Int" }], + }, { + "title": "ConsumePellet", + "dataType": "constructor", + "index": 1, + "fields": [], + }], + }, + "asteria/types/ShipDatum": { + "title": "ShipDatum", + "anyOf": [{ + "title": "ShipDatum", + "dataType": "constructor", + "index": 0, + "fields": [ + { "title": "posX", "$ref": "#/definitions/Int" }, + { "title": "posY", "$ref": "#/definitions/Int" }, + { "title": "shipTokenName", "$ref": "#/definitions/AssetName" }, + { "title": "pilotTokenName", "$ref": "#/definitions/AssetName" }, + { "title": "lastMoveLatestTime", "$ref": "#/definitions/PosixTime" }, + ], + }], + }, + "asteria/types/ShipRedeemer": { + "title": "ShipRedeemer", + "anyOf": [{ + "title": "MoveShip", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "deltaX", "$ref": "#/definitions/Int" }, { + "title": "deltaY", + "$ref": "#/definitions/Int", + }], + }, { + "title": "GatherFuel", + "dataType": "constructor", + "index": 1, + "fields": [{ "title": "amount", "$ref": "#/definitions/Int" }], + }, { + "title": "MineAsteria", + "dataType": "constructor", + "index": 2, + "fields": [], + }, { + "title": "Quit", + "dataType": "constructor", + "index": 3, + "fields": [], + }], + }, + "asteria/types/ShipyardRedeemer": { + "title": "ShipyardRedeemer", + "anyOf": [{ + "title": "MintShip", + "dataType": "constructor", + "index": 0, + "fields": [], + }, { + "title": "BurnShip", + "dataType": "constructor", + "index": 1, + "fields": [], + }], + }, + "asteria/types/Speed": { + "title": "Speed", + "anyOf": [{ + "title": "Speed", + "dataType": "constructor", + "index": 0, + "fields": [{ "title": "distance", "$ref": "#/definitions/Int" }, { + "title": "time", + "$ref": "#/definitions/Int", + }], + }], + }, +}; + +export interface AsteriaAsteriaSpend { + new ( + pelletAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + shipMintLovelaceFee: Int, + maxAsteriaMining: Int, + minAsteriaDistance: Int, + initialFuel: Int, + ): Script; + datum: AsteriaTypesAsteriaDatum; + redeemer: AsteriaTypesAsteriaRedeemer; +} + +export const AsteriaAsteriaSpend = Object.assign( + function ( + pelletAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + shipMintLovelaceFee: Int, + maxAsteriaMining: Int, + minAsteriaDistance: Int, + initialFuel: Int, + ) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [ + pelletAddress, + adminToken, + shipMintLovelaceFee, + maxAsteriaMining, + minAsteriaDistance, + initialFuel, + ], + "591101010100323232323232323223222322322322322533300d3232323232533233013300130143754004264664464646464a66603460060022a66603a60386ea80280085854ccc068c02000454ccc074c070dd50050010b0a99980d18020008a99980e980e1baa00a0021616301a37540122646464646464646464a666042601460446ea80304c8c8c8c8c8c8c8c94ccc0a4c048c0a8dd50008991919191919191919191929919981a980f00409919299981d181e80109919191919299981e1813181e9baa001132533303d302b303e375400826601600226464646464a66608a60900042646464646464a666090606c60926ea8c134c138c128dd518268030a999824181918249baa00213253330493037304a37540042a666092606460946ea80044c8c8c8c8c8c8c8c8c8c94ccc158c1640084c8c8c8c8c8c8c8c8c8c8c8c8c94ccc18008454ccc18008c54ccc18000c54ccc18000840045280a5014a02940cdd79ba6041374c666605c666605c666062076022900101d807a40040ba9101044655454c0005432533333306600114a02646464a646660cc0042a6660c6600200a266e25200000314a026644a6660ca66ebcc19800930101400015333065337126eb4c19cc1a8dd59833801002898019ba600114a02a6660ca66e2520000051300300714a060d000460d20046ebcc19cc1a000cdd5801992999830982518311baa0011375a60c660cc6eacc198c18cdd50008a400060ca0026466600200203844660cc004660cc6e980052f5c0444a6660ca00426600298103d87a80004bd6f7b630099199911299983319b9148900003153330663371e91010000313300530403306a374c00497ae00011330054c103d87a8000006133300700700122330070023306c337606ea4014dd30020009bae3064001375660ca00260d200660ce00429405280a50374c666605a666060074020900102e245044655454c00053533305d337120a86466e00c004050c00404894ccc178cdc4000a40002605400220022a6660ba0062a6660ba004200229405280a5032533305d304b305e3754002266e24dd69831182f9baa00100b163037305e3754606060bc6ea80f4cdc780599b8a48810550494c4f54003730600407066e3c030cdc52450453484950003730600206e46e64cc008dd4000a450030010012225333233330620031323232323300a0013371491101280053330620021337149101035b5d2900006133714911035b5f2000333300900233714911025d29000062233300a00a00230070012233300a00a002001533305e337100049007099b80483c80400854ccc178cdc40012410004266e00cdc0241002800490068b1bac305f002375a60ba0026466ec0dd4182e8009ba7305e0013754006264a6660be002266e292201027b7d00003133714911037b5f20003232330010010032253330620011003132533306300113233300a00a3062001337149101023a200033300a00a3063001005306500213233300a00a3062001337149101023a200033300a00a30630013007330040040023065002306500133714910102207d000033756006264a6660be002266e29221025b5d00003133714911035b5f2000333300600133714911015d000032233300700700230040012233300700700200137580066e292201022c2000133005375a00400226466e2922010268270032333001001337006e340092001337149101012700003222533305e3371000490000800899191919980300319b8000548004cdc599b80002533306133710004900a0a40c02903719b8b33700002a6660c266e2000520141481805206e0043370c004901019b8300148080cdc70020011bae0022222323300100100522533305f00110051325333060001133004306200200613300530620023300300300130620012232330010010032253330593042001133714910101300000315333059337100029000099b8a489012d0033002002302500113300533708002900a19b8b3370066e1400520144818000cc0040048894ccc158cdc4801240002002266600600666e1000920143371666e00cdc28012402890300008b1bad30570013057002375c60aa00260aa0046eb8c14c004c14c008dd6982880098288011bad304f001304b37540022c2c609a60946ea80085858c130c134008c12c004c12c008dd59824800982480098221baa0011630460013300d0232325333042303030433754002266e3c078dd7182398221baa00114a0603860866ea8c070c10cdd5000a99981f99baf374c00a6e98cccc038dd5980998209baa30133041375402c9110048810003a100114a066e212000333013004375c603260806ea80ecdd7180918201baa03b3375e602e660826ea0cdc000d24004660826ea40652f5c00022c6082607c6ea800458c10000cdd5981f801981f181f800981f000981e981c9baa00116303b0013300201823375e602260706ea8004c044c0e0dd51805181c1baa00d15333035302300813232533303a303d00213232323232533303c3026303d3754002264a66607a6056607c6ea80104c8c8c8c8c94ccc114c1200084c8c8c8c8c94ccc11cc0c4c120dd50008992999824181b18249baa00413232533304a3033304b3754006264646464646464646464a6660ae60b40042646464a6660ae0342a6660ae0322a6660ae0302a6660ae01e2a6660ae01c2a6660ae0062a6660ae004200229405280a5014a029405280a503375e6e980e0dd31999812999814019003a40020a89101044655454c00302233302b0110544881044655454c00325333056304430573754002266e2400cdd6982d982c1baa00116303030573754606060ae6ea80d8cdd79ba7330583750012660b06ea001d2f5c0981049f0000ff0016375a60b000260b00046eb8c158004c158008dd7182a000982a0011bad30520013052002375a60a000260986ea800c58cdd79ba732323300100102b22533304f00114bd70099199911299982819baf00700313305400233006006001133006006001304e001304f001305300230510013374a900119826981218259baa0084bd701ba73304d4c0103d87b80004bd70191929998269828001099299982599b88371a00400229404cdc7999b8c480000040092201045348495000371a910104534849500016375c609c002646600200264a666094607060966ea800452f5bded8c026eacc13cc130dd50009980f8020129129998268008a5eb804cc138c12cc13c004cc008008c14000458c130c124dd50008b18258019bab304a0033049304a0013049001304830443754602c60886ea800458c118004cc0340908c8c8c94ccc110c0c8c114dd50008a999822181918229baa3049304a00213371e6eb8c124c118dd5000810001801982400098221baa301d30443754602c60886ea80085281919baf374c600200c6e98c004dd5980a18211baa30143042375402e4646600200200444a66608a002297adef6c60132333222533304633722910100003153330463371e9101000031001100513304a337606ea400cdd3001198030030009bae30440013756608a0026092004608e00264646464a666084605660866ea80044c8c8c8cdc499b82375a60940026eb4c128c12c008cdc11bad304a002375a60946096002608c6ea8c8c8c080cc128dd419b82375a60960046eb4c12c004cc128dd419b82375a609660980046eb4c12cc1300052f5c0608e6ea8c8c8c8c8c08ccc134dd419b81337046eb4c138010004cdc11bad304e0020033304d375066e0800c0052f5c06eb4c134c138004c124dd5182618249baa006375a60966098002608e6ea8c00d200230463754600400a608a6ea8c00400c8c074cc11cdd400099823a610101004bd700b2999820a5014c0103d87a8000153330414a0260366608a60366608a6ea0c0340e8cc1153001023863004bd7025eb804c06ccc114c06ccc114dd401d19822a61021864004bd7025eb80c008018c004dd5980998209baa30133041375402c46660280029101004881003300b00113375e0380022c6082607c6ea800458c10000cdd5981f801981f181f800981f000981e981c9baa00116303b0013300201823375e602260706ea8004c044c0e0dd51805181c1baa00d15333035301e303637546601c0324a66606c66606ca66606c603e606e6ea8c044c0e0dd51808981c1baa300a303837540022940528a504a2266e21200033300b3756601460706ea8c028c0e0dd50009bae3011303837540666eb8c028c0e0dd50198a5014a22940dc0a400044646600200200644a666074002297ae0133225333039300500213303d00233004004001133004004001303c001303d001225333034301d30353754004264646464a666076607c00400a2c6eb8c0f0004c0f0008dd6981d000981b1baa0021622225333035301e0011004132323300100100622533303b00113303c337606ea4018dd3001a5eb7bdb1804c8ccc8894ccc0f0cdc800500189982019bb037520146e9801c01454ccc0f0cdc7805001899299981e9813181f1baa001133041337606ea402cc108c0fcdd5000801080119299981ea9998200008a5114a02980103d87a80001301733041374c00297ae03233001001003225333041001133042337606ea402cdd400525eb7bdb1804c8ccc8894ccc108cdc800780189982319bb0375201e6ea003801454ccc108cdc78078018992999821981618221baa001133047337606ea4040c120c114dd5000801080119299982198160008a6103d87a80001301d33047375000297ae03370000401c26608c66ec0dd48019ba800233006006001375c60800026eb4c104004c114008c10c0044cc100cdd81ba9003374c0046600c00c0026eb8c0e8004dd5981d800981f801181e800991900118030009981c99bb037520046ea00052f5bded8c0600200244a666068002293099299981a8008a4c264666444a66606c66e4000c0084cc01c01ccc0e801000458dd7181a181c0019bae30340013039002303700130370012225333031301a00114bd6f7b6300991919800800a5eb7bdb180894ccc0dc0044cc0e0cdd81ba9006374c00697adef6c6013233322253330383372001400626607866ec0dd48051ba6007005153330383371e01400626607866ec0dd48051ba600700113303c337606ea400cdd3001198030030009bae30360013756606e00260760046072002646600200297adef6c60225333036001133037337606ea4010dd4001a5eb7bdb1804c8ccc8894ccc0dccdc800400189981d99bb037520106ea001c01454ccc0dccdc780400189981d99bb037520106ea001c0044cc0eccdd81ba900337500046600c00c0026eb8c0d4004dd6981b000981d001181c00098171baa01d23032303300122232533302f301d303037540022900009bad30343031375400264a66605e603a60606ea80045300103d87a8000132330010013756606a60646ea8008894ccc0d0004530103d87a80001323332225333035337220100062a66606a66e3c02000c4c03ccc0e4dd400125eb80530103d87a8000133006006001375c60660026eb4c0d0004c0e0008c0d8004cc01000c00888c8cc00400400c894ccc0c4004530103d87a800013233322253330323372200e0062a66606466e3c01c00c4c030cc0d8dd300125eb80530103d87a8000133006006001375c60600026eacc0c4004c0d4008c0cc004c0b8c0acdd50008b19800806119baf3004302b375400202a44646600200200644a66605c0022980103d87a800013322533302d300500213007330310024bd70099802002000981800098188009ba5480008c0ac004dd7181498150011bad302800130243754002604c60466ea803058dd598129813181300298120021bab3023004375860440086eb0c084010c084c084c084004c080c080004c07cc07c004c068dd50049b8748000dc3a4008603200260326034002602a6ea8008dc3a40042c602c602e006602a00460280046028002601e6ea800452613656375a0026eb4004dd68009bad001375c002ae6955ceaab9e5573eae815d0aba25749", + { + "shape": { + "dataType": "list", + "items": [ + { "$ref": "#/definitions/ScriptHash" }, + { "$ref": "#/definitions/asteria/types/AssetClass" }, + { "$ref": "#/definitions/Int" }, + { "$ref": "#/definitions/Int" }, + { "$ref": "#/definitions/Int" }, + { "$ref": "#/definitions/Int" }, + ], + }, + definitions, + } as any, + ), + }; + }, + { + datum: { + "shape": { "$ref": "#/definitions/asteria/types/AsteriaDatum" }, + definitions, + }, + }, + { + redeemer: { + "shape": { "$ref": "#/definitions/asteria/types/AsteriaRedeemer" }, + definitions, + }, + }, +) as unknown as AsteriaAsteriaSpend; + +export interface DeployDeploySpend { + new (adminToken: AsteriaTypesAssetClass): Script; + _datum: Data; + _redeemer: Data; +} + +export const DeployDeploySpend = Object.assign( + function (adminToken: AsteriaTypesAssetClass) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [adminToken], + "5901ed0101003232323232323222533300332323232325332330093001300a37540042646644a66601866e1d2000300d375464660020026eb0c048c03cdd50041129998088008a6103d87a8000133225332330113232533301333301353330133370e9000180a1baa3001301537546002602a6ea8c008c054dd50028a5014a294128899b8848000ccc888c94ccc05cc03cc060dd50008a400026eb4c070c064dd500099299980b9807980c1baa00114c0103d87a8000132330010013756603a60346ea8008894ccc070004530103d87a8000132333222533301d337220100062a66603a66e3c02000c4c034cc084dd400125eb80530103d87a8000133006006001375c60360026eb4c070004c080008c078004c8cc004004010894ccc06c0045300103d87a8000132333222533301c337220100062a66603866e3c02000c4c030cc080dd300125eb80530103d87a8000133006006001375c60340026eacc06c004c07c008c074004dd59801180a9baa30023015375400a6eb8c004c054dd50091bae30023015375402429408c0600048c05cc0600044c004cc05400d2f5c06e9520001330040040013013001301400114a22940c03c004c03cc040004c02cdd50011b874800858c030c03400cc02c008c028008c028004c014dd50008a4c26cacae6955ceaab9e5573eae815d0aba201", + { + "shape": { + "dataType": "list", + "items": [{ "$ref": "#/definitions/asteria/types/AssetClass" }], + }, + definitions, + } as any, + ), + }; + }, + { _datum: { "shape": { "$ref": "#/definitions/Data" }, definitions } }, + { _redeemer: { "shape": { "$ref": "#/definitions/Data" }, definitions } }, +) as unknown as DeployDeploySpend; + +export interface PelletPelletSpend { + new (adminToken: AsteriaTypesAssetClass): Script; + datum: AsteriaTypesPelletDatum; + redeemer: AsteriaTypesPelletRedeemer; +} + +export const PelletPelletSpend = Object.assign( + function (adminToken: AsteriaTypesAssetClass) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [adminToken], + "590b00010100323232323232322253330033232323232323232323232323232325323232333015300900d13233223232533301a300800113232533301f302200200416375a604000260386ea805054ccc068c03800454ccc074c070dd500a0010b0b180d1baa013132323232323232323232533302230103023375400226464a6660486030604a6ea80044c8c94ccc098c050c09cdd50100991919192999816981800109919191919299919818180098189baa002132533303130253032375400a2a666062603e60646ea80044c8c8c8c8c8c94ccc0e8c0f40084c8c8c8c94ccc0f8c1040084c8c8c8c8c94ccc100c044c104dd50008992999820981a98211baa004132325333043303130443754006264646464646464646464a6660a060a6004264646464a6660a20342a6660a20322a6660a20202a6660a201e2a6660a20082a6660a20062a6660a2004200229405280a5014a029405280a50302133230010012253330550011480004cdc0240046600400460b00026605206846058608260a66ea8c10cc14cdd500099baf374c06298101a00032533304f304330503754002266e2400cdd6982a18289baa00116303e30503754607c60a06ea80bccdd79ba7330513750036660a26ea00652f5c06e9ccc144dd4004998289ba80074bd700b1bad30510013051002375c609e002609e0046eb8c134004c134008dd6982580098258011bad3049001304537540062c66ebcdd39981c811181799823181918221baa0084bd701ba733046302f33046375003897ae04bd70191929998231824801099299982219b88371a00400229404cdc7999b8c48000004009221045348495000371a910104534849500016375c608e00264660020026606600801844a66608c002297ae013304730443048001330020023049001163045304237540022c60880066eacc10c00cc108c10c004c108004c104c0f4dd51816981e9baa00116303f0013301201d2323232533303d3031303e37540022a66607a6062607c6ea8c108c10c0084cdc79bae3042303f375400200e0060066082002607a6ea8c0acc0f4dd51816981e9baa00214a0646464646464646464a66608266ebcdd31980100a0041ba633330033300200900801d489044655454c0033702900000d88008a50323300100101422533304500114a2264666444646600200200644a6660960022006264664464a6660986600c00c60a400a266e2400800452819981f0098040011bae304a001375a6096002609a0026eb8c110004dd59822800998018019824801182380091191980080098038019129998230008a5eb7bdb1804cc894ccc114c8cc004004018894ccc12800452809991299982499b8f00200614a22660080080026eb8c130004c1340044c8cc004004cc0dc01c00c894ccc128004400c4c8cccc028cc00c00cc138008014dd718248009bad304a001304c0011001375c60900026600400460920024444a66608460600022008264646600200200c44a66609000226609266ec0dd48031ba60034bd6f7b630099199911299982499b9000a00313304d337606ea4028dd30038028a99982499b8f00a003132533304a3038304b375400226609c66ec0dd4805982798261baa001002100232533304a533304d00114a22940530103d87a8000130403304e374c00297ae0323300100100322533304e00113304f337606ea402cdd400525eb7bdb1804c8ccc8894ccc13ccdc800780189982999bb0375201e6ea003801454ccc13ccdc78078018992999828181f18289baa001133054337606ea4040c154c148dd50008010801192999828181f0008a6103d87a80001304633054375000297ae03370000401c2660a666ec0dd48019ba800233006006001375c609a0026eb4c138004c148008c1400044cc134cdd81ba9003374c0046600c00c0026eb8c11c004dd5982400098260011825000991900118030009982319bb037520046ea00052f5bded8c0600200244a66608200229309929998210008a4c264666444a66608666e4000c0084cc01c01ccc11c01000458dd7182098228019bae3041001304600230440013044001300100122533303f00114bd70099820181e98208009980100118210009981ea6010140003303d3029303b37540706607a6ea40552f5c06eacc0a8c0e8dd51815181d1baa016533303730253038375400e2646464646464a6660806086004266ebcc0cccc1040352f5c004c2c6eb8c104004c104008dd6981f800981f8011bad303d0013039375400e2c2c6eb8c0ec004c0ec008dd6981c800981c8011bad3037001303337540022c2c606a60646ea8008dc3a40082c60660066eacc0c800cc0c4c0c8004c0c4004c0c0c0b0dd50008b181700099800805919baf3019302b3754002603260566ea8c06cc0acdd50039119198008008019129998170008a5eb804cc894ccc0b4c0140084cc0c4008cc0100100044cc010010004c0c0004c0c4004dd6981598141baa020153330263014302737546602a0144a66604e66604e6004602e60526ea8c064c0a4dd5000a504a2260266660346eacc064c0a4dd5180c98149baa001375c602e60526ea8098dd7180c98149baa02614a0294452812999813180a18139baa30163028375400229405289bae3029302637540022c6026604a6ea8c04cc094dd5180a98129baa0013027302437540022c6602000a466ebcc048c090dd50008061bab3025302630260053024004375660460086eb0c088010dd6181080218109810981080098101810000980f980f800980d1baa013301b001301b301c0013017375401c2a66602a600601a2646464a666030600c0022a66603660346ea80480085854ccc060c03000454ccc06cc068dd50090010b0b180c1baa0111323232323232533301f3022002132533301d3371e9101044655454c00375c603c0042a66603a6016603c6ea805c4c94ccc078c030c07cdd5000899192999810180600208008a50325333020300e3021375400229444c94ccc084ccc084cdc79bae3026302337540040189412888008a503375e6e9ccc05c01cc034cc090c040c088dd500125eb80dd399812260103d87980004bd70180798109baa300f30213754602260426ea8004c08cc080dd50008b19806002918051998089bab301030203754602060406ea8004dd7180718101baa01d375c602060406ea80744cdc4000a40002c6eb4c07800458c080004cc02cdd5980f8018029bab301e301f301f301f301f301f0023758603a004603a603a603a603a00260306ea8044dd7180d180b9baa00e16371090001ba548008dc3a400044646600200200644a666030002298103d87a800013322533301730050021300d3301b0024bd70099802002000980d000980d8009180b00091192999809180318099baa00114bd6f7b63009bab3017301437540026600c00400246028602a00244464a666022600a60246ea8004520001375a602c60266ea8004c94ccc044c014c048dd50008a6103d87a8000132330010013756602e60286ea8008894ccc058004530103d87a80001323332225333017337220100062a66602e66e3c02000c4c034cc06cdd400125eb80530103d87a8000133006006001375c602a0026eb4c058004c068008c060004cc01400c008dc3a400444646600200200644a666024002298103d87a800013233322253330133372200e0062a66602666e3c01c00c4c024cc05cdd300125eb80530103d87a8000133006006001375c60220026eacc048004c058008c050004dd2a400044646600200200644a666020002297ae013233322253330113375e00e00626602a0046600c00c00226600c00c002601e00260200026028004602400260126ea8004c030c03400cc02c008c028008c028004c014dd50008a4c26cacae6955ceaab9e5573eae815d0aba21", + { + "shape": { + "dataType": "list", + "items": [{ "$ref": "#/definitions/asteria/types/AssetClass" }], + }, + definitions, + } as any, + ), + }; + }, + { + datum: { + "shape": { "$ref": "#/definitions/asteria/types/PelletDatum" }, + definitions, + }, + }, + { + redeemer: { + "shape": { "$ref": "#/definitions/asteria/types/PelletRedeemer" }, + definitions, + }, + }, +) as unknown as PelletPelletSpend; + +export interface PelletPelletMint { + new (adminToken: AsteriaTypesAssetClass): Script; + redeemer: AsteriaTypesFuelRedeemer; +} + +export const PelletPelletMint = Object.assign( + function (adminToken: AsteriaTypesAssetClass) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [adminToken], + "590b00010100323232323232322253330033232323232323232323232323232325323232333015300900d13233223232533301a300800113232533301f302200200416375a604000260386ea805054ccc068c03800454ccc074c070dd500a0010b0b180d1baa013132323232323232323232533302230103023375400226464a6660486030604a6ea80044c8c94ccc098c050c09cdd50100991919192999816981800109919191919299919818180098189baa002132533303130253032375400a2a666062603e60646ea80044c8c8c8c8c8c94ccc0e8c0f40084c8c8c8c94ccc0f8c1040084c8c8c8c8c94ccc100c044c104dd50008992999820981a98211baa004132325333043303130443754006264646464646464646464a6660a060a6004264646464a6660a20342a6660a20322a6660a20202a6660a201e2a6660a20082a6660a20062a6660a2004200229405280a5014a029405280a50302133230010012253330550011480004cdc0240046600400460b00026605206846058608260a66ea8c10cc14cdd500099baf374c06298101a00032533304f304330503754002266e2400cdd6982a18289baa00116303e30503754607c60a06ea80bccdd79ba7330513750036660a26ea00652f5c06e9ccc144dd4004998289ba80074bd700b1bad30510013051002375c609e002609e0046eb8c134004c134008dd6982580098258011bad3049001304537540062c66ebcdd39981c811181799823181918221baa0084bd701ba733046302f33046375003897ae04bd70191929998231824801099299982219b88371a00400229404cdc7999b8c48000004009221045348495000371a910104534849500016375c608e00264660020026606600801844a66608c002297ae013304730443048001330020023049001163045304237540022c60880066eacc10c00cc108c10c004c108004c104c0f4dd51816981e9baa00116303f0013301201d2323232533303d3031303e37540022a66607a6062607c6ea8c108c10c0084cdc79bae3042303f375400200e0060066082002607a6ea8c0acc0f4dd51816981e9baa00214a0646464646464646464a66608266ebcdd31980100a0041ba633330033300200900801d489044655454c0033702900000d88008a50323300100101422533304500114a2264666444646600200200644a6660960022006264664464a6660986600c00c60a400a266e2400800452819981f0098040011bae304a001375a6096002609a0026eb8c110004dd59822800998018019824801182380091191980080098038019129998230008a5eb7bdb1804cc894ccc114c8cc004004018894ccc12800452809991299982499b8f00200614a22660080080026eb8c130004c1340044c8cc004004cc0dc01c00c894ccc128004400c4c8cccc028cc00c00cc138008014dd718248009bad304a001304c0011001375c60900026600400460920024444a66608460600022008264646600200200c44a66609000226609266ec0dd48031ba60034bd6f7b630099199911299982499b9000a00313304d337606ea4028dd30038028a99982499b8f00a003132533304a3038304b375400226609c66ec0dd4805982798261baa001002100232533304a533304d00114a22940530103d87a8000130403304e374c00297ae0323300100100322533304e00113304f337606ea402cdd400525eb7bdb1804c8ccc8894ccc13ccdc800780189982999bb0375201e6ea003801454ccc13ccdc78078018992999828181f18289baa001133054337606ea4040c154c148dd50008010801192999828181f0008a6103d87a80001304633054375000297ae03370000401c2660a666ec0dd48019ba800233006006001375c609a0026eb4c138004c148008c1400044cc134cdd81ba9003374c0046600c00c0026eb8c11c004dd5982400098260011825000991900118030009982319bb037520046ea00052f5bded8c0600200244a66608200229309929998210008a4c264666444a66608666e4000c0084cc01c01ccc11c01000458dd7182098228019bae3041001304600230440013044001300100122533303f00114bd70099820181e98208009980100118210009981ea6010140003303d3029303b37540706607a6ea40552f5c06eacc0a8c0e8dd51815181d1baa016533303730253038375400e2646464646464a6660806086004266ebcc0cccc1040352f5c004c2c6eb8c104004c104008dd6981f800981f8011bad303d0013039375400e2c2c6eb8c0ec004c0ec008dd6981c800981c8011bad3037001303337540022c2c606a60646ea8008dc3a40082c60660066eacc0c800cc0c4c0c8004c0c4004c0c0c0b0dd50008b181700099800805919baf3019302b3754002603260566ea8c06cc0acdd50039119198008008019129998170008a5eb804cc894ccc0b4c0140084cc0c4008cc0100100044cc010010004c0c0004c0c4004dd6981598141baa020153330263014302737546602a0144a66604e66604e6004602e60526ea8c064c0a4dd5000a504a2260266660346eacc064c0a4dd5180c98149baa001375c602e60526ea8098dd7180c98149baa02614a0294452812999813180a18139baa30163028375400229405289bae3029302637540022c6026604a6ea8c04cc094dd5180a98129baa0013027302437540022c6602000a466ebcc048c090dd50008061bab3025302630260053024004375660460086eb0c088010dd6181080218109810981080098101810000980f980f800980d1baa013301b001301b301c0013017375401c2a66602a600601a2646464a666030600c0022a66603660346ea80480085854ccc060c03000454ccc06cc068dd50090010b0b180c1baa0111323232323232533301f3022002132533301d3371e9101044655454c00375c603c0042a66603a6016603c6ea805c4c94ccc078c030c07cdd5000899192999810180600208008a50325333020300e3021375400229444c94ccc084ccc084cdc79bae3026302337540040189412888008a503375e6e9ccc05c01cc034cc090c040c088dd500125eb80dd399812260103d87980004bd70180798109baa300f30213754602260426ea8004c08cc080dd50008b19806002918051998089bab301030203754602060406ea8004dd7180718101baa01d375c602060406ea80744cdc4000a40002c6eb4c07800458c080004cc02cdd5980f8018029bab301e301f301f301f301f301f0023758603a004603a603a603a603a00260306ea8044dd7180d180b9baa00e16371090001ba548008dc3a400044646600200200644a666030002298103d87a800013322533301730050021300d3301b0024bd70099802002000980d000980d8009180b00091192999809180318099baa00114bd6f7b63009bab3017301437540026600c00400246028602a00244464a666022600a60246ea8004520001375a602c60266ea8004c94ccc044c014c048dd50008a6103d87a8000132330010013756602e60286ea8008894ccc058004530103d87a80001323332225333017337220100062a66602e66e3c02000c4c034cc06cdd400125eb80530103d87a8000133006006001375c602a0026eb4c058004c068008c060004cc01400c008dc3a400444646600200200644a666024002298103d87a800013233322253330133372200e0062a66602666e3c01c00c4c024cc05cdd300125eb80530103d87a8000133006006001375c60220026eacc048004c058008c050004dd2a400044646600200200644a666020002297ae013233322253330113375e00e00626602a0046600c00c00226600c00c002601e00260200026028004602400260126ea8004c030c03400cc02c008c028008c028004c014dd50008a4c26cacae6955ceaab9e5573eae815d0aba21", + { + "shape": { + "dataType": "list", + "items": [{ "$ref": "#/definitions/asteria/types/AssetClass" }], + }, + definitions, + } as any, + ), + }; + }, + { + redeemer: { + "shape": { "$ref": "#/definitions/asteria/types/FuelRedeemer" }, + definitions, + }, + }, +) as unknown as PelletPelletMint; + +export interface SpacetimeSpacetimeSpend { + new ( + pelletValidatorAddress: ScriptHash, + asteriaValidatorAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + maxSpeed: AsteriaTypesSpeed, + maxShipFuel: Int, + fuelPerStep: Int, + ): Script; + datum: AsteriaTypesShipDatum; + redeemer: AsteriaTypesShipRedeemer; +} + +export const SpacetimeSpacetimeSpend = Object.assign( + function ( + pelletValidatorAddress: ScriptHash, + asteriaValidatorAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + maxSpeed: AsteriaTypesSpeed, + maxShipFuel: Int, + fuelPerStep: Int, + ) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [ + pelletValidatorAddress, + asteriaValidatorAddress, + adminToken, + maxSpeed, + maxShipFuel, + fuelPerStep, + ], + "590d7201010032323232323232232232222322322533300c3232323232323232323232323232325323233301d300800c132332232323253330233007001132323232533302a302d00200616375a605600260560046eb4c0a4004c094dd500a0a999811980700089919299981418158010020b1bad3029001302537540282a66604660060022a66604c604a6ea80500085854ccc08ccdc3a400c0022a66604c604a6ea80500085858c08cdd500989919191919191919192999815180718159baa00b1323232323232323232323232325333037301b303837540022646464a666074603c60766ea80044c8c94ccc0f0c09cc0f4dd50008991919191919191919299982298148030991991192999824981a18251baa00113232533304b3036304c3754002264646464646464a6660aa60b000426464646464a6660ae606e60b06ea80044c94ccc160c10cc164dd500209980a000899191919299982e00f8a99982e00f0a99982e0070a99982e0068a99982e0018a99982e00108008a5014a029405280a5014a066ebcdd301a1ba632533305c304000114bd6f7b6300991919800800a5eb7bdb180894ccc1880044cc18ccdd81ba905d374c00697adef6c601323332225333063337200c20062660ce66ec0dd48309ba6007005153330633371e0c20062660ce66ec0dd48309ba6007001133067337606ea400cdd3001198030030009bae3061001375660c400260cc00460c8002646600200297adef6c6022533306100113306233760980105444655454c00375000697adef6c601323332225333062337209101044655454c0000313306633760980105444655454c00375000e00a2a6660c466e3d221044655454c0000313306633760980105444655454c00375000e0022660cc66ec0dd48019ba800233006006001375c60c00026eb4c184004c194008c18c004c09c038cdd79ba6301a005374c6034666602e6eacc104c170dd51820982e1baa020058489044655454c00302600d53330593375e608c660ba6ea0cdc00150099982e9ba833700052024660ba6ea40a0cc174dd48139982e9800982d9baa0024bd70001099b8900e375a600260b66ea80085281182f182f982f982f982f8008b182e182c9baa00116305b003375660b400660b260b400260b200260b060a86ea800458c158004cc0e40a88cdd7981b98299baa001303730533754607060a66ea805ccdc480e003192999827981998281baa001132323371266e08dd6982b0011bad30563057001337046eb4c158004dd6982b182b80118291baa0193051375460a860a26ea800458cc064008cdc080180299b820010433233700600200e600200c4a66609a66e200052000130190011001375a60a0609a6ea800458c0c0c130dd5181898261baa022375a609c60966ea800458c0b8c128dd5181718251baa020375a60960026eb4c12cc130004c11cdd501b0a9998229818003099191929998259827001099191919192999826981698271baa001132533304e3039304f37540082660140022646464a6660a20282a6660a20262a6660a20062a6660a2004200229405280a5014a064a6660a2606c018266e2400412452819981d002827245044655454c003375e6e98c03c010dd3180799998061bab303630513754606c60a26ea80541352201044655454c0000a3375e0020482c60a4609e6ea800458c14400cdd59828001982798280009827800982718251baa00116304c0013302f02023375e605a60926ea8004c0b4c124dd5181718249baa00d375a6094608e6ea80d854ccc114c0940184c8c94ccc128c1340084c8c94ccc12403054ccc12402c54ccc12400840045280a5014a066ebcdd39981b00f99ba548008cc130c0b8c128dd500125eb80dd39982626103d87a80004bd7018161998189bab302e30493754605c60926ea8004dd7181698249baa042375c605c60926ea810858c12c004cc0b80808c94ccc11cc0acc120dd50008a5013371e6eb8c130c124dd5000821981618241baa302c30483754605a60906ea80044c8c94ccc11c02854ccc11c02454ccc11c00840045280a5014a066e1cccc0c007c111221044655454c0030123330303756605a60906ea8c0b4c120dd5006022245044655454c003371066605e03c0120289000112999823181518239baa0021323232323232323232325333053305600200b16375a60a800260a80046eb8c148004c148008dd7182800098280011bad304e001304e002375a609800260906ea80085888894ccc11cc0ac00440104c8c8cc004004018894ccc1340044cc138cdd81ba9006374c00697adef6c60132333222533304e337200140062660a466ec0dd48051ba60070051533304e3371e014006264a66609e606660a06ea80044cc14ccdd81ba900b305430513754002004200464a66609ea6660a400229445280a6103d87a80001303c33053374c00297ae03233001001003225333053001133054337606ea402cdd400525eb7bdb1804c8ccc8894ccc150cdc800780189982c19bb0375201e6ea003801454ccc150cdc7807801899299982a981c982b1baa001133059337606ea4040c168c15cdd5000801080119299982a981c8008a6103d87a80001304233059375000297ae03370000401c2660b066ec0dd48019ba800233006006001375c60a40026eb4c14c004c15c008c1540044cc148cdd81ba9003374c0046600c00c0026eb8c130004dd5982680098288011827800991900118030009982599bb037520046ea00052f5bded8c0600200244a66608c00229309929998238008a4c264666444a66609066e4000c0084cc01c01ccc13001000458dd7182318250019bae3046001304b002304900130490012323300100100222533304600114bd6f7b630099199911299982399b91488100003153330473371e9101000031001100513304b337606ea400cdd3001198030030009bae30450013756608c0026094004609000260806ea80c0c0a4cc8c004004894ccc10c0045200013370090011980100118230009981380c9192999820181218209baa00114a0266e3cdd7182298211baa001004302530413754604a60826ea8c098c104dd5000a99981e9810981f1baa33005018232330010013233001001330283756604e60846ea8c09cc108dd50018021129998220008a5eb804cc114c108c118004cc008008c11c004894ccc10c00452809991299982119b8f00201014a22660080080026eb8c114004c1180045288a50375c6082607c6ea800458c084c0f4dd51810981e9baa3022303d3754002607e60786ea800458cc0040508cdd79810181e1baa00101c22323300100100322533303f00114c0103d87a800013322533303e30050021302b330420024bd7009980200200098208009821000981e181c9baa0011633001375a603860706ea80c0dd6980e981c1baa030225333037301b00114c103d87a800015333037337100029000098121981d98121981d9ba830030023303b3750600600297ae04bd70098121981d98121981d9ba80023303b375000297ae04bd701b8148000dd6981c181c8029bae3037004375c606c0086eb4c0d4010dd6981a002181a0009819800981900098169baa001302f302c37540162c6eacc0b8c0bcc0bc014c0b4010dd598160021bac302b00437586054008605460546054002605260520026050605000260466ea804cdc3a4008604600260466048002603e6ea803454ccc074c0040304c8c8c94ccc080c01000454ccc08cc088dd50088010b0a99981018058008a99981198111baa01100216163020375402026464646464a666046600e60486ea80504c8c94ccc0a0c0ac0084c94ccc098c02cccc040dd5980698141baa300d302837540046eb8c030c0a0dd50109bae300d3028375404220022940cdd79ba7330130043374a900119814980598139baa0014bd701ba7330294c103d87980004bd700b1814800998060019192999812980498131baa00114a0266e3cdd7181518139baa001021300a302637546014604c6ea8c02cc098dd500089919299981418158010a99981299b8748004dd698138008a51161630290013300b0010063756604e0066eacc098c09cc09cc09cc09cc09c008dd61812801181298129812981280098101baa010375c6044603e6ea803458dc3a40006e212000230200012301f30200012232533301b3006301c3754002297adef6c60137566040603a6ea8004cc01800800488c8cc00400400c894ccc07800452f5c026644a66603a600a004266042004660080080022660080080026040002604200244464a666034600a60366ea8004520001375a603e60386ea8004c94ccc068c014c06cdd50008a60103d87a80001323300100137566040603a6ea8008894ccc07c004530103d87a80001323332225333020337220100062a66604066e3c02000c4c034cc090dd400125eb80530103d87a8000133006006001375c603c0026eb4c07c004c08c008c084004cc01400c008dc3a400444646600200200644a666036002298103d87a8000132333222533301c3372200e0062a66603866e3c01c00c4c024cc080dd300125eb80530103d87a8000133006006001375c60340026eacc06c004c07c008c074004dd2a400044646600200200644a666032002297ae0132333222533301a3375e00e00626603c0046600c00c00226600c00c00260300026032002603a004603600260246ea8004c054c05800cc050008c04c008c04c004c038dd50008a4c26cac6eb4004dd68009bae001375c002ae6955ceaab9e5573eae815d0aba201", + { + "shape": { + "dataType": "list", + "items": [ + { "$ref": "#/definitions/ScriptHash" }, + { "$ref": "#/definitions/ScriptHash" }, + { "$ref": "#/definitions/asteria/types/AssetClass" }, + { "$ref": "#/definitions/asteria/types/Speed" }, + { "$ref": "#/definitions/Int" }, + { "$ref": "#/definitions/Int" }, + ], + }, + definitions, + } as any, + ), + }; + }, + { + datum: { + "shape": { "$ref": "#/definitions/asteria/types/ShipDatum" }, + definitions, + }, + }, + { + redeemer: { + "shape": { "$ref": "#/definitions/asteria/types/ShipRedeemer" }, + definitions, + }, + }, +) as unknown as SpacetimeSpacetimeSpend; + +export interface SpacetimeSpacetimeMint { + new ( + pelletValidatorAddress: ScriptHash, + asteriaValidatorAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + maxSpeed: AsteriaTypesSpeed, + maxShipFuel: Int, + fuelPerStep: Int, + ): Script; + redeemer: AsteriaTypesShipyardRedeemer; +} + +export const SpacetimeSpacetimeMint = Object.assign( + function ( + pelletValidatorAddress: ScriptHash, + asteriaValidatorAddress: ScriptHash, + adminToken: AsteriaTypesAssetClass, + maxSpeed: AsteriaTypesSpeed, + maxShipFuel: Int, + fuelPerStep: Int, + ) { + return { + type: "PlutusV3", + script: applyParamsToScript( + [ + pelletValidatorAddress, + asteriaValidatorAddress, + adminToken, + maxSpeed, + maxShipFuel, + fuelPerStep, + ], + "590d7201010032323232323232232232222322322533300c3232323232323232323232323232325323233301d300800c132332232323253330233007001132323232533302a302d00200616375a605600260560046eb4c0a4004c094dd500a0a999811980700089919299981418158010020b1bad3029001302537540282a66604660060022a66604c604a6ea80500085854ccc08ccdc3a400c0022a66604c604a6ea80500085858c08cdd500989919191919191919192999815180718159baa00b1323232323232323232323232325333037301b303837540022646464a666074603c60766ea80044c8c94ccc0f0c09cc0f4dd50008991919191919191919299982298148030991991192999824981a18251baa00113232533304b3036304c3754002264646464646464a6660aa60b000426464646464a6660ae606e60b06ea80044c94ccc160c10cc164dd500209980a000899191919299982e00f8a99982e00f0a99982e0070a99982e0068a99982e0018a99982e00108008a5014a029405280a5014a066ebcdd301a1ba632533305c304000114bd6f7b6300991919800800a5eb7bdb180894ccc1880044cc18ccdd81ba905d374c00697adef6c601323332225333063337200c20062660ce66ec0dd48309ba6007005153330633371e0c20062660ce66ec0dd48309ba6007001133067337606ea400cdd3001198030030009bae3061001375660c400260cc00460c8002646600200297adef6c6022533306100113306233760980105444655454c00375000697adef6c601323332225333062337209101044655454c0000313306633760980105444655454c00375000e00a2a6660c466e3d221044655454c0000313306633760980105444655454c00375000e0022660cc66ec0dd48019ba800233006006001375c60c00026eb4c184004c194008c18c004c09c038cdd79ba6301a005374c6034666602e6eacc104c170dd51820982e1baa020058489044655454c00302600d53330593375e608c660ba6ea0cdc00150099982e9ba833700052024660ba6ea40a0cc174dd48139982e9800982d9baa0024bd70001099b8900e375a600260b66ea80085281182f182f982f982f982f8008b182e182c9baa00116305b003375660b400660b260b400260b200260b060a86ea800458c158004cc0e40a88cdd7981b98299baa001303730533754607060a66ea805ccdc480e003192999827981998281baa001132323371266e08dd6982b0011bad30563057001337046eb4c158004dd6982b182b80118291baa0193051375460a860a26ea800458cc064008cdc080180299b820010433233700600200e600200c4a66609a66e200052000130190011001375a60a0609a6ea800458c0c0c130dd5181898261baa022375a609c60966ea800458c0b8c128dd5181718251baa020375a60960026eb4c12cc130004c11cdd501b0a9998229818003099191929998259827001099191919192999826981698271baa001132533304e3039304f37540082660140022646464a6660a20282a6660a20262a6660a20062a6660a2004200229405280a5014a064a6660a2606c018266e2400412452819981d002827245044655454c003375e6e98c03c010dd3180799998061bab303630513754606c60a26ea80541352201044655454c0000a3375e0020482c60a4609e6ea800458c14400cdd59828001982798280009827800982718251baa00116304c0013302f02023375e605a60926ea8004c0b4c124dd5181718249baa00d375a6094608e6ea80d854ccc114c0940184c8c94ccc128c1340084c8c94ccc12403054ccc12402c54ccc12400840045280a5014a066ebcdd39981b00f99ba548008cc130c0b8c128dd500125eb80dd39982626103d87a80004bd7018161998189bab302e30493754605c60926ea8004dd7181698249baa042375c605c60926ea810858c12c004cc0b80808c94ccc11cc0acc120dd50008a5013371e6eb8c130c124dd5000821981618241baa302c30483754605a60906ea80044c8c94ccc11c02854ccc11c02454ccc11c00840045280a5014a066e1cccc0c007c111221044655454c0030123330303756605a60906ea8c0b4c120dd5006022245044655454c003371066605e03c0120289000112999823181518239baa0021323232323232323232325333053305600200b16375a60a800260a80046eb8c148004c148008dd7182800098280011bad304e001304e002375a609800260906ea80085888894ccc11cc0ac00440104c8c8cc004004018894ccc1340044cc138cdd81ba9006374c00697adef6c60132333222533304e337200140062660a466ec0dd48051ba60070051533304e3371e014006264a66609e606660a06ea80044cc14ccdd81ba900b305430513754002004200464a66609ea6660a400229445280a6103d87a80001303c33053374c00297ae03233001001003225333053001133054337606ea402cdd400525eb7bdb1804c8ccc8894ccc150cdc800780189982c19bb0375201e6ea003801454ccc150cdc7807801899299982a981c982b1baa001133059337606ea4040c168c15cdd5000801080119299982a981c8008a6103d87a80001304233059375000297ae03370000401c2660b066ec0dd48019ba800233006006001375c60a40026eb4c14c004c15c008c1540044cc148cdd81ba9003374c0046600c00c0026eb8c130004dd5982680098288011827800991900118030009982599bb037520046ea00052f5bded8c0600200244a66608c00229309929998238008a4c264666444a66609066e4000c0084cc01c01ccc13001000458dd7182318250019bae3046001304b002304900130490012323300100100222533304600114bd6f7b630099199911299982399b91488100003153330473371e9101000031001100513304b337606ea400cdd3001198030030009bae30450013756608c0026094004609000260806ea80c0c0a4cc8c004004894ccc10c0045200013370090011980100118230009981380c9192999820181218209baa00114a0266e3cdd7182298211baa001004302530413754604a60826ea8c098c104dd5000a99981e9810981f1baa33005018232330010013233001001330283756604e60846ea8c09cc108dd50018021129998220008a5eb804cc114c108c118004cc008008c11c004894ccc10c00452809991299982119b8f00201014a22660080080026eb8c114004c1180045288a50375c6082607c6ea800458c084c0f4dd51810981e9baa3022303d3754002607e60786ea800458cc0040508cdd79810181e1baa00101c22323300100100322533303f00114c0103d87a800013322533303e30050021302b330420024bd7009980200200098208009821000981e181c9baa0011633001375a603860706ea80c0dd6980e981c1baa030225333037301b00114c103d87a800015333037337100029000098121981d98121981d9ba830030023303b3750600600297ae04bd70098121981d98121981d9ba80023303b375000297ae04bd701b8148000dd6981c181c8029bae3037004375c606c0086eb4c0d4010dd6981a002181a0009819800981900098169baa001302f302c37540162c6eacc0b8c0bcc0bc014c0b4010dd598160021bac302b00437586054008605460546054002605260520026050605000260466ea804cdc3a4008604600260466048002603e6ea803454ccc074c0040304c8c8c94ccc080c01000454ccc08cc088dd50088010b0a99981018058008a99981198111baa01100216163020375402026464646464a666046600e60486ea80504c8c94ccc0a0c0ac0084c94ccc098c02cccc040dd5980698141baa300d302837540046eb8c030c0a0dd50109bae300d3028375404220022940cdd79ba7330130043374a900119814980598139baa0014bd701ba7330294c103d87980004bd700b1814800998060019192999812980498131baa00114a0266e3cdd7181518139baa001021300a302637546014604c6ea8c02cc098dd500089919299981418158010a99981299b8748004dd698138008a51161630290013300b0010063756604e0066eacc098c09cc09cc09cc09cc09c008dd61812801181298129812981280098101baa010375c6044603e6ea803458dc3a40006e212000230200012301f30200012232533301b3006301c3754002297adef6c60137566040603a6ea8004cc01800800488c8cc00400400c894ccc07800452f5c026644a66603a600a004266042004660080080022660080080026040002604200244464a666034600a60366ea8004520001375a603e60386ea8004c94ccc068c014c06cdd50008a60103d87a80001323300100137566040603a6ea8008894ccc07c004530103d87a80001323332225333020337220100062a66604066e3c02000c4c034cc090dd400125eb80530103d87a8000133006006001375c603c0026eb4c07c004c08c008c084004cc01400c008dc3a400444646600200200644a666036002298103d87a8000132333222533301c3372200e0062a66603866e3c01c00c4c024cc080dd300125eb80530103d87a8000133006006001375c60340026eacc06c004c07c008c074004dd2a400044646600200200644a666032002297ae0132333222533301a3375e00e00626603c0046600c00c00226600c00c00260300026032002603a004603600260246ea8004c054c05800cc050008c04c008c04c004c038dd50008a4c26cac6eb4004dd68009bae001375c002ae6955ceaab9e5573eae815d0aba201", + { + "shape": { + "dataType": "list", + "items": [ + { "$ref": "#/definitions/ScriptHash" }, + { "$ref": "#/definitions/ScriptHash" }, + { "$ref": "#/definitions/asteria/types/AssetClass" }, + { "$ref": "#/definitions/asteria/types/Speed" }, + { "$ref": "#/definitions/Int" }, + { "$ref": "#/definitions/Int" }, + ], + }, + definitions, + } as any, + ), + }; + }, + { + redeemer: { + "shape": { "$ref": "#/definitions/asteria/types/ShipyardRedeemer" }, + definitions, + }, + }, +) as unknown as SpacetimeSpacetimeMint; diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index 74d34f5..458923a 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -8,6 +8,7 @@ import { SpacetimeSpacetimeSpend, } from "../../../onchain/src/plutus.ts"; import { lucidBase } from "../src/utils.ts"; +import deployParams from "./deploy_params.json" with { type: "json" }; console.log("DEPLOYING ASTERIA"); @@ -15,19 +16,19 @@ console.log("DEPLOYING ASTERIA"); // CONFIGURATION // const admin_token: AsteriaTypesAssetClass = { - policy: "0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64", - name: "0014df105af4eb1811a74ad4e61c45362f84cf69835d2740f9f54019b1e13a07", + policy: deployParams.admin_token.policy, + name: deployParams.admin_token.name, }; -const ship_mint_lovelace_fee = 1_000_000n; -const max_asteria_mining = 50n; +const ship_mint_lovelace_fee = BigInt(deployParams.ship_mint_lovelace_fee); +const max_asteria_mining = BigInt(deployParams.max_asteria_mining); const max_speed: AsteriaTypesSpeed = { - distance: 1n, - time: 30n * 1000n, // milliseconds (30 seconds) + distance: BigInt(deployParams.max_speed.distance), + time: BigInt(deployParams.max_speed.time), }; -const max_ship_fuel = 100n; -const fuel_per_step = 1n; -const initial_fuel = 30n; -const min_asteria_distance = 10n; +const max_ship_fuel = BigInt(deployParams.max_ship_fuel); +const fuel_per_step = BigInt(deployParams.fuel_per_step); +const initial_fuel = BigInt(deployParams.initial_fuel); +const min_asteria_distance = BigInt(deployParams.min_asteria_distance); // // VALIDATORS INSTANTIATION @@ -83,7 +84,7 @@ const asteriaDatum = { // // DEPLOYMENT TX (REFERENCE SCRIPTS AND ASTERIA) // -const tx = await lucid +const deployTx = await lucid .newTx() .payToContract( deployAddress, @@ -118,8 +119,10 @@ const tx = await lucid ) .commit(); -const signedTx = await tx.sign().commit(); -// console.log(signedTx.toString()); -// const txHash = await signedTx.submit(); -const txHash = "fee59afa92a0eff4d8b7532917ea514cee26fd22924c246072891ea741cdfb15"; -console.log("DEPLOYMENT TXHASH:", txHash); +const signedDeployTx = await deployTx.sign().commit(); +console.log(signedDeployTx.toString()); +const deployTxHash = await signedDeployTx.submit(); +console.log("Waiting for deployment transaction to be confirmed..."); +await lucid.awaitTx(deployTxHash); +console.log("DEPLOYMENT TXHASH:", deployTxHash); + diff --git a/sdk/lucid/examples/deploy_params.json b/sdk/lucid/examples/deploy_params.json new file mode 100644 index 0000000..e36c1fd --- /dev/null +++ b/sdk/lucid/examples/deploy_params.json @@ -0,0 +1,16 @@ +{ + "admin_token": { + "policy": "b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4", + "name": "746f6b656e42" + }, + "ship_mint_lovelace_fee": 1000000, + "max_asteria_mining": 50, + "max_speed": { + "distance": 1, + "time": 30000 + }, + "max_ship_fuel": 100, + "fuel_per_step": 1, + "initial_fuel": 31, + "min_asteria_distance": 10 +} From 110f3e6a878ba6b7f80e5c64ca579c332f62d958 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 19:34:16 -0300 Subject: [PATCH 08/19] create pellets in deployment script --- sdk/lucid/examples/deploy.ts | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index 458923a..917c720 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -4,10 +4,12 @@ import { AsteriaTypesAssetClass, AsteriaTypesSpeed, DeployDeploySpend, + PelletPelletMint, PelletPelletSpend, SpacetimeSpacetimeSpend, } from "../../../onchain/src/plutus.ts"; import { lucidBase } from "../src/utils.ts"; +import { readPelletsCSV } from "../../../offchain/tests/admin/pellets/utils.ts"; import deployParams from "./deploy_params.json" with { type: "json" }; console.log("DEPLOYING ASTERIA"); @@ -126,3 +128,61 @@ console.log("Waiting for deployment transaction to be confirmed..."); await lucid.awaitTx(deployTxHash); console.log("DEPLOYMENT TXHASH:", deployTxHash); +// This is a workaround to ensure the wallet UTxOs are updated after the deployment transaction. +// The wallet UTxOs may not be updated immediately after the transaction is submitted. +// This way we avoid errors like trying to use inputs that were already spent. +const delay = ms => new Promise(res => setTimeout(res, ms)); +let wereWalletUTxOsUpdated = false; +while (!wereWalletUTxOsUpdated) { + console.log("Waiting for wallet UTXOs to be updated..."); + await delay(5000); + const walletUTXOs = await lucid.wallet.getUtxos(); + wereWalletUTxOsUpdated = walletUTXOs.some(utxo => utxo.txHash === deployTxHash); +} + +// +// CREATE PELLETS +// +console.log("\nCREATING PELLETS"); + +const pelletRefs = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 2, +}]); + +const pellets = await readPelletsCSV("../../../offchain/tests/admin/pellets/pellets.csv"); +const fuelToken = pelletHash + fromText("FUEL"); + +let pelletsTx = await lucid.newTx().readFrom(pelletRefs); +for (const pellet of pellets) { + const pelletDatum = { + posX: pellet.pos_x, + posY: pellet.pos_y, + shipyardPolicy: spacetimeHash, + }; + const prizeToken = (pellet.prize_policy && pellet.prize_name) + ? pellet.prize_policy + fromText(pellet.prize_name) + : ""; + pelletsTx = pelletsTx + .mint( + { + [fuelToken]: pellet.fuel, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + pelletAddress, + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + { + [fuelToken]: pellet.fuel, + [adminToken]: 1n, + [prizeToken]: pellet.prize_amount && pellet.prize_amount > 0 ? pellet.prize_amount : 0n, + } + ); +} +const committedPelletsTx = await pelletsTx.commit(); +const signedPelletsTx = await committedPelletsTx.sign().commit(); +console.log(signedPelletsTx.toString()); +const pelletsTxHash = await signedPelletsTx.submit(); +await lucid.awaitTx(deployTxHash); +console.log("PELLETS TXHASH:", pelletsTxHash); From cccd4fc04cf18aacd16e8e144e7178b763266350 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 19:42:56 -0300 Subject: [PATCH 09/19] feat: update pellets CSV path and add pellets data --- sdk/lucid/examples/deploy.ts | 2 +- sdk/lucid/examples/pellets.csv | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 sdk/lucid/examples/pellets.csv diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index 917c720..3b524f6 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -150,7 +150,7 @@ const pelletRefs = await lucid.utxosByOutRef([{ outputIndex: 2, }]); -const pellets = await readPelletsCSV("../../../offchain/tests/admin/pellets/pellets.csv"); +const pellets = await readPelletsCSV("./pellets.csv"); const fuelToken = pelletHash + fromText("FUEL"); let pelletsTx = await lucid.newTx().readFrom(pelletRefs); diff --git a/sdk/lucid/examples/pellets.csv b/sdk/lucid/examples/pellets.csv new file mode 100644 index 0000000..8c44b8e --- /dev/null +++ b/sdk/lucid/examples/pellets.csv @@ -0,0 +1,5 @@ +fuel,x,y,prize_policy,prize_name,prize_amount +90,12,-35,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,2 +40,-8,3,,, +25,20,16,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,3 +36,-4,-17,,, From e20ef09fdaa3b7bbda933b5e0d3fcb6c9f13d9f0 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 28 Jul 2025 21:42:37 -0300 Subject: [PATCH 10/19] feat: enhance pellet csv structure check for prize tokens --- sdk/lucid/examples/deploy.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index 3b524f6..3a02d44 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -160,9 +160,21 @@ for (const pellet of pellets) { posY: pellet.pos_y, shipyardPolicy: spacetimeHash, }; - const prizeToken = (pellet.prize_policy && pellet.prize_name) - ? pellet.prize_policy + fromText(pellet.prize_name) - : ""; + + let assets = {}; + if (pellet.prize_policy && pellet.prize_name && pellet.prize_amount && pellet.prize_amount > 0) { + assets = { + [fuelToken]: pellet.fuel, + [adminToken]: 1n, + [pellet.prize_policy + fromText(pellet.prize_name)]: pellet.prize_amount, + }; + } else { + assets = { + [fuelToken]: pellet.fuel, + [adminToken]: 1n, + }; + } + pelletsTx = pelletsTx .mint( { @@ -173,13 +185,10 @@ for (const pellet of pellets) { .payToContract( pelletAddress, { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, - { - [fuelToken]: pellet.fuel, - [adminToken]: 1n, - [prizeToken]: pellet.prize_amount && pellet.prize_amount > 0 ? pellet.prize_amount : 0n, - } + assets ); } + const committedPelletsTx = await pelletsTx.commit(); const signedPelletsTx = await committedPelletsTx.sign().commit(); console.log(signedPelletsTx.toString()); From c2f5db15d2e46ba73517b9879c2452fe5ae8b44a Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Tue, 29 Jul 2025 17:28:46 -0300 Subject: [PATCH 11/19] improved UTxOs update check --- sdk/lucid/examples/deploy.ts | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index 3a02d44..e8bec53 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -1,4 +1,4 @@ -import { fromText, Data } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { fromText, Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; import { AsteriaAsteriaSpend, AsteriaTypesAssetClass, @@ -36,6 +36,7 @@ const min_asteria_distance = BigInt(deployParams.min_asteria_distance); // VALIDATORS INSTANTIATION // const lucid = await lucidBase(); +const initialWalletUTXOs = await lucid.wallet.getUtxos(); const deployValidator = new DeployDeploySpend( admin_token, @@ -128,16 +129,15 @@ console.log("Waiting for deployment transaction to be confirmed..."); await lucid.awaitTx(deployTxHash); console.log("DEPLOYMENT TXHASH:", deployTxHash); -// This is a workaround to ensure the wallet UTxOs are updated after the deployment transaction. -// The wallet UTxOs may not be updated immediately after the transaction is submitted. +// This is a workaround to wait for the wallet UTxOs to be updated after the deployment transaction. // This way we avoid errors like trying to use inputs that were already spent. const delay = ms => new Promise(res => setTimeout(res, ms)); -let wereWalletUTxOsUpdated = false; -while (!wereWalletUTxOsUpdated) { +let wereUTxOsUpdated = false; +while (!wereUTxOsUpdated) { console.log("Waiting for wallet UTXOs to be updated..."); await delay(5000); const walletUTXOs = await lucid.wallet.getUtxos(); - wereWalletUTxOsUpdated = walletUTXOs.some(utxo => utxo.txHash === deployTxHash); + wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); } // @@ -195,3 +195,24 @@ console.log(signedPelletsTx.toString()); const pelletsTxHash = await signedPelletsTx.submit(); await lucid.awaitTx(deployTxHash); console.log("PELLETS TXHASH:", pelletsTxHash); + +// We need to wait for the wallet UTxOs to be updated after the deployment transaction. +function haveSameUTxOs(utxos_1: Utxo[], utxos_2: Utxo[]): boolean { + if (utxos_1.length !== utxos_2.length) { + return false; + } + + const refs_1 = new Set(utxos_1.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); + const refs_2 = new Set(utxos_2.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); + + if (refs_1.size !== refs_2.size) { // Check if the number of unique refs is the same + return false; + } + + for (const ref of refs_1) { + if (!refs_2.has(ref)) { + return false; + } + } + return true; +} From 9dbe27c67e09fa6f295137cea8eaec44c9872670 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Fri, 1 Aug 2025 16:23:23 -0300 Subject: [PATCH 12/19] create pellets in batches --- sdk/lucid/examples/deploy.ts | 121 ++++++++++++++++++----------------- sdk/lucid/examples/utils.ts | 31 +++++++++ 2 files changed, 92 insertions(+), 60 deletions(-) create mode 100644 sdk/lucid/examples/utils.ts diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index e8bec53..b5e875f 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -9,6 +9,7 @@ import { SpacetimeSpacetimeSpend, } from "../../../onchain/src/plutus.ts"; import { lucidBase } from "../src/utils.ts"; +import { chunkArray, delay, haveSameUTxOs } from "./utils.ts"; import { readPelletsCSV } from "../../../offchain/tests/admin/pellets/utils.ts"; import deployParams from "./deploy_params.json" with { type: "json" }; @@ -123,15 +124,14 @@ const deployTx = await lucid .commit(); const signedDeployTx = await deployTx.sign().commit(); -console.log(signedDeployTx.toString()); +// console.log(signedDeployTx.toString()); const deployTxHash = await signedDeployTx.submit(); +console.log("\nDEPLOYMENT TXHASH:", deployTxHash); console.log("Waiting for deployment transaction to be confirmed..."); await lucid.awaitTx(deployTxHash); -console.log("DEPLOYMENT TXHASH:", deployTxHash); // This is a workaround to wait for the wallet UTxOs to be updated after the deployment transaction. // This way we avoid errors like trying to use inputs that were already spent. -const delay = ms => new Promise(res => setTimeout(res, ms)); let wereUTxOsUpdated = false; while (!wereUTxOsUpdated) { console.log("Waiting for wallet UTXOs to be updated..."); @@ -153,66 +153,67 @@ const pelletRefs = await lucid.utxosByOutRef([{ const pellets = await readPelletsCSV("./pellets.csv"); const fuelToken = pelletHash + fromText("FUEL"); -let pelletsTx = await lucid.newTx().readFrom(pelletRefs); -for (const pellet of pellets) { - const pelletDatum = { - posX: pellet.pos_x, - posY: pellet.pos_y, - shipyardPolicy: spacetimeHash, - }; - - let assets = {}; - if (pellet.prize_policy && pellet.prize_name && pellet.prize_amount && pellet.prize_amount > 0) { - assets = { - [fuelToken]: pellet.fuel, - [adminToken]: 1n, - [pellet.prize_policy + fromText(pellet.prize_name)]: pellet.prize_amount, - }; - } else { - assets = { - [fuelToken]: pellet.fuel, - [adminToken]: 1n, - }; - } +const chunkLength = 80; +const chunkedPellets: Utxo[][] = chunkArray(pellets, chunkLength); - pelletsTx = pelletsTx - .mint( - { - [fuelToken]: pellet.fuel, - }, - Data.to("MintFuel", PelletPelletMint.redeemer) - ) - .payToContract( - pelletAddress, - { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, - assets - ); -} - -const committedPelletsTx = await pelletsTx.commit(); -const signedPelletsTx = await committedPelletsTx.sign().commit(); -console.log(signedPelletsTx.toString()); -const pelletsTxHash = await signedPelletsTx.submit(); -await lucid.awaitTx(deployTxHash); -console.log("PELLETS TXHASH:", pelletsTxHash); +let totalCreated = 0; +for (const chunk of chunkedPellets) { + const initialWalletUTXOs = await lucid.wallet.getUtxos(); -// We need to wait for the wallet UTxOs to be updated after the deployment transaction. -function haveSameUTxOs(utxos_1: Utxo[], utxos_2: Utxo[]): boolean { - if (utxos_1.length !== utxos_2.length) { - return false; - } - - const refs_1 = new Set(utxos_1.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); - const refs_2 = new Set(utxos_2.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); - - if (refs_1.size !== refs_2.size) { // Check if the number of unique refs is the same - return false; + let pelletsTx = await lucid.newTx().readFrom(pelletRefs); + for (const pellet of chunk) { + const pelletDatum = { + posX: pellet.pos_x, + posY: pellet.pos_y, + shipyardPolicy: spacetimeHash, + }; + + let assets = {}; + if (pellet.prize_policy && pellet.prize_name && pellet.prize_amount && pellet.prize_amount > 0) { + assets = { + [fuelToken]: pellet.fuel, + [adminToken]: 1n, + [pellet.prize_policy + pellet.prize_name]: pellet.prize_amount, + }; + } else { + assets = { + [fuelToken]: pellet.fuel, + [adminToken]: 1n, + }; + } + + pelletsTx = pelletsTx + .mint( + { + [fuelToken]: pellet.fuel, + }, + Data.to("MintFuel", PelletPelletMint.redeemer) + ) + .payToContract( + pelletAddress, + { Inline: Data.to(pelletDatum, PelletPelletSpend.datum) }, + assets + ); } - for (const ref of refs_1) { - if (!refs_2.has(ref)) { - return false; - } + const committedPelletsTx = await pelletsTx.commit(); + const signedPelletsTx = await committedPelletsTx.sign().commit(); + // console.log(signedPelletsTx.toString()); + const pelletsTxHash = await signedPelletsTx.submit(); + + totalCreated += chunk.length; + console.log("\nPELLETS TXHASH:", pelletsTxHash); + console.log(`Created ${chunk.length} pellets`); + console.log(`Total created: ${totalCreated} of ${pellets.length}`); + console.log(`Waiting for transaction to be confirmed...`); + await lucid.awaitTx(pelletsTxHash); + + // Wait for wallet UTxOs to be updated. + let wereUTxOsUpdated = false; + while (!wereUTxOsUpdated) { + console.log("Waiting for wallet UTXOs to be updated..."); + await delay(5000); + const walletUTXOs = await lucid.wallet.getUtxos(); + wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); } - return true; } diff --git a/sdk/lucid/examples/utils.ts b/sdk/lucid/examples/utils.ts new file mode 100644 index 0000000..dfe4460 --- /dev/null +++ b/sdk/lucid/examples/utils.ts @@ -0,0 +1,31 @@ +import { Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; + +export function chunkArray(array: T[], chunkSize: number): T[][] { + const result: T[][] = []; + for (let i = 0; i < array.length; i += chunkSize) { + result.push(array.slice(i, i + chunkSize)); + } + return result; +} + +export const delay = ms => new Promise(res => setTimeout(res, ms)); + +export function haveSameUTxOs(utxos_1: Utxo[], utxos_2: Utxo[]): boolean { + if (utxos_1.length !== utxos_2.length) { + return false; + } + + const refs_1 = new Set(utxos_1.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); + const refs_2 = new Set(utxos_2.map(utxo => utxo.txHash + "#" + utxo.outputIndex)); + + if (refs_1.size !== refs_2.size) { // Check if the number of unique refs is the same + return false; + } + + for (const ref of refs_1) { + if (!refs_2.has(ref)) { + return false; + } + } + return true; +} From 5eb591c3b2d61d6c1073ed57d1498df635a7c24b Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Fri, 1 Aug 2025 16:24:04 -0300 Subject: [PATCH 13/19] scripts for consuming pellets and Asteria --- sdk/lucid/examples/consume_asteria.ts | 95 +++++++++++++++++++++++++++ sdk/lucid/examples/consume_pellets.ts | 92 ++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 sdk/lucid/examples/consume_asteria.ts create mode 100644 sdk/lucid/examples/consume_pellets.ts diff --git a/sdk/lucid/examples/consume_asteria.ts b/sdk/lucid/examples/consume_asteria.ts new file mode 100644 index 0000000..b2eb8da --- /dev/null +++ b/sdk/lucid/examples/consume_asteria.ts @@ -0,0 +1,95 @@ +import { Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { chunkArray, delay, haveSameUTxOs } from "./utils.ts" +import { + AsteriaTypesAssetClass, + PelletPelletSpend, + AsteriaAsteriaSpend, +} from "../../../onchain/src/plutus.ts"; +import { lucidBase } from "../src/utils.ts"; +import deployParams from "./deploy_params.json" with { type: "json" }; + +const deployTxHash = Deno.args[0]; +const admin_token: AsteriaTypesAssetClass = { + policy: deployParams.admin_token.policy, + name: deployParams.admin_token.name, +}; + +const lucid = await lucidBase(); + +const ship_mint_lovelace_fee = BigInt(deployParams.ship_mint_lovelace_fee); +const max_asteria_mining = BigInt(deployParams.max_asteria_mining); +const initial_fuel = BigInt(deployParams.initial_fuel); +const min_asteria_distance = BigInt(deployParams.min_asteria_distance); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); + +// +// CONSUME ASTERIA UTXOS +// +console.log("\nCONSUMING ASTERIA UTXOS"); + +const asterias = await lucid.utxosAt(asteriaAddress); + +console.log("ASTERIA(S) NUMBER:", asterias.length); + +const [asteriaRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 0, +}]); + +const chunkLength = 10; +const chunkedAsterias: Utxo[][] = chunkArray(asterias, chunkLength); +for (const chunk of chunkedAsterias) { + + const initialWalletUTXOs = await lucid.wallet.getUtxos(); + + const adminUTxO: Utxo = await lucid.wallet + .getUtxos() + .then((us) => us.filter((u) => u.assets[admin_token.policy + admin_token.name] >= 1n)) + .then((us) => us[0]); + + const tx = await lucid + .newTx() + .readFrom([asteriaRef]) + .collectFrom( + chunk, + Data.to("ConsumeAsteria", AsteriaAsteriaSpend.redeemer) + ) + .collectFrom([adminUTxO]) + .commit(); + + const signedTx = await tx.sign().commit(); + // console.log(signedTx.toString()); + const txHash = await signedTx.submit(); + + console.log("\nTXHASH:", txHash); + console.log("Waiting for transaction to be confirmed..."); + await lucid.awaitTx(txHash); + + + // This is a workaround to wait for the wallet UTxOs to be updated after the deployment transaction. + // This way we avoid errors like trying to use inputs that were already spent. + let wereUTxOsUpdated = false; + while (!wereUTxOsUpdated) { + console.log("Waiting for wallet UTXOs to be updated..."); + await delay(5000); + const walletUTXOs = await lucid.wallet.getUtxos(); + wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); + } +} diff --git a/sdk/lucid/examples/consume_pellets.ts b/sdk/lucid/examples/consume_pellets.ts new file mode 100644 index 0000000..bbb7472 --- /dev/null +++ b/sdk/lucid/examples/consume_pellets.ts @@ -0,0 +1,92 @@ +import { fromText, Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { + AsteriaTypesAssetClass, + PelletPelletMint, + PelletPelletSpend, +} from "../../../onchain/src/plutus.ts"; +import { lucidBase } from "../src/utils.ts"; +import { chunkArray, delay, haveSameUTxOs } from "./utils.ts"; +import deployParams from "./deploy_params.json" with { type: "json" }; + +const deployTxHash = Deno.args[0]; +const admin_token: AsteriaTypesAssetClass = { + policy: deployParams.admin_token.policy, + name: deployParams.admin_token.name, +}; + +const lucid = await lucidBase(); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); +const pelletAddress = lucid.newScript(pelletValidator).toAddress(); + +console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); + +// +// CONSUME PELLETS +// +console.log("\nCONSUMING PELLETS"); + +const pellets = await lucid.utxosAt(pelletAddress); + +console.log("PELLETS NUMBER:", pellets.length); + +const [pelletRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 2, +}]); +const fuelToken = pelletHash + fromText("FUEL"); + +const chunkLength = 25; +const chunkedPellets: Utxo[][] = chunkArray(pellets, chunkLength); +for (const chunk of chunkedPellets) { + const totalFuel = chunk.reduce( + (sum, pellet) => sum + pellet.assets[fuelToken], + 0n + ); + const initialWalletUTXOs = await lucid.wallet.getUtxos(); + + const adminUTxO: Utxo = await lucid.wallet + .getUtxos() + .then((us) => us.filter((u) => u.assets[admin_token.policy + admin_token.name] >= 1n)) + .then((us) => us[0]); + + const tx = await lucid + .newTx() + .readFrom([pelletRef]) + .mint( + { + [fuelToken]: -totalFuel, + }, + Data.to("BurnFuel", PelletPelletMint.redeemer) + ) + .collectFrom( + chunk, + Data.to("ConsumePellet", PelletPelletSpend.redeemer) + ) + .collectFrom([adminUTxO]) + .commit(); + + const signedTx = await tx.sign().commit(); + // console.log(signedTx.toString()); + const txHash = await signedTx.submit(); + + console.log("\nTXHASH:", txHash); + console.log("Waiting for transaction to be confirmed..."); + await lucid.awaitTx(txHash); + + // This is a workaround to wait for the wallet UTxOs to be updated. + // This way we avoid errors like trying to use inputs that were already spent. + let wereUTxOsUpdated = false; + while (!wereUTxOsUpdated) { + console.log("Waiting for wallet UTXOs to be updated..."); + await delay(5000); + const walletUTXOs = await lucid.wallet.getUtxos(); + wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); + } + + const remaining = await lucid.utxosAt(pelletAddress); + console.log(`Consumed ${chunk.length} pellets (${remaining.length} remaining)`); +} From 1b646398414249752173acd7f0176ccac9c93a4e Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Fri, 1 Aug 2025 16:25:35 -0300 Subject: [PATCH 14/19] board example --- sdk/lucid/examples/deploy_params.json | 8 +- sdk/lucid/examples/pellets.csv | 834 +++++++++++++++++++++++++- 2 files changed, 834 insertions(+), 8 deletions(-) diff --git a/sdk/lucid/examples/deploy_params.json b/sdk/lucid/examples/deploy_params.json index e36c1fd..bdd3c55 100644 --- a/sdk/lucid/examples/deploy_params.json +++ b/sdk/lucid/examples/deploy_params.json @@ -7,10 +7,10 @@ "max_asteria_mining": 50, "max_speed": { "distance": 1, - "time": 30000 + "time": 60000 }, - "max_ship_fuel": 100, + "max_ship_fuel": 5, "fuel_per_step": 1, - "initial_fuel": 31, - "min_asteria_distance": 10 + "initial_fuel": 5, + "min_asteria_distance": 50 } diff --git a/sdk/lucid/examples/pellets.csv b/sdk/lucid/examples/pellets.csv index 8c44b8e..b33e3da 100644 --- a/sdk/lucid/examples/pellets.csv +++ b/sdk/lucid/examples/pellets.csv @@ -1,5 +1,831 @@ fuel,x,y,prize_policy,prize_name,prize_amount -90,12,-35,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,2 -40,-8,3,,, -25,20,16,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,tokenA,3 -36,-4,-17,,, +445,-50,-49,,, +454,-50,-31,,, +498,-50,-29,,, +491,-50,5,,, +492,-50,7,,, +489,-50,17,,, +474,-50,27,,, +445,-50,31,,, +450,-50,41,,, +487,-49,-24,,, +488,-49,-12,,, +402,-49,-3,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,5 +452,-49,1,,, +421,-49,4,,, +455,-49,5,,, +464,-49,6,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,746f6b656e41,33 +448,-49,22,,, +445,-49,38,,, +423,-49,39,,, +423,-48,-47,,, +437,-48,-26,,, +472,-48,7,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,1 +420,-48,36,,, +437,-48,48,,, +414,-47,-50,,, +433,-47,-30,,, +486,-47,-25,,, +470,-47,-19,,, +476,-47,-16,,, +446,-47,6,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,2 +451,-47,16,,, +420,-47,26,,, +456,-47,47,,, +429,-46,-40,,, +493,-46,-25,,, +419,-46,-11,,, +435,-46,0,,, +444,-46,14,,, +415,-46,18,,, +498,-46,46,,, +414,-45,-36,,, +400,-45,-25,,, +462,-45,-21,,, +427,-45,-9,,, +420,-45,30,,, +462,-45,32,,, +461,-44,-44,,, +479,-44,-28,,, +440,-44,-19,,, +410,-43,-50,,, +415,-43,-46,,, +469,-43,-43,,, +486,-43,-30,,, +493,-43,-23,,, +487,-43,-21,,, +481,-43,10,,, +460,-43,13,,, +473,-42,-35,,, +457,-42,-27,,, +403,-42,-20,,, +431,-42,-5,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,123 +476,-42,-3,,, +484,-42,5,,, +439,-42,18,,, +450,-42,27,,, +458,-42,31,,, +404,-42,35,,, +453,-42,39,,, +480,-42,43,,, +434,-42,45,,, +422,-41,-33,,, +427,-41,31,,, +425,-41,34,,, +403,-40,-31,,, +446,-40,-21,,, +439,-40,-18,,, +496,-40,-11,,, +424,-40,0,,, +409,-40,9,,, +493,-40,13,,, +437,-40,36,,, +475,-39,-45,,, +436,-39,-37,,, +441,-39,-33,,, +492,-39,-23,,, +455,-39,-22,,, +468,-39,10,,, +436,-39,14,,, +430,-39,20,,, +465,-39,21,,, +450,-39,33,,, +423,-39,45,,, +438,-39,48,,, +423,-38,-47,,, +448,-38,-35,,, +404,-38,-30,,, +440,-38,-22,,, +464,-38,-21,,, +462,-38,5,,, +474,-38,17,,, +500,-38,20,,, +436,-38,31,,, +404,-38,36,,, +439,-38,44,,, +444,-38,45,,, +482,-38,49,,, +428,-37,-45,,, +484,-37,4,,, +475,-37,19,,, +418,-37,22,,, +428,-37,23,,, +439,-37,33,,, +495,-36,-50,,, +488,-36,-49,,, +446,-36,-41,,, +440,-36,-34,,, +474,-36,-31,,, +440,-36,-25,,, +407,-36,-23,,, +424,-36,-8,,, +446,-36,-1,,, +486,-36,4,,, +476,-36,13,,, +471,-35,-42,,, +400,-35,-31,,, +474,-35,-26,,, +445,-35,-23,,, +492,-35,-16,,, +408,-35,-9,,, +491,-35,-2,,, +415,-35,28,,, +441,-35,46,,, +491,-34,-49,,, +494,-34,-46,,, +424,-34,15,,, +428,-34,16,,, +455,-34,34,,, +449,-34,38,,, +471,-34,40,,, +498,-34,48,,, +496,-33,-23,,, +404,-33,-15,,, +428,-33,37,,, +474,-33,44,,, +472,-32,-50,,, +482,-32,-24,,, +455,-32,-21,,, +490,-32,-5,,, +454,-32,0,,, +491,-32,7,,, +451,-32,10,,, +428,-32,34,,, +456,-32,44,,, +484,-31,-49,,, +403,-31,-47,,, +434,-31,-36,,, +437,-31,-26,,, +494,-31,-22,,, +463,-31,-12,,, +475,-31,9,,, +456,-31,10,,, +439,-31,21,,, +456,-30,-32,,, +429,-30,12,,, +437,-30,23,,, +431,-30,27,,, +469,-30,31,,, +455,-30,35,,, +422,-30,43,,, +463,-30,48,,, +454,-29,-45,,, +406,-29,-40,,, +461,-29,-37,,, +429,-29,-35,,, +417,-29,-16,,, +450,-29,-3,,, +495,-29,0,,, +405,-29,6,,, +466,-29,17,,, +458,-29,23,,, +484,-29,32,,, +401,-29,39,,, +418,-29,43,,, +420,-29,48,,, +447,-28,-38,,, +479,-28,-23,,, +494,-28,-19,,, +445,-28,-4,,, +435,-28,8,,, +428,-28,11,,, +410,-28,26,,, +444,-28,28,,, +429,-28,36,,, +448,-28,39,,, +424,-27,-23,,, +421,-27,-10,,, +463,-27,1,,, +478,-27,6,,, +476,-27,9,,, +446,-27,12,,, +400,-27,17,,, +406,-27,49,,, +420,-26,-42,,, +422,-26,-9,,, +481,-26,46,,, +454,-25,-50,,, +406,-25,-42,,, +437,-25,-32,,, +475,-25,-26,,, +409,-25,-14,,, +428,-25,6,,, +411,-25,14,,, +426,-25,46,,, +444,-24,-48,,, +469,-24,-38,,, +450,-24,-34,,, +469,-24,35,,, +495,-23,-46,,, +447,-23,-44,,, +447,-23,-43,,, +419,-23,-35,,, +448,-23,-22,,, +430,-23,-14,,, +466,-23,-13,,, +492,-23,14,,, +423,-23,23,,, +451,-23,25,,, +407,-23,31,,, +466,-23,33,,, +422,-23,35,,, +486,-23,36,,, +469,-22,-36,,, +443,-22,-20,,, +405,-22,8,,, +408,-22,11,,, +421,-22,26,,, +465,-21,-50,,, +458,-21,-47,,, +465,-21,-41,,, +464,-21,-19,,, +432,-21,-14,,, +475,-21,-7,,, +457,-21,-2,,, +439,-21,5,,, +451,-21,7,,, +485,-21,10,,, +476,-20,-47,,, +446,-20,-26,,, +441,-20,-11,,, +453,-20,-5,,, +493,-20,9,,, +432,-20,12,,, +464,-20,21,,, +473,-20,32,,, +420,-20,47,,, +442,-19,-50,,, +418,-19,-21,,, +459,-19,-19,,, +420,-19,-10,,, +456,-19,2,,, +483,-19,15,,, +429,-19,18,,, +438,-19,36,,, +467,-18,-48,,, +494,-18,-44,,, +415,-18,-25,,, +474,-18,32,,, +411,-18,35,,, +429,-18,44,,, +491,-17,-48,,, +441,-17,-36,,, +411,-17,-28,,, +408,-17,8,,, +420,-17,19,,, +462,-17,43,,, +495,-16,-42,,, +474,-16,-38,,, +423,-16,-37,,, +466,-16,-16,,, +409,-16,-15,,, +482,-16,4,,, +497,-16,12,,, +487,-16,18,,, +490,-16,29,,, +405,-16,44,,, +420,-15,-43,,, +486,-15,-4,,, +407,-15,18,,, +465,-15,26,,, +483,-14,-29,,, +459,-14,-22,,, +443,-14,-12,,, +479,-14,0,,, +411,-14,17,,, +400,-14,35,,, +499,-14,48,,, +487,-13,-46,,, +416,-13,-37,,, +401,-13,-22,,, +408,-13,-21,,, +483,-13,-12,,, +458,-13,7,,, +441,-13,18,,, +476,-13,26,,, +442,-13,27,,, +402,-13,43,,, +424,-13,45,,, +440,-12,24,,, +448,-12,30,,, +490,-12,43,,, +454,-12,49,,, +438,-11,-45,,, +463,-11,-28,,, +414,-11,-2,,, +468,-11,-1,,, +434,-11,2,,, +490,-11,6,,, +439,-11,12,,, +420,-11,14,,, +473,-11,24,,, +433,-11,31,,, +421,-11,44,,, +470,-11,49,,, +499,-10,3,,, +472,-10,35,,, +459,-9,-33,,, +494,-9,-25,,, +438,-9,4,,, +406,-9,14,,, +460,-9,21,,, +404,-9,28,,, +420,-9,32,,, +485,-9,34,,, +411,-9,43,,, +466,-9,45,,, +414,-9,47,,, +463,-9,48,,, +442,-8,-42,,, +490,-8,-14,,, +488,-8,8,,, +495,-8,9,,, +476,-8,17,,, +484,-8,20,,, +466,-8,21,,, +405,-8,31,,, +424,-8,38,,, +444,-8,49,,, +426,-7,-24,,, +458,-7,-6,,, +473,-7,45,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,1 +491,-7,49,,, +431,-6,-38,,, +440,-6,-34,,, +451,-6,-33,,, +434,-6,-29,,, +415,-6,-26,,, +428,-6,-10,,, +499,-6,40,,, +464,-5,-48,,, +494,-5,-11,,, +433,-5,13,,, +482,-5,20,,, +452,-5,30,,, +433,-5,37,,, +465,-5,39,,, +458,-5,43,,, +409,-4,-29,,, +464,-4,-17,,, +456,-4,19,,, +436,-4,39,,, +436,-4,46,,, +427,-3,-46,,, +466,-3,-23,,, +434,-3,-9,,, +481,-3,2,,, +413,-3,12,,, +468,-3,14,,, +420,-3,16,,, +454,-3,27,,, +449,-3,40,,, +405,-3,42,,, +422,-2,-43,,, +462,-2,-22,,, +485,-2,-20,,, +488,-2,-14,,, +449,-2,-1,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,746f6b656e41,314 +433,-2,24,,, +471,-1,-46,,, +453,-1,-29,,, +499,-1,-4,,, +477,-1,16,,, +448,-1,20,,, +415,-1,24,,, +452,-1,41,,, +448,0,-48,,, +472,0,-29,,, +417,0,-18,,, +404,0,-17,,, +477,0,-16,,, +492,0,-6,,, +408,0,-2,,, +427,0,16,,, +418,0,33,,, +407,0,45,,, +490,1,-9,,, +419,1,-3,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,2 +433,1,8,,, +447,1,13,,, +420,1,43,,, +477,1,49,,, +437,2,-45,,, +442,2,-44,,, +427,2,-20,,, +450,2,-18,,, +496,2,-8,,, +436,2,-3,,, +411,2,-1,,, +447,2,9,,, +438,2,22,,, +452,3,-50,,, +496,3,-36,,, +421,3,-22,,, +408,3,-9,,, +449,3,-5,,, +404,3,47,,, +402,4,-47,,, +404,4,-43,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,3 +427,4,-31,,, +418,4,2,,, +452,4,5,,, +492,4,37,,, +416,5,-45,,, +446,5,-41,,, +455,5,-22,,, +454,5,3,,, +480,5,7,,, +446,5,14,,, +448,5,34,,, +485,6,-40,,, +418,6,-25,,, +401,6,-8,,, +442,6,5,,, +456,6,9,,, +426,6,13,,, +440,7,-37,,, +494,7,-19,,, +427,7,8,,, +446,7,9,,, +481,7,11,,, +430,7,18,,, +429,7,46,,, +423,8,-46,,, +459,8,-39,,, +496,8,-19,,, +430,8,-15,,, +451,8,-2,,, +411,8,26,,, +430,8,28,,, +403,8,33,,, +489,8,41,,, +449,8,44,,, +429,8,46,,, +495,9,-36,,, +421,9,-25,,, +425,9,-22,,, +500,9,-19,,, +498,9,-16,,, +479,9,18,,, +478,9,32,,, +413,9,38,,, +404,10,-29,,, +447,10,-27,,, +411,10,1,,, +428,10,2,,, +488,10,33,,, +403,10,36,,, +419,10,39,,, +436,10,42,,, +480,10,44,,, +465,10,48,,, +422,11,-37,,, +427,11,-34,,, +457,11,-23,,, +442,11,-22,,, +476,11,-13,,, +405,11,-12,,, +498,11,6,,, +424,11,8,,, +488,11,24,,, +497,12,-47,,, +497,12,-22,,, +474,12,-1,,, +413,12,7,,, +451,12,10,,, +437,12,28,,, +492,12,48,,, +455,13,-2,,, +477,13,3,,, +401,13,4,,, +446,13,14,,, +472,13,23,,, +463,13,31,,, +475,13,35,,, +445,13,40,,, +447,13,41,,, +489,14,-49,,, +476,14,-34,,, +484,14,-26,,, +421,14,-21,,, +450,14,-17,,, +440,14,-11,,, +473,14,12,,, +470,14,20,,, +450,15,-46,,, +410,15,-41,,, +497,15,-22,,, +408,15,-18,,, +413,15,-16,,, +477,15,16,,, +431,15,26,,, +467,15,28,,, +471,16,-43,,, +476,16,-19,,, +452,16,-12,,, +473,16,8,,, +470,16,13,,, +497,16,14,,, +485,16,46,,, +424,17,-38,,, +471,17,-34,,, +490,17,-16,,, +406,17,-15,,, +491,17,28,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,15 +450,17,45,,, +417,18,-21,,, +445,18,-14,,, +402,18,3,,, +443,18,9,,, +497,18,28,,, +487,18,29,,, +438,18,30,,, +423,18,34,,, +483,19,-35,,, +448,19,-33,,, +431,19,-32,,, +460,19,-28,,, +404,19,-2,,, +494,19,1,,, +489,19,3,,, +415,19,9,,, +486,19,10,,, +413,20,-49,,, +403,20,-30,,, +494,20,-18,,, +469,20,-5,,, +457,20,12,,, +427,21,-13,,, +483,21,1,,, +417,21,5,,, +456,21,28,,, +453,22,-48,,, +401,22,-44,,, +460,22,-38,,, +453,22,-37,,, +450,22,-14,,, +458,22,-7,,, +417,22,8,,, +476,22,10,,, +404,22,26,,, +491,22,37,,, +445,22,44,,, +447,23,-46,,, +491,23,-45,,, +455,23,-41,,, +402,23,-32,,, +470,23,-16,,, +470,23,-15,,, +477,23,-13,,, +437,23,3,,, +497,23,23,,, +462,23,27,,, +454,23,36,,, +427,23,40,,, +469,23,44,,, +401,24,-40,,, +448,24,-39,,, +406,24,-15,,, +469,24,13,,, +438,24,14,,, +476,24,25,,, +422,24,28,,, +428,24,34,,, +492,24,35,,, +419,24,42,,, +416,25,-46,,, +473,25,-44,,, +445,25,-19,,, +400,25,-12,,, +439,25,-8,,, +477,25,-6,,, +473,25,5,,, +440,25,12,,, +486,25,27,,, +418,25,34,,, +401,25,38,,, +496,25,43,,, +497,25,46,,, +427,26,-50,,, +455,26,-39,,, +471,26,-37,,, +434,26,-29,,, +431,26,-24,,, +475,26,-15,,, +403,26,-7,,, +406,26,4,,, +402,26,19,,, +425,26,47,,, +461,26,49,,, +449,27,-30,,, +478,27,-23,,, +471,27,-21,,, +421,27,-20,,, +461,27,-19,,, +414,27,-14,,, +449,27,29,,, +446,27,32,,, +409,27,44,,, +457,27,47,,, +418,28,-46,,, +460,28,-45,,, +500,28,-40,,, +418,28,-30,,, +433,28,-21,,, +422,28,-19,,, +447,28,6,,, +484,28,29,,, +451,29,-36,,, +400,29,-32,,, +484,29,-31,,, +422,29,-23,,, +467,29,-12,,, +436,29,-2,,, +482,29,25,,, +417,29,35,,, +444,29,43,,, +500,29,47,,, +414,30,-48,,, +494,30,-26,,, +500,30,-22,,, +438,30,-16,,, +449,30,-15,,, +495,30,-5,,, +467,30,-1,,, +448,30,2,,, +455,30,7,,, +482,30,9,,, +402,30,27,,, +414,30,33,,, +455,30,34,,, +408,30,36,,, +476,30,47,,, +480,31,-32,,, +430,31,45,,, +479,32,-48,,, +407,32,-38,,, +413,32,-23,,, +487,32,-16,,, +479,32,4,,, +452,32,14,,, +457,32,15,,, +426,32,20,,, +414,32,26,,, +430,32,31,,, +458,32,48,,, +436,33,-31,,, +461,33,-15,,, +433,33,-5,,, +411,33,13,,, +420,33,28,,, +417,33,33,,, +483,33,35,,, +494,34,-47,,, +413,34,-25,,, +430,34,-22,,, +411,34,-14,,, +491,34,3,,, +462,34,40,,, +471,35,-47,,, +472,35,-45,,, +493,35,-35,,, +485,35,-34,,, +480,35,-33,,, +493,35,-19,,, +442,35,-8,,, +470,35,-7,,, +420,35,17,,, +448,35,21,,, +472,35,44,,, +421,36,-49,,, +464,36,-40,,, +403,36,-32,,, +435,36,-31,,, +411,36,-7,,, +438,36,15,,, +423,36,36,,, +492,36,46,,, +410,37,-42,,, +461,37,-40,,, +431,37,-33,,, +470,37,-28,,, +417,37,-20,,, +401,37,-11,,, +499,37,-2,,, +481,37,8,,, +436,37,32,,, +451,37,43,,, +408,38,-32,,, +414,38,-30,,, +406,38,-28,,, +477,38,-18,,, +446,38,-9,,, +470,38,-3,,, +427,38,15,,, +469,38,48,,, +499,39,-42,,, +479,39,-32,,, +418,39,-27,,, +452,39,-26,,, +427,39,-19,,, +466,39,-11,,, +402,39,6,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,22 +448,39,21,,, +461,39,30,,, +436,39,41,,, +487,40,-47,,, +428,40,-46,,, +441,40,-35,,, +477,40,-25,,, +400,40,-23,,, +400,40,-16,,, +430,40,-13,,, +452,40,3,,, +408,40,5,,, +428,40,13,,, +445,40,19,,, +435,40,39,,, +449,40,49,,, +453,41,-48,,, +444,41,-47,,, +402,41,-36,,, +405,41,-31,,, +483,41,-11,,, +491,41,13,,, +433,41,20,,, +486,41,34,,, +491,41,38,,, +410,42,-50,,, +406,42,-47,,, +499,42,-43,,, +499,42,-28,,, +419,42,-23,,, +455,42,2,,, +400,42,21,,, +401,42,24,,, +426,42,32,,, +427,42,49,,, +460,43,-49,,, +424,43,-41,,, +463,43,20,,, +435,43,34,,, +445,44,-47,,, +489,44,-44,,, +496,44,-43,,, +460,44,-34,,, +456,44,-1,,, +500,44,6,,, +437,44,8,,, +498,44,10,,, +466,44,13,,, +421,44,21,,, +498,44,24,,, +460,44,35,,, +493,44,38,,, +481,44,39,,, +444,45,-48,,, +466,45,-31,,, +479,45,-26,,, +445,45,-15,,, +458,45,-9,,, +495,45,-8,,, +420,45,12,,, +416,45,29,,, +461,46,-11,,, +421,46,-5,,, +436,46,-1,,, +407,46,0,,, +444,46,1,,, +428,46,2,,, +408,46,6,,, +484,46,16,,, +499,46,17,,, +452,46,38,,, +491,46,39,,, +470,46,45,,, +477,47,-45,,, +421,47,-43,,, +454,47,-41,,, +454,47,-38,,, +412,47,-33,,, +464,47,-27,,, +452,47,-21,,, +431,47,-19,,, +429,47,-16,,, +467,47,-13,,, +425,47,7,,, +487,47,9,,, +444,47,11,,, +490,47,30,,, +483,48,-12,,, +459,48,6,,, +418,48,11,,, +485,48,17,,, +477,48,19,,, +413,48,20,,, +483,48,29,,, +410,48,43,,, +496,49,-45,,, +435,49,-17,,, +443,49,0,,, +499,49,17,,, From 421363f0a668b4babbb490cd66f0c66215deb942 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 4 Aug 2025 20:52:13 -0300 Subject: [PATCH 15/19] minting admin tokens on deploy --- sdk/lucid/examples/deploy.ts | 67 +++++++++++++++------------ sdk/lucid/examples/deploy_params.json | 4 -- sdk/lucid/examples/utils.ts | 38 ++++++++++++++- 3 files changed, 74 insertions(+), 35 deletions(-) diff --git a/sdk/lucid/examples/deploy.ts b/sdk/lucid/examples/deploy.ts index b5e875f..11f407b 100644 --- a/sdk/lucid/examples/deploy.ts +++ b/sdk/lucid/examples/deploy.ts @@ -9,18 +9,45 @@ import { SpacetimeSpacetimeSpend, } from "../../../onchain/src/plutus.ts"; import { lucidBase } from "../src/utils.ts"; -import { chunkArray, delay, haveSameUTxOs } from "./utils.ts"; +import { adminTokenName, chunkArray, getAdminPolicy, waitUtxosUpdate } from "./utils.ts"; import { readPelletsCSV } from "../../../offchain/tests/admin/pellets/utils.ts"; import deployParams from "./deploy_params.json" with { type: "json" }; -console.log("DEPLOYING ASTERIA"); - // // CONFIGURATION // +const lucid = await lucidBase(); +let walletUtxos = await lucid.wallet.getUtxos(); + +const pellets = await readPelletsCSV("./pellets.csv"); +const pelletsAmount = pellets.length; + +const adminPolicy = await getAdminPolicy(lucid); +const adminPolicyId = adminPolicy.toHash(); +const adminToken = adminPolicyId + adminTokenName; + +console.log(`\nMINTING ${pelletsAmount + 2} ADMIN TOKENS (#pellets + 2)`); + +const mintingTx = await lucid + .newTx() + .mint({ [adminToken]: BigInt(pelletsAmount) + 2n }) + .attachScript(adminPolicy.script) + .commit(); +const signedTx = await mintingTx.sign().commit(); +const mintingTxHash = await signedTx.submit(); + +console.log("Waiting for minting transaction to be confirmed..."); +await lucid.awaitTx(mintingTxHash); + +console.log("MINTING TXHASH:", mintingTxHash); +console.log("ADMIN TOKEN POLICY ID:", adminPolicyId); +walletUtxos = await waitUtxosUpdate(lucid, walletUtxos); + +console.log("\nDEPLOYING ASTERIA"); + const admin_token: AsteriaTypesAssetClass = { - policy: deployParams.admin_token.policy, - name: deployParams.admin_token.name, + policy: adminPolicyId, + name: adminTokenName, }; const ship_mint_lovelace_fee = BigInt(deployParams.ship_mint_lovelace_fee); const max_asteria_mining = BigInt(deployParams.max_asteria_mining); @@ -36,9 +63,6 @@ const min_asteria_distance = BigInt(deployParams.min_asteria_distance); // // VALIDATORS INSTANTIATION // -const lucid = await lucidBase(); -const initialWalletUTXOs = await lucid.wallet.getUtxos(); - const deployValidator = new DeployDeploySpend( admin_token, ); @@ -79,7 +103,6 @@ console.log("PELLET SCRIPT ADDRESS:", { pelletAddress, pelletHash }); // // ASTERIA // -const adminToken = admin_token.policy + admin_token.name; const asteriaDatum = { shipCounter: 0n, shipyardPolicy: spacetimeHash, @@ -128,17 +151,9 @@ const signedDeployTx = await deployTx.sign().commit(); const deployTxHash = await signedDeployTx.submit(); console.log("\nDEPLOYMENT TXHASH:", deployTxHash); console.log("Waiting for deployment transaction to be confirmed..."); -await lucid.awaitTx(deployTxHash); -// This is a workaround to wait for the wallet UTxOs to be updated after the deployment transaction. -// This way we avoid errors like trying to use inputs that were already spent. -let wereUTxOsUpdated = false; -while (!wereUTxOsUpdated) { - console.log("Waiting for wallet UTXOs to be updated..."); - await delay(5000); - const walletUTXOs = await lucid.wallet.getUtxos(); - wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); -} +await lucid.awaitTx(deployTxHash); +walletUtxos = await waitUtxosUpdate(lucid, walletUtxos); // // CREATE PELLETS @@ -150,7 +165,6 @@ const pelletRefs = await lucid.utxosByOutRef([{ outputIndex: 2, }]); -const pellets = await readPelletsCSV("./pellets.csv"); const fuelToken = pelletHash + fromText("FUEL"); const chunkLength = 80; @@ -204,16 +218,9 @@ for (const chunk of chunkedPellets) { totalCreated += chunk.length; console.log("\nPELLETS TXHASH:", pelletsTxHash); console.log(`Created ${chunk.length} pellets`); - console.log(`Total created: ${totalCreated} of ${pellets.length}`); + console.log(`Total created: ${totalCreated} of ${pelletsAmount}`); console.log(`Waiting for transaction to be confirmed...`); - await lucid.awaitTx(pelletsTxHash); - // Wait for wallet UTxOs to be updated. - let wereUTxOsUpdated = false; - while (!wereUTxOsUpdated) { - console.log("Waiting for wallet UTXOs to be updated..."); - await delay(5000); - const walletUTXOs = await lucid.wallet.getUtxos(); - wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); - } + await lucid.awaitTx(pelletsTxHash); + walletUtxos = await waitUtxosUpdate(lucid, walletUtxos); } diff --git a/sdk/lucid/examples/deploy_params.json b/sdk/lucid/examples/deploy_params.json index bdd3c55..f5cffcb 100644 --- a/sdk/lucid/examples/deploy_params.json +++ b/sdk/lucid/examples/deploy_params.json @@ -1,8 +1,4 @@ { - "admin_token": { - "policy": "b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4", - "name": "746f6b656e42" - }, "ship_mint_lovelace_fee": 1000000, "max_asteria_mining": 50, "max_speed": { diff --git a/sdk/lucid/examples/utils.ts b/sdk/lucid/examples/utils.ts index dfe4460..0011df1 100644 --- a/sdk/lucid/examples/utils.ts +++ b/sdk/lucid/examples/utils.ts @@ -1,4 +1,4 @@ -import { Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { Addresses, Codec, fromText, Lucid, ScriptUtility, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; export function chunkArray(array: T[], chunkSize: number): T[][] { const result: T[][] = []; @@ -29,3 +29,39 @@ export function haveSameUTxOs(utxos_1: Utxo[], utxos_2: Utxo[]): boolean { } return true; } + +// This is a workaround to wait for the wallet UTxOs to be updated after a transaction. +// This way we avoid errors like trying to use inputs that were already spent. +export async function waitUtxosUpdate(lucid: Lucid, initialWalletUtxos: Utxo[]): Promise { + let wereUTxOsUpdated = false; + let newWalletUtxos: Utxo[] = []; + + while (!wereUTxOsUpdated) { + console.log("Waiting for wallet UTXOs to be updated..."); + await delay(5000); + newWalletUtxos = await lucid.wallet.getUtxos(); + wereUTxOsUpdated = !haveSameUTxOs(newWalletUtxos, initialWalletUtxos); + } + + return newWalletUtxos +} + +export async function getAdminPolicy(lucid: Lucid): ScriptUtility { + const { payment } = Addresses.inspect( + await lucid.wallet.address(), + ); + + return lucid.newScript({ + type: "Native", + script: Codec.encodeNativeScript( + { + type: "All", + scripts: [ + { type: "Sig", keyHash: payment?.hash! }, + ], + }, + ), + }) +} + +export const adminTokenName = fromText("auth"); From 80b4182a53ec62c9618cd90713f8844a2f595679 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 4 Aug 2025 20:53:12 -0300 Subject: [PATCH 16/19] burning admin tokens when consuming pellets and Asteria --- sdk/lucid/examples/consume_asteria.ts | 84 +++++++++++++-------------- sdk/lucid/examples/consume_pellets.ts | 46 +++++++-------- 2 files changed, 62 insertions(+), 68 deletions(-) diff --git a/sdk/lucid/examples/consume_asteria.ts b/sdk/lucid/examples/consume_asteria.ts index b2eb8da..93577fe 100644 --- a/sdk/lucid/examples/consume_asteria.ts +++ b/sdk/lucid/examples/consume_asteria.ts @@ -1,5 +1,5 @@ import { Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; -import { chunkArray, delay, haveSameUTxOs } from "./utils.ts" +import { adminTokenName, getAdminPolicy, waitUtxosUpdate } from "./utils.ts" import { AsteriaTypesAssetClass, PelletPelletSpend, @@ -9,13 +9,15 @@ import { lucidBase } from "../src/utils.ts"; import deployParams from "./deploy_params.json" with { type: "json" }; const deployTxHash = Deno.args[0]; -const admin_token: AsteriaTypesAssetClass = { - policy: deployParams.admin_token.policy, - name: deployParams.admin_token.name, -}; const lucid = await lucidBase(); +const adminPolicy = await getAdminPolicy(lucid); +const adminPolicyId = adminPolicy.toHash(); +const admin_token: AsteriaTypesAssetClass = { + policy: adminPolicyId, + name: adminTokenName, +}; const ship_mint_lovelace_fee = BigInt(deployParams.ship_mint_lovelace_fee); const max_asteria_mining = BigInt(deployParams.max_asteria_mining); const initial_fuel = BigInt(deployParams.initial_fuel); @@ -53,43 +55,35 @@ const [asteriaRef] = await lucid.utxosByOutRef([{ outputIndex: 0, }]); -const chunkLength = 10; -const chunkedAsterias: Utxo[][] = chunkArray(asterias, chunkLength); -for (const chunk of chunkedAsterias) { - - const initialWalletUTXOs = await lucid.wallet.getUtxos(); - - const adminUTxO: Utxo = await lucid.wallet - .getUtxos() - .then((us) => us.filter((u) => u.assets[admin_token.policy + admin_token.name] >= 1n)) - .then((us) => us[0]); - - const tx = await lucid - .newTx() - .readFrom([asteriaRef]) - .collectFrom( - chunk, - Data.to("ConsumeAsteria", AsteriaAsteriaSpend.redeemer) - ) - .collectFrom([adminUTxO]) - .commit(); - - const signedTx = await tx.sign().commit(); - // console.log(signedTx.toString()); - const txHash = await signedTx.submit(); - - console.log("\nTXHASH:", txHash); - console.log("Waiting for transaction to be confirmed..."); - await lucid.awaitTx(txHash); - - - // This is a workaround to wait for the wallet UTxOs to be updated after the deployment transaction. - // This way we avoid errors like trying to use inputs that were already spent. - let wereUTxOsUpdated = false; - while (!wereUTxOsUpdated) { - console.log("Waiting for wallet UTXOs to be updated..."); - await delay(5000); - const walletUTXOs = await lucid.wallet.getUtxos(); - wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); - } -} + +const initialWalletUTXOs = await lucid.wallet.getUtxos(); + +const adminUTxO: Utxo = await lucid.wallet + .getUtxos() + .then((us) => us.filter((u) => u.assets[adminPolicyId + adminTokenName] >= 1n)) + .then((us) => us[0]); + +const tx = await lucid + .newTx() + .readFrom([asteriaRef]) + .attachScript(adminPolicy.script) + .collectFrom( + asterias, + Data.to("ConsumeAsteria", AsteriaAsteriaSpend.redeemer) + ) + .collectFrom([adminUTxO]) + .mint( + { + [adminPolicyId + adminTokenName]: BigInt(-asterias.length), + }, + ) + .commit(); + +const signedTx = await tx.sign().commit(); +// console.log(signedTx.toString()); +const txHash = await signedTx.submit(); + +console.log("\nTXHASH:", txHash); +console.log("Waiting for transaction to be confirmed..."); +await lucid.awaitTx(txHash); +await waitUtxosUpdate(lucid, initialWalletUTXOs); diff --git a/sdk/lucid/examples/consume_pellets.ts b/sdk/lucid/examples/consume_pellets.ts index bbb7472..60f4b9f 100644 --- a/sdk/lucid/examples/consume_pellets.ts +++ b/sdk/lucid/examples/consume_pellets.ts @@ -1,21 +1,25 @@ -import { fromText, Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { Data, fromText, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; import { AsteriaTypesAssetClass, PelletPelletMint, PelletPelletSpend, } from "../../../onchain/src/plutus.ts"; import { lucidBase } from "../src/utils.ts"; -import { chunkArray, delay, haveSameUTxOs } from "./utils.ts"; -import deployParams from "./deploy_params.json" with { type: "json" }; +import { adminTokenName, chunkArray, getAdminPolicy, waitUtxosUpdate } from "./utils.ts"; +const chunkLength = 25; const deployTxHash = Deno.args[0]; -const admin_token: AsteriaTypesAssetClass = { - policy: deployParams.admin_token.policy, - name: deployParams.admin_token.name, -}; +console.log(`CHUNK LENGTH: ${chunkLength}`) const lucid = await lucidBase(); +const adminPolicy = await getAdminPolicy(lucid); +const adminPolicyId = adminPolicy.toHash(); + +const admin_token: AsteriaTypesAssetClass = { + policy: adminPolicyId, + name: adminTokenName, +}; const pelletValidator = new PelletPelletSpend( admin_token, ); @@ -39,7 +43,6 @@ const [pelletRef] = await lucid.utxosByOutRef([{ }]); const fuelToken = pelletHash + fromText("FUEL"); -const chunkLength = 25; const chunkedPellets: Utxo[][] = chunkArray(pellets, chunkLength); for (const chunk of chunkedPellets) { const totalFuel = chunk.reduce( @@ -50,21 +53,27 @@ for (const chunk of chunkedPellets) { const adminUTxO: Utxo = await lucid.wallet .getUtxos() - .then((us) => us.filter((u) => u.assets[admin_token.policy + admin_token.name] >= 1n)) + .then((us) => us.filter((u) => u.assets[adminPolicyId + adminTokenName] >= 1n)) .then((us) => us[0]); const tx = await lucid .newTx() .readFrom([pelletRef]) + .attachScript(adminPolicy.script) + .collectFrom( + chunk, + Data.to("ConsumePellet", PelletPelletSpend.redeemer) + ) .mint( { - [fuelToken]: -totalFuel, + [fuelToken]: -totalFuel, }, Data.to("BurnFuel", PelletPelletMint.redeemer) ) - .collectFrom( - chunk, - Data.to("ConsumePellet", PelletPelletSpend.redeemer) + .mint( + { + [adminPolicyId + adminTokenName]: BigInt(-chunkLength), + }, ) .collectFrom([adminUTxO]) .commit(); @@ -76,16 +85,7 @@ for (const chunk of chunkedPellets) { console.log("\nTXHASH:", txHash); console.log("Waiting for transaction to be confirmed..."); await lucid.awaitTx(txHash); - - // This is a workaround to wait for the wallet UTxOs to be updated. - // This way we avoid errors like trying to use inputs that were already spent. - let wereUTxOsUpdated = false; - while (!wereUTxOsUpdated) { - console.log("Waiting for wallet UTXOs to be updated..."); - await delay(5000); - const walletUTXOs = await lucid.wallet.getUtxos(); - wereUTxOsUpdated = !haveSameUTxOs(walletUTXOs, initialWalletUTXOs); - } + await waitUtxosUpdate(lucid, initialWalletUTXOs); const remaining = await lucid.utxosAt(pelletAddress); console.log(`Consumed ${chunk.length} pellets (${remaining.length} remaining)`); From f782832d76f75ea60f567d6fb476e2690666ffe7 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Mon, 4 Aug 2025 20:53:46 -0300 Subject: [PATCH 17/19] script for adding lovelace to Asteria --- sdk/lucid/examples/add_lovelace_to_asteria.ts | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sdk/lucid/examples/add_lovelace_to_asteria.ts diff --git a/sdk/lucid/examples/add_lovelace_to_asteria.ts b/sdk/lucid/examples/add_lovelace_to_asteria.ts new file mode 100644 index 0000000..381d4a5 --- /dev/null +++ b/sdk/lucid/examples/add_lovelace_to_asteria.ts @@ -0,0 +1,90 @@ +import { Data, Utxo } from "https://deno.land/x/lucid@0.20.5/mod.ts"; +import { adminTokenName, getAdminPolicy, waitUtxosUpdate } from "./utils.ts" +import { + AsteriaTypesAssetClass, + PelletPelletSpend, + AsteriaAsteriaSpend, +} from "../../../onchain/src/plutus.ts"; +import { lucidBase } from "../src/utils.ts"; +import deployParams from "./deploy_params.json" with { type: "json" }; + +const lucid = await lucidBase(); +const deployTxHash = Deno.args[0]; +const lovelace_to_add = Deno.args[1]; + +const adminPolicy = await getAdminPolicy(lucid); +const adminPolicyId = adminPolicy.toHash() +const admin_token: AsteriaTypesAssetClass = { + policy: adminPolicyId, + name: adminTokenName, +}; + +const ship_mint_lovelace_fee = BigInt(deployParams.ship_mint_lovelace_fee); +const max_asteria_mining = BigInt(deployParams.max_asteria_mining); +const initial_fuel = BigInt(deployParams.initial_fuel); +const min_asteria_distance = BigInt(deployParams.min_asteria_distance); + +const pelletValidator = new PelletPelletSpend( + admin_token, +); +const pelletHash = lucid.newScript(pelletValidator).toHash(); + +const asteriaValidator = new AsteriaAsteriaSpend( + pelletHash, + admin_token, + ship_mint_lovelace_fee, + max_asteria_mining, + min_asteria_distance, + initial_fuel, +); +const asteriaHash = lucid.newScript(asteriaValidator).toHash(); +const asteriaAddress = lucid.newScript(asteriaValidator).toAddress(); + +console.log("ASTERIA SCRIPT ADDRESS:", { asteriaAddress, asteriaHash }); + +// +// CONSUME ASTERIA UTXOS +// +const [asteria] = await lucid.utxosAt(asteriaAddress); +const asteriaDatum = Data.from(asteria.datum, AsteriaAsteriaSpend.datum); + +console.log("\nCONSUMING INITIAL ASTERIA UTXO:", asteria); + +const [asteriaRef] = await lucid.utxosByOutRef([{ + txHash: deployTxHash, + outputIndex: 0, +}]); + +const initialWalletUTXOs = await lucid.wallet.getUtxos(); + +const adminUTxO: Utxo = await lucid.wallet +.getUtxos() +.then((us) => us.filter((u) => u.assets[adminPolicyId + adminTokenName] >= 1n)) +.then((us) => us[0]); + +const tx = await lucid + .newTx() + .readFrom([asteriaRef]) + .collectFrom( + [asteria], + Data.to("ConsumeAsteria", AsteriaAsteriaSpend.redeemer) + ) + .collectFrom([adminUTxO]) + .payToContract( + asteriaAddress, + { Inline: Data.to(asteriaDatum, AsteriaAsteriaSpend.datum) }, + { + [adminPolicy.toHash() + adminTokenName]: 1n, + lovelace: asteria.assets.lovelace + BigInt(lovelace_to_add) + } + ) + .commit(); + +const signedTx = await tx.sign().commit(); +// console.log(signedTx.toString()); +const txHash = await signedTx.submit(); + +console.log("\nTXHASH:", txHash); +console.log("Waiting for transaction to be confirmed..."); +await lucid.awaitTx(txHash); +await waitUtxosUpdate(lucid, initialWalletUTXOs); From 543521f5e5191ba9e404dbf28eb6840bdf482fe6 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Wed, 6 Aug 2025 00:27:17 -0300 Subject: [PATCH 18/19] fixed error when consuming pellets in last chunk --- sdk/lucid/examples/consume_pellets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lucid/examples/consume_pellets.ts b/sdk/lucid/examples/consume_pellets.ts index 60f4b9f..585f84c 100644 --- a/sdk/lucid/examples/consume_pellets.ts +++ b/sdk/lucid/examples/consume_pellets.ts @@ -72,7 +72,7 @@ for (const chunk of chunkedPellets) { ) .mint( { - [adminPolicyId + adminTokenName]: BigInt(-chunkLength), + [adminPolicyId + adminTokenName]: BigInt(-chunk.length), }, ) .collectFrom([adminUTxO]) From e5c4579b1ad008147c887d7e45a9b475da5d7e29 Mon Sep 17 00:00:00 2001 From: Francisco Joray Date: Wed, 6 Aug 2025 01:29:21 -0300 Subject: [PATCH 19/19] pellets for deploy --- sdk/lucid/examples/pellets.csv | 1679 ++++++++++++++++---------------- 1 file changed, 849 insertions(+), 830 deletions(-) diff --git a/sdk/lucid/examples/pellets.csv b/sdk/lucid/examples/pellets.csv index b33e3da..17b5a17 100644 --- a/sdk/lucid/examples/pellets.csv +++ b/sdk/lucid/examples/pellets.csv @@ -1,831 +1,850 @@ fuel,x,y,prize_policy,prize_name,prize_amount -445,-50,-49,,, -454,-50,-31,,, -498,-50,-29,,, -491,-50,5,,, -492,-50,7,,, -489,-50,17,,, -474,-50,27,,, -445,-50,31,,, -450,-50,41,,, -487,-49,-24,,, -488,-49,-12,,, -402,-49,-3,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,5 -452,-49,1,,, -421,-49,4,,, -455,-49,5,,, -464,-49,6,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,746f6b656e41,33 -448,-49,22,,, -445,-49,38,,, -423,-49,39,,, -423,-48,-47,,, -437,-48,-26,,, -472,-48,7,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,1 -420,-48,36,,, -437,-48,48,,, -414,-47,-50,,, -433,-47,-30,,, -486,-47,-25,,, -470,-47,-19,,, -476,-47,-16,,, -446,-47,6,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,2 -451,-47,16,,, -420,-47,26,,, -456,-47,47,,, -429,-46,-40,,, -493,-46,-25,,, -419,-46,-11,,, -435,-46,0,,, -444,-46,14,,, -415,-46,18,,, -498,-46,46,,, -414,-45,-36,,, -400,-45,-25,,, -462,-45,-21,,, -427,-45,-9,,, -420,-45,30,,, -462,-45,32,,, -461,-44,-44,,, -479,-44,-28,,, -440,-44,-19,,, -410,-43,-50,,, -415,-43,-46,,, -469,-43,-43,,, -486,-43,-30,,, -493,-43,-23,,, -487,-43,-21,,, -481,-43,10,,, -460,-43,13,,, -473,-42,-35,,, -457,-42,-27,,, -403,-42,-20,,, -431,-42,-5,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,123 -476,-42,-3,,, -484,-42,5,,, -439,-42,18,,, -450,-42,27,,, -458,-42,31,,, -404,-42,35,,, -453,-42,39,,, -480,-42,43,,, -434,-42,45,,, -422,-41,-33,,, -427,-41,31,,, -425,-41,34,,, -403,-40,-31,,, -446,-40,-21,,, -439,-40,-18,,, -496,-40,-11,,, -424,-40,0,,, -409,-40,9,,, -493,-40,13,,, -437,-40,36,,, -475,-39,-45,,, -436,-39,-37,,, -441,-39,-33,,, -492,-39,-23,,, -455,-39,-22,,, -468,-39,10,,, -436,-39,14,,, -430,-39,20,,, -465,-39,21,,, -450,-39,33,,, -423,-39,45,,, -438,-39,48,,, -423,-38,-47,,, -448,-38,-35,,, -404,-38,-30,,, -440,-38,-22,,, -464,-38,-21,,, -462,-38,5,,, -474,-38,17,,, -500,-38,20,,, -436,-38,31,,, -404,-38,36,,, -439,-38,44,,, -444,-38,45,,, -482,-38,49,,, -428,-37,-45,,, -484,-37,4,,, -475,-37,19,,, -418,-37,22,,, -428,-37,23,,, -439,-37,33,,, -495,-36,-50,,, -488,-36,-49,,, -446,-36,-41,,, -440,-36,-34,,, -474,-36,-31,,, -440,-36,-25,,, -407,-36,-23,,, -424,-36,-8,,, -446,-36,-1,,, -486,-36,4,,, -476,-36,13,,, -471,-35,-42,,, -400,-35,-31,,, -474,-35,-26,,, -445,-35,-23,,, -492,-35,-16,,, -408,-35,-9,,, -491,-35,-2,,, -415,-35,28,,, -441,-35,46,,, -491,-34,-49,,, -494,-34,-46,,, -424,-34,15,,, -428,-34,16,,, -455,-34,34,,, -449,-34,38,,, -471,-34,40,,, -498,-34,48,,, -496,-33,-23,,, -404,-33,-15,,, -428,-33,37,,, -474,-33,44,,, -472,-32,-50,,, -482,-32,-24,,, -455,-32,-21,,, -490,-32,-5,,, -454,-32,0,,, -491,-32,7,,, -451,-32,10,,, -428,-32,34,,, -456,-32,44,,, -484,-31,-49,,, -403,-31,-47,,, -434,-31,-36,,, -437,-31,-26,,, -494,-31,-22,,, -463,-31,-12,,, -475,-31,9,,, -456,-31,10,,, -439,-31,21,,, -456,-30,-32,,, -429,-30,12,,, -437,-30,23,,, -431,-30,27,,, -469,-30,31,,, -455,-30,35,,, -422,-30,43,,, -463,-30,48,,, -454,-29,-45,,, -406,-29,-40,,, -461,-29,-37,,, -429,-29,-35,,, -417,-29,-16,,, -450,-29,-3,,, -495,-29,0,,, -405,-29,6,,, -466,-29,17,,, -458,-29,23,,, -484,-29,32,,, -401,-29,39,,, -418,-29,43,,, -420,-29,48,,, -447,-28,-38,,, -479,-28,-23,,, -494,-28,-19,,, -445,-28,-4,,, -435,-28,8,,, -428,-28,11,,, -410,-28,26,,, -444,-28,28,,, -429,-28,36,,, -448,-28,39,,, -424,-27,-23,,, -421,-27,-10,,, -463,-27,1,,, -478,-27,6,,, -476,-27,9,,, -446,-27,12,,, -400,-27,17,,, -406,-27,49,,, -420,-26,-42,,, -422,-26,-9,,, -481,-26,46,,, -454,-25,-50,,, -406,-25,-42,,, -437,-25,-32,,, -475,-25,-26,,, -409,-25,-14,,, -428,-25,6,,, -411,-25,14,,, -426,-25,46,,, -444,-24,-48,,, -469,-24,-38,,, -450,-24,-34,,, -469,-24,35,,, -495,-23,-46,,, -447,-23,-44,,, -447,-23,-43,,, -419,-23,-35,,, -448,-23,-22,,, -430,-23,-14,,, -466,-23,-13,,, -492,-23,14,,, -423,-23,23,,, -451,-23,25,,, -407,-23,31,,, -466,-23,33,,, -422,-23,35,,, -486,-23,36,,, -469,-22,-36,,, -443,-22,-20,,, -405,-22,8,,, -408,-22,11,,, -421,-22,26,,, -465,-21,-50,,, -458,-21,-47,,, -465,-21,-41,,, -464,-21,-19,,, -432,-21,-14,,, -475,-21,-7,,, -457,-21,-2,,, -439,-21,5,,, -451,-21,7,,, -485,-21,10,,, -476,-20,-47,,, -446,-20,-26,,, -441,-20,-11,,, -453,-20,-5,,, -493,-20,9,,, -432,-20,12,,, -464,-20,21,,, -473,-20,32,,, -420,-20,47,,, -442,-19,-50,,, -418,-19,-21,,, -459,-19,-19,,, -420,-19,-10,,, -456,-19,2,,, -483,-19,15,,, -429,-19,18,,, -438,-19,36,,, -467,-18,-48,,, -494,-18,-44,,, -415,-18,-25,,, -474,-18,32,,, -411,-18,35,,, -429,-18,44,,, -491,-17,-48,,, -441,-17,-36,,, -411,-17,-28,,, -408,-17,8,,, -420,-17,19,,, -462,-17,43,,, -495,-16,-42,,, -474,-16,-38,,, -423,-16,-37,,, -466,-16,-16,,, -409,-16,-15,,, -482,-16,4,,, -497,-16,12,,, -487,-16,18,,, -490,-16,29,,, -405,-16,44,,, -420,-15,-43,,, -486,-15,-4,,, -407,-15,18,,, -465,-15,26,,, -483,-14,-29,,, -459,-14,-22,,, -443,-14,-12,,, -479,-14,0,,, -411,-14,17,,, -400,-14,35,,, -499,-14,48,,, -487,-13,-46,,, -416,-13,-37,,, -401,-13,-22,,, -408,-13,-21,,, -483,-13,-12,,, -458,-13,7,,, -441,-13,18,,, -476,-13,26,,, -442,-13,27,,, -402,-13,43,,, -424,-13,45,,, -440,-12,24,,, -448,-12,30,,, -490,-12,43,,, -454,-12,49,,, -438,-11,-45,,, -463,-11,-28,,, -414,-11,-2,,, -468,-11,-1,,, -434,-11,2,,, -490,-11,6,,, -439,-11,12,,, -420,-11,14,,, -473,-11,24,,, -433,-11,31,,, -421,-11,44,,, -470,-11,49,,, -499,-10,3,,, -472,-10,35,,, -459,-9,-33,,, -494,-9,-25,,, -438,-9,4,,, -406,-9,14,,, -460,-9,21,,, -404,-9,28,,, -420,-9,32,,, -485,-9,34,,, -411,-9,43,,, -466,-9,45,,, -414,-9,47,,, -463,-9,48,,, -442,-8,-42,,, -490,-8,-14,,, -488,-8,8,,, -495,-8,9,,, -476,-8,17,,, -484,-8,20,,, -466,-8,21,,, -405,-8,31,,, -424,-8,38,,, -444,-8,49,,, -426,-7,-24,,, -458,-7,-6,,, -473,-7,45,0d69753742e6e5fe5f545498708d61f3335adffd90686d41c8529a64,0014df10a49bfe0b8b0257a051d5cc7a16fb0881733d83188c978cdd0fbf1fdb,1 -491,-7,49,,, -431,-6,-38,,, -440,-6,-34,,, -451,-6,-33,,, -434,-6,-29,,, -415,-6,-26,,, -428,-6,-10,,, -499,-6,40,,, -464,-5,-48,,, -494,-5,-11,,, -433,-5,13,,, -482,-5,20,,, -452,-5,30,,, -433,-5,37,,, -465,-5,39,,, -458,-5,43,,, -409,-4,-29,,, -464,-4,-17,,, -456,-4,19,,, -436,-4,39,,, -436,-4,46,,, -427,-3,-46,,, -466,-3,-23,,, -434,-3,-9,,, -481,-3,2,,, -413,-3,12,,, -468,-3,14,,, -420,-3,16,,, -454,-3,27,,, -449,-3,40,,, -405,-3,42,,, -422,-2,-43,,, -462,-2,-22,,, -485,-2,-20,,, -488,-2,-14,,, -449,-2,-1,255d6456fa68e3d858d80e3168b0d76d57b6c4033c6234e2f0de8499,746f6b656e41,314 -433,-2,24,,, -471,-1,-46,,, -453,-1,-29,,, -499,-1,-4,,, -477,-1,16,,, -448,-1,20,,, -415,-1,24,,, -452,-1,41,,, -448,0,-48,,, -472,0,-29,,, -417,0,-18,,, -404,0,-17,,, -477,0,-16,,, -492,0,-6,,, -408,0,-2,,, -427,0,16,,, -418,0,33,,, -407,0,45,,, -490,1,-9,,, -419,1,-3,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,2 -433,1,8,,, -447,1,13,,, -420,1,43,,, -477,1,49,,, -437,2,-45,,, -442,2,-44,,, -427,2,-20,,, -450,2,-18,,, -496,2,-8,,, -436,2,-3,,, -411,2,-1,,, -447,2,9,,, -438,2,22,,, -452,3,-50,,, -496,3,-36,,, -421,3,-22,,, -408,3,-9,,, -449,3,-5,,, -404,3,47,,, -402,4,-47,,, -404,4,-43,fa3eff2047fdf9293c5feef4dc85ce58097ea1c6da4845a351535183,74494e4459,3 -427,4,-31,,, -418,4,2,,, -452,4,5,,, -492,4,37,,, -416,5,-45,,, -446,5,-41,,, -455,5,-22,,, -454,5,3,,, -480,5,7,,, -446,5,14,,, -448,5,34,,, -485,6,-40,,, -418,6,-25,,, -401,6,-8,,, -442,6,5,,, -456,6,9,,, -426,6,13,,, -440,7,-37,,, -494,7,-19,,, -427,7,8,,, -446,7,9,,, -481,7,11,,, -430,7,18,,, -429,7,46,,, -423,8,-46,,, -459,8,-39,,, -496,8,-19,,, -430,8,-15,,, -451,8,-2,,, -411,8,26,,, -430,8,28,,, -403,8,33,,, -489,8,41,,, -449,8,44,,, -429,8,46,,, -495,9,-36,,, -421,9,-25,,, -425,9,-22,,, -500,9,-19,,, -498,9,-16,,, -479,9,18,,, -478,9,32,,, -413,9,38,,, -404,10,-29,,, -447,10,-27,,, -411,10,1,,, -428,10,2,,, -488,10,33,,, -403,10,36,,, -419,10,39,,, -436,10,42,,, -480,10,44,,, -465,10,48,,, -422,11,-37,,, -427,11,-34,,, -457,11,-23,,, -442,11,-22,,, -476,11,-13,,, -405,11,-12,,, -498,11,6,,, -424,11,8,,, -488,11,24,,, -497,12,-47,,, -497,12,-22,,, -474,12,-1,,, -413,12,7,,, -451,12,10,,, -437,12,28,,, -492,12,48,,, -455,13,-2,,, -477,13,3,,, -401,13,4,,, -446,13,14,,, -472,13,23,,, -463,13,31,,, -475,13,35,,, -445,13,40,,, -447,13,41,,, -489,14,-49,,, -476,14,-34,,, -484,14,-26,,, -421,14,-21,,, -450,14,-17,,, -440,14,-11,,, -473,14,12,,, -470,14,20,,, -450,15,-46,,, -410,15,-41,,, -497,15,-22,,, -408,15,-18,,, -413,15,-16,,, -477,15,16,,, -431,15,26,,, -467,15,28,,, -471,16,-43,,, -476,16,-19,,, -452,16,-12,,, -473,16,8,,, -470,16,13,,, -497,16,14,,, -485,16,46,,, -424,17,-38,,, -471,17,-34,,, -490,17,-16,,, -406,17,-15,,, -491,17,28,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,15 -450,17,45,,, -417,18,-21,,, -445,18,-14,,, -402,18,3,,, -443,18,9,,, -497,18,28,,, -487,18,29,,, -438,18,30,,, -423,18,34,,, -483,19,-35,,, -448,19,-33,,, -431,19,-32,,, -460,19,-28,,, -404,19,-2,,, -494,19,1,,, -489,19,3,,, -415,19,9,,, -486,19,10,,, -413,20,-49,,, -403,20,-30,,, -494,20,-18,,, -469,20,-5,,, -457,20,12,,, -427,21,-13,,, -483,21,1,,, -417,21,5,,, -456,21,28,,, -453,22,-48,,, -401,22,-44,,, -460,22,-38,,, -453,22,-37,,, -450,22,-14,,, -458,22,-7,,, -417,22,8,,, -476,22,10,,, -404,22,26,,, -491,22,37,,, -445,22,44,,, -447,23,-46,,, -491,23,-45,,, -455,23,-41,,, -402,23,-32,,, -470,23,-16,,, -470,23,-15,,, -477,23,-13,,, -437,23,3,,, -497,23,23,,, -462,23,27,,, -454,23,36,,, -427,23,40,,, -469,23,44,,, -401,24,-40,,, -448,24,-39,,, -406,24,-15,,, -469,24,13,,, -438,24,14,,, -476,24,25,,, -422,24,28,,, -428,24,34,,, -492,24,35,,, -419,24,42,,, -416,25,-46,,, -473,25,-44,,, -445,25,-19,,, -400,25,-12,,, -439,25,-8,,, -477,25,-6,,, -473,25,5,,, -440,25,12,,, -486,25,27,,, -418,25,34,,, -401,25,38,,, -496,25,43,,, -497,25,46,,, -427,26,-50,,, -455,26,-39,,, -471,26,-37,,, -434,26,-29,,, -431,26,-24,,, -475,26,-15,,, -403,26,-7,,, -406,26,4,,, -402,26,19,,, -425,26,47,,, -461,26,49,,, -449,27,-30,,, -478,27,-23,,, -471,27,-21,,, -421,27,-20,,, -461,27,-19,,, -414,27,-14,,, -449,27,29,,, -446,27,32,,, -409,27,44,,, -457,27,47,,, -418,28,-46,,, -460,28,-45,,, -500,28,-40,,, -418,28,-30,,, -433,28,-21,,, -422,28,-19,,, -447,28,6,,, -484,28,29,,, -451,29,-36,,, -400,29,-32,,, -484,29,-31,,, -422,29,-23,,, -467,29,-12,,, -436,29,-2,,, -482,29,25,,, -417,29,35,,, -444,29,43,,, -500,29,47,,, -414,30,-48,,, -494,30,-26,,, -500,30,-22,,, -438,30,-16,,, -449,30,-15,,, -495,30,-5,,, -467,30,-1,,, -448,30,2,,, -455,30,7,,, -482,30,9,,, -402,30,27,,, -414,30,33,,, -455,30,34,,, -408,30,36,,, -476,30,47,,, -480,31,-32,,, -430,31,45,,, -479,32,-48,,, -407,32,-38,,, -413,32,-23,,, -487,32,-16,,, -479,32,4,,, -452,32,14,,, -457,32,15,,, -426,32,20,,, -414,32,26,,, -430,32,31,,, -458,32,48,,, -436,33,-31,,, -461,33,-15,,, -433,33,-5,,, -411,33,13,,, -420,33,28,,, -417,33,33,,, -483,33,35,,, -494,34,-47,,, -413,34,-25,,, -430,34,-22,,, -411,34,-14,,, -491,34,3,,, -462,34,40,,, -471,35,-47,,, -472,35,-45,,, -493,35,-35,,, -485,35,-34,,, -480,35,-33,,, -493,35,-19,,, -442,35,-8,,, -470,35,-7,,, -420,35,17,,, -448,35,21,,, -472,35,44,,, -421,36,-49,,, -464,36,-40,,, -403,36,-32,,, -435,36,-31,,, -411,36,-7,,, -438,36,15,,, -423,36,36,,, -492,36,46,,, -410,37,-42,,, -461,37,-40,,, -431,37,-33,,, -470,37,-28,,, -417,37,-20,,, -401,37,-11,,, -499,37,-2,,, -481,37,8,,, -436,37,32,,, -451,37,43,,, -408,38,-32,,, -414,38,-30,,, -406,38,-28,,, -477,38,-18,,, -446,38,-9,,, -470,38,-3,,, -427,38,15,,, -469,38,48,,, -499,39,-42,,, -479,39,-32,,, -418,39,-27,,, -452,39,-26,,, -427,39,-19,,, -466,39,-11,,, -402,39,6,b7341c90d38390ae3a890435559184f01fac24f79df06fd5c02f7fe4,746f6b656e42,22 -448,39,21,,, -461,39,30,,, -436,39,41,,, -487,40,-47,,, -428,40,-46,,, -441,40,-35,,, -477,40,-25,,, -400,40,-23,,, -400,40,-16,,, -430,40,-13,,, -452,40,3,,, -408,40,5,,, -428,40,13,,, -445,40,19,,, -435,40,39,,, -449,40,49,,, -453,41,-48,,, -444,41,-47,,, -402,41,-36,,, -405,41,-31,,, -483,41,-11,,, -491,41,13,,, -433,41,20,,, -486,41,34,,, -491,41,38,,, -410,42,-50,,, -406,42,-47,,, -499,42,-43,,, -499,42,-28,,, -419,42,-23,,, -455,42,2,,, -400,42,21,,, -401,42,24,,, -426,42,32,,, -427,42,49,,, -460,43,-49,,, -424,43,-41,,, -463,43,20,,, -435,43,34,,, -445,44,-47,,, -489,44,-44,,, -496,44,-43,,, -460,44,-34,,, -456,44,-1,,, -500,44,6,,, -437,44,8,,, -498,44,10,,, -466,44,13,,, -421,44,21,,, -498,44,24,,, -460,44,35,,, -493,44,38,,, -481,44,39,,, -444,45,-48,,, -466,45,-31,,, -479,45,-26,,, -445,45,-15,,, -458,45,-9,,, -495,45,-8,,, -420,45,12,,, -416,45,29,,, -461,46,-11,,, -421,46,-5,,, -436,46,-1,,, -407,46,0,,, -444,46,1,,, -428,46,2,,, -408,46,6,,, -484,46,16,,, -499,46,17,,, -452,46,38,,, -491,46,39,,, -470,46,45,,, -477,47,-45,,, -421,47,-43,,, -454,47,-41,,, -454,47,-38,,, -412,47,-33,,, -464,47,-27,,, -452,47,-21,,, -431,47,-19,,, -429,47,-16,,, -467,47,-13,,, -425,47,7,,, -487,47,9,,, -444,47,11,,, -490,47,30,,, -483,48,-12,,, -459,48,6,,, -418,48,11,,, -485,48,17,,, -477,48,19,,, -413,48,20,,, -483,48,29,,, -410,48,43,,, -496,49,-45,,, -435,49,-17,,, -443,49,0,,, -499,49,17,,, +468,-54,-9,,, +419,-54,9,,, +400,-53,-14,,, +411,-52,-13,,, +469,-52,-11,,, +448,-52,-1,,, +480,-52,9,,, +463,-52,13,,, +437,-51,-15,,, +422,-50,-23,,, +452,-50,-11,,, +401,-50,-2,,, +469,-50,2,,, +495,-50,5,,, +424,-50,6,,, +447,-50,7,,, +494,-49,-25,,, +408,-49,-9,,, +431,-49,-8,,, +495,-49,6,,, +432,-48,-25,,, +468,-48,8,,, +428,-47,-18,,, +426,-47,-6,,, +417,-47,-4,,, +490,-47,16,,, +402,-47,21,,, +436,-47,27,,, +429,-46,-28,,, +499,-46,-6,,, +401,-46,4,,, +458,-46,14,,, +454,-45,-26,,, +429,-45,-13,,, +466,-45,2,,, +489,-45,16,,, +443,-45,27,,, +445,-44,-23,,, +413,-44,-19,,, +430,-44,9,,, +429,-44,27,,, +406,-43,-29,,, +419,-43,-25,,, +493,-43,-13,,, +498,-43,-1,,, +406,-43,26,,, +477,-42,-17,,, +445,-42,-1,,, +450,-42,8,,, +409,-41,6,,, +401,-41,10,,, +490,-41,13,,, +465,-41,26,,, +463,-41,33,,, +485,-41,35,,, +478,-40,-8,,, +411,-40,-6,,, +464,-40,-5,,, +402,-39,-30,,, +429,-39,-22,,, +427,-39,-15,,, +466,-39,0,,, +489,-39,2,,, +494,-39,4,,, +420,-39,10,,, +434,-39,23,,, +487,-39,32,,, +443,-39,36,,, +459,-38,-39,,, +496,-38,-35,,, +451,-38,-31,,, +410,-38,-29,,, +454,-38,-7,,, +402,-38,31,,, +455,-37,-23,,, +475,-37,-20,,, +439,-37,15,,, +469,-37,25,,, +442,-37,28,,, +457,-37,35,,, +400,-36,-35,,, +477,-36,-26,,, +444,-36,-22,,, +496,-36,1,,, +454,-36,20,,, +419,-36,32,,, +402,-35,-41,,, +439,-35,-40,,, +449,-35,-8,,, +447,-35,-4,,, +467,-35,2,,, +485,-35,3,,, +448,-35,15,,, +441,-35,27,,, +408,-35,30,,, +489,-35,35,,, +468,-34,-38,,, +489,-34,-33,,, +477,-34,-25,,, +416,-34,-24,,, +478,-34,2,,, +431,-34,14,,, +441,-34,17,,, +404,-34,28,,, +476,-34,33,,, +415,-34,42,,, +469,-33,-41,,, +443,-33,-35,,, +492,-33,-18,,, +427,-33,-17,,, +476,-33,14,,, +478,-33,29,,, +459,-33,32,,, +470,-33,33,,, +459,-33,43,,, +435,-32,-28,,, +496,-32,-27,,, +433,-32,-19,,, +457,-32,-12,,, +414,-32,-9,,, +409,-32,-3,,, +404,-32,-1,,, +493,-32,14,,, +406,-32,21,,, +409,-32,26,,, +499,-32,35,,, +482,-31,-9,,, +444,-31,2,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +402,-31,7,,, +478,-31,10,,, +478,-31,17,,, +469,-31,24,,, +425,-31,31,,, +453,-30,-30,,, +424,-30,-12,,, +406,-30,-7,,, +434,-30,-4,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +485,-29,-35,,, +460,-29,-34,,, +438,-29,-16,,, +409,-29,-12,,, +442,-29,-10,,, +472,-29,-2,b4df23876be7207fe26e0cddfb08d6a73ff83754075efafb53446234,41533039333631,1 +434,-29,27,,, +480,-29,35,,, +441,-28,-6,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +464,-28,1,,, +421,-28,7,,, +472,-28,33,,, +452,-28,36,,, +464,-27,-43,,, +455,-27,-38,,, +427,-27,-31,,, +406,-27,-28,,, +461,-27,-4,,, +411,-27,6,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +497,-27,13,,, +474,-27,15,,, +428,-27,26,,, +447,-27,36,,, +435,-27,40,,, +437,-26,-46,,, +414,-26,-25,,, +437,-26,-24,,, +475,-26,-13,,, +477,-26,34,,, +460,-26,41,,, +426,-25,-19,,, +455,-25,-8,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +486,-25,-4,,, +438,-25,0,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,40 +407,-25,4,,, +414,-25,12,,, +482,-25,17,,, +490,-25,24,,, +487,-25,29,,, +489,-25,32,,, +454,-25,34,,, +413,-24,-45,,, +412,-24,-32,,, +472,-24,-29,,, +432,-24,-23,,, +488,-24,-22,,, +420,-24,-12,,, +494,-24,-6,,, +496,-24,3,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +404,-24,10,,, +477,-24,14,,, +487,-24,19,,, +431,-24,33,,, +481,-24,48,,, +490,-23,-47,,, +429,-23,-32,,, +435,-23,-30,,, +400,-23,-20,,, +402,-23,-17,,, +436,-23,-11,,, +415,-23,-2,,, +474,-23,0,,, +424,-23,8,,, +483,-23,11,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +441,-23,49,,, +420,-22,-38,,, +440,-22,-27,,, +411,-22,-22,,, +473,-22,-20,,, +477,-22,-19,,, +427,-22,-16,,, +483,-22,-11,,, +469,-22,4,,, +459,-22,21,,, +481,-22,30,,, +464,-21,-37,,, +473,-21,18,,, +451,-21,22,,, +421,-21,30,,, +405,-21,40,,, +473,-21,46,,, +472,-20,-43,,, +400,-20,-23,,, +476,-20,-15,,, +406,-20,17,,, +438,-20,23,,, +474,-20,33,,, +453,-20,37,,, +432,-19,4,,, +441,-19,23,,, +447,-19,25,,, +459,-19,26,,, +492,-19,34,,, +400,-19,47,,, +447,-18,-48,,, +459,-18,-47,,, +423,-18,-20,,, +439,-18,-11,,, +422,-18,-9,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +430,-18,-3,,, +440,-18,-1,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +469,-18,1,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +478,-18,2,,, +430,-18,30,,, +440,-18,46,,, +424,-17,-30,,, +431,-17,-27,,, +473,-17,-12,,, +448,-17,12,,, +438,-17,15,,, +446,-17,21,,, +406,-17,43,,, +446,-17,48,,, +413,-16,-49,,, +414,-16,-44,,, +432,-16,-37,,, +496,-16,-35,,, +446,-16,-32,,, +486,-16,11,,, +417,-16,32,,, +468,-16,47,,, +454,-15,-52,,, +419,-15,-38,,, +449,-15,-35,,, +453,-15,-26,,, +410,-15,-15,,, +481,-15,0,,, +428,-15,3,,, +401,-15,17,,, +428,-15,32,,, +411,-15,34,,, +495,-15,43,,, +430,-14,-51,,, +450,-14,-38,,, +498,-14,-35,,, +494,-14,-17,,, +405,-14,-1,,, +476,-14,3,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +401,-14,22,,, +437,-13,-27,,, +486,-13,-24,,, +419,-13,-15,,, +461,-13,-7,5d16cc1a177b5d9ba9cfa9793b07e60f1fb70fea1f8aef064415d114,494147,527 +462,-13,-5,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28574 +409,-13,3,477cec772adb1466b301fb8161f505aa66ed1ee8d69d3e7984256a43,477574656e62657267204269626c65202332363033,1 +407,-13,5,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,196 +480,-13,13,,, +456,-13,17,,, +489,-13,49,,, +403,-12,-46,,, +469,-12,-39,,, +449,-12,-22,,, +484,-12,-7,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +462,-12,-3,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +440,-12,-2,,, +497,-12,19,,, +474,-12,20,,, +414,-12,21,,, +413,-12,39,,, +495,-12,47,,, +415,-11,-53,,, +451,-11,-42,,, +410,-11,-27,,, +467,-11,-14,,, +483,-11,25,,, +483,-11,47,,, +473,-10,-52,,, +478,-10,-7,,, +410,-10,0,,, +450,-10,10,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +489,-10,22,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +469,-10,39,,, +441,-9,-51,,, +435,-9,-38,,, +455,-9,-32,,, +417,-9,-25,,, +489,-9,-23,,, +442,-9,-8,,, +487,-9,-7,,, +473,-9,2,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +406,-9,21,,, +452,-9,32,,, +439,-9,40,,, +414,-9,41,,, +402,-8,-51,,, +487,-8,-49,,, +445,-8,-21,,, +432,-8,28,,, +442,-8,30,,, +440,-8,36,,, +423,-8,49,,, +485,-7,-53,,, +484,-7,-47,,, +408,-7,-31,,, +406,-7,-30,,, +477,-7,-4,,, +493,-7,-3,,, +419,-7,0,,, +456,-7,4,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +442,-7,10,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +493,-7,12,,, +459,-7,22,,, +401,-7,29,,, +463,-7,42,,, +425,-7,47,,, +464,-6,-12,,, +442,-6,-7,,, +471,-6,25,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +499,-5,-51,,, +476,-5,-43,,, +419,-5,-15,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +444,-5,-14,,, +439,-5,-4,,, +472,-5,3,,, +410,-5,6,,, +409,-5,9,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +454,-5,10,,, +411,-5,14,,, +477,-5,16,,, +500,-5,25,,, +465,-5,27,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +421,-5,29,,, +420,-5,30,,, +442,-5,40,,, +403,-4,-40,,, +412,-4,-18,,, +423,-4,-17,,, +432,-4,-9,,, +445,-4,-6,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +458,-4,-5,,, +436,-4,5,,, +435,-4,12,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +416,-4,23,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +490,-4,50,,, +445,-3,-43,,, +493,-3,-40,,, +492,-3,-9,,, +437,-3,11,,, +432,-3,14,,, +494,-3,15,,, +461,-3,18,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +443,-3,28,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +424,-3,32,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +441,-3,33,,, +413,-3,37,,, +443,-3,40,,, +489,-2,-52,,, +407,-2,-2,,, +452,-2,10,,, +453,-2,17,,, +417,-2,32,,, +466,-2,47,,, +411,-1,-41,,, +458,-1,-37,,, +429,-1,-30,c5ec84e79e58cd5d7203d38738848991ddce76efad59ef701b6f4cf4,576869746554726173685761726c6f636b333838,1 +425,-1,-29,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1674 +427,-1,-25,,, +437,-1,-20,,, +449,-1,-13,,, +494,-1,-11,,, +420,-1,-7,,, +498,-1,16,,, +500,-1,21,804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f,56594649,1250 +401,-1,33,,, +489,0,-39,,, +423,0,-19,11fb60cbc42fc2012327d82309fe0c5cb39e5b2e83a83a9272d2faad,436f6c6c656374696e6753696d70736f6e73303734,1 +472,0,-12,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +465,0,-9,,, +428,0,-4,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +422,0,4,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +492,0,19,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +444,0,33,,, +420,0,44,,, +457,1,-54,,, +405,1,-52,,, +460,1,-50,,, +436,1,-39,,, +427,1,-35,,, +470,1,-26,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +460,1,-24,,, +469,1,-23,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +493,1,-9,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +451,1,12,,, +419,1,14,,, +403,1,20,,, +402,1,33,,, +430,1,35,,, +400,1,41,,, +440,2,-50,,, +404,2,-31,,, +491,2,-20,,, +468,2,-3,,, +434,2,4,,, +415,2,16,,, +455,2,22,,, +433,2,42,,, +417,2,46,,, +483,2,50,,, +425,3,-50,,, +406,3,-41,,, +425,3,-30,,, +416,3,-11,,, +456,3,-6,,, +401,3,0,,, +423,3,1,,, +466,3,2,,, +465,3,12,,, +412,3,16,,, +453,3,34,,, +499,3,51,,, +470,4,-45,,, +416,4,-5,,, +433,4,-3,,, +467,4,1,,, +472,4,7,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +467,4,18,,, +411,4,23,,, +433,4,53,,, +426,5,-49,,, +481,5,-43,,, +485,5,-42,,, +409,5,-28,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +455,5,-18,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +404,5,-16,,, +405,5,-6,,, +483,5,-1,,, +420,5,1,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +436,5,11,,, +482,5,24,,, +439,5,52,,, +456,6,-42,,, +471,6,-28,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +470,6,-15,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +402,6,-11,,, +414,6,41,,, +458,6,47,,, +425,6,51,,, +409,7,-45,,, +420,7,-12,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +477,7,-9,,, +409,7,1,,, +406,7,20,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +416,7,23,,, +432,7,41,,, +421,7,44,,, +450,7,45,,, +472,8,-44,,, +444,8,-24,804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f,56594649,1250 +471,8,-22,,, +430,8,-19,,, +428,8,-15,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +465,8,-8,,, +400,8,12,,, +463,8,38,,, +412,8,53,,, +492,9,-43,,, +488,9,-38,,, +438,9,-25,,, +490,9,-21,,, +424,9,-17,,, +410,9,5,,, +447,9,33,,, +467,9,51,,, +467,10,-35,,, +453,10,-29,,, +497,10,-28,,, +419,10,-26,,, +478,10,-19,,, +446,10,-13,,, +448,10,1,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +418,10,9,,, +452,10,17,,, +491,10,24,,, +401,10,44,,, +472,10,48,,, +431,11,-45,,, +444,11,-17,,, +465,11,-15,,, +470,11,-10,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +413,11,-2,,, +432,11,1,,, +420,11,3,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +470,11,21,,, +412,11,32,,, +450,11,35,,, +440,11,38,,, +419,11,41,,, +412,12,-31,,, +443,12,-17,,, +426,12,-11,a0bf068fda05eda2d7cd00e51cdc599059449294101e7211a12195f9,53494c56455231313139,1 +421,12,20,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +420,12,22,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +407,12,24,,, +491,12,39,,, +463,12,52,,, +447,13,-53,,, +484,13,-22,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +446,13,-19,,, +453,13,-16,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +418,13,-13,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +450,13,-11,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +492,13,-7,,, +482,13,8,,, +407,13,11,,, +447,13,22,,, +462,13,23,,, +485,13,32,,, +423,13,33,,, +497,13,51,,, +400,14,-53,,, +455,14,-41,,, +462,14,-37,,, +427,14,-8,,, +430,14,2,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +468,14,17,,, +456,14,27,,, +449,14,38,,, +428,14,46,,, +422,14,49,,, +441,15,-38,,, +425,15,-18,a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235,484f534b59,500000000 +467,15,32,,, +408,15,37,,, +456,15,38,,, +460,15,48,,, +457,16,-47,,, +401,16,-39,,, +474,16,-35,,, +476,16,-30,,, +439,16,-29,,, +411,16,-19,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777786 +436,16,-4,,, +486,16,4,,, +415,16,9,,, +483,16,10,,, +406,16,13,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +461,16,19,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +437,16,40,,, +443,16,42,,, +404,16,50,,, +433,17,-20,,, +440,17,-15,,, +471,17,4,577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e,0014df10464c4454,188 +463,17,8,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +406,17,10,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +476,17,13,,, +489,17,18,,, +449,17,42,,, +494,18,-51,,, +500,18,-49,,, +457,18,-20,,, +500,18,4,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +486,18,11,29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6,4d494e,1666 +471,18,21,,, +461,18,31,,, +409,18,36,,, +459,18,37,,, +483,19,-33,,, +452,19,-23,,, +483,19,-17,,, +453,19,-13,,, +495,19,5,,, +481,19,6,,, +409,19,17,,, +474,19,49,,, +417,20,-35,,, +400,20,-1,,, +493,20,6,,, +495,20,23,,, +444,20,29,,, +483,20,48,,, +469,20,49,,, +460,21,-50,,, +466,21,-46,,, +419,21,-15,,, +484,21,-13,,, +433,21,-12,51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34,424f4f4b,8402777777 +493,21,-8,,, +493,21,18,,, +465,21,21,,, +409,21,23,,, +485,21,29,,, +413,21,30,,, +428,22,-29,,, +417,22,-10,,, +486,22,-3,,, +494,22,2,,, +475,22,6,,, +425,22,15,,, +407,22,32,,, +494,23,-17,,, +500,23,-4,,, +429,23,8,,, +416,23,22,,, +433,23,26,,, +411,24,-49,,, +500,24,-31,,, +437,24,-25,,, +404,24,-21,,, +480,24,-15,,, +451,24,-14,,, +471,24,9,,, +401,24,16,,, +465,24,31,,, +487,24,33,,, +416,25,-48,,, +481,25,-37,,, +451,25,-30,,, +477,25,-20,,, +473,25,-19,,, +462,25,-15,,, +456,25,-6,,, +448,25,10,,, +410,25,11,,, +467,25,13,,, +409,25,29,,, +480,26,-47,,, +404,26,-43,,, +426,26,-34,,, +464,26,-30,,, +445,26,-26,,, +438,26,-10,,, +479,26,-9,,, +464,26,11,,, +414,26,15,,, +482,26,43,,, +497,26,44,,, +494,27,-40,,, +461,27,-37,,, +469,27,-31,,, +459,27,-30,,, +432,27,-23,,, +472,27,-11,,, +421,27,-9,,, +430,27,16,,, +443,27,23,,, +453,27,27,,, +422,27,29,,, +478,27,40,,, +426,28,-46,,, +483,28,-31,,, +459,28,-24,,, +429,28,-20,,, +424,28,-15,,, +417,28,-12,,, +422,28,-8,,, +411,28,3,8ebb4f0eb39543cdab83eb35f5f194798817eaaa3061872b4101efdb,0014df104d4554455241,28571 +401,28,5,,, +449,28,13,,, +425,28,18,,, +470,28,27,,, +457,28,35,,, +450,29,-46,,, +415,29,-31,,, +487,29,-20,,, +419,29,-3,,, +492,29,-1,,, +481,29,20,,, +435,29,27,,, +472,29,29,,, +422,29,30,,, +480,29,31,,, +449,29,36,,, +474,30,-12,,, +454,30,-9,,, +439,30,3,,, +452,30,6,,, +406,30,13,,, +424,30,14,,, +468,30,19,,, +405,30,29,,, +461,30,38,,, +441,30,40,,, +472,31,-24,,, +406,31,-15,,, +496,31,-1,533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0,494e4459,36 +484,31,34,,, +441,31,38,,, +405,31,39,,, +418,32,-41,,, +466,32,-30,,, +403,32,-20,,, +494,32,7,,, +477,32,17,,, +491,32,25,,, +412,32,29,,, +459,32,34,,, +425,33,-31,,, +435,33,-27,,, +409,33,-21,,, +462,33,-20,,, +416,33,-10,,, +458,33,-8,,, +482,33,-6,,, +401,33,-3,,, +403,33,2,9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77,53554e444145,7500 +417,33,4,,, +463,33,22,,, +409,33,28,,, +410,33,29,,, +422,33,31,,, +444,33,42,,, +453,34,-22,,, +475,34,-9,,, +462,35,-28,,, +460,35,-21,,, +456,35,-14,,, +484,35,-11,,, +480,35,4,,, +498,35,11,,, +458,35,31,,, +431,36,-40,,, +429,36,-39,,, +413,36,-34,,, +434,36,-28,,, +423,36,-23,,, +413,36,-6,,, +410,36,15,,, +500,36,31,,, +482,37,-39,,, +441,37,-21,,, +493,37,-6,,, +475,37,-1,,, +445,37,1,,, +402,37,19,,, +462,38,-38,,, +450,38,-35,,, +414,38,-27,,, +482,38,-10,,, +458,38,-8,,, +484,38,27,,, +443,39,-37,,, +476,39,-35,,, +409,39,-25,,, +490,39,-24,,, +429,39,-23,,, +478,39,-9,,, +411,39,2,,, +414,39,3,,, +449,39,27,,, +469,39,31,,, +423,40,-20,,, +497,40,-13,,, +500,40,-4,,, +486,40,4,,, +416,40,5,,, +415,40,29,,, +499,41,-20,,, +424,41,1,,, +438,41,11,,, +479,41,23,,, +449,41,25,,, +481,41,32,,, +468,42,-32,,, +489,42,-24,,, +457,42,-15,,, +418,42,-6,,, +471,42,4,,, +425,42,28,,, +485,43,-28,,, +433,43,-3,,, +472,43,-1,,, +477,43,1,,, +418,43,11,,, +423,43,20,,, +423,43,26,,, +413,44,-20,,, +482,44,-4,,, +441,44,13,,, +439,44,23,,, +491,45,-28,,, +401,45,-23,,, +492,45,-22,,, +458,45,-15,,, +476,45,-7,,, +401,45,10,,, +484,45,25,,, +484,46,-24,,, +406,46,-13,,, +435,46,-1,,, +431,46,0,,, +439,46,11,,, +463,46,21,,, +474,46,23,,, +419,47,-25,,, +439,47,-22,,, +459,47,-6,,, +402,47,-4,,, +453,47,4,,, +491,47,10,,, +421,48,-22,,, +500,48,-12,,, +418,48,-9,,, +461,48,-8,,, +497,48,3,,, +441,48,8,,, +444,49,-20,,, +431,49,4,,, +478,49,11,,, +450,50,-18,,, +461,50,-14,,, +450,50,-2,,, +488,50,1,,, +427,50,5,,, +491,51,-18,,, +486,51,-13,,, +403,51,12,,, +495,52,-2,,, +463,52,1,,, +462,52,9,,, +400,53,1,,, +482,53,3,,,