Developer Center

Developer Center

  • Getting Started
  • Built-in Features
  • REST API Endpoints
  • Guides
  • Cheat Sheet

›Aggregate Transaction

Getting Started

  • What is Sirius Chain
  • Setting up your workstation
  • Writing your first application

Built-in Features

  • Account
  • Mosaic (SDA)
  • Namespace
  • Transfer Transaction
  • Aggregate Transaction
  • Multisig Account
  • Metadata
  • Account Restriction
  • Cross-Chain Swaps
  • Exchange Market
  • Decentralized Exchange Market
  • Liquidity Provider
  • Storage

Protocol

  • Node
  • Block
  • Cryptography
  • Transaction
  • Validating
  • Consensus Algorithms
  • Receipt
  • Inflation

REST API

  • Overview
  • Tools
  • Serialization
  • Websockets
  • Status Errors

SDKs

  • Overview
  • Architecture
  • Languages
  • Extending Sirius Chain Capabilities
  • SDK Development
  • SDK Documentation

Wallets & Explorers

  • Wallets & Explorers

Cheat Sheet

  • Sirius Chain Cheat Sheet

Guides

  • Overview
  • External Guides
  • Account

    • Creating and opening an account
    • Getting account information
    • Getting the amount of XPX sent to an account
    • Reading transactions from an account

    Account Restriction

    • Preventing spam attacks with account restrictions

    Aggregate Transaction

    • Sending payouts with aggregate-complete transaction
    • Creating an escrow with aggregate bonded transaction
    • Asking for mosaics with aggregate-bonded transaction
    • Signing announced aggregate-bonded transactions

    Block

    • Listening to New Blocks
    • Getting block by height

    Cross Chain Swaps

    • Atomic cross-chain swap between Sirius public and private chains

    Metadata

    • Account Metadata
    • Mosaic Metadata
    • Namespace Metadata
    • Account Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Mosaic Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Namespace Metadata (Deprecated since 0.7.0 Sirius Chain release)

    Monitoring

    • Monitor transaction

    Mosaic

    • Creating a mosaic (SDA)
    • Getting the mosaic information
    • Getting the asset identifier behind a namespace with receipts

    Mosaic Levy

    • Modifying Mosaic Supply

    Multisig Account

    • Converting an account to multisig
    • Modifying a multisig account
    • Creating a multi-level multisig-account
    • Sending a multisig transaction

    Namespace

    • Registering a namespace
    • Registering a subnamespace
    • Getting the Namespace information
    • Linking a namespace to a mosaic
    • Linking namespace to account

    Transfer Transaction

    • Transfer transaction
    • Sending an encrypted message

    Storage

    • Data Modification Cancel
    • Data Modification
    • Download Channel
    • Download Payment
    • Drive Closure
    • Finish Download Channel
    • Prepare Bc Drive
    • Replicator Offboarding
    • Replicator Onboarding
    • Storage Payment
    • Verification Payment

Storage

  • Overview
  • Participate
  • External Economy
  • Roles
  • Verification
  • Challenge
  • Rewards
  • Transaction Schemas
  • Built-In Features

    • Drive
    • Replicator
    • Verifier
    • Supercontracts

    Protocols

    • Cross-Block Protocol
    • Fair Streaming

    Storage User Application

    • Overview
    • Getting Started
    • Managing Drives
    • Managing Drive Files
    • Downloading Data

Signing announced aggregate-bonded transactions

This guide will show you how to cosign aggregate bonded transactions that require your account’s cosignature.

Prerequisites

  • Finish creating an escrow with aggregate bonded transaction guide.
  • Have received an aggregate bounded transaction.
  • XPX-Chain-SDK.
  • A text editor or IDE.
  • Have an account with XPX.

Getting into some code

You have announced an aggregate bonded transaction, but all required cosigners have not signed it yet.

  1. Create a function to cosign any aggregate bonded transactions.
Golang
TypeScript
JavaScript
func cosignAggregateBoundedTransaction(signedAggregateBoundedTransaction *sdk.SignedTransaction, account *sdk.Account) *sdk.CosignatureSignedTransaction {
cosignatureTransaction := sdk.NewCosignatureTransactionFromHash(signedAggregateBoundedTransaction.Hash)
signedCosignatureTransaction , err := account.SignCosignatureTransaction(cosignatureTransaction)
if err != nil {
panic(err)
}
return signedCosignatureTransaction
}
const cosignAggregateBondedTransaction = (signedAggregateBondedTransaction: AggregateTransaction, account: Account): CosignatureSignedTransaction => {
const cosignatureTransaction = CosignatureTransaction.create(signedAggregateBondedTransaction);
return account.signCosignatureTransaction(cosignatureTransaction);
};
const cosignAggregateBondedTransaction = (signedAggregateBondedTransaction, account)  => {
const cosignatureTransaction = CosignatureTransaction.create(signedAggregateBondedTransaction);
return account.signCosignatureTransaction(cosignatureTransaction);
};
  1. Fetch all aggregate bonded transactions pending to be signed by your account.

Note:

To fetch aggregate bonded transactions that must be signed by multisig cosignatories, refer to the multisig public key instead. See how to get multisig accounts where an account is cosignatory.

  1. For each transaction, check if you have not already signed it. Cosign each pending transaction using the previously created function.

  2. Announce CosignatureSignedTransaction to the network.

Golang
TypeScript
JavaScript
Java
_, err = client.Transaction.AnnounceAggregateBoundedCosignature(context.Background(), cosignatureSignedTransaction)
if err != nil {
panic(err)
}
const privateKey = process.env.PRIVATE_KEY as string;
const account = Account.createFromPrivateKey(privateKey, NetworkType.TEST_NET);

const nodeUrl = 'http://bctestnet1.brimstone.xpxsirius.io:3000';

const transactionHttp = new TransactionHttp(nodeUrl);

const signedCosignatureTransaction = cosignAggregateBondedTransaction(signedAggregateBoundedTransaction, account);

transactionHttp.announceAggregateBondedCosignature(signedCosignatureTransaction);

// or we can use get the aggregateBondedTransaction from blockchain, cosign and annouce it directly

const accountHttp = new AccountHttp(nodeUrl);

accountHttp
.aggregateBondedTransactions(account.publicAccount)
.pipe(
mergeMap((_) => _),
filter((_)=> _.transactionInfo.hash === signedAggregateBoundedTransaction.hash ),
filter((_) => !_.signedByAccount(account.publicAccount)),
map(signedAggregateBoundedTransaction => cosignAggregateBondedTransaction(signedAggregateBoundedTransaction, account)),
mergeMap(cosignatureSignedTransaction => transactionHttp.announceAggregateBondedCosignature(cosignatureSignedTransaction))
)
.subscribe(announcedTransaction => console.log(announcedTransaction),
err => console.error(err));

const privateKey = process.env.PRIVATE_KEY;
const account = Account.createFromPrivateKey(privateKey, NetworkType.TEST_NET);

const nodeUrl = 'http://bctestnet1.brimstone.xpxsirius.io:3000';

const transactionHttp = new TransactionHttp(nodeUrl);

const signedCosignatureTransaction = cosignAggregateBondedTransaction(signedAggregateBoundedTransaction, account);

transactionHttp.announceAggregateBondedCosignature(signedCosignatureTransaction);

// or we can use get the aggregateBondedTransaction from blockchain, cosign and annouce it directly

const accountHttp = new AccountHttp(nodeUrl);

accountHttp
.aggregateBondedTransactions(account.publicAccount)
.pipe(
mergeMap((_) => _),
filter((_)=> _.transactionInfo.hash === signedAggregateBoundedTransaction.hash ),
filter((_) => !_.signedByAccount(account.publicAccount)),
map(signedAggregateBoundedTransaction => cosignAggregateBondedTransaction(signedAggregateBoundedTransaction, account)),
mergeMap(cosignatureSignedTransaction => transactionHttp.announceAggregateBondedCosignature(cosignatureSignedTransaction))
)
.subscribe(announcedTransaction => console.log(announcedTransaction),
err => console.error(err));
    // Replace with a private key
final String privateKey = "<privateKey>";

final Account account = Account.createFromPrivateKey(privateKey, NetworkType.TEST_NET);

final String nodeUrl = 'http://bctestnet1.brimstone.xpxsirius.io:3000';

final AccountHttp accountHttp = new AccountHttp(nodeUrl);

final TransactionHttp transactionHttp = new TransactionHttp(nodeUrl);

accountHttp.aggregateBondedTransactions(account.getPublicAccount())
.flatMapIterable(tx -> tx) // Transform transaction array to single transactions to process them
.filter(tx -> tx.getHash() == signedAggregateBoundedTransaction.getHash() )
.filter(tx -> !tx.signedByAccount(account.getPublicAccount()))
.map(tx -> {
final CosignatureTransaction cosignatureTransaction = CosignatureTransaction.create(tx);

final CosignatureSignedTransaction cosignatureSignedTransaction = account.signCosignatureTransaction(cosignatureTransaction);

return transactionHttp.announceAggregateBondedCosignature(cosignatureSignedTransaction).toFuture().get();
})
.toFuture()
.get();
← Asking for mosaics with aggregate-bonded transactionNext →
  • Prerequisites
  • Getting into some code
  • Follow our profile
  • Ask development questions
  • Join our Discord channel
  • Explore our Youtube channel
  • Explore Github
Protocol
BlockConsensus AlgorithmsCryptographyInflationNodeReceiptTransactionValidating
Built-in Features
AccountAggregate TransactionCross-Chain SwapsExchange MarketDecentralized Exchange MarketMetadataMosaicMultisig AccountNamespaceTransfer TransactionStorageLiquidity Provider
References
REST APISDKsCheat Sheet
Includes Documentation Forked from NEM
Copyright © 2025 Sirius Chain