Skip to content

Commit

Permalink
update name to MoveStructType
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Oct 25, 2023
1 parent 87a5635 commit 2ba5f67
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
LedgerVersion,
MoveModuleBytecode,
MoveResource,
MoveResourceType,
MoveStructType,
OrderBy,
PaginationArgs,
TokenStandard,
Expand Down Expand Up @@ -173,7 +173,7 @@ export class Account {
*/
async getAccountResource(args: {
accountAddress: HexInput;
resourceType: MoveResourceType;
resourceType: MoveStructType;
options?: LedgerVersion;
}): Promise<MoveResource> {
return getResource({ aptosConfig: this.config, ...args });
Expand Down
4 changes: 2 additions & 2 deletions src/api/coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,7 +31,7 @@ export class Coin {
sender: Account;
recipient: HexInput;
amount: AnyNumber;
coinType?: MoveResourceType;
coinType?: MoveStructType;
options?: GenerateTransactionOptions;
}): Promise<SingleSignerTransaction> {
return transferCoinTransaction({ aptosConfig: this.config, ...args });
Expand Down
4 changes: 2 additions & 2 deletions src/api/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -41,7 +41,7 @@ export class Event {
*/
async getAccountEventsByEventType(args: {
accountAddress: HexInput;
eventType: MoveResourceType;
eventType: MoveStructType;
options?: {
pagination?: PaginationArgs;
orderBy?: OrderBy<GetEventsResponse[0]>;
Expand Down
4 changes: 2 additions & 2 deletions src/internal/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
LedgerVersion,
MoveModuleBytecode,
MoveResource,
MoveResourceType,
MoveStructType,
OrderBy,
PaginationArgs,
TokenStandard,
Expand Down Expand Up @@ -158,7 +158,7 @@ export async function getResources(args: {
export async function getResource(args: {
aptosConfig: AptosConfig;
accountAddress: HexInput;
resourceType: MoveResourceType;
resourceType: MoveStructType;
options?: LedgerVersion;
}): Promise<MoveResource> {
const { aptosConfig, accountAddress, resourceType, options } = args;
Expand Down
4 changes: 2 additions & 2 deletions src/internal/coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { U64 } from "../bcs/serializable/movePrimitives";
import { Account, AccountAddress } from "../core";
import { GenerateTransactionOptions, SingleSignerTransaction } from "../transactions/types";
import { StructTag, TypeTagStruct } from "../transactions/typeTag/typeTag";
import { HexInput, AnyNumber, MoveResourceType } from "../types";
import { HexInput, AnyNumber, MoveStructType } from "../types";
import { APTOS_COIN } from "../utils/const";
import { generateTransaction } from "./transactionSubmission";

Expand All @@ -12,7 +12,7 @@ export async function transferCoinTransaction(args: {
sender: Account;
recipient: HexInput;
amount: AnyNumber;
coinType?: MoveResourceType;
coinType?: MoveStructType;
options?: GenerateTransactionOptions;
}): Promise<SingleSignerTransaction> {
const { aptosConfig, sender, recipient, amount, coinType, options } = args;
Expand Down
4 changes: 2 additions & 2 deletions src/internal/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<GetEventsResponse[0]>;
Expand Down
4 changes: 2 additions & 2 deletions src/transactions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
TransactionPayloadMultisig,
TransactionPayloadScript,
} from "./instances";
import { AnyNumber, HexInput, MoveResourceType } from "../types";
import { AnyNumber, HexInput, MoveStructType } from "../types";
import { TypeTag } from "./typeTag/typeTag";

export type EntryFunctionArgumentTypes =
Expand Down Expand Up @@ -81,7 +81,7 @@ export type GenerateTransactionPayloadData = EntryFunctionData | ScriptData | Mu
* The data needed to generate an Entry Function payload
*/
export type EntryFunctionData = {
function: MoveResourceType;
function: MoveStructType;
typeArguments?: Array<TypeTag>;
functionArguments: Array<EntryFunctionArgumentTypes>;
};
Expand Down
20 changes: 10 additions & 10 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export type GasEstimation = {
};

export type MoveResource = {
type: MoveResourceType;
type: MoveStructType;
data: {};
};

Expand Down Expand Up @@ -506,7 +506,7 @@ export type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPa

export type EntryFunctionPayloadResponse = {
type: string;
function: MoveResourceType;
function: MoveStructType;
/**
* Type arguments of the function
*/
Expand Down Expand Up @@ -671,7 +671,7 @@ export type MoveOptionType = MoveType | null | undefined;
/**
* String representation of a on-chain Move struct type.
*/
export type MoveResourceType = `${string}::${string}::${string}`;
export type MoveStructType = `${string}::${string}::${string}`;

export type MoveType =
| boolean
Expand All @@ -684,7 +684,7 @@ export type MoveType =
| MoveUint256Type
| MoveAddressType
| MoveObjectType
| MoveResourceType
| MoveStructType
| Array<MoveType>;

/**
Expand Down Expand Up @@ -721,7 +721,7 @@ export type MoveValue =
| MoveUint256Type
| MoveAddressType
| MoveObjectType
| MoveResourceType
| MoveStructType
| MoveOptionType
| Array<MoveValue>;

Expand Down Expand Up @@ -879,8 +879,8 @@ export type Block = {
* The data needed to generate a View Request payload
*/
export type ViewRequestData = {
function: MoveResourceType;
typeArguments?: Array<MoveResourceType>;
function: MoveStructType;
typeArguments?: Array<MoveStructType>;
functionArguments?: Array<MoveValue>;
};

Expand All @@ -889,14 +889,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<MoveResourceType>;
type_arguments: Array<MoveStructType>;
/**
* Arguments of the function
*/
Expand Down

0 comments on commit 2ba5f67

Please sign in to comment.