Skip to content

@aldea/sdk / Exports / Aldea

Class: Aldea

The Aldea class connects to a remote Aldea instance and provide a top-level API for interacting with the Node, building and commiting new transactions.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Aldea(url, options?): Aldea

Parameters

NameType
urlstring
options?Partial<AldeaClientOpts>

Returns

Aldea

Defined in

packages/sdk/src/aldea.ts:30

Properties

api

api: KyInstance

Defined in

packages/sdk/src/aldea.ts:27


cache

cache: Map<string, Response>

Defined in

packages/sdk/src/aldea.ts:28

Methods

commitTx

commitTx(tx): Promise<CommitTxResponse>

Broadcasts the given transaction to the Aldea Computer and responds with the full transaction execution result.

Parameters

NameType
txTx

Returns

Promise<CommitTxResponse>

Defined in

packages/sdk/src/aldea.ts:75


createTx

createTx(builder): Promise<Tx>

Builds and returns a new Transaction. The given callback recieves the TxBuilder instance and a ref function for turning integers into Instruction references.

Parameters

NameType
builderCreateTxCallback

Returns

Promise<Tx>

Defined in

packages/sdk/src/aldea.ts:55

createTx(opts, builder): Promise<Tx>

Parameters

NameType
optsTxBuilderOpts
builderCreateTxCallback

Returns

Promise<Tx>

Defined in

packages/sdk/src/aldea.ts:56


getOutput

getOutput(outputId): Promise<OutputResponse>

Gets an output by its output ID and responds with the transaction execution output.

Parameters

NameType
outputIdstring

Returns

Promise<OutputResponse>

Defined in

packages/sdk/src/aldea.ts:102


getOutputByOrigin

getOutputByOrigin(origin): Promise<OutputResponse>

Gets the most recent version of an output by its origin and responds with the most transaction execution output.

Parameters

NameType
originstring

Returns

Promise<OutputResponse>

Defined in

packages/sdk/src/aldea.ts:110


getPackageAbi

getPackageAbi(pkgId): Promise<Abi>

Gets a package by its ID and responds with the ABI in JSON format.

Parameters

NameType
pkgIdstring

Returns

Promise<Abi>

Defined in

packages/sdk/src/aldea.ts:131


getPackageSrc

getPackageSrc(pkgId): Promise<PackageResponse>

Gets a package by its ID and responds with the package source files.

Parameters

NameType
pkgIdstring

Returns

Promise<PackageResponse>

Defined in

packages/sdk/src/aldea.ts:139


getPackageWasm

getPackageWasm(pkgId): Promise<Uint8Array>

Gets a package by its ID and responds with the compiled WASM module.

Parameters

NameType
pkgIdstring

Returns

Promise<Uint8Array>

Defined in

packages/sdk/src/aldea.ts:156


getRawTx

getRawTx(txid): Promise<Uint8Array>

Gets a transaction by its txid and responds with the raw transaction data.

Parameters

NameType
txidstring

Returns

Promise<Uint8Array>

Defined in

packages/sdk/src/aldea.ts:93


getTx

getTx(txid): Promise<CommitTxResponse>

Gets a transaction by its txid and responds with the full transaction execution result.

Parameters

NameType
txidstring

Returns

Promise<CommitTxResponse>

Defined in

packages/sdk/src/aldea.ts:85


getUtxosByAddress

getUtxosByAddress(address): Promise<Output[]>

Returns every output in the otxo locked by the given address

Parameters

NameType
addressAddress

Returns

Promise<Output[]>

Defined in

packages/sdk/src/aldea.ts:118


loadOutput

loadOutput(outputId): Promise<Output>

Loads an output by its output ID and responds with a generic Output object with its state parsed as an object.

Parameters

NameType
outputIdstring

Returns

Promise<Output>

Defined in

packages/sdk/src/aldea.ts:165


loadOutputByOrigin

loadOutputByOrigin(origin): Promise<Output>

Gets the most recent version of an output by its origin and responds with a generic Output object with its state parsed as an object.

Parameters

NameType
originstring

Returns

Promise<Output>

Defined in

packages/sdk/src/aldea.ts:176