Skip to content

Commit 09c287d

Browse files
author
Your Name
committed
Fix TariL1Signer missing method, squash initialState mutation bug, and refactor state to camelCase
1 parent ec2f915 commit 09c287d

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

clients/tari-l1-signer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ export class TariL1Signer {
188188
})
189189
}
190190

191+
/**
192+
* @description get the wallet session ID
193+
* @returns wallet session ID
194+
*/
195+
public async getAppWalletSession(): Promise<string> {
196+
return this.sendRequest({
197+
methodName: 'getAppWalletSession',
198+
args: [],
199+
})
200+
}
201+
191202
/**
192203
* @description get Tari Account bridge transactions from backend
193204
* @returns Bridge transactions

store/account.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { OpenAPI } from '@tari-project/wxtm-bridge-backend-api'
66

77
interface State {
88
tariAccount?: AccountData
9-
available_balance: number
9+
availableBalance: number
1010
isProcessingTransaction: boolean
1111
pendingBridgeTx?: PendingUserTransaction
1212
pendingBridgeTxFromTU?: BridgeTxDetails
1313
language: string
1414
walletConnectId: string
15-
bridge_api: string
15+
bridgeApi: string
1616
wrapTokenFeePercentageBps: number
1717
tariColdWalletAddress: string
1818
walletConnected: boolean
@@ -35,14 +35,14 @@ const initialState: State = {
3535
account_id: 0,
3636
address: '',
3737
},
38-
available_balance: 0,
38+
availableBalance: 0,
3939
pendingBridgeTx: undefined,
4040
isProcessingTransaction: false,
4141
pendingBridgeTxFromTU: undefined,
4242
language: '',
4343
walletConnectId: '',
4444

45-
bridge_api: '',
45+
bridgeApi: '',
4646
wrapTokenFeePercentageBps: 50, // 0.5% fee
4747
tariColdWalletAddress: '',
4848
walletConnected: false,
@@ -52,10 +52,7 @@ export const useTariAccount = create<OotleWalletStoreState>()((set) => {
5252
// Rehydrate state from localStorage on initial load
5353
let rehydratedConnected = false
5454
if (typeof window !== 'undefined') {
55-
const storedWalletConnected = localStorage.getItem('walletConnected')
56-
if (storedWalletConnected === 'true') {
57-
rehydratedConnected = true
58-
}
55+
rehydratedConnected = localStorage.getItem('walletConnected') === 'true'
5956
}
6057

6158
return {
@@ -79,10 +76,10 @@ export const useTariAccount = create<OotleWalletStoreState>()((set) => {
7976
account_id: account.account_id,
8077
address: account.address,
8178
},
82-
available_balance: balance?.available_balance ?? 0,
79+
availableBalance: balance?.available_balance ?? 0,
8380
language: language,
8481
walletConnectId: envs?.[0] ?? '',
85-
bridge_api: envs?.[1] ?? '',
82+
bridgeApi: envs?.[1] ?? '',
8683
walletConnected: true,
8784
})
8885
localStorage.setItem('walletConnected', 'true')

0 commit comments

Comments
 (0)