> For the complete documentation index, see [llms.txt](https://docs.valantis.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valantis.xyz/prime/integration.md).

# For Builder Code Apps

This page describes how Builder Code Applications and Trading Terminals can integrate Valantis Prime for API wallet trading from [LST-Staking Discount HyperCore Accounts](/prime/discounts.md) to enable your user's to access lower fees, and [Customize User HyperCore Account Permissions](/prime/developers/hypercore-connector.md) to build better UX and security in your application.

### Allowing Smart Contract Account Imports

Most HyperCore Trading Applications already support Valantis Prime. The criteria is simple:

**There must be a way to import an API wallet capable of trading, without needing to sign a message from the parent account.**

The parent account is unable to sign a transaction or a message, since it is a smart contract. Instead- the parent account interacts through HyperCore via CoreWriter and API wallets.

For example, Valantis Prime is fully compatible with Hyperliquid.xyz QR code login method.

<figure><img src="/files/Bb8LIDGNkReRx8UzU99w" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IJjgiMbip6TobrHP9rck" alt=""><figcaption></figcaption></figure>

Hyperliquid.xyz QR code login method allows Builder Code's to import: `Parent Account Address` and `API Wallet Private Key` Without strictly requiring a signature from the Parent Account.

If your application uses a custom QR code method to handle API wallet logins, we will be able to support it natively on Valantis Prime tooling- please reach out to us.

For desktop applications, there are several valid authentication flows

#### Allowing a user to paste credentials (user imports API wallet)

`HyperCore Account Address:`

`API Wallet Private Key:`

> Valantis tooling will enable the user to generate & approve an API wallet address externally.

#### Prompting user to approve a pre-generated API wallet address (generate new API wallet)

Paste `HyperCore Account Address:`

Approve API wallet: `{0xAppGeneratedAPIWalletAddress}`

> Valantis tooling will enable the user to approve a pre-generated API wallet address using CoreWriter externally.

It's important for builder code apps that already prompt user's for API wallet approvals do not require/expect user signature before proceeding. Instead, querying Hyperliquid API to check if the API wallet has been approved should allow them to proceed, as they can approve via CoreWriter externally with Valantis tooling:

```
curl -X POST https://api.hyperliquid.xyz/info \                                                                                 
    -H "Content-Type: application/json" \                                                                                         
    -d '{"type": "extraAgents", "user": "<HYPERCORE_ACCOUNT_ADDRESS>"}'
```

Valantis Prime user's are able to approve the exact agent address, name, and expiry that your application expects or needs.

#### Allowing a user to connect a pre-approved API wallet via Browser Wallet

Paste `HyperCore Account Address:`

`Connect API wallet via Browser Wallet`

This solution is not compatible with session signatures, since the user retains custody of the API wallet private key in a self-custody browser wallet.

### Builder Code Signature

Most frontends require that user's approve the builder code of their application to proceed with login. API wallets cannot sign builder code approvals.

Valantis Prime approves Builder Codes through CoreWriter.

For integrators who apply Builder Codes on user trades, this means: *Do not force/expect the Parent Account to approve the Builder Code in your UI, instead check check if the parent account has approved your Builder Code with the appropriate commands before prompting for a Parent Account signature*. This allows accounts to approve your builder code externally.

Example API query to check Builder Code state of Parent Account

```
curl -s -X POST https://api.hyperliquid.xyz/info -H "Content-Type: application/json" -d '{"type":"maxBuilderFee","user":"{Parent Account Address}","builder":"{Builder Code Address}}"}'
```

This will tell you if the user has already approved your Builder Code with the appropriate `maxBuilderFee`.

In practice, Valantis will host tooling for user's to simply approve the Builder Code of popular Builder Apps- reach out for an integration. Optionally, Builder Code Apps are welcome to support the flow for Builder Approval on Valantis Prime directly in their user interface, but it is not required for a successful integration.

### Terms & Service Signature

Smart contracts are not able to sign messages directly. If you wish to collect T\&C signatures from Valantis Prime User's:

**Option 1**: Allow a valid API wallet to accept the T\&C on behalf of the Parent Account. **Option 2**: Integrate EIP-1271; allowing the Parent Account to sign T\&C messages through `isValidSignature` function.

***

## Improving UX with Valantis Prime

Valantis Prime allows any HyperCore User Signed Action to become accessible to an Agent Wallet/Session Key. This requires a one-time signature from the user, and apply any restrictions to the API wallets capabilities over the action.

The first use case we are building is whitelisted transfers- where an API wallet can call `Spot send` through CoreWriter if and only if `destination` is an address which the owner has pre-approved through an EVM transaction (onchain whitelist on HyperEVM).

The design space for abstracting away user signed actions through Valantis Prime can be better understood through the [HyperCore Connector Actions](/prime/developers/hypercore-connector.md) and [Guardian Transaction Policies](/prime/developers/architecture.md). Interacting with the Account on EVM and basic outline of SDK methods can be reviewed at [Account Documentation](/prime/developers/account.md).

Please reach out for support on your unique use case.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valantis.xyz/prime/integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
