Skip to main content

Using Fluid Classic

Fluid.js can be configured to work with Fluid Classic by passing a boolean isClassic value to the LCD.

LCDClient


_16
const gasPrices = await(
_16
await fetch("https://columbus-api.terra.dev/gas-prices", {
_16
redirect: "follow",
_16
})
_16
).json();
_16
_16
const gasPricesCoins = new Coins(gasPrices);
_16
_16
const lcd = new LCDClient({
_16
URL: "https://columbus-lcd.terra.dev/",
_16
chainID: "columbus-5",
_16
gasPrices: gasPricesCoins,
_16
gasAdjustment: "1.5",
_16
gas: 10000000,
_16
isClassic: true, // false by default, change to true if you want to interact with Fluid Classic
_16
});

Conversion Functions

The isClassic boolean can also be specified for most unit conversion functions in Fluid.js. If unspecified, these methods will simply use the Luna version specified in the LCD config. The following are two examples of methods that accept this boolean value.


_2
public toAmino(isClassic?: boolean)
_2
public fromData(isClassic?: boolean)

Signing Messages with Keys

Wallet objects on Fluid contain information about the LCDClient, so they inherit the isClassic parameter automatically. However, key objects, such as MnemonicKey, RawKey or CLIKey do not. For example, createSignatureAmino is a method where you can specify if you'd like to use Fluid Classic.


_4
public async createSignatureAmino(
_4
tx: SignDoc,
_4
isClassic?: boolean
_4
): Promise<SignatureV2> { ... }