Ihilda Documentation

Download Now

Install

Start Up

Keys

Trust

  • Account Currencies
  • Account Info
  • Account Offers
  • Account Transactions
  • BIP39 Mnemonics
  • book_offers
  • Ledger Tracker
  • Network
  • Offer Create
  • Path Find
  • Payment
  • Ping
  • Server Info
  • Server State
  • Subscribe
  • Trustline
  • Transaction Types
  • Transaction Look up

Payments

  • Trading

    RippleLibSharp Account Currencies Example


    Import the necessary libraries
    using System.Linq;

    using System.Threading;

    using System.Threading.Tasks;

    using RippleLibSharp.Commands.Accounts;

    using RippleLibSharp.Keys;

    using RippleLibSharp.Network;

    using RippleLibSharp.Result;

    using RippleLibSharp.Transactions;

    Connect to the xrp ledger
    var tokenSource = new CancellationTokenSource();
    
    var token = tokenSource.Token;
    
    ConnectionSettings connectInfo = new ConnectionSettings
    {
    
        // list of server url's in prefered order.
        ServerUrls = new string[] { "wss://s1.ripple.com:443", "wss://s2.ripple.com:443" },
    
    
        LocalUrl = "localhost",
        UserAgent = "optional spoof browser user agent",
        Reconnect = true
    };
    
    
    NetworkInterface network = new NetworkInterface(connectInfo);
    bool didConnect = network.Connect();
    
    if (!didConnect) {
        return;
    }
    
    Retrieve currencies for account
    RippleAddress account = new RippleAddress("");
    
    var task = AccountOffers.GetResult(account, network, token);
    
    task.Wait(token);
    
    Response<AccountOffersResult> response = task.Result;
    
    AccountOffersResult accountOffersResult = response.result;
    
    Offer[] account_offers = accountOffersResult.offers.ToArray();