Skip to content

Commit c46bf05

Browse files
committed
chore(app2): pre commit
1 parent 9ecc0b4 commit c46bf05

File tree

8 files changed

+28
-31
lines changed

8 files changed

+28
-31
lines changed

app2/src/lib/stores/sorted-balances.svelte.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Option, pipe} from "effect"
1+
import { Option } from "effect"
22
import type {
33
AddressCanonicalBytes,
44
Chain,
@@ -95,18 +95,16 @@ class SortedBalancesStore {
9595
chains.data.pipe(
9696
Option.map(d =>
9797
d.map(chain => {
98-
99-
10098
return {
10199
chain,
102100
tokens: Option.flatMap(
103-
Option.isSome(wallets.inputAddress) ?
104-
wallets.inputAddress :
105-
wallets.getAddressForChain(chain),
106-
addr =>
107-
tokensStore
108-
.getData(chain.universal_chain_id)
109-
.pipe(Option.map(ts => getSortedTokens(ts, chain, balancesStore, addr)))
101+
Option.isSome(wallets.inputAddress)
102+
? wallets.inputAddress
103+
: wallets.getAddressForChain(chain),
104+
addr =>
105+
tokensStore
106+
.getData(chain.universal_chain_id)
107+
.pipe(Option.map(ts => getSortedTokens(ts, chain, balancesStore, addr)))
110108
)
111109
}
112110
})

app2/src/lib/transfer/multisig/index.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { fly } from "svelte/transition"
1616
import { transferHashStore } from "$lib/stores/transfer-hash.svelte.ts"
1717
import { wallets } from "$lib/stores/wallets.svelte.ts"
1818
import { beforeNavigate } from "$app/navigation"
19-
import transfer from "$lib/transfer/index.svelte";
19+
import transfer from "$lib/transfer/index.svelte"
2020
let currentPage = $state(0)
2121
let previousPage = $state(0)
2222
let isLoading = $state(true)
@@ -136,7 +136,7 @@ function newTransfer() {
136136
beforeNavigate(newTransfer)
137137
138138
$effect(() => {
139-
console.log('here', wallets.inputAddress)
139+
console.log("here", wallets.inputAddress)
140140
})
141141
</script>
142142

app2/src/lib/transfer/normal/steps/IndexStep.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { fly } from "svelte/transition"
77
import TransactionHashComponent from "$lib/components/model/TransactionHashComponent.svelte"
88
import ErrorComponent from "$lib/components/model/ErrorComponent.svelte"
99
import SpinnerIcon from "$lib/components/icons/SpinnerIcon.svelte"
10-
import type {WaitForIndex} from "$lib/transfer/normal/steps/steps.ts";
10+
import type { WaitForIndex } from "$lib/transfer/normal/steps/steps.ts"
1111
1212
type Props = {
1313
newTransfer: () => void

app2/src/lib/transfer/normal/steps/SubmitStep.svelte

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import { generateSalt } from "@unionlabs/sdk/utils"
1717
import { getConnectorClient, http, type GetConnectorClientErrorType } from "@wagmi/core"
1818
import { createViemPublicClient, createViemWalletClient } from "@unionlabs/sdk/evm"
19-
import {custom, encodeAbiParameters, fromHex, toHex} from "viem"
19+
import { custom, encodeAbiParameters, fromHex, toHex } from "viem"
2020
import { wagmiConfig } from "$lib/wallet/evm/wagmi-config.ts"
2121
import { wallets } from "$lib/stores/wallets.svelte.ts"
2222
import { getCosmWasmClient } from "$lib/services/cosmos/clients.ts"
@@ -31,7 +31,7 @@ import { isValidBech32ContractAddress } from "$lib/utils"
3131
import Label from "$lib/components/ui/Label.svelte"
3232
import ChainComponent from "$lib/components/model/ChainComponent.svelte"
3333
import InsetError from "$lib/components/model/InsetError.svelte"
34-
import type {SubmitInstruction} from "$lib/transfer/normal/steps/steps.ts";
34+
import type { SubmitInstruction } from "$lib/transfer/normal/steps/steps.ts"
3535
3636
type Props = {
3737
stepIndex: number
@@ -173,13 +173,13 @@ export const submit = Effect.gen(function* () {
173173
cosmosStore.connectedWallet
174174
)
175175
176-
console.log('here stop',step.intent.baseToken )
177-
const sender = yield* step.intent.sourceChain.getDisplayAddress(wallets.cosmosAddress.value)
178-
const isNative = !isValidBech32ContractAddress(
179-
step.intent.baseToken
176+
console.log("here stop", step.intent.baseToken)
177+
const sender = yield* step.intent.sourceChain.getDisplayAddress(
178+
wallets.cosmosAddress.value
180179
)
180+
const isNative = !isValidBech32ContractAddress(step.intent.baseToken)
181181
182-
console.log({isNative})
182+
console.log({ isNative })
183183
184184
do {
185185
const timeout_timestamp = getTimeoutInNanoseconds24HoursFromNow().toString()
@@ -206,11 +206,11 @@ export const submit = Effect.gen(function* () {
206206
},
207207
isNative
208208
? [
209-
{
210-
denom: step.intent.baseToken,
211-
amount: step.intent.baseAmount.toString()
212-
}
213-
]
209+
{
210+
denom: step.intent.baseToken,
211+
amount: step.intent.baseAmount.toString()
212+
}
213+
]
214214
: undefined
215215
)
216216
)

app2/src/lib/transfer/shared/services/filling/create-context.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Match, Option } from "effect"
2-
import {fromHex, isHex, toHex} from "viem"
2+
import { fromHex, isHex, toHex } from "viem"
33
import type { TransferArgs } from "./check-filling.ts"
44
import type {
55
AddressCanonicalBytes,
@@ -81,7 +81,6 @@ export const createContext = (args: TransferArgs): Option.Option<TransferContext
8181
}),
8282

8383
Match.when("cosmos", () => {
84-
8584
const baseToken = isHex(args.baseToken) ? fromHex(args.baseToken, "string") : args.baseToken
8685
const baseAmountWithFee =
8786
args.sourceChain.universal_chain_id === "babylon.bbn-1" && args.baseToken === toHex("ubbn")

app2/src/lib/transfer/shared/services/write-cosmos.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const nextStateCosmos = async (
3535
): Promise<TransactionSubmissionCosmos> =>
3636
TransactionSubmissionCosmos.$match(ts, {
3737
Filling: () => {
38-
console.log('write-cosmos:', {senderAddress, contractAddress, msg, funds})
38+
console.log("write-cosmos:", { senderAddress, contractAddress, msg, funds })
3939
return SwitchChainInProgress()
4040
},
4141
SwitchChainInProgress: async () => {

ts-sdk/src/schema/address.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as S from "effect/Schema"
22
import { Hex, HexChecksum, HexFromString } from "./hex.js"
33
import { Bech32, Bech32FromAddressCanonicalBytesWithPrefix } from "./bech32.js"
44
import { pipe } from "effect"
5-
import { checksumAddress, isAddress } from "viem"
5+
import { isAddress } from "viem"
66

77
// For Reference, see: https://docs.union.build/ucs/05
88
// We always store bytes arrays as hex-encoded strings

ts-sdk/test/schema/address.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const validErc55s = [
1616
"0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb"
1717
]
1818

19-
const vaildBech32s = [
19+
const validBech32s = [
2020
"A12UEL5L",
2121
"a12uel5l",
2222
"an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs",
@@ -32,7 +32,7 @@ describe("Address", () => {
3232
})
3333

3434
describe("union", () => {
35-
it.effect.each([...validErc55s, ...vaildBech32s])("passes for %s", x =>
35+
it.effect.each([...validErc55s, ...validBech32s])("passes for %s", x =>
3636
S.decode(Address.MyUnion)(x)
3737
)
3838
})

0 commit comments

Comments
 (0)