@lumera/sdk-js
    Preparing search index...

    Interface CascadeChainPort

    Port interface for Cascade components to access blockchain capabilities.

    This interface is implemented by an adapter in the blockchain layer, allowing Cascade to remain decoupled from blockchain implementation details.

    // In Cascade uploader
    const params = await this.chainPort.getActionParams();
    const outcome = await this.chainPort.requestActionTx({
    actionId: 'my-action-123',
    msg: registerActionMsg
    });
    interface CascadeChainPort {
        getActionParams(): Promise<CascadeActionParams>;
        requestActionTx(
            input: RequestActionTxInput,
            fileSize: number,
        ): Promise<TxOutcome>;
    }

    Implemented by

    Index

    Methods

    • Fetch action module parameters from the blockchain.

      This method is typically cached with a TTL to avoid repeated LCD queries.

      Returns Promise<CascadeActionParams>

      Action parameters including max_raptor_q_symbols

      If the query fails or returns invalid data

    • Request an action transaction (single-call: simulate → sign → broadcast).

      This method:

      1. Fetches the action fee from the blockchain based on file size
      2. Builds the RegisterAction message with the provided payload
      3. Simulates the transaction to compute the exact gas needed
      4. Calculates the fee based on gas used and gas price
      5. Signs the transaction using the configured signer
      6. Broadcasts the transaction to the network
      7. Returns the transaction outcome

      Parameters

      Returns Promise<TxOutcome>

      Transaction outcome with hash, height, code, gas, and fee

      If simulation, signing, or broadcast fails

      const outcome = await chainPort.requestActionTx({
      actionId: 'cascade-upload-123',
      msg: { data_hash: '...', index_file: '...' },
      gasPrice: '0.025ulume'
      }, 1024000); // 1MB file

      console.log(`Tx ${outcome.txHash} at height ${outcome.height}`);