Skip to content

(CURRENTLY IN BETA) A lightweight library to manage swaps/withdrawals from Fiat to Terra Assets

License

Notifications You must be signed in to change notification settings

TerraMystics/Binance.Net.FiatToTerra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


A lightweight library to manage swaps/withdrawals from Fiat to LUNC/LUNA via the Binance Exchange, and makes it very easy for Terra developers to migrate liquidity on-chain.


GitHub GitHub GitHub

Explore the Docs »

Example App · API Reference · NuGet Package · GitHub

Helps dApps & developers migrate customer funds from the Binance Exchange to prepare wallets for on-chain transactions & payments.

Features

  • Written in C#, with type definitions
  • Works with Xamarin, Unity, Asp, and all other frameworks in the .Net Ecosystems
  • Makes it easier for dApps to migrate customer funds from a Binance wallet to an OnChain Terra Wallet

Usage

This package is designed for dApps looking to migrate customer funds from the Binance Exchange to a customer's OnChain Terra Wallet.

Configure a Binance Api Key

To set a binance Api Key please follow this

Binance Security Restrictions

Due to Binance's security restrictions, customers of your dApps, will be required to configure their Api Keys to enable Withdrawals & Swaps. They will need to pass their Public IP Address.

Installation & Configuration

Grab the latest version off NuGet

dotnet add package Binance.FiatToTerra

Manage Swaps & Withdrawals for LUNC

Here we are going to run a Market Price Swap from BUSD to our Terra Coin of choice, then migrate the funds to the customer Terra Wallet.

// LUNC
void RunSwapForLUNC(){
      var lunc = new FiatToLUNCHelper(
             "customer_api_key",
             "customer_api_secret",
             Binance.FiatToTerra.Models.Enums.StableCoins.BUSD,
             Binance.FiatToTerra.Models.Enums.BinanceEnvironment.Mainnet)
             .ConfigureOnChainTerraWallet("customer_terra_wallet_recovery_words");

      var luncAmount = 200000;

      // Purchase 200,000 LUNC coins & Transfer them to the customer wallet
      var orderId = await lunc.ExecuteSwapForLUNC_WithMarketPrice(luncAmount);
      await lunc.TransferLUNCToTerraStation(luncAmount);
}

// USTC
void RunSwapForUSTC(){
      var ustc = new FiatToUSTCHelper(
             "customer_api_key",
             "customer_api_secret",
             Binance.FiatToTerra.Models.Enums.StableCoins.BUSD,
             Binance.FiatToTerra.Models.Enums.BinanceEnvironment.Mainnet)
             .ConfigureOnChainTerraWallet("customer_terra_wallet_recovery_words");

      var ustcAmount = 200;

      // Purchase 200 USTC coins & Transfer them to the customer wallet
      var orderId = await ustc.ExecuteSwapForUSTC_WithMarketPrice(ustcAmount);
      await ustc.TransferUSTCToTerraStation(ustcAmount);
}

// LUNA
void RunSwapForLUNA(){
      var luna = new FiatToLUNA2Helper(
             "customer_api_key",
             "customer_api_secret",
             Binance.FiatToTerra.Models.Enums.StableCoins.BUSD,
             Binance.FiatToTerra.Models.Enums.BinanceEnvironment.Mainnet)
             .ConfigureOnChainTerraWallet("customer_terra_wallet_recovery_words");

      var lunaAmount = 200;

      // Purchase 200 LUNA coins & Transfer them to the customer wallet
      var orderId = await luna.ExecuteSwapForLUNA_WithMarketPrice(lunaAmount);
      await luna.TransferLUNAToTerraStation(lunaAmount);
}

Binance.FiatToTerra For Unity Developers

If you are using Binance.FiatToTerra for Unity, please make sure to install the following asset in your project, and follow the installation instructions above

License

This software is licensed under the MIT license. See LICENSE for full disclosure.

© 2022 TerraMystics.

About

(CURRENTLY IN BETA) A lightweight library to manage swaps/withdrawals from Fiat to Terra Assets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages