Skip to content
Merged
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion packages/chain-adapters/src/sui/SuiChainAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
ValidAddressResult,
} from '../types'
import { ChainAdapterDisplayName, ValidAddressResultType } from '../types'
import { toAddressNList } from '../utils'
import { toAddressNList, verifyLedgerAppOpen } from '../utils'

export interface ChainAdapterArgs {
rpcUrl: string
Expand Down Expand Up @@ -100,6 +100,8 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.SuiMainnet> {
if (!wallet) throw new Error('wallet is required')
this.assertSupportsChain(wallet)

await verifyLedgerAppOpen(this.chainId, wallet)

const address = await wallet.suiGetAddress({
addressNList: toAddressNList(this.getBip44Params({ accountNumber })),
showDisplay: showOnDevice,
Expand Down Expand Up @@ -320,6 +322,8 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.SuiMainnet> {
if (!wallet) throw new Error('wallet is required')
this.assertSupportsChain(wallet)

await verifyLedgerAppOpen(this.chainId, wallet)

const signedTx = await wallet.suiSignTx(txToSign)

if (!signedTx?.signature || !signedTx?.publicKey) {
Expand Down Expand Up @@ -349,6 +353,8 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.SuiMainnet> {
if (!wallet) throw new Error('wallet is required')
this.assertSupportsChain(wallet)

await verifyLedgerAppOpen(this.chainId, wallet)

const signedTx = await wallet.suiSignTx(txToSign)

if (!signedTx?.signature || !signedTx?.publicKey) {
Expand Down