From 8ceb6b4e73b454b77008971ce316228eaafffea2 Mon Sep 17 00:00:00 2001 From: Karolina Kosiorowska Date: Mon, 4 Nov 2024 09:22:51 +0100 Subject: [PATCH] Rename from `builtDataStepCallback` to `dataBuiltStepCallback` --- dapp/src/acre-react/hooks/useInitializeWithdraw.ts | 6 +++--- .../ActiveUnstakingStep/SignMessageModal.tsx | 4 ++-- sdk/src/lib/redeemer-proxy.ts | 10 +++++----- sdk/src/modules/account.ts | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dapp/src/acre-react/hooks/useInitializeWithdraw.ts b/dapp/src/acre-react/hooks/useInitializeWithdraw.ts index 28997a41b..c6863e23d 100644 --- a/dapp/src/acre-react/hooks/useInitializeWithdraw.ts +++ b/dapp/src/acre-react/hooks/useInitializeWithdraw.ts @@ -1,6 +1,6 @@ import { useCallback } from "react" import { - BuiltDataStepCallback, + DataBuiltStepCallback, MessageSignedStepCallback, OnSignMessageStepCallback, } from "@acre-btc/sdk/dist/src/lib/redeemer-proxy" @@ -12,7 +12,7 @@ export default function useInitializeWithdraw() { return useCallback( async ( amount: bigint, - builtDataStepCallback?: BuiltDataStepCallback, + dataBuiltStepCallback?: DataBuiltStepCallback, onSignMessageStep?: OnSignMessageStepCallback, messageSignedStep?: MessageSignedStepCallback, ) => { @@ -20,7 +20,7 @@ export default function useInitializeWithdraw() { return acre.account.initializeWithdrawal( amount, - builtDataStepCallback, + dataBuiltStepCallback, onSignMessageStep, messageSignedStep, ) diff --git a/dapp/src/components/TransactionModal/ActiveUnstakingStep/SignMessageModal.tsx b/dapp/src/components/TransactionModal/ActiveUnstakingStep/SignMessageModal.tsx index 3872e9e4c..3fd8e628b 100644 --- a/dapp/src/components/TransactionModal/ActiveUnstakingStep/SignMessageModal.tsx +++ b/dapp/src/components/TransactionModal/ActiveUnstakingStep/SignMessageModal.tsx @@ -62,7 +62,7 @@ export default function SignMessageModal() { } }, []) - const builtDataStepCallback = useCallback(() => { + const dataBuiltStepCallback = useCallback(() => { setWaitingStatus("built-data") return Promise.resolve() }, []) @@ -103,7 +103,7 @@ export default function SignMessageModal() { const { redemptionKey } = await initializeWithdraw( amount, - builtDataStepCallback, + dataBuiltStepCallback, onSignMessageCallback, ) diff --git a/sdk/src/lib/redeemer-proxy.ts b/sdk/src/lib/redeemer-proxy.ts index ec47d02d6..bb0bb3cf7 100644 --- a/sdk/src/lib/redeemer-proxy.ts +++ b/sdk/src/lib/redeemer-proxy.ts @@ -7,7 +7,7 @@ import { OrangeKitSdk } from "@orangekit/sdk" import { AcreContracts } from "./contracts" import { BitcoinProvider } from "./bitcoin" -export type BuiltDataStepCallback = (safeTxData: Hex) => Promise +export type DataBuiltStepCallback = (safeTxData: Hex) => Promise export type OnSignMessageStepCallback = (messageToSign: string) => Promise export type MessageSignedStepCallback = (signedMessage: string) => Promise @@ -26,7 +26,7 @@ export default class OrangeKitTbtcRedeemerProxy implements TbtcRedeemerProxy { #sharesAmount: bigint - #builtDataStepCallback?: BuiltDataStepCallback + #dataBuiltStepCallback?: DataBuiltStepCallback #onSignMessageStepCallback?: OnSignMessageStepCallback @@ -42,7 +42,7 @@ export default class OrangeKitTbtcRedeemerProxy implements TbtcRedeemerProxy { }, bitcoinProvider: BitcoinProvider, sharesAmount: bigint, - builtDataStepCallback?: BuiltDataStepCallback, + dataBuiltStepCallback?: DataBuiltStepCallback, onSignMessageStepCallback?: OnSignMessageStepCallback, messageSignedStepCallback?: MessageSignedStepCallback, ) { @@ -51,7 +51,7 @@ export default class OrangeKitTbtcRedeemerProxy implements TbtcRedeemerProxy { this.#account = account this.#bitcoinProvider = bitcoinProvider this.#sharesAmount = sharesAmount - this.#builtDataStepCallback = builtDataStepCallback + this.#dataBuiltStepCallback = dataBuiltStepCallback this.#onSignMessageStepCallback = onSignMessageStepCallback this.#messageSignedStepCallback = messageSignedStepCallback } @@ -66,7 +66,7 @@ export default class OrangeKitTbtcRedeemerProxy implements TbtcRedeemerProxy { this.#sharesAmount, redemptionData, ) - await this.#builtDataStepCallback?.(safeTxData) + await this.#dataBuiltStepCallback?.(safeTxData) const transactionHash = await this.#orangeKitSdk.sendTransaction( `0x${this.#contracts.stBTC.getChainIdentifier().identifierHex}`, diff --git a/sdk/src/modules/account.ts b/sdk/src/modules/account.ts index 78b9a86fa..38ddc83ce 100644 --- a/sdk/src/modules/account.ts +++ b/sdk/src/modules/account.ts @@ -6,7 +6,7 @@ import Tbtc from "./tbtc" import AcreSubgraphApi from "../lib/api/AcreSubgraphApi" import { DepositStatus } from "../lib/api/TbtcApi" import OrangeKitTbtcRedeemerProxy, { - BuiltDataStepCallback, + DataBuiltStepCallback, MessageSignedStepCallback, OnSignMessageStepCallback, } from "../lib/redeemer-proxy" @@ -184,7 +184,7 @@ export default class Account { /** * Initializes the withdrawal process. * @param amount Bitcoin amount to withdraw in 1e8 satoshi precision. - * @param builtDataStepCallback A callback triggered after the data + * @param dataBuiltStepCallback A callback triggered after the data * building step. * @param onSignMessageStepCallback A callback triggered before the message * signing step. @@ -194,7 +194,7 @@ export default class Account { */ async initializeWithdrawal( btcAmount: bigint, - builtDataStepCallback?: BuiltDataStepCallback, + dataBuiltStepCallback?: DataBuiltStepCallback, onSignMessageStepCallback?: OnSignMessageStepCallback, messageSignedStepCallback?: MessageSignedStepCallback, ): Promise<{ transactionHash: string; redemptionKey: string }> { @@ -213,7 +213,7 @@ export default class Account { }, this.#bitcoinProvider, shares, - builtDataStepCallback, + dataBuiltStepCallback, onSignMessageStepCallback, messageSignedStepCallback, )