Skip to content

Commit

Permalink
feat: update inscribe API with dynamic metaid and testid, fix fee rat…
Browse files Browse the repository at this point in the history
…e display issue, optimize send page layout

1. Update inscribe API to accept dynamic 'metaid' and 'testid'.
2. Fix abnormal fee rate text display.
3. Optimize the display on the send page.
  • Loading branch information
AricRedemption committed May 21, 2024
1 parent 1212671 commit 6a70d47
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/FeeRateSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const selectCustom = () => {
>
<div class="text-xs">{{ rate.title }}</div>
<div class="text-sm">{{ rate.feeRate }} sat/vB</div>
<div class="text-xs text-gray-primary">{{ rate.desc }}</div>
<div class="text-xs text-gray-primary text-center px-2">{{ rate.desc }}</div>
<SelectIcon class="absolute top-0 right-0" v-if="index === selectedIndex" />
</FlexBox>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/actions/btc/inscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type MetaidData = {
version?: string
encoding?: BufferEncoding
revealAddr: string
flag?: 'metaid' | 'testid'
}

export type PrevOutput = {
Expand Down Expand Up @@ -345,7 +346,7 @@ function createMetaIdTxCtxData(
inscriptionBuilder.push(ops.OP_CHECKSIG)
inscriptionBuilder.push(ops.OP_FALSE)
inscriptionBuilder.push(ops.OP_IF)
inscriptionBuilder.push(Buffer.from('testid'))
inscriptionBuilder.push(Buffer.from(metaidData?.flag || 'metaid'))
inscriptionBuilder.push(Buffer.from(metaidData.operation))

if (metaidData.operation !== 'init') {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/addressType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useStorage from '@/lib/storage'
import { AddressType, Chain } from '@metalet/utxo-wallet-service'
import { getCurrentAccountId } from './account'
import { AddressType, Chain } from '@metalet/utxo-wallet-service'

const storage = useStorage()
const V3_BTC_ADDRESS_TYPE_RECORD__KEY = 'v3_btc_address_type_record'
Expand Down
6 changes: 3 additions & 3 deletions src/pages/wallet/Send.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ async function send() {
<div v-if="asset" class="flex flex-col items-center w-full relative min-h-full">
<TransactionResultModal v-model:is-open-result="isOpenResultModal" :result="transactionResult" />

<div class="grow w-full space-y-4">
<div class="space-y-4 w-full">
<div class="grow w-full space-y-3">
<div class="space-y-3 w-full">
<FlexBox d="col" ai="center" :gap="3">
<AssetLogo :logo="logo" :symbol="symbol" :chain="asset.chain" type="network" class="w-15" />
<div class="text-base">{{ symbol }}</div>
Expand Down Expand Up @@ -394,7 +394,7 @@ async function send() {
type="primary"
@click="popConfirm"
:disabled="btnDisabled"
:class="[{ 'opacity-50 cursor-not-allowed': btnDisabled }, 'my-12 mt-12 w-61.5 h-12']"
:class="[{ 'opacity-50 cursor-not-allowed': btnDisabled }, 'my-6 w-61.5 h-12']"
>
<div class="flex items-center gap-2" v-if="operationLock">
<LoadingIcon />
Expand Down

0 comments on commit 6a70d47

Please sign in to comment.