This page covers the direct developer-portal API clients
@swig-wallet/api and @swig-wallet/developer. If you
want the newer prepare-first SDK in
swig-ts/packages/developer-sdk, start with
What the Developer SDK Does.
Treat @swig-wallet/developer as the legacy developer SDK for
existing integrations.When to Use the API
Use the Portal API when:- Creating wallets from a backend service
- Using predefined policies from the Developer Portal
- Leveraging the paymaster for sponsored wallet creation (optional)
- You want to build the transaction server-side but sign and send it client-side
- Managing wallets at scale
- Building client-side applications
- Users control their own keypairs
- You need full control over wallet configuration
- Not using the Developer Portal policies
Prerequisites
Before creating wallets via the API, ensure you have:- An API key created in the Developer Portal
- A policy configured (with or without a signer)
- (Optional) A paymaster public key — see Creating a Paymaster
A paymaster is optional. When you omit
paymasterPubkey, the API returns an unsigned transaction instead of submitting it on-chain. You can then sign and send the transaction yourself. See Creating Without a Paymaster below.Installing a Portal Client
- API SDK
- Legacy SDK
Current Swig Developer SDK
If you are starting a new server-assisted integration, prefer@swig-wallet/developer-sdk over
@swig-wallet/developer.
The current package is prepare-first:
- your server uses an API key
- the server prepares wallet transactions
- the client signs only the required transactions
- your app submits them directly or through a sponsor flow
Specifying the Wallet Authority
When creating a Swig wallet, you need to define the authority (signer) that will control it. There are two ways to do this: Option 1: Using a Signer ID from the Dashboard If you’ve already created a signer in the Developer Portal dashboard (or your policy has one attached), you can reference it by itssignerId. This is the original approach and is useful when you manage signers centrally through the portal.
Option 2: Providing a Wallet Address and Type Directly
You can supply a walletAddress (the public key) and walletType (the authority type) at creation time instead of using a signer ID. This lets you skip creating a signer in the dashboard entirely — useful when your application already knows the user’s public key and authority type.
Provide either
signerId or the walletAddress + walletType pair. When
your policy already has a signer attached and both inputs are omitted, the
policy’s signer is used by default.Supported Wallet Types
When using thewalletAddress + walletType approach, the following types are supported:
Creating a Swig Wallet
Using the REST API
Make a POST request to the wallet creation endpoint:Using a Portal Client
- API SDK
- Legacy SDK
With Wallet Address and Type
You can also provide awalletAddress and walletType directly instead of relying on a signer configured in the dashboard:
- API SDK
- Legacy SDK
Portal Client Comparison
Request Parameters
Required Parameters
Optional Parameters
Response Fields
The response shape depends on whether a paymaster was provided.With Paymaster
Without Paymaster
When no paymaster is used, the expected swig address is still recorded in the Developer Portal database so you can track and manage it through the dashboard.
Creating Without a Paymaster
When you omitpaymasterPubkey, the API builds the create-swig transaction but does not send it. Instead, it returns a base58-encoded serialized VersionedTransaction that you can deserialize, sign, and send yourself.
This is useful when:
- Your users pay their own transaction fees
- You want to collect multiple signatures before sending
- You prefer to manage fee payment directly
Using the REST API (No Paymaster)
Using the SDK (No Paymaster)
- API SDK
- Legacy SDK
Examples
Basic Wallet Creation
- API SDK
- Legacy SDK
With Custom Swig ID
- API SDK
- Legacy SDK
With Signer Override
If your policy doesn’t have a signer attached, or you want to use a different signer from the dashboard:- API SDK
- Legacy SDK
With Wallet Address and Type
Instead of creating a signer in the dashboard and referencing it by ID, you can supply the wallet’s public key and authority type directly at creation time:- API SDK
- Legacy SDK
With Session Authority
For session-based authority types, includemaxDurationSlots to set the session lifetime:
- API SDK
- Legacy SDK
Production Wallet
- API SDK
- Legacy SDK
Error Handling
- API SDK
- Legacy SDK
Common Errors
Complete Example
- API SDK
- Legacy SDK
TypeScript Types
Legacy SDK Types
The legacy@swig-wallet/developer SDK provides higher-level types that automatically reconstruct the transaction:
Comparison: Portal API vs Direct SDK
Next Steps
After creating a wallet, you can:- View the wallet on Solana Explorer
- Sign transactions using the wallet
- Manage authorities to add more signers

