Skip to content

Commit

Permalink
settle pnl
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarnadas committed Feb 26, 2024
1 parent ff8c5e2 commit 78b9c25
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function App() {
</Tabs.Root>
) : (
<Callout.Root variant="outline" style={{ alignSelf: 'center' }}>
<Callout.Text>Please insert your Broker ID and Contract Address</Callout.Text>
<Callout.Text>Please insert your Broker ID and Contract Address.</Callout.Text>
</Callout.Root>
)}
</Flex>
Expand Down
14 changes: 8 additions & 6 deletions src/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
getVaultAddress,
delegateDeposit,
delegateWithdraw,
getClientHolding
getClientHolding,
delegateSettlePnL
} from './helpers';

export const Assets: FC<{
Expand Down Expand Up @@ -227,21 +228,22 @@ export const Assets: FC<{
Withdraw from Contract
</Button>

{/* <Button
disabled={!delegateSigner || !wallet || !connectedChain || !brokerId || !orderlyKey}
<Button
disabled={!wallet || !connectedChain || !brokerId || !orderlyKey}
onClick={async () => {
if (!delegateSigner || !wallet || !connectedChain || !brokerId || !orderlyKey) return;
if (!wallet || !connectedChain || !brokerId || !orderlyKey) return;
await delegateSettlePnL(
wallet,
connectedChain.id,
brokerId,
delegateSigner.account_id,
contractAddress,
accountId,
orderlyKey
);
}}
>
Settle Delegate PnL
</Button> */}
</Button>
</Flex>
</Flex>
);
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ export async function delegateSettlePnL(
body: JSON.stringify({
message: delegateSettlePnLMessage,
signature,
userAddress: wallet.accounts[0].address
userAddress: wallet.accounts[0].address,
verifyingContract: getVerifyingAddress(chainId)
})
}
);
Expand Down

0 comments on commit 78b9c25

Please sign in to comment.