Skip to content

Commit

Permalink
[ts-sdk] Update generated client with documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnazario committed Sep 2, 2022
1 parent 73e3907 commit 73a56a5
Show file tree
Hide file tree
Showing 107 changed files with 971 additions and 154 deletions.
5 changes: 5 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/AccountData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import type { HexEncodedBytes } from './HexEncodedBytes';
import type { U64 } from './U64';

/**
* Account data
*
* A simplified version of the onchain Account resource
*/
export type AccountData = {
sequence_number: U64;
authentication_key: HexEncodedBytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
import type { AccountSignature_Ed25519Signature } from './AccountSignature_Ed25519Signature';
import type { AccountSignature_MultiEd25519Signature } from './AccountSignature_MultiEd25519Signature';

/**
* Account signature scheme
*
* The account signature scheme allows you to have two types of accounts:
*
* 1. A single Ed25519 key account, one private key
* 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
*/
export type AccountSignature = (AccountSignature_Ed25519Signature | AccountSignature_MultiEd25519Signature);

8 changes: 7 additions & 1 deletion ecosystem/typescript/sdk/src/generated/models/Address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
/* eslint-disable */

/**
* Hex encoded 32 byte Aptos account address
* The address of an account
*
* This is represented in a string as a 64 character hex string, sometimes
* shortened by stripping leading 0s, and adding a 0x.
*
* For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
*
*/
export type Address = string;
9 changes: 9 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import type { HashValue } from './HashValue';
import type { Transaction } from './Transaction';
import type { U64 } from './U64';

/**
* A Block with or without transactions
*
* This contains the information about a transactions along with
* associated transactions if requested
*/
export type Block = {
block_height: U64;
block_hash: HashValue;
block_timestamp: U64;
first_version: U64;
last_version: U64;
/**
* The transactions in the block in sequential order
*/
transactions?: Array<Transaction>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,47 @@ import type { HashValue } from './HashValue';
import type { U64 } from './U64';
import type { WriteSetChange } from './WriteSetChange';

/**
* A block metadata transaction
*
* This signifies the beginning of a block, and contains information
* about the specific block
*/
export type BlockMetadataTransaction = {
version: U64;
hash: HashValue;
state_change_hash: HashValue;
event_root_hash: HashValue;
state_checkpoint_hash?: HashValue;
gas_used: U64;
/**
* Whether the transaction was successful
*/
success: boolean;
/**
* The VM status of the transaction, can tell useful information in a failure
*/
vm_status: string;
accumulator_root_hash: HashValue;
/**
* Final state of resources changed by the transaction
*/
changes: Array<WriteSetChange>;
id: HashValue;
epoch: U64;
round: U64;
/**
* The events emitted at the block creation
*/
events: Array<Event>;
/**
* Previous block votes
*/
previous_block_votes_bitvec: Array<number>;
proposer: Address;
/**
* The indices of the proposers who failed to propose
*/
failed_proposer_indices: Array<number>;
timestamp: U64;
};
Expand Down
15 changes: 15 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/DecodedTableData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@
/* tslint:disable */
/* eslint-disable */

/**
* Decoded table data
*/
export type DecodedTableData = {
/**
* Key of table in JSON
*/
key: any;
/**
* Type of key
*/
key_type: string;
/**
* Value of table in JSON
*/
value: any;
/**
* Type of value
*/
value_type: string;
};

3 changes: 3 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/DeleteModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import type { Address } from './Address';
import type { MoveModuleId } from './MoveModuleId';

/**
* Delete a module
*/
export type DeleteModule = {
address: Address;
state_key_hash: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import type { Address } from './Address';
import type { MoveStructTag } from './MoveStructTag';

/**
* Delete a resource
*/
export type DeleteResource = {
address: Address;
state_key_hash: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import type { DeletedTableData } from './DeletedTableData';
import type { HexEncodedBytes } from './HexEncodedBytes';

/**
* Delete a table item
*/
export type DeleteTableItem = {
state_key_hash: string;
handle: HexEncodedBytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
/* tslint:disable */
/* eslint-disable */

/**
* Deleted table data
*/
export type DeletedTableData = {
/**
* Deleted key
*/
key: any;
/**
* Deleted key type
*/
key_type: string;
};

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import type { HexEncodedBytes } from './HexEncodedBytes';

/**
* A single Ed25519 signature
*/
export type Ed25519Signature = {
public_key: HexEncodedBytes;
signature: HexEncodedBytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ import type { Address } from './Address';
import type { TransactionPayload } from './TransactionPayload';
import type { U64 } from './U64';

/**
* Request to encode a submission
*/
export type EncodeSubmissionRequest = {
sender: Address;
sequence_number: U64;
max_gas_amount: U64;
gas_unit_price: U64;
expiration_timestamp_secs: U64;
payload: TransactionPayload;
/**
* Secondary signer accounts of the request for Multi-agent
*/
secondary_signers?: Array<Address>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@
import type { EntryFunctionId } from './EntryFunctionId';
import type { MoveType } from './MoveType';

/**
* Payload which runs a single entry function
*/
export type EntryFunctionPayload = {
function: EntryFunctionId;
/**
* Type arguments of the function
*/
type_arguments: Array<MoveType>;
/**
* Arguments of the function
*/
arguments: Array<any>;
};

6 changes: 6 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ import type { EventKey } from './EventKey';
import type { MoveType } from './MoveType';
import type { U64 } from './U64';

/**
* An event from a transaction
*/
export type Event = {
key: EventKey;
sequence_number: U64;
type: MoveType;
/**
* The JSON representation of the event
*/
data: any;
};

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
/* tslint:disable */
/* eslint-disable */

/**
* Struct holding the outputs of the estimate gas API
*/
export type GasEstimation = {
/**
* The current estimate for the gas unit price
*/
gas_estimate: number;
};

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@

import type { GenesisPayload_WriteSetPayload } from './GenesisPayload_WriteSetPayload';

/**
* The writeset payload of the Genesis transaction
*/
export type GenesisPayload = GenesisPayload_WriteSetPayload;

Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,35 @@ import type { HashValue } from './HashValue';
import type { U64 } from './U64';
import type { WriteSetChange } from './WriteSetChange';

/**
* The genesis transaction
*
* This only occurs at the genesis transaction (version 0)
*/
export type GenesisTransaction = {
version: U64;
hash: HashValue;
state_change_hash: HashValue;
event_root_hash: HashValue;
state_checkpoint_hash?: HashValue;
gas_used: U64;
/**
* Whether the transaction was successful
*/
success: boolean;
/**
* The VM status of the transaction, can tell useful information in a failure
*/
vm_status: string;
accumulator_root_hash: HashValue;
/**
* Final state of resources changed by the transaction
*/
changes: Array<WriteSetChange>;
payload: GenesisPayload;
/**
* Events emitted during genesis
*/
events: Array<Event>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/* tslint:disable */
/* eslint-disable */

/**
* Struct for healthcheck
*/
export type HealthCheckSuccess = {
message: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import type { U64 } from './U64';
* index endpoint (i.e., GET "/").
*/
export type IndexResponse = {
/**
* Chain ID of the current chain
*/
chain_id: number;
epoch: U64;
ledger_version: U64;
Expand Down
15 changes: 15 additions & 0 deletions ecosystem/typescript/sdk/src/generated/models/MoveFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ import type { MoveFunctionGenericTypeParam } from './MoveFunctionGenericTypePara
import type { MoveFunctionVisibility } from './MoveFunctionVisibility';
import type { MoveType } from './MoveType';

/**
* Move function
*/
export type MoveFunction = {
name: IdentifierWrapper;
visibility: MoveFunctionVisibility;
/**
* Whether the function can be called as an entry function directly in a transaction
*/
is_entry: boolean;
/**
* Generic type params associated with the Move function
*/
generic_type_params: Array<MoveFunctionGenericTypeParam>;
/**
* Parameters associated with the move function
*/
params: Array<MoveType>;
/**
* Return type of the function
*/
return: Array<MoveType>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

import type { MoveAbility } from './MoveAbility';

/**
* Move function generic type param
*/
export type MoveFunctionGenericTypeParam = {
/**
* Move abilities tied to the generic type param and associated with the function that uses it
*/
constraints: Array<MoveAbility>;
};

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/* tslint:disable */
/* eslint-disable */

/**
* Move function visibility
*/
export enum MoveFunctionVisibility {
PRIVATE = 'private',
PUBLIC = 'public',
Expand Down
Loading

0 comments on commit 73a56a5

Please sign in to comment.