Skip to content

Commit

Permalink
Merge branch 'main' into feat/taostats-api
Browse files Browse the repository at this point in the history
  • Loading branch information
UrbanWill authored Oct 1, 2024
2 parents 09bcc48 + 315fc70 commit 2ee4532
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 42 deletions.
30 changes: 0 additions & 30 deletions apps/portal/src/domains/bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,6 @@ export const bridgeState = selector({
adapters: Object.values(bridgeConfig)
.filter((x): x is NonNullable<typeof x> => x !== undefined)
.map(x => x.adapter),
disabledRouters: [
// Disable routes from asset hub
// due to reports of possible lost of funds from users
{ from: 'assetHubPolkadot' },
// Temporarily disable Kusama routes
// due to: https://github.com/paritytech/polkadot-sdk/issues/3050
{ from: 'altair' },
{ from: 'kusama' },
{ from: 'basilisk' },
{ from: 'bifrost' },
{ from: 'calamari' },
{ from: 'crab' },
{ from: 'khala' },
{ from: 'kintsugi' },
{ from: 'shiden' },
{ from: 'shadow' },
{ from: 'turing' },
{ from: 'heiko' },
{ from: 'integritee' },
{ from: 'kico' },
{ from: 'tinkernet' },
{ from: 'listen' },
{ from: 'pichiu' },
{ from: 'quartz' },
{ from: 'moonriver' },
{ from: 'karura' },
{ from: 'robonomics' },
{ from: 'tinkernet' },
{ from: 'assetHubKusama' },
],
})
await bridge.isReady
return bridge
Expand Down
21 changes: 9 additions & 12 deletions apps/portal/src/domains/staking/subtensor/hooks/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ export const useAddStakeForm = (account: Account, stake: Stake, delegate: string
const [input, setInput] = useState('')
const amount = useTokenAmount(input)

const feeEstimateTx: SubmittableExtrinsic<any> = useMemo(
() => (api.tx as any)?.subtensorModule?.addStake?.(delegate, accountInfo.data.free.toBigInt() ?? 0n),
[accountInfo.data.free, api.tx, delegate]
const tx: SubmittableExtrinsic<any> = useMemo(
() =>
api.tx.utility.batchAll([
(api.tx as any)?.subtensorModule?.addStake?.(delegate, amount.decimalAmount?.planck ?? 0n),
api.tx.system.remarkWithEvent(`talisman-bittensor`),
]),
[api.tx, delegate, amount.decimalAmount?.planck]
)
const [feeEstimate, isFeeEstimateReady] = useStakeFormFeeEstimate(account.address, feeEstimateTx)

const [feeEstimate, isFeeEstimateReady] = useStakeFormFeeEstimate(account.address, tx)

const existentialDeposit = useMemo(
() => api.consts.balances.existentialDeposit.toBigInt(),
Expand Down Expand Up @@ -88,14 +93,6 @@ export const useAddStakeForm = (account: Account, stake: Stake, delegate: string
transferable.decimalAmount.planck,
])

const tx: SubmittableExtrinsic<any> = useMemo(
() =>
api.tx.utility.batchAll([
(api.tx as any)?.subtensorModule?.addStake?.(delegate, amount.decimalAmount?.planck ?? 0n),
api.tx.system.remarkWithEvent(`talisman-bittensor`),
]),
[api.tx, delegate, amount.decimalAmount?.planck]
)
const extrinsic = useExtrinsic(tx)

const ready = isFeeEstimateReady && (amount.decimalAmount?.planck ?? 0n) > 0n && error === undefined
Expand Down

0 comments on commit 2ee4532

Please sign in to comment.