Dragon Wallets API Reference
Version 0.8.4 (Beta)The Dragon Wallets API provides a blockchain-secure identity framework and financial operations platform with phi-resonant vector-based transactions and secure token authentication.
Overview
Dragon Wallets provides a sophisticated digital identity and financial transaction framework built on DragonFire's mathematical foundation. Unlike traditional wallet systems, Dragon Wallets uses phi-resonant vector pathways for transactions and integrates with RWT tokens for seamless authentication.
Key Features
- Vector Transactions: Phi-resonant transaction routes for optimized processing
- Digital Identity: Blockchain-secured identity framework with multi-dimensional profiles
- RWT Integration: Secure authentication using Rotational WebSockets tokens
- Phi-Resonant Security: Security based on mathematical constants
- Layer 1 Foundation: Foundation layer for financial operations across DragonFire services
Wallet Architecture
Client SDK Requirements
To use the Dragon Wallets API, you'll need the DragonFire Wallet Client SDK:
# Using npm
npm install @dragonfire/wallet-client
# Using yarn
yarn add @dragonfire/wallet-client
Authentication
Dragon Wallets uses a specialized authentication system that integrates with DragonFire's RWT (Rotational WebSockets) protocol.
Wallet Client Authentication
WalletClient Authentication
Authenticates with Dragon Wallets using secure credentials and establishes a secure connection.
Syntax
constructor(dragonfire: DragonFireClient, options?: WalletClientOptions)
Parameters
Name | Type | Description |
---|---|---|
dragonfire | DragonFireClient | An initialized and connected DragonFire client instance. |
options | WalletClientOptions | Optional. Configuration options for the wallet client. |
Example
import { DragonFireClient } from '@dragonfire/client';
import { WalletClient } from '@dragonfire/wallet-client';
// Initialize DragonFire client
const dragonfire = new DragonFireClient({
apiKey: 'YOUR_API_KEY',
region: 'us-west'
});
await dragonfire.connect();
// Initialize wallet client
const wallet = new WalletClient(dragonfire, {
securityLevel: 'high', // Security level for wallet operations
vectorDimension: 7, // Vector space dimension for transactions
autoBackup: true, // Enable automatic wallet backups
identityVerification: true // Enable advanced identity verification
});
RWT Token Authentication
Dragon Wallets uses RWT tokens for secure authentication of wallet operations:
// Get wallet authentication token
const authToken = await wallet.getAuthToken();
// Use token for sensitive operations
const result = await wallet.authenticatedOperation(operation, {
token: authToken,
parameters: {
// Operation parameters
}
});
Unwrapping RWT Tokens
For wallet authentication of third-party services, the API provides token unwrapping functionality:
unwrapToken()
Unwraps and verifies a private RWT token for third-party authentication.
Syntax
async unwrapToken(wrappedToken: string, options?: UnwrapOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
wrappedToken | string | The wrapped RWT token to verify. |
options | UnwrapOptions | Optional. Additional options for token unwrapping. |
Returns
A Promise that resolves to a TokenVerificationResult object with token verification information.
Example
// Verify a wrapped token
const verification = await wallet.unwrapToken(wrappedToken, {
service: 'payment-gateway', // Service requesting verification
permissions: ['transaction'], // Required permissions
strictValidation: true // Strict validation mode
});
if (verification.valid) {
console.log('Token verified successfully');
console.log('User ID:', verification.userId);
console.log('Permissions:', verification.permissions);
console.log('Expires in:', verification.expiresIn, 'ms');
// Proceed with authenticated operation
// ...
} else {
console.error('Token verification failed:', verification.reason);
}
Wallet Management
Dragon Wallets provides comprehensive wallet management capabilities for creating, importing, and managing digital wallets.
Creating a Wallet
createWallet()
Creates a new Dragon Wallet with the specified configuration.
Syntax
async createWallet(options?: CreateWalletOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
options | CreateWalletOptions | Optional. Configuration options for the new wallet. |
Returns
A Promise that resolves to a WalletInfo object with information about the created wallet.
Example
// Create a new wallet
const walletInfo = await wallet.createWallet({
name: 'Primary Wallet', // Wallet name
securityLevel: 'high', // Security level
backupMethod: 'cloud', // Backup method
recoveryOptions: { // Recovery options
email: 'user@example.com',
phoneNumber: '+1234567890'
},
attributes: { // Custom attributes
purpose: 'personal',
limit: 1000
}
});
console.log('Wallet created successfully');
console.log('Wallet ID:', walletInfo.id);
console.log('Address:', walletInfo.address);
console.log('Creation date:', new Date(walletInfo.createdAt));
console.log('Backup status:', walletInfo.backupStatus);
// Save recovery phrase securely
console.log('IMPORTANT: Save your recovery phrase securely:');
console.log(walletInfo.recoveryPhrase);
Importing a Wallet
importWallet()
Imports an existing wallet using a recovery phrase or private key.
Syntax
async importWallet(importData: WalletImportData, options?: ImportOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
importData | WalletImportData | Data required to import the wallet (recovery phrase or private key). |
options | ImportOptions | Optional. Additional options for the import operation. |
Returns
A Promise that resolves to a WalletInfo object with information about the imported wallet.
Example
// Import wallet using recovery phrase
const importedWallet = await wallet.importWallet({
recoveryPhrase: 'dragon fire quantum space vector phi golden ratio harmony',
walletName: 'Imported Wallet'
}, {
restoreIdentity: true, // Restore associated identity
overwriteExisting: false, // Don't overwrite existing wallet
validateBeforeImport: true // Validate recovery phrase before import
});
console.log('Wallet imported successfully');
console.log('Wallet ID:', importedWallet.id);
console.log('Address:', importedWallet.address);
console.log('Balance:', importedWallet.balance);
Getting Wallet Information
getWalletInfo()
Retrieves detailed information about a wallet.
Syntax
async getWalletInfo(walletId?: string, options?: InfoOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
walletId | string | Optional. The ID of the wallet to retrieve information for. If not provided, returns information for the active wallet. |
options | InfoOptions | Optional. Additional options for the information retrieval. |
Returns
A Promise that resolves to a WalletInfo object with detailed information about the wallet.
Example
// Get information about the active wallet
const walletInfo = await wallet.getWalletInfo(null, {
includeBalance: true, // Include balance information
includeTransactions: true, // Include recent transactions
includeIdentity: true, // Include identity information
transactionLimit: 10 // Limit to 10 most recent transactions
});
console.log('Wallet information:');
console.log('ID:', walletInfo.id);
console.log('Name:', walletInfo.name);
console.log('Address:', walletInfo.address);
console.log('Balance:', walletInfo.balance);
console.log('Currency:', walletInfo.currency);
console.log('Status:', walletInfo.status);
console.log('Created:', new Date(walletInfo.createdAt));
console.log('Last accessed:', new Date(walletInfo.lastAccessedAt));
console.log('Security level:', walletInfo.securityLevel);
console.log('Backup status:', walletInfo.backupStatus);
if (walletInfo.transactions) {
console.log('Recent transactions:');
walletInfo.transactions.forEach(tx => {
console.log(`- ${tx.id}: ${tx.type} ${tx.amount} ${tx.currency}`);
console.log(` Status: ${tx.status}, Date: ${new Date(tx.timestamp)}`);
});
}
Vector Transactions
Dragon Wallets uses a unique vector-based transaction system that optimizes transaction routes based on mathematical patterns.
Creating a Transaction
createTransaction()
Creates a new vector-based transaction.
Syntax
async createTransaction(transaction: TransactionData, options?: TransactionOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
transaction | TransactionData | Data for the transaction to create. |
options | TransactionOptions | Optional. Additional options for the transaction. |
Returns
A Promise that resolves to a TransactionResult object with information about the created transaction.
Example
// Create a vector transaction
const result = await wallet.createTransaction({
recipient: 'wallet_789', // Recipient wallet ID or address
amount: 50.75, // Transaction amount
currency: 'USD', // Currency code
memo: 'Payment for services' // Transaction memo
}, {
priority: 'high', // Transaction priority
vectorRouting: 'phi', // Vector routing pattern
maxFee: 1.5, // Maximum fee allowed
timeout: 30000, // Transaction timeout (ms)
securityLevel: 'high' // Security level for transaction
});
console.log('Transaction created:');
console.log('Transaction ID:', result.transactionId);
console.log('Status:', result.status);
console.log('Timestamp:', new Date(result.timestamp));
console.log('Fee:', result.fee);
console.log('Confirmations required:', result.confirmationsRequired);
console.log('Estimated completion time:', new Date(result.estimatedCompletionTime));
Vector Routing Patterns
Dragon Wallets supports different vector routing patterns for optimizing transactions:
Pattern | Mathematical Basis | Optimal Use Case |
---|---|---|
phi | Golden Ratio (φ = 1.618...) | General purpose, balanced performance (default) |
pi | Pi (π = 3.14159...) | Cyclical transactions, recurring payments |
sqrt2 | Square Root of 2 (√2 = 1.414...) | High-throughput transactions, binary splits |
sqrt3 | Square Root of 3 (√3 = 1.732...) | Multi-party transactions, triangulation |
e | Euler's Number (e = 2.718...) | Growth-based transactions, compound interest |
Getting Transaction Status
getTransactionStatus()
Retrieves the current status of a transaction.
Syntax
async getTransactionStatus(transactionId: string, options?: StatusOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
transactionId | string | The ID of the transaction to check. |
options | StatusOptions | Optional. Additional options for the status check. |
Returns
A Promise that resolves to a TransactionStatus object with the current status information.
Example
// Check transaction status
const status = await wallet.getTransactionStatus('tx_123456789', {
includeVectorPath: true, // Include vector path information
includeHistory: true // Include status history
});
console.log('Transaction status:', status.status);
console.log('Confirmations:', status.confirmations, '/', status.confirmationsRequired);
console.log('Last updated:', new Date(status.lastUpdated));
if (status.vectorPath) {
console.log('Vector path:', status.vectorPath);
console.log('Path efficiency:', status.pathEfficiency);
}
if (status.history) {
console.log('Status history:');
status.history.forEach(entry => {
console.log(`- ${new Date(entry.timestamp)}: ${entry.status}`);
});
}
Transaction Analysis
analyzeVectorPath()
Analyzes the vector path of a transaction for optimization.
Syntax
async analyzeVectorPath(transactionId: string, options?: AnalysisOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
transactionId | string | The ID of the transaction to analyze. |
options | AnalysisOptions | Optional. Additional options for the analysis. |
Returns
A Promise that resolves to a VectorAnalysis object with the analysis results.
Example
// Analyze transaction vector path
const analysis = await wallet.analyzeVectorPath('tx_123456789', {
detailLevel: 'high', // Analysis detail level
includeAlternatives: true, // Include alternative paths
optimizationSuggestions: true // Include optimization suggestions
});
console.log('Vector path analysis:');
console.log('Path length:', analysis.pathLength);
console.log('Efficiency rating:', analysis.efficiencyRating.toFixed(2), '/10');
console.log('Mathematical pattern:', analysis.pattern);
console.log('Completion time:', analysis.completionTimeMs, 'ms');
console.log('Processing nodes:', analysis.processingNodes);
if (analysis.optimizationSuggestions) {
console.log('Suggested optimizations:');
analysis.optimizationSuggestions.forEach(suggestion => {
console.log(`- ${suggestion.description}`);
console.log(` Efficiency improvement: ${suggestion.improvementPercent}%`);
});
}
Digital Identity
Dragon Wallets provides a comprehensive digital identity framework that integrates with wallet operations.
Identity Management
createIdentity()
Creates a new digital identity associated with a wallet.
Syntax
async createIdentity(identity: IdentityData, options?: IdentityOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
identity | IdentityData | Data for the identity to create. |
options | IdentityOptions | Optional. Additional options for identity creation. |
Returns
A Promise that resolves to an IdentityInfo object with information about the created identity.
Example
// Create a digital identity
const identity = await wallet.createIdentity({
displayName: 'Alice Johnson',
email: 'alice@example.com',
attributes: {
country: 'US',
birthYear: 1985,
profession: 'Software Engineer'
},
verificationLevel: 'standard',
walletId: 'wallet_123' // Associate with specific wallet
}, {
privacyLevel: 'high', // Privacy protection level
backupIdentity: true, // Create identity backup
allowCredentials: true // Allow credential attachment
});
console.log('Identity created:');
console.log('Identity ID:', identity.id);
console.log('Display name:', identity.displayName);
console.log('Verification status:', identity.verificationStatus);
console.log('Created at:', new Date(identity.createdAt));
console.log('Associated wallet:', identity.walletId);
// Store the identity credential securely
console.log('Identity credential:', identity.credential);
Identity Verification
verifyIdentity()
Verifies an identity through various verification methods.
Syntax
async verifyIdentity(identityId: string, verificationData: VerificationData, options?: VerificationOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
identityId | string | The ID of the identity to verify. |
verificationData | VerificationData | Data required for verification. |
options | VerificationOptions | Optional. Additional options for verification. |
Returns
A Promise that resolves to a VerificationResult object with the verification results.
Example
// Verify identity through document verification
const verificationResult = await wallet.verifyIdentity('identity_123', {
method: 'document', // Verification method
documentType: 'passport', // Document type
documentNumber: 'AB1234567', // Document number
documentCountry: 'US', // Issuing country
expirationDate: '2030-01-01', // Document expiration date
documentImage: documentImageData // Document image data
}, {
strictVerification: true, // Use strict verification rules
saveDocumentData: false, // Don't save sensitive document data
requestHumanReview: false // Don't request human review
});
console.log('Verification result:');
console.log('Status:', verificationResult.status);
console.log('Confidence score:', verificationResult.confidenceScore);
console.log('Verification ID:', verificationResult.verificationId);
console.log('Verified fields:', verificationResult.verifiedFields);
console.log('Verification timestamp:', new Date(verificationResult.timestamp));
if (verificationResult.nextSteps) {
console.log('Next steps for full verification:');
verificationResult.nextSteps.forEach(step => {
console.log(`- ${step.description}`);
});
}
Credential Management
issueCredential()
Issues a verifiable credential associated with an identity.
Syntax
async issueCredential(identityId: string, credentialData: CredentialData, options?: CredentialOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
identityId | string | The ID of the identity to issue a credential for. |
credentialData | CredentialData | Data for the credential to issue. |
options | CredentialOptions | Optional. Additional options for credential issuance. |
Returns
A Promise that resolves to a CredentialInfo object with information about the issued credential.
Example
// Issue a verifiable credential
const credential = await wallet.issueCredential('identity_123', {
type: 'EducationCredential',
issuer: {
id: 'issuer_456',
name: 'University of Technology'
},
claims: {
degree: 'Bachelor of Science',
field: 'Computer Science',
graduationDate: '2020-06-15',
gpa: 3.8
},
expirationDate: '2030-01-01'
}, {
revocable: true, // Allow credential revocation
proofType: 'phi-signature', // Signature proof type
storageLocation: 'wallet', // Store in wallet
notifyRecipient: true // Notify recipient
});
console.log('Credential issued:');
console.log('Credential ID:', credential.id);
console.log('Type:', credential.type);
console.log('Issuer:', credential.issuer.name);
console.log('Issuance date:', new Date(credential.issuanceDate));
console.log('Expiration date:', new Date(credential.expirationDate));
console.log('Verification method:', credential.verificationMethod);
// Proof information
console.log('Proof type:', credential.proof.type);
console.log('Proof created:', new Date(credential.proof.created));
console.log('Proof purpose:', credential.proof.purpose);
Security Features
Dragon Wallets implements advanced security features to protect wallets and identities.
Phi-Resonant Security
The phi-resonant security system uses mathematical patterns to create secure operations:
// Configure phi-resonant security
await wallet.configurePhiSecurity({
phiResonanceLevel: 3, // Phi resonance level (1-5)
vectorSpaceDimension: 7, // Vector space dimension
nonLinearMapping: true, // Use non-linear mapping
patternRotation: true, // Enable pattern rotation
fractionalDimensions: false // Disable fractional dimensions
});
// Generate phi-resonant security key
const securityKey = await wallet.generatePhiSecurityKey({
purpose: 'transaction-signing',
strength: 'high',
rotationPeriod: 86400000 // 24 hours in milliseconds
});
console.log('Security key generated:');
console.log('Key ID:', securityKey.id);
console.log('Purpose:', securityKey.purpose);
console.log('Strength:', securityKey.strength);
console.log('Creation time:', new Date(securityKey.createdAt));
console.log('Expiration time:', new Date(securityKey.expiresAt));
Multi-Factor Authentication
setupMFA()
Sets up multi-factor authentication for wallet operations.
Syntax
async setupMFA(mfaType: MFAType, mfaData: MFASetupData, options?: MFAOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
mfaType | MFAType | The type of MFA to set up ('totp', 'sms', 'email', 'biometric', 'phi-pattern'). |
mfaData | MFASetupData | Data required for MFA setup. |
options | MFAOptions | Optional. Additional options for MFA setup. |
Returns
A Promise that resolves to an MFASetupResult object with the setup results.
Example
// Set up TOTP (Time-based One-Time Password) authentication
const totpSetup = await wallet.setupMFA('totp', {
label: 'Alice\'s Wallet'
}, {
issuer: 'DragonFire Wallet',
digits: 6,
period: 30,
algorithm: 'SHA-256'
});
console.log('TOTP MFA set up successfully');
console.log('Secret key:', totpSetup.secret);
console.log('QR code URL:', totpSetup.qrCodeUrl);
console.log('URI:', totpSetup.uri);
// Verify TOTP setup with a test code
const verificationResult = await wallet.verifyMFA('totp', {
code: '123456' // Code from authenticator app
});
if (verificationResult.verified) {
console.log('TOTP verification successful');
} else {
console.error('TOTP verification failed');
}
Transaction Signing
signTransaction()
Signs a transaction using secure signing methods.
Syntax
async signTransaction(transactionId: string, options?: SigningOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
transactionId | string | The ID of the transaction to sign. |
options | SigningOptions | Optional. Additional options for transaction signing. |
Returns
A Promise that resolves to a SigningResult object with the signing results.
Example
// Sign a transaction
const signingResult = await wallet.signTransaction('tx_123456789', {
signingMethod: 'phi-vector', // Signing method
securityLevel: 'high', // Security level
includeBiometrics: true, // Include biometric verification
useHardwareKey: false, // Don't use hardware key
mfaRequired: true // Require MFA
});
console.log('Transaction signed:');
console.log('Signature:', signingResult.signature);
console.log('Signing method:', signingResult.method);
console.log('Timestamp:', new Date(signingResult.timestamp));
console.log('Public key:', signingResult.publicKey);
console.log('Signature verification URL:', signingResult.verificationUrl);
RWT Integration
Dragon Wallets integrates with DragonFire's RWT (Rotational WebSockets) protocol for secure token authentication.
Creating RWT Tokens
createRWTToken()
Creates a new RWT token for authentication purposes.
Syntax
async createRWTToken(tokenData: TokenData, options?: TokenOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
tokenData | TokenData | Data for the token to create. |
options | TokenOptions | Optional. Additional options for token creation. |
Returns
A Promise that resolves to a TokenResult object with the created token.
Example
// Create an RWT token
const token = await wallet.createRWTToken({
purpose: 'payment-gateway', // Token purpose
permissions: ['transaction'], // Token permissions
expiresIn: 3600000, // Token expiration (1 hour)
metadata: { // Additional metadata
service: 'e-commerce',
transactionLimit: 500
}
}, {
rotationPattern: 'phi', // Token rotation pattern
rotationInterval: 300000, // Rotation interval (5 minutes)
securityLevel: 'high', // Token security level
wrappedToken: true // Create wrapped token
});
console.log('RWT token created:');
console.log('Token:', token.token);
console.log('Expires at:', new Date(token.expiresAt));
console.log('Rotation count:', token.rotationCount);
console.log('Rotation interval:', token.rotationInterval);
console.log('Verification URL:', token.verificationUrl);
Verifying RWT Tokens
verifyRWTToken()
Verifies an RWT token.
Syntax
async verifyRWTToken(token: string, options?: VerifyOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
token | string | The RWT token to verify. |
options | VerifyOptions | Optional. Additional options for token verification. |
Returns
A Promise that resolves to a TokenVerificationResult object with verification information.
Example
// Verify an RWT token
const verification = await wallet.verifyRWTToken(token, {
checkPermissions: ['transaction'], // Required permissions
service: 'payment-gateway', // Expected service
strictValidation: true // Use strict validation
});
if (verification.valid) {
console.log('Token is valid');
console.log('User ID:', verification.userId);
console.log('Permissions:', verification.permissions);
console.log('Issued at:', new Date(verification.issuedAt));
console.log('Expires at:', new Date(verification.expiresAt));
console.log('Current rotation:', verification.currentRotation);
// Proceed with authenticated operation
// ...
} else {
console.error('Token is invalid:', verification.reason);
}
Token Rotation
rotateRWTToken()
Rotates an existing RWT token to a new token.
Syntax
async rotateRWTToken(token: string, options?: RotationOptions): Promise
Parameters
Name | Type | Description |
---|---|---|
token | string | The RWT token to rotate. |
options | RotationOptions | Optional. Additional options for token rotation. |
Returns
A Promise that resolves to a TokenRotationResult object with the rotated token.
Example
// Rotate an RWT token
const rotationResult = await wallet.rotateRWTToken(token, {
extendValidity: true, // Extend the token validity
additionalTime: 3600000, // Add 1 hour to validity
preservePermissions: true, // Preserve original permissions
updateMetadata: { // Update metadata
lastRotated: Date.now()
}
});
console.log('Token rotated:');
console.log('New token:', rotationResult.newToken);
console.log('Rotation count:', rotationResult.rotationCount);
console.log('Previous token valid until:', new Date(rotationResult.previousValidUntil));
console.log('New expiration:', new Date(rotationResult.expiresAt));
console.log('Next rotation in:', rotationResult.nextRotationMs, 'ms');
Error Handling
The Dragon Wallets API provides structured error handling for managing different types of failures.
Error Types
Error Type | Description | Common Causes |
---|---|---|
WalletError | Base class for all wallet errors | General wallet-related issues |
AuthenticationError | Authentication-related errors | Invalid credentials, expired tokens |
TransactionError | Transaction processing errors | Insufficient funds, invalid recipient |
SecurityError | Security-related errors | Failed security checks, invalid signatures |
IdentityError | Identity-related errors | Invalid identity data, verification failures |
TokenError | RWT token errors | Invalid tokens, rotation failures |
Error Handling Examples
// Try-catch error handling
try {
const result = await wallet.createTransaction({
recipient: 'wallet_789',
amount: 50.75,
currency: 'USD'
});
// Use result...
} catch (error) {
if (error instanceof TransactionError) {
console.error('Transaction error:', error.message);
if (error.code === 'insufficient_funds') {
console.error('Insufficient funds. Current balance:', error.details.currentBalance);
console.error('Required amount:', error.details.requiredAmount);
}
} else if (error instanceof SecurityError) {
console.error('Security error:', error.message);
console.error('Security check failed:', error.details.check);
} else {
console.error('Unexpected error:', error);
}
}
// Error event handling
wallet.on('error', (error) => {
console.error('Wallet error:', error.message);
// Log error details
console.error('Error details:', {
type: error.constructor.name,
code: error.code,
timestamp: new Date(),
details: error.details
});
});
Error Recovery
// Recover from transaction errors
try {
await wallet.createTransaction({
recipient: 'wallet_789',
amount: 1000,
currency: 'USD'
});
} catch (error) {
if (error instanceof TransactionError) {
if (error.code === 'insufficient_funds') {
// Handle insufficient funds
const currentBalance = error.details.currentBalance;
const requiredAmount = error.details.requiredAmount;
console.log(`Insufficient funds. You have ${currentBalance} USD but need ${requiredAmount} USD.`);
// Suggest recovery options
if (error.recoveryOptions) {
console.log('Recovery options:');
if (error.recoveryOptions.canSplit) {
console.log('- Split into multiple transactions');
// Create multiple smaller transactions
const splitAmount = Math.floor(currentBalance * 0.9); // Use 90% of available balance
await wallet.createTransaction({
recipient: 'wallet_789',
amount: splitAmount,
currency: 'USD',
memo: 'Partial payment (1/2)'
});
}
if (error.recoveryOptions.alternativeFunding) {
console.log('- Use alternative funding sources');
console.log(' Available sources:', error.recoveryOptions.alternativeFunding.join(', '));
}
}
}
}
}