diff --git a/src/api/account.ts b/src/api/account.ts index 0927727fd..c3f0ebeb9 100644 --- a/src/api/account.ts +++ b/src/api/account.ts @@ -14,7 +14,7 @@ import { LedgerVersion, MoveModuleBytecode, MoveResource, - MoveResourceType, + MoveStructType, OrderBy, PaginationArgs, TokenStandard, @@ -175,7 +175,7 @@ export class Account { */ async getAccountResource(args: { accountAddress: HexInput; - resourceType: MoveResourceType; + resourceType: MoveStructType; options?: LedgerVersion; }): Promise { return getResource({ aptosConfig: this.config, ...args }); diff --git a/src/api/coin.ts b/src/api/coin.ts index bb6fac069..5b906ea86 100644 --- a/src/api/coin.ts +++ b/src/api/coin.ts @@ -5,7 +5,7 @@ import { AptosConfig } from "./aptosConfig"; import { Account } from "../core"; import { transferCoinTransaction } from "../internal/coin"; import { SingleSignerTransaction, GenerateTransactionOptions } from "../transactions/types"; -import { AnyNumber, HexInput, MoveResourceType } from "../types"; +import { AnyNumber, HexInput, MoveStructType } from "../types"; /** * A class to handle all `Coin` operations @@ -31,7 +31,7 @@ export class Coin { sender: Account; recipient: HexInput; amount: AnyNumber; - coinType?: MoveResourceType; + coinType?: MoveStructType; options?: GenerateTransactionOptions; }): Promise { return transferCoinTransaction({ aptosConfig: this.config, ...args }); diff --git a/src/api/event.ts b/src/api/event.ts index a1f863efa..72e2d9201 100644 --- a/src/api/event.ts +++ b/src/api/event.ts @@ -3,7 +3,7 @@ import { AptosConfig } from "./aptosConfig"; import { getAccountEventsByCreationNumber, getAccountEventsByEventType, getEvents } from "../internal/event"; -import { AnyNumber, GetEventsResponse, HexInput, MoveResourceType, OrderBy, PaginationArgs } from "../types"; +import { AnyNumber, GetEventsResponse, HexInput, MoveStructType, OrderBy, PaginationArgs } from "../types"; import { EventsBoolExp } from "../types/generated/types"; /** @@ -41,7 +41,7 @@ export class Event { */ async getAccountEventsByEventType(args: { accountAddress: HexInput; - eventType: MoveResourceType; + eventType: MoveStructType; options?: { pagination?: PaginationArgs; orderBy?: OrderBy; diff --git a/src/internal/account.ts b/src/internal/account.ts index 168dd11d0..091f37b28 100644 --- a/src/internal/account.ts +++ b/src/internal/account.ts @@ -26,7 +26,7 @@ import { LedgerVersion, MoveModuleBytecode, MoveResource, - MoveResourceType, + MoveStructType, OrderBy, PaginationArgs, SigningScheme, @@ -164,7 +164,7 @@ export async function getResources(args: { export async function getResource(args: { aptosConfig: AptosConfig; accountAddress: HexInput; - resourceType: MoveResourceType; + resourceType: MoveStructType; options?: LedgerVersion; }): Promise { const { aptosConfig, accountAddress, resourceType, options } = args; diff --git a/src/internal/coin.ts b/src/internal/coin.ts index 2fb36156b..0370675bc 100644 --- a/src/internal/coin.ts +++ b/src/internal/coin.ts @@ -2,7 +2,7 @@ import { AptosConfig } from "../api/aptosConfig"; import { U64 } from "../bcs/serializable/movePrimitives"; import { Account, AccountAddress } from "../core"; import { GenerateTransactionOptions, SingleSignerTransaction } from "../transactions/types"; -import { HexInput, AnyNumber, MoveResourceType } from "../types"; +import { HexInput, AnyNumber, MoveStructType } from "../types"; import { APTOS_COIN } from "../utils/const"; import { generateTransaction } from "./transactionSubmission"; import { parseTypeTag } from "../transactions/typeTag/parser"; @@ -12,7 +12,7 @@ export async function transferCoinTransaction(args: { sender: Account; recipient: HexInput; amount: AnyNumber; - coinType?: MoveResourceType; + coinType?: MoveStructType; options?: GenerateTransactionOptions; }): Promise { const { aptosConfig, sender, recipient, amount, coinType, options } = args; diff --git a/src/internal/event.ts b/src/internal/event.ts index 6dbcb9ccc..9c564b895 100644 --- a/src/internal/event.ts +++ b/src/internal/event.ts @@ -10,7 +10,7 @@ import { AptosConfig } from "../api/aptosConfig"; import { AccountAddress } from "../core"; -import { AnyNumber, GetEventsResponse, HexInput, PaginationArgs, MoveResourceType, OrderBy } from "../types"; +import { AnyNumber, GetEventsResponse, HexInput, PaginationArgs, MoveStructType, OrderBy } from "../types"; import { GetEventsQuery } from "../types/generated/operations"; import { GetEvents } from "../types/generated/queries"; import { EventsBoolExp } from "../types/generated/types"; @@ -35,7 +35,7 @@ export async function getAccountEventsByCreationNumber(args: { export async function getAccountEventsByEventType(args: { aptosConfig: AptosConfig; accountAddress: HexInput; - eventType: MoveResourceType; + eventType: MoveStructType; options?: { pagination?: PaginationArgs; orderBy?: OrderBy; diff --git a/src/types/index.ts b/src/types/index.ts index 1722e9ac7..e1d0db0a9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -249,7 +249,7 @@ export type GasEstimation = { }; export type MoveResource = { - type: MoveResourceType; + type: MoveStructType; data: {}; }; @@ -518,7 +518,7 @@ export type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPa export type EntryFunctionPayloadResponse = { type: string; - function: MoveResourceType; + function: MoveStructType; /** * Type arguments of the function */ @@ -679,12 +679,11 @@ export type MoveUint128Type = string; export type MoveUint256Type = string; export type MoveAddressType = string; export type MoveObjectType = string; -export type MoveStructType = `${string}::${string}::${string}`; export type MoveOptionType = MoveType | null | undefined; /** - * String representation of a on-chain Move struct type. + * This is the format for a fully qualified struct, resource, or entry function in Move. */ -export type MoveResourceType = `${string}::${string}::${string}`; +export type MoveStructType = `${string}::${string}::${string}`; export type MoveType = | boolean @@ -893,7 +892,7 @@ export type Block = { */ export type ViewRequestData = { function: MoveStructType; - typeArguments?: Array; + typeArguments?: Array; functionArguments?: Array; }; @@ -902,14 +901,14 @@ export type ViewRequestData = { /** * View request for the Move view function API * - * `type MoveResourceType = ${string}::${string}::${string}`; + * `type MoveStructType = ${string}::${string}::${string}`; */ export type ViewRequest = { - function: MoveResourceType; + function: MoveStructType; /** * Type arguments of the function */ - type_arguments: Array; + type_arguments: Array; /** * Arguments of the function */