FCT Class (BatchMultiSigCall)

BatchMultiSigCall FCT

BatchMultiSigCall is a class designed to simplify the process of building the FCT.

Create a new FCT from scratch

import { BatchMultiSigCall } from "@kirobo/fct-core";

const FCT = new BatchMultiSigCall({
    chainId: "1",
    options: {...},
    defaults: {...}
});

Import already existing FCT

import { BatchMultiSigCall } from "@kirobo/fct-core";

const FCT = BatchMultiSigCall.from(FCTData);

Constructor

BatchMultiSigCallConstructor

All constructor parameters are optional

NameTypeDescription

chainId

ChainId

ChainId 1 by default.

options

Partial<MSCallOptions>

Initial options for BatchMultiSigCall

defaults

DeepPartial<ICallDefaults>

Allows you to set default values for calls.

For example, you can set the from address to ensure that every call has the same from address.

Functions

create

Promise function - Create/add call

const createdCall = await batchMultiSigCall.create(call)

Method Arguments

NameTypeDescription

call

Returns

IMSCallInput

createMultiple

Promise function - Create/add multiple calls

const createdCalls = await batchMultiSigCall.createMultiple(calls)

Method Arguments

NameTypeDescription

calls

Returns

IMSCallInput[]

exportFCT

Generate FCT from provided calls and options

const FCT = batchMultiSigCall.exportFCT()

Returns

IBatchMultiSigCallFCT

importFCT

Import an already-made FCT to automatically set the calls and options.

const calls = batchMultiSigCall.importFCT(FCT)

Method Arguments

NameTypeDescription

FCT

IBatchMultiSigCallFCT

Generated/exported FCT

Returns

IMSCallInput[]

setOptions

Set options of the FCT

const options = batchMultiSigCall.setOptions(options)

Method Arguments

NameTypeDescription

options

DeepPartial<IFCTOptions>

FCT Options

Returns

IFCTOptions

setCallDefaults

Set default values for calls.

For example, you can set the from address to ensure that every call has the same from address and you don't need to specify from value in create / createMultiple functions

const callDefaults = batchMultiSigCall.setCallDefaults(defaults)
NameTypeDescription

defaults

DeepPartial<ICallDefaults>

Returns

ICallDefaults

addComputed

Add computed variable to the FCT

const computed = batchMultiSigCall.addComputed(computedVariable)
NameTypeDescription

computedVariable

Returns

Variable & { type: "computed" } 

createPlugin

Create a plugin from @kirobo/fct-plugins library with FCT's chainId

const plugin = batchMultiSigCall.createPlugin({
    plugin,
    initParams
})
NameTypeDescription

plugin

@kirobo/fct-plugins plugin

initParams

plugin init params - depends on what the plugin is

Returns

@kirobo/fct-plugins plugin instance

changeChainId

Change the chain ID of the FCT.

By calling this function, it will automatically update FCT's domain

batchMultiSigCall.changeChaineId(chainId)
NameTypeDescription

chainId

string

Returns

void

addComputed

Add a computed variable to FCT. This variable then can be used inside any calls as one of the parameters.

const computedVariable = batchMultiSigCall.addComputed(computed)
NameTypeDescription

computed

Returns

{
    type: "computed";
    id: string;
}

Utils

Utility functions of FCT. Learn more about FCT utility functions here

const utils = batchMultiSigCall.utils

Returns

FCTUtils

Getters

calls

Returns created calls

const calls = batchMultiSigCall.calls

Returns

StrictMSCallInput[]

decodedCalls

Returns the created calls with all Variables used in the calls replaced by their corresponding values.

const decodedCalls = batchMultiSigCall.decodedCalls

Returns

DecodedCalls[]

options

Retrieve options for the FCT. If no options have been set, the default options will be returned.

const options = batchMultiSigCall.options

Returns

RequiredFCTOptions

computed

Retrieve all computed variables added in FCT.

const computed = batchMultiSigCall.computed

Returns

IComputed[]

computedWithValues

Retrieve all computed variables added in FCT and all values are strings.

const computedWithValues = batchMultiSigCall.computedWithValues

Returns

ComputedVariables[]

Static functions

from

Creates a BatchMultiSigCall instance from an exported FCT.

from function is useful for those FCTs that have been exported previously.

const FCT = BatchMultiSigCall.from(FCTData)
NameTypeDescription

FCTData

FCT object from exportFCT

Returns

BatchMultiSigCall class

Last updated