@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
- commitTx
- createTx
- getOutput
- getOutputByOrigin
- getPackageAbi
- getPackageSrc
- getPackageWasm
- getRawTx
- getTx
- getUtxosByAddress
- loadOutput
- loadOutputByOrigin
Constructors
constructor
• new Aldea(url
, options?
): Aldea
Parameters
Name | Type |
---|---|
url | string |
options? | Partial <AldeaClientOpts > |
Returns
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
Name | Type |
---|---|
tx | Tx |
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
Name | Type |
---|---|
builder | CreateTxCallback |
Returns
Promise
<Tx
>
Defined in
packages/sdk/src/aldea.ts:55
▸ createTx(opts
, builder
): Promise
<Tx
>
Parameters
Name | Type |
---|---|
opts | TxBuilderOpts |
builder | CreateTxCallback |
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
Name | Type |
---|---|
outputId | string |
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
Name | Type |
---|---|
origin | string |
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
Name | Type |
---|---|
pkgId | string |
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
Name | Type |
---|---|
pkgId | string |
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
Name | Type |
---|---|
pkgId | string |
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
Name | Type |
---|---|
txid | string |
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
Name | Type |
---|---|
txid | string |
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
Name | Type |
---|---|
address | Address |
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
Name | Type |
---|---|
outputId | string |
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
Name | Type |
---|---|
origin | string |
Returns
Promise
<Output
>
Defined in
packages/sdk/src/aldea.ts:176