fix: correct stale/fabricated APIs across Move and TS SDK skills#57
Draft
WGB5445 wants to merge 2 commits into
Draft
fix: correct stale/fabricated APIs across Move and TS SDK skills#57WGB5445 wants to merge 2 commits into
WGB5445 wants to merge 2 commits into
Conversation
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>
gregnazario
reviewed
Jul 7, 2026
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); |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
similar to big ordered map, except this one is doable in length
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
Audited all skills against the current
mainbranches ofaptos-coreandaptos-ts-sdk(via parallel background research agents) and fixed factually wrong or non-existent APIs found.Move (aptos-core):
ordered_map/big_ordered_maplive underaptos_framework::, notaptos_std::big_ordered_map::new_with_configtakes(inner_max_degree, leaf_max_degree, reuse_slots), not(initial_capacity, allocate_spare_slots, reuse_slots); pre-allocation is a separateallocate_spare_slots()callbig_ordered_maphas nofor_each_reverse; replaced with collect+reverseSmartTabletakes keys by value,BigOrderedMapby reference (exceptadd) — the modernize-move migration guide had this backwardsobject::enable_ungated_transfertakes&TransferRef, not&ConstructorRef, and objects are ungated-transferable by default alreadyaccount::get_storage_usage,std::u64::MAX/std::i32::MIN-style constants, andstd::box::Box(Move has no recursive struct/enum support at all — replaced with flatvector<Node>indexing)aptosCLI gas profiling:aptos move run-function --simulateandgas::remaining_gas()don't exist; corrected toaptos move run --local/--profile-gasTypeScript SDK (aptos-ts-sdk v7.1.3):
aptos.getBalance()requires anassetarg and returnsnumber, notbigintaptos.getModule()doesn't exist; it'saptos.getAccountModule()aptos.gasProfile()andaptos.getAccountEventsByEventType()don't exist (gas profiling is a CLI-only feature; events go throughqueryIndexer)maxGasAmount/gasUnitPrice/expireTimestamparenumber, notbigintAccountUtilsis not exported from the package's public entry pointAlso fixed stale self-references in
CONTRIBUTING.mdleft over from a prior repo/skill rename.Test plan
aptos-corecheckout@aptos-labs/ts-sdk@7.1.3type definitionsCloses DVR-180
🤖 Generated with Claude Code