feat(examples): add TRX DelegateResource example scripts#8253
Merged
bhavidhingra merged 1 commit intomasterfrom Apr 14, 2026
Merged
feat(examples): add TRX DelegateResource example scripts#8253bhavidhingra merged 1 commit intomasterfrom
bhavidhingra merged 1 commit intomasterfrom
Conversation
7038a4f to
d286299
Compare
Contributor
449452c to
41b0d66
Compare
41b0d66 to
8c426ae
Compare
Contributor
5 similar comments
Contributor
Contributor
Contributor
Contributor
Contributor
3d17681 to
7592b0f
Compare
7592b0f to
8e80838
Compare
Add an example script demonstrating how to build and sign a TRX DelegateResource transaction via the BitGo platform API. This allows delegating frozen ENERGY or BANDWIDTH resources to another address. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> TICKET: CHALO-350
8e80838 to
7074a0e
Compare
ranga-r2
approved these changes
Apr 14, 2026
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/ts/trx/delegate-resource.ts,examples/ts/trx/get-resource-delegations.ts) demonstrating how to build/sign a TRXDelegateResourcetransaction and query resource delegations via the BitGo SDKgetResourceDelegations(params?)method to theWalletclass insdk-core, following the same pattern asgetAccountResources():iWallet.ts:GetResourceDelegationsOptions,DelegationRecord,GetResourceDelegationsResponseresourcefilter accepts any string (case-insensitive) — backend handles validationthis.url('/resourcedelegations')+.query()for the GET requesthandleV2ResourceDelegationsinexpressto usewallet.getResourceDelegations()instead of callingbitgo.get(bitgo.url(...))directly, consistent with howhandleV2AccountResourcesuseswallet.getAccountResources()wallet.getResourceDelegations()instead of the raw bitgo HTTP methodswallet.getResourceDelegations()covering all query param combinationsTest plan
get-resource-delegations.tsagainst a testnet wallet to confirm delegations are returneddelegate-resource.tsagainst a testnet wallet with frozen TRX balance to confirm the delegation flow works end-to-endENERGYandBANDWIDTHresource types work (case-insensitive)sdk-coreunit tests:yarn run unit-test --scope @bitgo/sdk-core -- -- --grep "getResourceDelegations"expressunit tests:yarn run unit-test --scope @bitgo/express -- -- --grep "TRX Resource Delegation"🤖 Generated with Claude Code