diff --git a/.changeset/social-pandas-wait.md b/.changeset/social-pandas-wait.md new file mode 100644 index 00000000..7c781e65 --- /dev/null +++ b/.changeset/social-pandas-wait.md @@ -0,0 +1,5 @@ +--- +"@stakekit/widget": patch +--- + +feat: enriched tx diff --git a/packages/widget/package.json b/packages/widget/package.json index 3dbedd06..f3efab1a 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -71,7 +71,7 @@ "@radix-ui/react-visually-hidden": "^1.2.3", "@safe-global/safe-apps-provider": "^0.18.6", "@safe-global/safe-apps-sdk": "^9.1.0", - "@stakekit/api-hooks": "0.0.101", + "@stakekit/api-hooks": "0.0.102", "@stakekit/common": "^0.0.49", "@stakekit/rainbowkit": "^2.2.5", "@tanstack/react-query": "^5.76.1", diff --git a/packages/widget/src/domain/types/wallets/generic-wallet.ts b/packages/widget/src/domain/types/wallets/generic-wallet.ts index ef5a5619..084496e5 100644 --- a/packages/widget/src/domain/types/wallets/generic-wallet.ts +++ b/packages/widget/src/domain/types/wallets/generic-wallet.ts @@ -50,7 +50,7 @@ export type ActionMeta = { export type SKTxMeta = ActionMeta & { txId: TransactionDto["id"]; txType: TransactionDto["type"]; -}; +} & Pick; export type SKWallet = { signMessage: (message: string) => Promise; diff --git a/packages/widget/src/pages/steps/hooks/use-steps-machine.hook.ts b/packages/widget/src/pages/steps/hooks/use-steps-machine.hook.ts index 80cff55d..624e8aac 100644 --- a/packages/widget/src/pages/steps/hooks/use-steps-machine.hook.ts +++ b/packages/widget/src/pages/steps/hooks/use-steps-machine.hook.ts @@ -303,6 +303,10 @@ const getMachine = ( ...ref.current.actionMeta, txId: constructedTx.id, txType: constructedTx.type, + annotatedTransaction: + constructedTx.annotatedTransaction, + structuredTransaction: + constructedTx.structuredTransaction, }, network: constructedTx.network, }) diff --git a/packages/widget/tests/use-cases/referral-flow/setup.ts b/packages/widget/tests/use-cases/referral-flow/setup.ts index 9510152a..2c3a2c88 100644 --- a/packages/widget/tests/use-cases/referral-flow/setup.ts +++ b/packages/widget/tests/use-cases/referral-flow/setup.ts @@ -59,6 +59,7 @@ export const setup = () => { }, }, }, + feeConfigurations: [], id: "avalanche-avax-liquid-staking", token, tokens: [token], diff --git a/packages/widget/tests/use-cases/sk-wallet.test.tsx b/packages/widget/tests/use-cases/sk-wallet.test.tsx index 953539ff..34e2c2b4 100644 --- a/packages/widget/tests/use-cases/sk-wallet.test.tsx +++ b/packages/widget/tests/use-cases/sk-wallet.test.tsx @@ -79,6 +79,8 @@ describe("SK Wallet", () => { name: "", network: "solana", }, + structuredTransaction: null, + annotatedTransaction: null, providersDetails: [], }, ledgerHwAppId: null, @@ -106,6 +108,8 @@ describe("SK Wallet", () => { name: "", network: "solana", }, + structuredTransaction: null, + annotatedTransaction: null, providersDetails: [], } ); @@ -153,6 +157,8 @@ describe("SK Wallet", () => { name: "", network: "ton", }, + structuredTransaction: null, + annotatedTransaction: null, providersDetails: [], }, ledgerHwAppId: null, @@ -180,6 +186,8 @@ describe("SK Wallet", () => { name: "", network: "ton", }, + structuredTransaction: null, + annotatedTransaction: null, providersDetails: [], } ); diff --git a/packages/widget/tests/use-cases/staking-flow/setup.ts b/packages/widget/tests/use-cases/staking-flow/setup.ts index 9a6f6431..0ca95403 100644 --- a/packages/widget/tests/use-cases/staking-flow/setup.ts +++ b/packages/widget/tests/use-cases/staking-flow/setup.ts @@ -29,6 +29,7 @@ export const setup = async () => { apy: 0.05863407069791653, rewardRate: 0.05863407069791653, rewardType: "apy", + feeConfigurations: [], args: { enter: { addresses: { @@ -151,6 +152,8 @@ export const setup = async () => { isMessage: false, broadcastedAt: null, createdAt: "2023-12-28T14:36:21.700Z", + annotatedTransaction: null, + structuredTransaction: null, }, ], addresses: null as unknown as AddressesDto, @@ -167,6 +170,8 @@ export const setup = async () => { '{"from":"0xB6c5273e79E2aDD234EBC07d87F3824e0f94B2F7","gasLimit":"56572","value":"10000000000000000","to":"0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be","data":"0x5bcb2fc6","nonce":122,"type":2,"maxFeePerGas":"50000000000","maxPriorityFeePerGas":"0","chainId":43114}', stepIndex: 0, error: null, + annotatedTransaction: null, + structuredTransaction: null, gasEstimate: { amount: "0.002828600000000000", gasLimit: "56572", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adc7c542..3eb0a615 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,8 +185,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.20) '@stakekit/api-hooks': - specifier: 0.0.101 - version: 0.0.101(@faker-js/faker@9.8.0)(@tanstack/react-query@5.76.1(react@19.1.0))(msw@2.8.4(@types/node@22.15.21)(typescript@5.8.3))(react@19.1.0) + specifier: 0.0.102 + version: 0.0.102(@faker-js/faker@9.8.0)(@tanstack/react-query@5.76.1(react@19.1.0))(msw@2.8.4(@types/node@22.15.21)(typescript@5.8.3))(react@19.1.0) '@stakekit/common': specifier: ^0.0.49 version: 0.0.49 @@ -2543,8 +2543,8 @@ packages: '@stacks/transactions@6.17.0': resolution: {integrity: sha512-FUah2BRgV66ApLcEXGNGhwyFTRXqX5Zco3LpiM3essw8PF0NQlHwwdPgtDko5RfrJl3LhGXXe/30nwsfNnB3+g==} - '@stakekit/api-hooks@0.0.101': - resolution: {integrity: sha512-h55QZEmG7QC9P5TOybrH9j8uX+JpKf8VQrTQS6/1uYh7ZLUu3YZNTliaY5JVk8JRyoqXXBH58SVP4Ve+tCSr0Q==} + '@stakekit/api-hooks@0.0.102': + resolution: {integrity: sha512-TUtO94bF/0KMMFXC1nC7rAJmUpN8TDBRlRYthX9XeVScVaiE+U+hLIhLtZLbPHixPZwETd2S2B19Y86zzJnrAQ==} peerDependencies: '@faker-js/faker': ^9 '@tanstack/react-query': '>=5' @@ -9554,7 +9554,7 @@ snapshots: transitivePeerDependencies: - encoding - '@stakekit/api-hooks@0.0.101(@faker-js/faker@9.8.0)(@tanstack/react-query@5.76.1(react@19.1.0))(msw@2.8.4(@types/node@22.15.21)(typescript@5.8.3))(react@19.1.0)': + '@stakekit/api-hooks@0.0.102(@faker-js/faker@9.8.0)(@tanstack/react-query@5.76.1(react@19.1.0))(msw@2.8.4(@types/node@22.15.21)(typescript@5.8.3))(react@19.1.0)': dependencies: react: 19.1.0 optionalDependencies: