@vleap/warps-wallet-gaupa
v1.0.0-beta.10
Published
Gaupa wallet provider for multiple chains
Readme
@vleap/warps-wallet-gaupa
Gaupa wallet provider for Warps SDK. This package enables you to use Gaupa agentic wallets with the Warps SDK.
Installation
npm install @vleap/warps-wallet-gaupaPrerequisites
@vleap/warpscore package installed- Appropriate chain adapter package(s) for your target blockchain(s)
- Gaupa API credentials (API key and public key)
Usage
import { createGaupaWalletProvider } from '@vleap/warps-wallet-gaupa'
import { WarpClient } from '@vleap/warps'
import { getAllChainAdapters } from '@vleap/warps-adapter-<chain>'
const config = {
env: 'devnet', // or 'mainnet'
walletProviders: {
<chain>: {
gaupa: createGaupaWalletProvider({
apiKey: 'your-api-key',
publicKey: 'your-public-key',
}),
},
},
}
const client = new WarpClient(config, {
chains: getAllChainAdapters(),
})API
GaupaWalletProvider
Implements the WalletProvider interface from @vleap/warps.
Methods:
getAddress(): Promise<string | null>- Get the wallet address from configurationgetPublicKey(): Promise<string | null>- Derive public key from the wallet addresssignTransaction(tx: Transaction): Promise<Transaction>- Sign a transaction using the Gaupa API'ssign-agentic-messageendpoint. The transaction is serialized as JSON and signed as a message.signMessage(message: string): Promise<string>- Sign a message using the Gaupa APIgenerate(): Promise<WarpWalletDetails>- Create a new agentic wallet via the Gaupa API
Unsupported Methods:
importFromMnemonic()- Not supported. Usegenerate()to create wallets via Gaupa API.importFromPrivateKey()- Not supported. Usegenerate()to create wallets via Gaupa API.export()- Not supported. Private keys are managed by Gaupa and cannot be exported.
How It Works
API Configuration: The API URL is automatically configured based on the environment:
devnet:https://devnet-login.gaupa.xyz/apimainnetor other:https://login.gaupa.xyz/api
Wallet Creation: Use
generate()to create a new agentic wallet via the Gaupa API. The wallet address is stored in your Warps configuration.Transaction Signing: When signing a transaction, the provider:
- Serializes the transaction data as JSON
- Calls the Gaupa API's
sign-agentic-messageendpoint with the serialized transaction - Converts the returned hex signature to a
Uint8Arrayand applies it to the transaction
Message Signing: Messages are signed directly via the
sign-agentic-messageendpoint.
Configuration
The wallet configuration is stored in your Warps config under user.wallets.<chain>:
{
"provider": "gaupa",
"address": "erd1..."
}The address is set automatically when you call generate() or can be configured manually.
