Skip to main content

Namespace: helpers

Classes

Interfaces

Type Aliases

ChainName

Ƭ ChainName: keyof TablelandNetworkConfig

The set of supported chain names as used by the Tableland network.

Defined in

@tableland/sdk/src/helpers/chains.ts:10


Config

Ƭ Config: Partial<ReadConfig & SignerConfig>

Defined in

@tableland/sdk/src/helpers/config.ts:20


ExternalProvider

Ƭ ExternalProvider: providers.ExternalProvider

Defined in

@tableland/sdk/src/helpers/ethers.ts:11


NameMapping

Ƭ NameMapping: Record<string, string>

Defined in

@tableland/sdk/src/helpers/config.ts:22


NormalizedStatement

Ƭ NormalizedStatement: sqlparser.NormalizedStatement

Defined in

@tableland/sqlparser/types.d.ts:34


RegistryReceipt

Ƭ RegistryReceipt: Required<Omit<TransactionReceipt, "error" | "errorEventIdx">>

RegistryReceipt is based on the TransactionReceipt type which defined by the API spec. The API v1 has a known problem where it only returns the first tableId from a transaction.

Defined in

@tableland/sdk/src/helpers/ethers.ts:46


SignalAndInterval

Ƭ SignalAndInterval: Signal & Interval

Defined in

@tableland/sdk/src/helpers/await.ts:11


StatementType

Ƭ StatementType: sqlparser.StatementType

Defined in

@tableland/sqlparser/types.d.ts:36

Variables

supportedChains

Const supportedChains: Record<keyof TablelandNetworkConfig, ChainInfo>

The set of chains and their information as supported by the Tableland network.

Defined in

@tableland/sdk/src/helpers/chains.ts:44

Functions

checkWait

checkWait(config, receipt): Promise<WaitableTransactionReceipt>

Parameters

NameType
configPartial<ReadConfig & SignerConfig> & Partial<AutoWaitConfig>
receiptWaitableTransactionReceipt

Returns

Promise<WaitableTransactionReceipt>

Defined in

@tableland/sdk/src/helpers/config.ts:29


extractBaseUrl

extractBaseUrl(conn?, chainNameOrId?): Promise<string>

Parameters

NameType
connPartial<ReadConfig & SignerConfig>
chainNameOrId?number | keyof TablelandNetworkConfig

Returns

Promise<string>

Defined in

@tableland/sdk/src/helpers/config.ts:40


extractChainId

extractChainId(conn?): Promise<number>

Parameters

NameType
connPartial<ReadConfig & SignerConfig>

Returns

Promise<number>

Defined in

@tableland/sdk/src/helpers/config.ts:69


extractSigner

extractSigner(conn?, external?): Promise<Signer>

Parameters

NameType
connPartial<ReadConfig & SignerConfig>
external?ExternalProvider

Returns

Promise<Signer>

Defined in

@tableland/sdk/src/helpers/config.ts:59


getBaseUrl

getBaseUrl(chainNameOrId): string

Get the default host uri for a given chain name.

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigThe requested chain name.

Returns

string

A string representing the default host uri for a given chain.

Defined in

@tableland/sdk/src/helpers/chains.ts:107


getChainId

getChainId(chainNameOrId): number

Get the default chain id for a given chain name.

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigThe requested chain name.

Returns

number

A number representing the default chain id of the requested chain.

Defined in

@tableland/sdk/src/helpers/chains.ts:98


getChainInfo

getChainInfo(chainNameOrId): ChainInfo

Get the default chain information for a given chain name.

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigThe requested chain name.

Returns

ChainInfo

An object containing the default chainId, contractAddress, chainName, and baseUrl for the given chain.

Defined in

@tableland/sdk/src/helpers/chains.ts:59


getContractAddress

getContractAddress(chainNameOrId): string

Get the default contract address for a given chain name.

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigThe requested chain name.

Returns

string

A hex string representing the default address for the Tableland registry contract.

Defined in

@tableland/sdk/src/helpers/chains.ts:89


getContractReceipt

getContractReceipt(tx): Promise<MultiEventTransactionReceipt>

Given a transaction, this helper will return the tableIds that were part of the transaction. Especially useful for transactions that create new tables because you need the tableId to calculate the full table name.

Parameters

NameType
txContractTransaction

Returns

Promise<MultiEventTransactionReceipt>

tableland receipt

Defined in

@tableland/sdk/src/helpers/ethers.ts:75


getDefaultProvider

getDefaultProvider(network?, options?): BaseProvider

Parameters

NameType
network?Networkish
options?any

Returns

BaseProvider

Defined in

@ethersproject/providers/lib/index.d.ts:21


getSigner

getSigner(external?): Promise<Signer>

Request a signer object from the global ethereum object.

Throws

If no global ethereum object is available.

Parameters

NameTypeDescription
external?ExternalProviderA valid external provider. Defaults to globalThis.ethereum if not provided.

Returns

Promise<Signer>

A promise that resolves to a valid web3 provider/signer

Defined in

@tableland/sdk/src/helpers/ethers.ts:108


isTestnet

isTestnet(chainNameOrId): boolean

Parameters

NameType
chainNameOrIdnumber | keyof TablelandNetworkConfig

Returns

boolean

Defined in

@tableland/sdk/src/helpers/chains.ts:73


jsonFileAliases

jsonFileAliases(filepath): AliasesNameMap

Parameters

NameType
filepathstring

Returns

AliasesNameMap

Defined in

@tableland/sdk/src/helpers/config.ts:106


normalize

normalize(sql, nameMap?): Promise<NormalizedStatement>

Parameters

NameType
sqlstring
nameMap?NameMapping

Returns

Promise<NormalizedStatement>

Defined in

@tableland/sdk/src/helpers/parser.ts:13


overrideDefaults

overrideDefaults(chainNameOrId, values): void

Override the internal list of registry addresses and validator urls that will be used for Contract calls and read queries

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigEither the chain name or chainId. For a list of chain names see the evm-tableland networks file
valuesRecord<keyof ChainInfo, string | number>The values you would like to use to override the defaults. Example: {contractAddress: "0x000deadbeef", baseUrl: "https://my.validator.mydomain.tld"}

Returns

void

void

Defined in

@tableland/sdk/src/helpers/chains.ts:120


prepReadConfig

prepReadConfig(config): FetchConfig

Parameters

NameType
configPartial<ReadConfig>

Returns

FetchConfig

Defined in

@tableland/sdk/src/helpers/config.ts:119


validateTableName

validateTableName(tableName, isCreate?): Promise<ValidatedTable>

Parameters

NameTypeDefault value
tableNamestringundefined
isCreatebooleanfalse

Returns

Promise<ValidatedTable>

Defined in

@tableland/sdk/src/helpers/parser.ts:27