Skip to content

Commit f3a3fd1

Browse files
committed
Add support for fast fill hyperliquid demo
1 parent c82a430 commit f3a3fd1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

demo/pages/sdk/actions/fastFill.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ const FastFillPage: NextPage = () => {
103103
tronWeb
104104
)
105105
}
106-
// Note: Hyperliquid support can be added here following a similar pattern
106+
// Note: Hyperliquid wallets are EVM-compatible and handled by the isEthereumWallet path above.
107+
// The SDK automatically converts Hyperliquid transaction steps to signature steps (chain ID 1337).
107108

108109
setAdaptedWallet(wallet)
109110
} catch (e: any) {

demo/utils/createFastFillWallet.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AdaptedWallet, Execute, TransactionStepItem } from '@relayprotocol/relay-sdk'
1+
import type { AdaptedWallet, Execute, SignatureStepItem, TransactionStepItem } from '@relayprotocol/relay-sdk'
22

33
/**
44
* Creates a fast-fill wallet adapter that wraps any AdaptedWallet
@@ -48,6 +48,19 @@ export const createFastFillWallet = (
4848

4949
return {
5050
...originalWallet,
51+
handleSignMessageStep: async (
52+
item: SignatureStepItem,
53+
step: Execute['steps'][0]
54+
) => {
55+
const signature = await originalWallet.handleSignMessageStep(item, step)
56+
57+
// Call fastFill proxy API after Hyperliquid signature deposit
58+
if (step.requestId && step.id === ('hyperliquid-signature' as any)) {
59+
await callFastFillAPI(step.requestId)
60+
}
61+
62+
return signature
63+
},
5164
handleSendTransactionStep: async (
5265
chainId: number,
5366
stepItem: TransactionStepItem,

0 commit comments

Comments
 (0)