Skip to content

SDK, API, and integration reference

  • bitsafe-token-lib: Workflows and examples for BitSafe assets.
  • canton-lib: shared Canton API clients, utilities, and the Token Standard operations that bitsafe-token-lib re-exports.

Pin approved release tags and keep their compatibility row together.

LayerUse
Generated Canton clientsAuthenticate, query contracts, submit commands, and read updates
BETH workflow functionsBalance, transfer, mint, redeem, account, and credential operations
BitSafe API clientRetrieve approved account rules and token-standard contracts
Ethereum bridge callBuild the depositETH transaction for a deposit
ExamplesExecutable references for supported tasks
  1. Load configuration through a typed layer.
  2. Create authenticated Canton and BitSafe API clients.
  3. Verify the party with a read-only query.
  4. Query current contracts and runtime rules.
  5. Validate the business request.
  6. Submit one command with a unique reference where supported.
  7. Read the authoritative result.
  8. Reconcile Canton, application, and Ethereum identifiers.

Generated type and method documentation should remain in the repository or generated reference site. Public task guides should link to exact release documentation instead of copying full schemas.

Balance checks, sending, incoming and outgoing offers, accepting or cancelling offers, credentials, minting, redemption, account inspection, batch transfers, and UTXO management.

The mint::Deposit type in bitsafe-token-lib 0.6.0 uses this shared EVM event layout:

event Deposit(
bytes32 indexed depositAccountIdHash,
bytes depositAccountId,
address indexed sender,
uint256 amount,
uint256 prevDepositBlock
);

prevDepositBlock identifies the previous deposit block for the same account. A zero value means no earlier deposit exists since deployment or the upgrade that adds this field. Two deposits for one account can share a block. The second then has prevDepositBlock equal to its own block number. The bridge view lastDepositBlock(bytes32 depositAccountIdHash) returns the block of the last deposit. The log filter must include the proxy address, topic0, and topic1 for the account. mint::deposit_id_topic computes topic1 from the deposit account ID. Read all matching logs in each block and use their lowest prevDepositBlock as the next link. The bridge’s deposit-link guide describes the complete walk. This view belongs to the bridge contract; the library provides no wrapper for it.

Callers that construct Deposit values must supply the new field.

mint::DEPOSIT_EVENT_TOPIC now matches only the five-field event:

0xf3ca88974ec5963addc617fe6c0c359d7196759e318be6ab0cade940986e30e2

Callers that scan historical deposits must also filter on the old topic:

0xacaea730ea841fae3326f72a7ff746b6e06c646840526bcaf5dabee5fd887ef8

Declare the old four-field layout in a separate sol! block to decode those logs. The new Deposit decoder rejects logs with the old topic. Decoding old data without checking the topic can silently produce an incorrect prevDepositBlock value. The library provides one event binding; callers select the decoder by the log topic. Check the bridge ABI for the deployment and block range that you query.

Validate the integration: BETH developer Quick Start.