Skip to content

Commit

Permalink
chore: save progress
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Jun 5, 2024
1 parent 64729b9 commit 29deb63
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/app.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _: {
{
packages = {
app = unstablePkgs.buildNpmPackage {
npmDepsHash = "sha256-SMJ/Qjxh6pRMOQVD8me5Xdcc0gBmhHRwvIMB7pkCZAA=";
npmDepsHash = "sha256-CMdHOVBGB0FIlhqdJft+2IUdAS8QVzZBBEuwFhQJN6g=";
src = ./.;
sourceRoot = "app";
npmFlags = [ "--legacy-peer-deps" ];
Expand Down
8 changes: 4 additions & 4 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.3",
"tailwindcss-animate": "^1.0.7",
"tslib": "^2.6.2",
"tslib": "^2.6.3",
"tsx": "^4.11.2",
"typed-query-selector": "^2.11.2",
"typescript": "^5.4.5",
Expand Down
Binary file modified typescript-sdk/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions typescript-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@cosmjs/encoding": "^0.32.3",
"@cosmjs/stargate": "0.32.3",
"@cosmjs/tendermint-rpc": "0.32.3",
"viem": "^2.13.3"
"viem": "^2.13.6"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
Expand All @@ -29,7 +29,7 @@
"@scure/base": "^1.1.6",
"@total-typescript/ts-reset": "^0.5.1",
"@types/bun": "^1.1.3",
"@types/node": "^20.14.0",
"@types/node": "^20.14.1",
"consola": "^3.2.3",
"cosmjs-types": "^0.9.0",
"patch-package": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions typescript-sdk/scripts/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export const consola = createConsola({
}
})

export const timestamp = () => {
export function timestamp() {
const d = new Date()
const [date] = d.toISOString().split("T")
const [time] = d.toTimeString().split(" ")
return `${date} ${time}`
return `${date}--${time?.replace(/:/g, "-")}`
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bun
import { parseArgs } from "node:util"
import { UnionClient } from "#/mod.ts"
import { timestamp } from "./logger"

/* `bun scripts/from-osmosis.ts --private-key "..."` */

Expand Down Expand Up @@ -30,7 +31,7 @@ const osmoFromOsmosisToUnion = await unionClient.transferAssets({
token: { denom: "uosmo", amount: "1" },
sender: "osmo14qemq0vw6y3gc3u3e0aty2e764u4gs5l32ydm0",
receiver: "union14qemq0vw6y3gc3u3e0aty2e764u4gs5lnxk4rv",
memo: "sending OSMO from Osmosis to Union x",
memo: `${timestamp()} sending OSMO from Osmosis to Union x`,
timeoutHeight: { revisionHeight: 888888888n, revisionNumber: 8n }
}
]
Expand Down
10 changes: 5 additions & 5 deletions typescript-sdk/scripts/union-to-sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ const unionClient = await UnionClient.connectWithSecret({
})

const contractAddress = "union124t57vjgsyknnhmr3fpkmyvw2543448kpt2xhk5p5hxtmjjsrmzsjyc4n7"

const stamp = timestamp()
const unionToSepoliaTransactions: Array<ExecuteInstruction> = Array.from(
{ length: TX_COUNT },
(_, index) => ({
contractAddress,
msg: {
transfer: {
channel: "channel-0",
receiver: "0xD0081080Ae8493cf7340458Eaf4412030df5FEEb".slice(2),
memo: `${index} - ${timestamp()} Sending UNO from Union to Sepolia`
receiver: "0x8478B37E983F520dBCB5d7D3aAD8276B82631aBd".slice(2),
memo: `${index} - ${stamp} Sending UNO from Union to Sepolia`
}
},
funds: [{ amount: (index + 1).toString(), denom: `muno` }]
funds: [{ amount: (index + 2).toString(), denom: `muno` }]
})
)

Expand All @@ -53,7 +53,7 @@ const transactionResults = await Array.fromAsync(
unionClient.transferAssets({ kind: "cosmwasm", instructions: [transaction] }),
{ concurrency: 1 }
)

console.info(stamp)
consola.info(
JSON.stringify(
transactionResults.map(item => item.transactionHash),
Expand Down

0 comments on commit 29deb63

Please sign in to comment.