# Solana Transaction Builder

## POST /solana/nest/mint/build-tx

> Returns a base64 transaction to initiate a Nest vault mint. Deposits USDC from Solana to mint Nest share tokens, which are delivered to the receiver's Solana wallet. \
> \
> The transaction includes: (1) Creating the receiver's Nest share token ATA if it doesn't exist, (2) Creating the CCTP MessageSent event data account (rent funded by Nest keeper), (3) CCTP depositForBurn instruction to bridge USDC to Plume. \
> \
> On Plume, the NestVaultComposer receives the USDC, mints vault shares, and sends them back to the receiver via LayerZero OFT. The transaction is pre-signed by the Nest keeper; the caller only needs to sign with the receiver wallet and broadcast.

```json
{"openapi":"3.0.0","info":{"title":"Nest API","version":"1.0.0"},"servers":[{"url":"https://api.nest.credit/v1","description":"Nest API Server"}],"paths":{"/solana/nest/mint/build-tx":{"post":{"tags":["Solana Transaction Builder"],"description":"Returns a base64 transaction to initiate a Nest vault mint. Deposits USDC from Solana to mint Nest share tokens, which are delivered to the receiver's Solana wallet. \n\nThe transaction includes: (1) Creating the receiver's Nest share token ATA if it doesn't exist, (2) Creating the CCTP MessageSent event data account (rent funded by Nest keeper), (3) CCTP depositForBurn instruction to bridge USDC to Plume. \n\nOn Plume, the NestVaultComposer receives the USDC, mints vault shares, and sends them back to the receiver via LayerZero OFT. The transaction is pre-signed by the Nest keeper; the caller only needs to sign with the receiver wallet and broadcast.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rawAmountUsdc":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Amount of USDC to deposit, in raw base units (6 decimals). For example, 1000000 (1e6) represents 1.0 USDC."},"amountUsdc":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"DEPRECATED: Use rawAmountUsdc instead. Amount of USDC in raw base units (6 decimals).","deprecated":true},"finality":{"type":"string","enum":["fast","standard"],"default":"standard","description":"CCTP finality mode. 'fast' (~1-2 min) has higher fees, 'standard' (~15 min) has lower fees."},"nestVaultSlug":{"type":"string","description":"Slug identifying the Nest vault. Valid options: nest-alpha-vault, nest-treasury-vault, nest-basis-vault, nest-wisdom-vault, nest-opal-vault, nest-test-vault, nest-scope-vault, nest-lcrd-vault, nest-perena-vault."},"receiver":{"type":"string","minLength":1,"description":"Base58-encoded Solana public key of the user who will receive the minted Nest share tokens and pay the transaction fees."},"priorityFee":{"type":"string","enum":["low","medium","high"],"description":"Optional dynamic priority fee level. The API fetches recent prioritization fees for all transaction accounts and selects low/median/high."},"priorityFeeMaxLamports":{"type":"integer","minimum":0,"description":"Optional maximum total priority fee in lamports. If provided, it takes precedence over priorityFee."}},"required":["nestVaultSlug","receiver"]}}}},"responses":{"200":{"description":"Transaction built successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"txBase64":{"type":"string","minLength":1,"description":"Base64-encoded Solana VersionedTransaction ready for signing. The caller must sign this transaction with the receiver wallet and broadcast it to the Solana network."}},"required":["txBase64"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Receiver wallet failed compliance check","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}
```

## POST /solana/nest/redeem/build-tx

> Returns a base64 transaction to initiate a Nest vault redeem for USDC. \
> \
> Under the hood, this builds a LayerZero OFT send transaction that transfers Nest shares to the vault's NestVaultComposer contract on Plume, which processes the redemption and returns USDC via CCTP bridge. \
> \
> The transaction must be signed and sent by the caller's wallet.

```json
{"openapi":"3.0.0","info":{"title":"Nest API","version":"1.0.0"},"servers":[{"url":"https://api.nest.credit/v1","description":"Nest API Server"}],"paths":{"/solana/nest/redeem/build-tx":{"post":{"tags":["Solana Transaction Builder"],"description":"Returns a base64 transaction to initiate a Nest vault redeem for USDC. \n\nUnder the hood, this builds a LayerZero OFT send transaction that transfers Nest shares to the vault's NestVaultComposer contract on Plume, which processes the redemption and returns USDC via CCTP bridge. \n\nThe transaction must be signed and sent by the caller's wallet.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rawAmountNestToken":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Amount of Nest share tokens to redeem, in raw base units (6 decimals). For example, 1000000 (1e6) represents 1.0 Nest share token."},"amountNest":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"DEPRECATED: Use rawAmountNestToken instead. Amount of Nest shares in raw base units (6 decimals).","deprecated":true},"nestVaultSlug":{"type":"string","description":"Slug identifying the Nest vault. Valid options: nest-alpha-vault, nest-treasury-vault, nest-basis-vault, nest-wisdom-vault, nest-opal-vault, nest-test-vault, nest-scope-vault, nest-lcrd-vault, nest-perena-vault."},"owner":{"type":"string","minLength":1,"description":"Base58-encoded Solana public key of the user who owns the Nest share tokens and will pay the transaction fees."},"dstEid":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"DEPRECATED: This field is ignored. Destination is always Plume mainnet.","deprecated":true},"priorityFee":{"type":"string","enum":["low","medium","high"],"description":"Optional dynamic priority fee level. The API fetches recent prioritization fees for all transaction accounts and selects low/median/high."},"priorityFeeMaxLamports":{"type":"integer","minimum":0,"description":"Optional maximum total priority fee in lamports. If provided, it takes precedence over priorityFee."}},"required":["nestVaultSlug","owner"]}}}},"responses":{"200":{"description":"Transaction built successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"txBase64":{"type":"string","minLength":1,"description":"Base64-encoded Solana VersionedTransaction ready for signing. The caller must sign this transaction with the owner wallet and broadcast it to the Solana network."}},"required":["txBase64"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}
```


---

# Agent Instructions: 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.nest.credit/developers/api/solana-transaction-builder.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.
