diff --git a/src/eosjs-api.ts b/src/eosjs-api.ts index d4fa2a3ad..28fd097e6 100644 --- a/src/eosjs-api.ts +++ b/src/eosjs-api.ts @@ -33,6 +33,7 @@ import { ReadOnlyTransactResult, } from './eosjs-rpc-interfaces'; import * as ser from './eosjs-serialize'; +import { abiEosioNull } from './static-abi'; export class Api { /** Issues RPC calls */ @@ -63,7 +64,7 @@ export class Api { public contracts = new Map(); /** Fetched abis */ - public cachedAbis = new Map(); + public cachedAbis = new Map([abiEosioNull]); /** * @param args diff --git a/src/static-abi/eosio.null.ts b/src/static-abi/eosio.null.ts new file mode 100644 index 000000000..deb2b85fc --- /dev/null +++ b/src/static-abi/eosio.null.ts @@ -0,0 +1,29 @@ +import type { CachedAbi } from "../eosjs-api-interfaces"; + +export const accountName = "eosio.null"; +export const value: CachedAbi = { + rawAbi: new Uint8Array(), + abi: { + version: "eosio::abi/1.0", + types: [], + structs: [ + { + name: "nonce", + base: "", + fields: [{ name: "value", type: "string" }], + }, + ], + actions: [ + { + name: "nonce", + type: "nonce", + ricardian_contract: "", + }, + ], + tables: [], + ricardian_clauses: [], + abi_extensions: [], + error_messages: [], + }, +}; +export const abi = [accountName, value] as const; diff --git a/src/static-abi/index.ts b/src/static-abi/index.ts new file mode 100644 index 000000000..98bad261f --- /dev/null +++ b/src/static-abi/index.ts @@ -0,0 +1 @@ +export { abi as abiEosioNull } from "./eosio.null";