Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ All generated or modified code **must** include JSDoc comments (`/** ... */`), c
- `pnpm test` runs `npm run build` first (not `pnpm build`), then jest — the build must succeed before tests run
- protoc-gen packages have `postinstall` scripts that trigger `pnpm dist` — this can be slow on first install
- The `fix-hybrid-output.mjs` script must run after every build of hybrid packages or ESM imports will break in Node
- Keep `AccountObject.created` optional: valid system-account responses may omit it.
- `packages/sdk-core/src/contracts/sysio/authex` owns `sysio.authex` action builders, link table reads, and create-link proof helpers. Consumers should not duplicate the `createlink` message/signature rules locally.
- AuthEx `links` reads use wire-sysio KV `index_name` queries with JSON-encoded bounds. Preserve KV row unwrapping, generated enum-name normalization, and compressed/uncompressed EM key equivalence.
- `packages/sdk-core/src/contracts/sysio/reserv` owns public `sysio.reserv` registry reads, normalized rows, matching, rewards, and read-only quote helpers. External-chain reserve custody belongs in the ABI/IDL-owning chain SDK.
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

JavaScript library for working with Wire powered blockchains (formerly EOSIO, still compatible with EOSIO).

The v1 account decoder accepts valid system-account responses that omit the
optional `created` timestamp.

Available on npm: <https://www.npmjs.com/package/@wireio/sdk-core>

## Multisig
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-core/src/api/v1/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ export class AccountObject extends Struct {
@Struct.field("bool") declare privileged: boolean
/** Last update to accounts contract as unix timestamp. */
@Struct.field("time_point") declare last_code_update: TimePoint
/** Account created as unix timestamp. */
@Struct.field("time_point") declare created: TimePoint
/** Account creation timestamp, omitted by some valid system-account responses. */
@Struct.field("time_point", { optional: true }) declare created: TimePoint | null
/** Account core token balance */
@Struct.field("asset?") core_liquid_balance?: Asset
@Struct.field("int64") declare ram_quota: Int64
Expand Down
25 changes: 25 additions & 0 deletions packages/sdk-core/tests/api/v1/Chain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,31 @@ describe("ChainAPI.get_block", () => {
})
})

describe("ChainAPI.get_account", () => {
test("decodes system accounts that omit the creation timestamp", async () => {
const client = makeClient({
"/v1/chain/get_account": {
account_name: "sysio",
head_block_num: 729126,
head_block_time: "2026-07-21T19:06:21.000",
privileged: true,
last_code_update: "2026-07-16T21:03:45.500",
ram_quota: 464220502,
net_weight: -1,
cpu_weight: -1,
net_limit: { used: -1, available: -1, max: -1 },
cpu_limit: { used: -1, available: -1, max: -1 },
ram_usage: 1745389,
permissions: []
}
}),
account = await client.v1.chain.get_account("sysio")

expect(account.account_name.toString()).toBe("sysio")
expect(account.created).toBeNull()
})
})

describe("ChainAPI.get_table_rows — wire-sysio KV row shape", () => {
test("forwards named KV secondary-index bounds", async () => {
const provider = new CapturingProvider(),
Expand Down
Loading