feat(statics): add TOKENIZED_EQUITY and BITGO_TOKENIZED_EQUITY CoinFeatures#9312
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
feat(statics): add TOKENIZED_EQUITY and BITGO_TOKENIZED_EQUITY CoinFeatures#9312bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
@claude Please review this PR. |
Author
|
Requesting a Copilot review. |
bitgo-ai-agent-dev
Bot
force-pushed
the
SCAAS-10372-tokenized-equity-coin-features
branch
3 times, most recently
from
July 21, 2026 14:46
99e8963 to
f2e3d0c
Compare
raj-bitgo
force-pushed
the
SCAAS-10372-tokenized-equity-coin-features
branch
from
July 21, 2026 14:52
f2e3d0c to
d65dd0c
Compare
There was a problem hiding this comment.
Pull request overview
Adds new CoinFeature markers in @bitgo/statics for tokenized equities (generic) and BitGo-issued permissioned tokenized equities (goStocks), and enforces a construction-time invariant to keep these features consistent across coin definitions.
Changes:
- Introduces
TOKENIZED_EQUITYandBITGO_TOKENIZED_EQUITYinCoinFeature. - Enforces
BITGO_TOKENIZED_EQUITY⇒TOKENIZED_EQUITYinBaseCoin.validateOptionsviaMissingRequiredCoinFeatureError. - Tags all goSPCX representations (SOL + OFC mirrors, mainnet + testnet variants) with both features and adds unit tests for enum values, tagging, and the invariant.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| modules/statics/src/base.ts | Adds the two new CoinFeature enum values and enforces the BITGO_TOKENIZED_EQUITY → TOKENIZED_EQUITY invariant during coin construction. |
| modules/statics/src/coins/solTokens.ts | Applies both features to SOL-chain goSPCX token definitions (mainnet + testnet variants). |
| modules/statics/src/coins/ofcCoins.ts | Applies both features to OFC mirror coin definitions for goSPCX (mainnet + testnet variants). |
| modules/statics/test/unit/base.ts | Adds unit tests validating enum values, per-coin tagging, and the invariant behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+112
to
+115
| } catch (err: any) { | ||
| threw = true; | ||
| errorMessage = err.message; | ||
| } |
bitgo-ai-agent-dev
Bot
force-pushed
the
SCAAS-10372-tokenized-equity-coin-features
branch
from
July 21, 2026 16:39
d65dd0c to
6217b16
Compare
Author
|
Copilot review (round 1) — addressed:
|
Author
|
@claude Please re-review this PR. |
…atures Add two new values to the CoinFeature enum in @bitgo/statics: - TOKENIZED_EQUITY: economic-nature marker for any tokenized stock. Drives generic behavior (pricing off the underlying, asset-class reporting). May be set for BitGo-issued or third-party tokens. - BITGO_TOKENIZED_EQUITY: BitGo first-party permissioned goStocks marker. Drives whitelist-destination withdrawal validation and allowlist/segregation behavior. Requires TOKENIZED_EQUITY to also be set (invariant enforced in BaseCoin.validateOptions). Apply both flags to all goSPCX representations: sol:gospcx, tsol:gospcx, tsol:stggospcx (on-chain tokens) and ofcsol:gospcx, ofctsol:gospcx, ofctsol:stggospcx (OFC mirrors). No other goStock tokens receive these flags in this ticket; behavioral enforcement (withdrawal allowlist checks) is out of scope and tracked in TDD §13.4. Ticket: SCAAS-10372 Session-Id: a4128cc9-058b-4a15-ab67-160780260e8a Task-Id: a0f7361a-becc-4c21-ab18-99920c0c7a35
bitgo-ai-agent-dev
Bot
force-pushed
the
SCAAS-10372-tokenized-equity-coin-features
branch
from
July 21, 2026 16:51
6217b16 to
ecbf8a1
Compare
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.
What
TOKENIZED_EQUITY(tokenized-equity) to theCoinFeatureenum in@bitgo/statics: economic-nature marker for any tokenized stock (BitGo-issued or third-party). Drives generic behavior — pricing off the underlying, asset-class reporting.BITGO_TOKENIZED_EQUITY(bitgo-tokenized-equity) toCoinFeature: BitGo first-party permissioned goStocks marker. Drives whitelist-destination withdrawal validation and allowlist/segregation behavior.BaseCoin.validateOptions: a coin that hasBITGO_TOKENIZED_EQUITYmust also haveTOKENIZED_EQUITY; violating this throwsMissingRequiredCoinFeatureError.sol:gospcx,tsol:gospcx,tsol:stggospcx(on-chain tokens) andofcsol:gospcx,ofctsol:gospcx,ofctsol:stggospcx(OFC mirrors).Why
convertStringsToCoinFeatures()silently drops unknown strings, so the enum values must exist before AMS config can carry these flags. No downstream schema changes are required once the enum is in place.Decision log
Invariant placement (
base.ts:validateOptionsvs. a separate utility): Added theBITGO_TOKENIZED_EQUITY→TOKENIZED_EQUITYcheck directly inBaseCoin.validateOptions. This is the single entry point for all coin construction and is where all other feature-constraint checks already live (requiredFeatures,disallowedFeatures). A separate utility would be easy to forget.Which goSPCX tokens to tag: The ticket says "every representation of that token: the
sol:mainnet token, thetsol:testnet twin, and theofc:mirror." There are two testnet variants (tsol:gospcxandtsol:stggospcx) — both refer to the same goSPCX token on different testnet deployments and both already carrySTABLECOIN, so both received the new flags for consistency.Replacing
STABLECOIN: The ticket does not ask to remove the existingSTABLECOINfeature from goSPCX. TheSTABLECOINflag is left in place to avoid breaking any downstream consumers that depend on it until a formal deprecation plan is in place. The new flags are additive.Test evidence
Unit tests in
test/unit/base.tscovering:TOKENIZED_EQUITYenum value ='tokenized-equity'✓BITGO_TOKENIZED_EQUITYenum value ='bitgo-tokenized-equity'✓sol:gospcx,tsol:gospcx,tsol:stggospcx,ofcsol:gospcx,ofctsol:gospcx,ofctsol:stggospcxeach have both features ✓BITGO_TOKENIZED_EQUITYbut withoutTOKENIZED_EQUITYthrows an error mentioning'tokenized-equity'✓TypeScript compilation (
npx tsc --noEmit) passes with zero errors.CI fix: initial run had 1 failing test —
invariant: BITGO_TOKENIZED_EQUITY without TOKENIZED_EQUITY should throw MissingRequiredCoinFeatureError— becauseshould.throws(fn, callbackFn)triggersTypeError: Function has non-object prototype 'undefined' in instanceof checkin Node 20/22/24 when the error class prototype isn't fully resolved across module boundaries. Replaced with an explicit try/catch that capturesthrewanderrorMessagethen asserts both.Copilot review
No Copilot review yet (first CI round still running).
Open questions
None.
Ticket: SCAAS-10372