Skip to content

Remove builtin tokens#1034

Open
peachbits wants to merge 12 commits into
masterfrom
matthew/no-builtin-tokens
Open

Remove builtin tokens#1034
peachbits wants to merge 12 commits into
masterfrom
matthew/no-builtin-tokens

Conversation

@peachbits
Copy link
Copy Markdown
Contributor

@peachbits peachbits commented Feb 26, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Note

Medium Risk
Touches shared token-resolution and URI/denomination logic across many currency plugins; regressions could cause token codes/amounts to fail to resolve or parse correctly, especially for previously built-in tokens.

Overview
Removes builtinTokens support end-to-end. The plugin framework (makeOuterPlugin / PluginEnvironment) no longer carries or exposes builtin token maps, and token utilities (makeMetaTokens, token-id helpers, info-server token ingestion) are deleted.

Currency tools/engines are updated to stop referencing builtin tokens when parsing/encoding URIs and resolving denominations (including getLegacyDenomination now checking only primary currency + provided legacy/custom tokens). Numerous *Info.ts files drop hardcoded token lists and metaTokens wiring; CLI commands (get-balance, list-tokens) now operate only on settings.customTokens.

Written by Cursor Bugbot for commit b32b302. This will update automatically on new commits. Configure here.


Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable autofix in the Cursor dashboard.

const enabledTokens = settings.enabledTokens[pluginId] ?? []

for (const tokenId of Object.keys(builtinTokens)) {
const token = builtinTokens[tokenId]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom tokens listed twice in CLI command

Medium Severity

Both for loops now iterate over customTokens, causing every custom token to be printed twice — once without the "(custom)" label and once with it. The first loop was originally for builtinTokens and the second for customTokens, but after the removal the first loop wasn't deleted, it was just retargeted to customTokens.

Fix in Cursor Fix in Web

Comment thread package.json
"clipanion": "^4.0.0-rc.2",
"crypto-browserify": "^3.12.0",
"edge-core-js": "^2.42.0",
"edge-core-js": "file:../edge-core-js",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local file path for edge-core-js dependency committed

High Severity

The edge-core-js dependency was changed from "^2.42.0" to "file:../edge-core-js", which is a local filesystem path. This will break builds for anyone who doesn't have the edge-core-js repo checked out as a sibling directory, including CI and other developers.

Fix in Cursor Fix in Web

Comment thread src/eos/EosEngine.ts Outdated
networkLocation: {
contractAddress: 'eosio.token'
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOS native token entry lost on custom token changes

High Severity

The eosio.token entry is added to allTokensMap in the constructor, but allTokensMap is reassigned to a fresh object whenever changeCustomTokensSync runs. Since the EOS engine doesn't override that method, any runtime custom token update will discard the eosio.token entry, breaking native currency transaction processing (it won't find the contract address).

Fix in Cursor Fix in Web

Comment thread src/common/innerPlugin.ts Outdated
async function getBuiltinTokens(): Promise<EdgeTokenMap> {
return builtinTokens
}
function updateBuiltinTokens(payload: JsonObject = {}): void {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty updateBuiltinTokens function is dead code

Low Severity

updateBuiltinTokens is now an empty function body but is still called in two places (on initial plugin creation and after updateInfoPayload). This dead code adds unnecessary noise and confusion about whether builtin token processing still occurs.

Fix in Cursor Fix in Web

@peachbits peachbits force-pushed the matthew/no-builtin-tokens branch from b32b302 to 0132641 Compare February 26, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant