You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/smart-accounts/guides/typescript-viem/01-state-lookup.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ import YouTubeEmbed from "@site/src/components/YouTubeEmbed";
23
23
In this guide, you will learn how to get the following using the Viem TypeScript library:
24
24
25
25
- the Flare address that corresponds to an XRPL account
26
+
- whether a Flare address is a smart account
26
27
- the total value of FXRP that belongs to a personal account tied to an XRPL address
27
28
- a list of all the registered vaults
28
29
- the total value of FXRP of a personal account, in each of the registered vaults
@@ -131,6 +132,33 @@ export async function getContractAddressByName(name: string) {
131
132
}
132
133
```
133
134
135
+
## Checking if a Flare address is a smart account
136
+
137
+
A Flare address is a smart account (PersonalAccount) if calling the `xrplOwner()`functionon it returns an XRPL account using the [`IPersonalAccount`](/smart-accounts/reference/IPersonalAccount) interface.
138
+
The `PersonalAccount` contract exposes the `xrplOwner()`function— the XRPL address that controls it.
139
+
If the call succeeds and returns a non-empty and valid XRPL address, the address is a smart account.
Copy file name to clipboardExpand all lines: docs/smart-accounts/reference/IPersonalAccount.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,11 @@ Returns the XRPL owner address associated with this personal account.
21
21
function xrplOwner() external view returns (string memory);
22
22
```
23
23
24
+
:::tip Smart account detection
25
+
If a contract at a given Flare address returns an XRPL account when the `xrplOwner()` function is called, then it is a smart account.
26
+
Use this to [detect whether an arbitrary Flare address is a smart account](/smart-accounts/guides/typescript-viem/state-lookup-ts#checking-if-a-flare-address-is-a-smart-account).
27
+
:::
28
+
24
29
### `controllerAddress`
25
30
26
31
Returns the `MasterAccountController` address that manages this personal account.
0 commit comments