Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
6f4de0d
[skip ci] feat: yield.xyz exploration
gomesalexandre Jan 6, 2026
bfd8e24
feat: add comprehensive Yield.xyz POC implementation plan
gomesalexandre Jan 6, 2026
04619bd
feat: add Yield.xyz foundation (env vars, CSP, types, API, hooks)
gomesalexandre Jan 6, 2026
cce008e
feat: wip
gomesalexandre Jan 6, 2026
fd81d5e
fix: improve Yield.xyz types and filter SKIPPED/CREATED approval steps
gomesalexandre Jan 6, 2026
988df70
wip: wip
gomesalexandre Jan 6, 2026
374ce85
fix: shit
gomesalexandre Jan 6, 2026
412a26f
feat: wip
gomesalexandre Jan 6, 2026
bdee0d8
wip: wip
gomesalexandre Jan 6, 2026
07f2d57
fix: patch yield-xyz provider logo with local image
gomesalexandre Jan 6, 2026
72b633d
feat: add yield filters, tx confirmation polling, and UI improvements
gomesalexandre Jan 6, 2026
659dd71
fix: revert AssetIcon changes that caused nested icon bug
gomesalexandre Jan 6, 2026
5e74f1f
feat: carrot
gomesalexandre Jan 6, 2026
544b651
feat: wip
gomesalexandre Jan 6, 2026
1cf9fd1
feat: visual bits
gomesalexandre Jan 6, 2026
072cc5e
[skip ci] wip: disgusting ai spew wip
gomesalexandre Jan 7, 2026
8862b52
[skip ci] fix: sui staking tx execution and yield detail icon
gomesalexandre Jan 7, 2026
8b93520
[skip ci] fix: revert to base unit amount for yield api
gomesalexandre Jan 7, 2026
2f96d10
[skip ci] wip: sui minimum deposit
gomesalexandre Jan 7, 2026
2b2ece9
[skip ci] feat: add Solana staking support for yield.xyz
gomesalexandre Jan 7, 2026
1b138f3
[skip ci] fix: show yield balances on account page and sum all balanc…
gomesalexandre Jan 7, 2026
8350517
[skip ci] fix: hide duplicate opportunity row when no active positions
gomesalexandre Jan 7, 2026
11dffe3
Merge remote-tracking branch 'origin/develop' into feat_yield
gomesalexandre Jan 7, 2026
fec6eeb
feat: robots review code
gomesalexandre Jan 7, 2026
d934342
Apply yield xyz fixes and cleanup
gomesalexandre Jan 7, 2026
7134897
Follow-up yield xyz adjustments
gomesalexandre Jan 7, 2026
57e4be5
fix: yield xyz query key inconsistencies and related improvements
gomesalexandre Jan 7, 2026
3d71632
refactor: delete unused formatters.ts, replace with Amount component
gomesalexandre Jan 7, 2026
8338e99
fix: yield component refinements and transaction flow hook
gomesalexandre Jan 7, 2026
041ff35
feat: add token name to yields search
gomesalexandre Jan 7, 2026
2e85e56
wip: wip
gomesalexandre Jan 7, 2026
4677e65
fix: add Figment validator address for Monad native staking
gomesalexandre Jan 7, 2026
52f4e71
wip: wip
gomesalexandre Jan 7, 2026
a4e09c9
fix: spacing
gomesalexandre Jan 7, 2026
98778a3
wip: wip
gomesalexandre Jan 7, 2026
2ece99e
feat: wip
gomesalexandre Jan 7, 2026
c1d8a85
chore: save yields page perf optimization attempts as diff for reference
gomesalexandre Jan 7, 2026
c312710
feat: validator breakdown
gomesalexandre Jan 7, 2026
b054c08
feat: normalization
gomesalexandre Jan 7, 2026
f85d171
fix: shit
gomesalexandre Jan 7, 2026
ff00a37
feat: normalize more
gomesalexandre Jan 7, 2026
ebe40fa
feat: even more normalization
gomesalexandre Jan 7, 2026
b1f789b
wip: wip
gomesalexandre Jan 7, 2026
bd6882e
wip: wip
gomesalexandre Jan 7, 2026
b7e172a
feat: wip
gomesalexandre Jan 7, 2026
afc01d3
wip: wip
gomesalexandre Jan 8, 2026
dedef6e
wip: wip
gomesalexandre Jan 8, 2026
a88afd5
feat: cr final
gomesalexandre Jan 8, 2026
8be4d50
fix: yield.xyz claim modal validator fallback, precision amounts, tra…
gomesalexandre Jan 8, 2026
dfe412d
refactor(yields): normalize balance data architecture for O(1) lookups
gomesalexandre Jan 8, 2026
1b1b577
fix(yields): use correct query key for useYield cache lookup
gomesalexandre Jan 8, 2026
bf50af6
[skip ci] wip: wip
gomesalexandre Jan 8, 2026
dd6dbf2
[skip ci] wip: rm cr
gomesalexandre Jan 8, 2026
b14cc3c
feat(AssetAccountDetails): explicitly gate YieldAssetSection behind Y…
gomesalexandre Jan 8, 2026
fbf8b97
refactor(lib/utils): remove dead code isTransactionStatusAdapter
gomesalexandre Jan 8, 2026
e43c4ac
fix(lib/utils): restore isTransactionStatusAdapter (was actually used)
gomesalexandre Jan 8, 2026
76780f9
fix(yields): use context-based account selection and cleanup API
gomesalexandre Jan 8, 2026
6b30286
feat: hyperevm
gomesalexandre Jan 8, 2026
7ed1b99
[skip ci] wip: cleanup
gomesalexandre Jan 8, 2026
0829eaa
[skip ci] wip: wip
gomesalexandre Jan 8, 2026
c3bda92
[skip ci] refactor(YieldDetail): add memo, useMemo, extract memoized …
gomesalexandre Jan 8, 2026
9806a6a
[skip ci] refactor(YieldAssetDetails): add memo, useMemo, useCallback…
gomesalexandre Jan 8, 2026
ad3fa93
[skip ci] refactor(ValidatorBreakdown): add memo, useMemo, useCallbac…
gomesalexandre Jan 8, 2026
eca1a4a
[skip ci] refactor(YieldsList): add memo, useMemo, useCallback, extra…
gomesalexandre Jan 8, 2026
187135e
[skip ci] refactor(Yields): add memo, implicit return
gomesalexandre Jan 8, 2026
af06793
[skip ci] refactor(YieldFilters): add memo, useMemo, useCallback, cle…
gomesalexandre Jan 8, 2026
5cc8b1d
[skip ci] refactor(YieldAssetGroupRow): add memo, useMemo, useCallbac…
gomesalexandre Jan 8, 2026
110a7b7
[skip ci] refactor(YieldActivePositions): add memo, useMemo, useCallb…
gomesalexandre Jan 8, 2026
77e46f9
[skip ci] refactor(YieldAssetSection): add memo, useMemo, useCallback…
gomesalexandre Jan 8, 2026
352cae8
[skip ci] refactor(YieldCard): add memo, useMemo, useCallback, clean …
gomesalexandre Jan 8, 2026
8b44395
[skip ci] refactor(YieldStats): add memo, useMemo, useCallback, clean…
gomesalexandre Jan 8, 2026
ec18dda
[skip ci] refactor(YieldEnterExit): add memo, useMemo, useCallback, c…
gomesalexandre Jan 8, 2026
8c7ed68
[skip ci] refactor(YieldPositionCard): add memo, useMemo, useCallback…
gomesalexandre Jan 8, 2026
b00280e
[skip ci] refactor(YieldOpportunityStats): add memo, useMemo, useCall…
gomesalexandre Jan 8, 2026
aaa03ba
[skip ci] refactor(YieldAssetCard): add memo, useMemo, useCallback, c…
gomesalexandre Jan 8, 2026
de8141e
[skip ci] refactor(YieldValidatorSelectModal): add memo, useMemo, use…
gomesalexandre Jan 8, 2026
bac2c43
[skip ci] refactor(YieldActionModal): add memo, useMemo, useCallback,…
gomesalexandre Jan 8, 2026
d34c044
[skip ci] refactor(YieldViewHelpers): add memo, useMemo, useCallback,…
gomesalexandre Jan 8, 2026
9a913d0
[skip ci] refactor(GradientApy): add memo, useMemo, clean up JSX
gomesalexandre Jan 8, 2026
4bd7b2f
[skip ci] refactor(YieldOpportunityCard): add memo, useMemo, useCallb…
gomesalexandre Jan 8, 2026
095c086
[skip ci] refactor(YieldTable): add memo, useMemo, useCallback, clean…
gomesalexandre Jan 8, 2026
22f96d6
[skip ci] refactor(YieldAccountContext): add memo, useMemo for contex…
gomesalexandre Jan 8, 2026
77835d6
[skip ci] refactor(useYieldOpportunities): add useMemo, useCallback
gomesalexandre Jan 8, 2026
c798386
[skip ci] refactor(useYieldTransactionFlow): add useMemo, useCallback
gomesalexandre Jan 8, 2026
6ac88d9
feat(yields): add NEAR signing, fix EVM nonce, improve validator TVL …
gomesalexandre Jan 8, 2026
c6228a7
merge: resolve conflicts with origin/develop, keep both Yield and Kat…
gomesalexandre Jan 8, 2026
4416ee5
[skip ci] fix(YieldActivePositions): use ReactNode type instead of JS…
gomesalexandre Jan 8, 2026
68b2368
[skip ci] perf(useYields): use push() instead of spread in pagination…
gomesalexandre Jan 8, 2026
c0ece7e
[skip ci] perf(useAllYieldBalances): use Map for O(1) chainId lookup …
gomesalexandre Jan 8, 2026
1c93615
[skip ci] fix: restore yield.xyz feature flags lost in merge
gomesalexandre Jan 8, 2026
cb568e2
fix: flags
gomesalexandre Jan 8, 2026
9fd5ed3
[skip ci] refactor(yieldxyz): extract poll constants and formatYieldT…
gomesalexandre Jan 8, 2026
a0247be
[skip ci] refactor(yieldxyz): extract hardcoded ShapeShift validator …
gomesalexandre Jan 8, 2026
fc6487a
Revert "[skip ci] refactor(yieldxyz): extract hardcoded ShapeShift va…
gomesalexandre Jan 8, 2026
f11f312
[skip ci] refactor(yieldxyz): cleanup - remove docs, add feature flag…
gomesalexandre Jan 8, 2026
03de53b
[skip ci] refactor(yieldxyz): replace forEach/let patterns with funct…
gomesalexandre Jan 8, 2026
f592770
[skip ci] fix(YieldsList): fix positions grid not rendering and remov…
gomesalexandre Jan 8, 2026
648d945
feat(yieldXYZ): add missing successClaim translation
gomesalexandre Jan 8, 2026
fab0c4d
fix(yieldXYZ): move action center notification and query invalidation…
gomesalexandre Jan 8, 2026
d336783
feat: cleanup dead code
gomesalexandre Jan 8, 2026
b8a6885
feat: more normalization
gomesalexandre Jan 8, 2026
3e7d565
refactor: split ValidatorBreakdown into smaller components
gomesalexandre Jan 8, 2026
0d2a359
refactor(yield): normalize data flow and consolidate components (-106…
gomesalexandre Jan 8, 2026
8f9898c
fix(yield): preserve claim amount during transaction and cleanup unus…
gomesalexandre Jan 8, 2026
d55ac12
wip : wip
gomesalexandre Jan 8, 2026
44e4b48
fix(yield): restore SUI gas buffer, improve claim detection, add miss…
gomesalexandre Jan 8, 2026
5a357c8
feat: make @coderabbitai happy, pls resolve
gomesalexandre Jan 8, 2026
4bb0509
feat: make @coderabbitai happy
gomesalexandre Jan 8, 2026
77351bd
fix: lint
gomesalexandre Jan 8, 2026
270ca59
fix: whoopsie
gomesalexandre Jan 8, 2026
94db88b
fix: things @coderabbitai
gomesalexandre Jan 8, 2026
8fc9cca
feat: @coderabbitai you nitty rabbit pls resolve
gomesalexandre Jan 8, 2026
a9d3df9
chore: lint fixes
gomesalexandre Jan 8, 2026
39b2d89
Merge branch 'develop' into feat_yield
gomesalexandre Jan 9, 2026
8476f7a
feat: rm todos
gomesalexandre Jan 9, 2026
764d781
Merge remote-tracking branch 'origin/feat_yield' into feat_yield
gomesalexandre Jan 9, 2026
60baf28
Merge branch 'develop' into feat_yield
gomesalexandre Jan 9, 2026
3afcc5f
Merge branch 'develop' into feat_yield
gomesalexandre Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,12 @@ VITE_FEATURE_PLASMA=true
VITE_HYPEREVM_NODE_URL=https://rpc.hyperliquid.xyz/evm
VITE_FEATURE_HYPEREVM=true
VITE_FEATURE_NEAR=false

# Yield.xyz Feature Flag
VITE_FEATURE_YIELD_XYZ=false

# Yield.xyz API
VITE_YIELD_XYZ_API_KEY=

# Yield.xyz Multi-Account Fetching
VITE_FEATURE_YIELD_MULTI_ACCOUNT=false
Comment on lines +311 to +313

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need those 2 different flags? Might discover later while reviewing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do! Though multi-account isn't implemented at all atm.

6 changes: 6 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,9 @@ VITE_FEATURE_NOTIFICATIONS_WEBSERVICES=true
VITE_FEATURE_WC_DIRECT_CONNECTION=true
VITE_FEATURE_CETUS_SWAP=true
VITE_FEATURE_NEAR=true

# Yield.xyz Feature Flag
VITE_FEATURE_YIELD_XYZ=true

# Yield.xyz API
VITE_YIELD_XYZ_API_KEY=06903960-e442-4870-81eb-03ff3ad4c035
112 changes: 112 additions & 0 deletions COSMOS_STAKING_SPIKE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Cosmos Staking via Yield XYZ - Technical Spike

## Problem

Yield XYZ returns Cosmos transactions as **hex-encoded protobuf** (e.g., `0ab7010a9d010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512760a2d...`), but our `@shapeshiftoss/hdwallet-core` expects **Amino JSON format** for signing.

### Current Error
```
ChainAdapterError: Cannot read properties of undefined (reading 'msg')
```

The adapter's `signAndBroadcastTransaction` expects `txToSign.tx.msg[]` in Amino format, not raw protobuf bytes.

## Yield XYZ Response Example

```json
{
"id": "f5aef598-0987-4a60-9341-9d0be2613e39",
"intent": "enter",
"type": "STAKE",
"yieldId": "cosmos-atom-native-staking",
"transactions": [
{
"id": "68a1648a-7c8c-43f9-9df5-110960148368",
"title": "STAKE Transaction",
"unsignedTransaction": "0ab7010a9d010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512760a2d636f736d6f733161386c33737271796b356b72767a686b743763797a79353279786367687436333232773271791234636f736d6f7376616c6f70657231686a63743671376e707373707367336467767a6b33736466383973706d6c7066646e366d39641a0f0a057561746f6d12063730373036341215766961205374616b654b6974204349442d3130303912680a510a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034d61c87b52901de0969a12d285289bec15b7a7217fe2a03132b469b55f3cb1d112040a02080118e00612130a0d0a057561746f6d12043336323910ef92161a0b636f736d6f736875622d3420f6953a",
"gasEstimate": "{\"amount\":\"0.003629\",\"gasLimit\":\"362863\",\"token\":{...}}"
}
]
}
```

## HDWallet Expected Format

From `@shapeshiftoss/hdwallet-core/dist/cosmos.d.ts`:

```typescript
interface CosmosSignTx {
addressNList: BIP32Path;
tx: Cosmos.StdTx; // <- Amino format
chain_id: string;
account_number: string;
sequence: string;
}

interface StdTx {
msg: Msg[]; // <- Amino messages
fee: StdFee;
signatures: StdSignature[];
memo?: string;
}
```

## Investigation Tasks

1. **Check HDWallet capabilities**
- Review `../shapeshiftHdWallet` repository
- Does hdwallet support `signDirect` (protobuf signing) in addition to `signAmino`?
- Look at `cosmosSignTx` implementation

2. **Protobuf decoding option**
- Can we decode the hex protobuf to extract message types and values?
- Then reconstruct in Amino format?
- Libraries: `@cosmjs/proto-signing`, `cosmjs-types`

3. **Alternative: Build our own transaction**
- Current workaround in `executeTransaction.ts` uses `adapter.buildDelegateTransaction()`
- This bypasses Yield XYZ's pre-built transaction entirely
- Need to pass `cosmosStakeArgs` with validator/amount/action

4. **Yield XYZ API check**
- Does their API support returning Amino format instead of protobuf?
- Contact Yield XYZ support about transaction format options

## Current Workaround

File: `src/lib/yieldxyz/executeTransaction.ts`

We're currently attempting to build the transaction ourselves using the adapter's native methods:

```typescript
const executeCosmosTransaction = async ({ cosmosStakeArgs, ... }) => {
const { txToSign } = await adapter.buildDelegateTransaction({
accountNumber,
wallet,
validator: cosmosStakeArgs.validator,
value: cosmosStakeArgs.amountCryptoBaseUnit,
chainSpecific: { gas, fee },
memo: '',
})

return adapter.signAndBroadcastTransaction({
signTxInput: { txToSign, wallet },
...
})
}
```

This requires passing `cosmosStakeArgs` from `YieldActionModal.tsx`.

## Files to Investigate

- `../shapeshiftHdWallet/packages/hdwallet-core/src/cosmos.ts`
- `../shapeshiftHdWallet/packages/hdwallet-native/src/cosmos.ts`
- `@shapeshiftoss/chain-adapters` cosmos adapter source
- Yield XYZ API docs: https://docs.yield.xyz/docs/cosmos-atom-native-staking

## Related Code

- `src/lib/yieldxyz/executeTransaction.ts` - Transaction execution
- `src/pages/Yields/components/YieldActionModal.tsx` - Modal that initiates transactions
- `src/plugins/cosmos/hooks/useStakingAction/useStakingAction.tsx` - Existing cosmos staking pattern
Loading