docs(examples): document the allocate_cbtc DvP example - #65
Draft
sosaucily wants to merge 1 commit into
Draft
Conversation
examples/README.md documents every example except allocate_cbtc, which landed with the DvP allocation client in #59. Anyone reading the README to find out what the library can do would not learn that DvP settlement is supported at all. Adds an "Allocate CBTC (DvP)" section covering how to run it, how an allocation differs from the free-of-payment send_cbtc flow (settled by a third-party executor across all legs atomically, rather than accepted by the receiver), the allocateBefore/settleBefore ordering, and the withdraw/cancel/execute_transfer choices. Also documents the example's environment variables: EXECUTOR_PARTY_ID and LIB_TEST_RECEIVER_PARTY_ID as required, ALLOCATE_AMOUNT and SETTLEMENT_REF_ID as optional with their defaults. These were verified against the env::var calls in examples/allocate_cbtc.rs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/README.mddocuments every example exceptallocate_cbtc, which landed with the DvP allocation client in #59. Someone reading the README to find out what the library can do wouldn't learn that DvP settlement is supported at all.Found while updating the public CBTC developer docs to cover DvP — the docs site had no mention of it either, and this README was the natural place to have discovered it.
What's added
An "Allocate CBTC (DvP)" section, placed with the other transfer-related examples (after Cancel Pending Transfers), covering:
send_cbtc— an allocation is settled by a third party (the settlement executor) across all legs atomically, rather than accepted by the receiverallocateBefore/settleBeforeordering constraintwithdraw,cancel) and the executor'sexecute_transferPlus an "For the allocate_cbtc example" block in the Environment Variables section:
LIB_TEST_RECEIVER_PARTY_IDEXECUTOR_PARTY_IDALLOCATE_AMOUNT0.1SETTLEMENT_REF_IDcbtc-dvp-exampleVerified against the
env::varcalls inexamples/allocate_cbtc.rsrather than assumed.Note: four other examples are also undocumented
While checking, these are in
examples/but absent from the README:check_darscheck_withdraw_requestslist_deposit_addresseslist_withdraw_accountsLeft out to keep this PR to one thing. Happy to add them in a follow-up if useful — say the word.
Testing
Docs-only change, no code touched. Confirmed every
*.rsinexamples/except the four listed above now has a matchingcargo run --example <name>entry in the README.🤖 Generated with Claude Code