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

# fast-sdk

Fast-native account queries, signing, and transactions with @fastxyz/sdk

`@fastxyz/sdk` is the TypeScript SDK for Fast-native operations. The [package README](https://github.com/fastxyz/fast-sdk/blob/main/packages/fast-sdk/README.md) is the API reference for your installed version. EVM ↔ Fast movements belong to [`@fastxyz/allset-sdk`](/sdk-references/core-sdk-execution/allset-sdk.md).

## Install and choose a network

```bash
npm install @fastxyz/sdk
```

```ts
import { FastProvider, Signer, TransactionBuilder } from '@fastxyz/sdk';
import { mainnet, testnet } from '@fastxyz/sdk/networks';

const network = testnet; // change to mainnet for real-value operations
const provider = new FastProvider(network);
```

`FastProvider` uses the proxy **REST** API. The built-in network constants include the URL and network ID; mainnet uses `https://api.fast.xyz/proxy-rest`, while testnet uses `https://testnet.api.fast.xyz/proxy-rest`. The [JSON-RPC API](/api-reference/json-rpc-api.md) is a separate low-level interface, not the transport used by this SDK.

## Build, sign, and submit

```ts
const signer = new Signer(privateKey); // keep this secret out of logs and source control
const sender = await signer.getPublicKey();
const account = await provider.getAccountInfo({ address: sender });

const envelope = await new TransactionBuilder({
  networkId: network.networkId!,
  signer,
  nonce: account.nextNonce,
})
  .addTokenTransfer({ tokenId, recipient, amount: 1000n, userData: null })
  .sign();

const result = await provider.submitTransaction(envelope);
```

The builder does **not** take a provider or automatically fetch a nonce. Fetch the current nonce and select the network explicitly. Multiple operations may be batched in one Fast transaction. Other builders and multisig support are documented in the [package README](https://github.com/fastxyz/fast-sdk/blob/main/packages/fast-sdk/README.md).

If submission times out or the response is lost, do not assume it failed. Reconcile the transaction identity, certificate, account nonce, and any pending multisig proposal before deciding whether to resubmit. A freshly rebuilt transaction can have a different timestamp or nonce and is not a safe substitute for the exact signed envelope.

The SDK also provides account/token queries, Ed25519 message signing, address conversion, and `MultiSigWorkflow`. It does not provide an EVM wallet or a generic bridge. See the [REST reference](/api-reference/rest-api.md) for proxy API documentation.


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fast.xyz/sdk-references/core-sdk-execution/fast-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
