Mixtral_ether / asset.json
jeduardogruiz's picture
asset.jon
a03f954 verified
raw
history blame
1.45 kB
using OKX.Api;
class MigrationScript
{
static async Task Main(string[] args)
{
// Set API credentials
string okxApiKey = "33bfe871-b6a5-4391-aeeb-cca4ce971548";
string okxApiSecret = "0F1A96741B083277007AA84F61A716C5";
string okxApiPassphrase = ""; // Set your API passphrase
// Create OKX API client
var okxClient = new OKXRestApiClient();
okxClient.SetApiCredentials(okxApiKey, okxApiSecret, okxApiPassphrase);
// Migrate assets
await MigrateAsset(okxClient, "BTC", 10);
await MigrateAsset(okxClient, "ETH", 10);
await MigrateAsset(okxClient, "USDT", 50);
await MigrateAsset(okxClient, "WBTC", 20);
}
static async Task MigrateAsset(OKXRestApiClient okxClient, string assetSymbol, decimal amount)
{
// Get asset details
var instrument = await okxClient.Public.GetInstrumentAsync(OkxInstrumentType.Spot, assetSymbol + "-USDT");
if (instrument == null)
{
Console.WriteLine($"Error: Instrument {assetSymbol}-USDT not found");
return;
}
// Create asset on OKX API
var asset = await okxClient.Asset.CreateAssetAsync(assetSymbol, amount);
// Create connection on OKX API
await okxClient.Connection.CreateConnectionAsync("connections", asset.Id, assetSymbol);
Console.WriteLine($"Migrated {amount} {assetSymbol} to OKX API");
}
}