Account
useAccountInstance
Software Development Kits
[EVM] React Components SDK
- Overview
- Getting started
- Theming
- Wallet connect
- Framework Guides
- Page Components
- Block Components
[EVM] React Hooks SDK
[EVM] Core SDK
[EVM] Perp SDK
Account
useAccountInstance
Get Account
singleton, that can be used to e.g. register an account or create a new Orderly key.
Example
const account = useAccountInstance();
return (
<>
<div>Connected address: {account.address}</div>
<div>Connected chain: {account.chainId}</div>
<button onClick={account.createAccount}>Register</button>
<button
onClick={() => {
account.createOrderlyKey(365);
}}
>
Create Orderly Key
</button>
<button onClick={account.settle}>Settle PnL</button>
</>
);
On this page