Wallet Management

Get information about your Skyfire Account and manage your wallets with our account endpoints.

  • Step 1: Install the Skyfire SDK

    npm install @skyfire-xyz/skyfire-sdk
    
    pip install skyfire-sdk
    
  • Step 2: Initialize the SDK

    import { SkyfireClient } from '@skyfire-xyz/skyfire-sdk'
    const skyfire = new SkyfireClient({
      apiKey: 'YOUR_API_KEY'
    })
    
    import skyfire_sdk
    configuration = skyfire_sdk.Configuration(
        host = "https://api.skyfire.xyz"
    )
    configuration.api_key['ApiKeyAuth'] = "YOUR_API_KEY"
    
  • Step 3: Call the wallet management functions to get information about your Skyfire account and manage your wallets

    // get claims for your account
    async function getClaims(): Promise<any>{
        let res = await skyfire.account.wallet.getClaimsForUser()
        // use getClaimsForUserWithHttpInfo() for response headers included in the response
        return res
    }
    
    # get claims for your account
    with skyfire_sdk.ApiClient(configuration) as api_client:
        api_instance = skyfire_sdk.WalletManagementApi(api_client)
        api_response = api_instance.get_claims_for_user()
        # use get_claims_for_user_with_http_info() for response headers in response
    

Additional Wallet Management Tools

Get Wallet Balances by wallet network

// get wallet balances by network
async function getWalletBalance(network: EthNetworkType): Promise<any>{
    let res = await skyfire.account.wallet.getWalletBalanceByAddress(network)
    // use getWalletBalanceByAddressWithHttpInfo() for response headers included in the response
    return res
}

Get default wallet balance

// get wallet balance of your default wallet
async function getWalletBalanceForUser(): Promise<any>{
    let res = await skyfire.account.wallet.getWalletBalanceForUser()
    // use getWalletBalanceForUserWithHttpInfo() for response headers included in the response
    return res
}

Delete wallet by wallet ID

// delete a wallet by its wallet id
// get your wallet id by using getWalletBalanceByAddress
async function deleteWallet(walletId: string): Promise<any>{
    let res = await skyfire.account.wallet.deleteWallet(walletId)
    // use deleteWalletWithHttpInfo() for response headers included in the response
    return res
}
# delete a wallet by its wallet id
# get your wallet id by using getWalletBalanceByAddress
with skyfire_sdk.ApiClient(configuration) as api_client:
    api_instance = skyfire_sdk.WalletManagementApi(api_client)
    api_response = api_instance.delete_wallet('wallet-id-to-delete')
    # use deleteWalletWithHttpInfo() for response headers included in the response

Update wallet network or name

// update the name or network of your wallet 
// get your wallet id by using getWalletBalanceByAddress
async function updateWallet(updateWalletRequest: UpdateWalletRequest): Promise<any>{
    let res = await skyfire.account.wallet.updateWallet(updateWalletRequest)
    // use updateWalletWithHttpInfo() for response headers included in the response
    return res
}

Get default wallet

// get your default wallet
async function getWallets(): Promise<any>{
    let res = await skyfire.account.wallet.wallet()
    // use walletWithHttpInfo() for response headers included in the response
    return res
}
# get your default wallet
with skyfire_sdk.ApiClient(configuration) as api_client:
    api_instance = skyfire_sdk.WalletManagementApi(api_client)
    api_response = api_instance.wallet()
    # use wallet_with_http_info() for response headers included in the response