Skip to content

fix: correct stale/fabricated APIs across Move and TS SDK skills#57

Draft
WGB5445 wants to merge 2 commits into
mainfrom
fix/skills-audit-stale-apis
Draft

fix: correct stale/fabricated APIs across Move and TS SDK skills#57
WGB5445 wants to merge 2 commits into
mainfrom
fix/skills-audit-stale-apis

Conversation

@WGB5445

@WGB5445 WGB5445 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Audited all skills against the current main branches of aptos-core and aptos-ts-sdk (via parallel background research agents) and fixed factually wrong or non-existent APIs found.

Move (aptos-core):

  • ordered_map/big_ordered_map live under aptos_framework::, not aptos_std::
  • big_ordered_map::new_with_config takes (inner_max_degree, leaf_max_degree, reuse_slots), not (initial_capacity, allocate_spare_slots, reuse_slots); pre-allocation is a separate allocate_spare_slots() call
  • big_ordered_map has no for_each_reverse; replaced with collect+reverse
  • SmartTable takes keys by value, BigOrderedMap by reference (except add) — the modernize-move migration guide had this backwards
  • object::enable_ungated_transfer takes &TransferRef, not &ConstructorRef, and objects are ungated-transferable by default already
  • removed fabricated account::get_storage_usage, std::u64::MAX/std::i32::MIN-style constants, and std::box::Box (Move has no recursive struct/enum support at all — replaced with flat vector<Node> indexing)
  • aptos CLI gas profiling: aptos move run-function --simulate and gas::remaining_gas() don't exist; corrected to aptos move run --local / --profile-gas

TypeScript SDK (aptos-ts-sdk v7.1.3):

  • aptos.getBalance() requires an asset arg and returns number, not bigint
  • aptos.getModule() doesn't exist; it's aptos.getAccountModule()
  • aptos.gasProfile() and aptos.getAccountEventsByEventType() don't exist (gas profiling is a CLI-only feature; events go through queryIndexer)
  • maxGasAmount/gasUnitPrice/expireTimestamp are number, not bigint
  • AccountUtils is not exported from the package's public entry point

Also fixed stale self-references in CONTRIBUTING.md left over from a prior repo/skill rename.

Test plan

  • Skim each changed file to confirm the corrected code examples read cleanly
  • Spot-check a couple of the Move fixes by compiling equivalent snippets against a local aptos-core checkout
  • Spot-check a couple of the TS SDK fixes against @aptos-labs/ts-sdk@7.1.3 type definitions

Closes DVR-180

🤖 Generated with Claude Code

WGB5445 and others added 2 commits July 7, 2026 19:49
Audited all skills against the current main branches of aptos-core and
aptos-ts-sdk and fixed factually wrong or non-existent APIs found:

Move (aptos-core):
- ordered_map/big_ordered_map live under aptos_framework::, not aptos_std::
- big_ordered_map::new_with_config takes (inner_max_degree, leaf_max_degree,
  reuse_slots), not (initial_capacity, allocate_spare_slots, reuse_slots);
  pre-allocation is a separate allocate_spare_slots() call
- big_ordered_map has no for_each_reverse; replaced with collect+reverse
- SmartTable takes keys by value, BigOrderedMap by reference (except add) -
  the modernize-move migration guide had this backwards
- object::enable_ungated_transfer takes &TransferRef, not &ConstructorRef,
  and objects are ungated-transferable by default already
- removed fabricated account::get_storage_usage, std::u64::MAX/std::i32::MIN
  style constants, and std::box::Box (Move has no recursive struct/enum
  support at all - replaced with flat vector<Node> indexing)
- aptos CLI gas profiling: `aptos move run-function --simulate` and
  `gas::remaining_gas()` don't exist; corrected to `aptos move run --local`
  / `--profile-gas`

TypeScript SDK (aptos-ts-sdk v7.1.3):
- aptos.getBalance() requires an `asset` arg and returns number, not bigint
- aptos.getModule() doesn't exist; it's aptos.getAccountModule()
- aptos.gasProfile() and aptos.getAccountEventsByEventType() don't exist
  (gas profiling is a CLI-only feature; events go through queryIndexer)
- maxGasAmount/gasUnitPrice/expireTimestamp are number, not bigint
- AccountUtils is not exported from the package's public entry point

Also fixed stale self-references in CONTRIBUTING.md (old repo/skill names
left over from a prior rename).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@WGB5445 WGB5445 requested a review from gregnazario July 7, 2026 14:56
Comment on lines +238 to +243
// BigOrderedMap has no for_each_reverse - collect ascending, then reverse
let all_players = vector[];
big_ordered_map::for_each_ref(&leaderboard.scores, |_score, player| {
vector::push_back(&mut all_players, *player);
});
vector::reverse(&mut all_players);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there's a keys() then you call reverse() on that, then iterate with lookups, rather than read everything twice.

Either way, iterating a BigOrderedMap in reverse is likely to cause issues if the map is too big.

vector::push_back(&mut top, *vector::borrow(&all_players, i));
i = i + 1;
};
top

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

similar to big ordered map, except this one is doable in length

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.

2 participants