Consolidate Outputs
This How-To will show you how to consolidate all outputs of an account.
Code Example
- Rust
- Nodejs
- Python
sdk/examples/how_tos/accounts_and_addresses/consolidate_outputs.rs
loading...
bindings/nodejs/examples/how_tos/accounts_and_addresses/consolidate-outputs.ts
loading...
bindings/python/examples/how_tos/accounts_and_addresses/consolidate_outputs.py
loading...
Expected Output
- Rust
- Nodejs
- Python
Account synced
Outputs BEFORE consolidation:
OUTPUT #0
- address: Bech32Address(rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq)
- amount: 1000000
- native tokens: Some(NativeTokens([]))
OUTPUT #1
- address: Bech32Address(rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq)
- amount: 998000000
- native tokens: Some(NativeTokens([]))
OUTPUT #2
- address: Bech32Address(rms1qz7652a7c7s9pcur04x7jlmmnyfq8mpxgahmz50tzqutmv6p72vus60pqsd)
- amount: 1000000
- native tokens: Some(NativeTokens([]))
Sending consolidation transaction...
Transaction sent: 0x245f75cb1b985304ceb022687e5c70ed6a936d667258015303e3f7f9ec285bbf
Transaction included: https://explorer.shimmer.network/testnet/block/0x5c06b0d2a16e22a54ca2f976a12d56515b58f8310c77de724b8d03dc4f862180
Account synced
Outputs AFTER consolidation:
OUTPUT #0
- address: Bech32Address(rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq)
- amount: 1000000000
- native tokens: Some(NativeTokens([]))
Account synced
Outputs BEFORE consolidation:
OUTPUT #0
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 1000000
- native tokens: undefined
OUTPUT #1
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 998000000
- native tokens: undefined
OUTPUT #2
- address: rms1qz7652a7c7s9pcur04x7jlmmnyfq8mpxgahmz50tzqutmv6p72vus60pqsd
- amount: 1000000
- native tokens: undefined
Sending consolidation transaction...
Transaction sent: 0x245f75cb1b985304ceb022687e5c70ed6a936d667258015303e3f7f9ec285bbf
Transaction included: https://explorer.shimmer.network/testnet/block/0x5c06b0d2a16e22a54ca2f976a12d56515b58f8310c77de724b8d03dc4f862180
Account synced
Outputs AFTER consolidation:
OUTPUT #0
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 1000000000
- native tokens: undefined
Account synced
Outputs BEFORE consolidation:
OUTPUT #0
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 1000000
- native tokens: None
OUTPUT #1
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 998000000
- native tokens: None
OUTPUT #2
- address: rms1qz7652a7c7s9pcur04x7jlmmnyfq8mpxgahmz50tzqutmv6p72vus60pqsd
- amount: 1000000
- native tokens: None
Sending consolidation transaction...
Transaction sent: 0x245f75cb1b985304ceb022687e5c70ed6a936d667258015303e3f7f9ec285bbf
Transaction included: https://explorer.shimmer.network/testnet/block/0x5c06b0d2a16e22a54ca2f976a12d56515b58f8310c77de724b8d03dc4f862180
Account synced
Outputs AFTER consolidation:
OUTPUT #0
- address: rms1qr58umklvtqa4yxxwmskgzyhx2axfe5tfvunu5gauqu9sns7ava3u3kehwq
- amount: 1000000000
- native tokens: None