wowok
Version:
Wowok Blockchain TypeScript API
955 lines (954 loc) • 23.8 kB
TypeScript
export interface Balance {
coinObjectCount: number;
coinType: string;
lockedBalance: {
[key: string]: string;
};
totalBalance: string;
}
export interface BalanceChange {
amount: string;
coinType: string;
owner: ObjectOwner;
}
export interface Checkpoint {
checkpointCommitments: CheckpointCommitment[];
digest: string;
endOfEpochData?: EndOfEpochData | null;
epoch: string;
epochRollingGasCostSummary: GasCostSummary;
networkTotalTransactions: string;
previousDigest?: string | null;
sequenceNumber: string;
timestampMs: string;
transactions: string[];
validatorSignature: string;
}
export type CheckpointCommitment = {
ECMHLiveObjectSetDigest: ECMHLiveObjectSetDigest;
};
export type CheckpointId = string | string;
export interface Claim {
indexMod4: number;
value: string;
}
export interface CoinStruct {
balance: string;
coinObjectId: string;
coinType: string;
digest: string;
previousTransaction: string;
version: string;
}
export interface CommitteeInfo {
epoch: string;
validators: [string, string][];
}
export type CompressedSignature = {
Ed25519: string;
} | {
Secp256k1: string;
} | {
Secp256r1: string;
} | {
Falcon512: string;
};
export type ConsensusDeterminedVersionAssignments = {
CancelledTransactions: [string, [string, string][]][];
} | {
CancelledTransactionsV2: [string, [[string, string], string][]][];
};
export type WowParsedData = {
dataType: "moveObject";
fields: MoveStruct;
hasPublicTransfer: boolean;
type: string;
} | {
dataType: "package";
disassembled: {
[key: string]: unknown;
};
};
export interface DelegatedStake {
stakes: StakeObject[];
stakingPool: string;
validatorAddress: string;
}
export interface DevInspectArgs {
gasBudget?: string | null;
gasObjects?: [string, string, string][] | null;
gasSponsor?: string | null;
showRawTxnDataAndEffects?: boolean | null;
skipChecks?: boolean | null;
}
export interface DevInspectResults {
effects: TransactionEffects;
error?: string | null;
events: WowEvent[];
rawEffects?: number[];
rawTxnData?: number[];
results?: SuiExecutionResult[] | null;
}
export interface DisplayFieldsResponse {
data?: {
[key: string]: string;
} | null;
error?: ObjectResponseError | null;
}
export interface DryRunTransactionBlockResponse {
balanceChanges: BalanceChange[];
effects: TransactionEffects;
events: WowEvent[];
executionErrorSource?: string | null;
input: TransactionBlockData;
objectChanges: WowObjectChange[];
suggestedGasPrice?: string | null;
}
export type DynamicFieldInfo = {
digest: string;
name: DynamicFieldName;
objectId: string;
objectType: string;
type: DynamicFieldType;
version: string;
bcsEncoding: "base64";
bcsName: string;
} | {
digest: string;
name: DynamicFieldName;
objectId: string;
objectType: string;
type: DynamicFieldType;
version: string;
bcsEncoding: "base58";
bcsName: string;
};
export interface DynamicFieldName {
type: string;
value: unknown;
}
export type DynamicFieldType = "DynamicField" | "DynamicObject";
export interface ECMHLiveObjectSetDigest {
digest: number[];
}
export interface EndOfEpochData {
epochCommitments: CheckpointCommitment[];
nextEpochCommittee: [string, string][];
nextEpochProtocolVersion: string;
}
export type WowEvent = {
id: EventId;
packageId: string;
parsedJson: unknown;
sender: string;
timestampMs?: string | null;
transactionModule: string;
type: string;
bcs: string;
bcsEncoding: "base64";
} | {
id: EventId;
packageId: string;
parsedJson: unknown;
sender: string;
timestampMs?: string | null;
transactionModule: string;
type: string;
bcs: string;
bcsEncoding: "base58";
};
export type WowEventFilter = {
All: [];
} | {
Any: WowEventFilter[];
} | {
Sender: string;
} | {
Transaction: string;
} | {
MoveModule: {
module: string;
package: string;
};
} | {
MoveEventType: string;
} | {
MoveEventModule: {
module: string;
package: string;
};
} | {
TimeRange: {
endTime: string;
startTime: string;
};
};
export interface EventId {
eventSeq: string;
txDigest: string;
}
export type ExecuteTransactionRequestType = "WaitForEffectsCert" | "WaitForLocalExecution";
export type ExecutionStatus = {
status: "success" | "failure";
error?: string;
};
export interface GasCostSummary {
computationCost: string;
nonRefundableStorageFee: string;
storageCost: string;
storageRebate: string;
}
export interface SuiGasData {
budget: string;
owner: string;
payment: WowObjectRef[];
price: string;
}
export interface GetPastObjectRequest {
objectId: string;
version: string;
}
export type InputObjectKind = {
MovePackage: string;
} | {
ImmOrOwnedMoveObject: WowObjectRef;
} | {
SharedMoveObject: {
id: string;
initial_shared_version: string;
mutable?: boolean;
};
};
export interface MoveCallParams {
arguments: unknown[];
function: string;
module: string;
packageObjectId: string;
typeArguments?: string[];
}
export type WowMoveFunctionArgType = "Pure" | {
Object: ObjectValueKind;
};
export type MoveStruct = MoveValue[] | {
fields: {
[key: string]: MoveValue;
};
type: string;
} | {
[key: string]: MoveValue;
};
export type MoveValue = number | boolean | string | MoveValue[] | string | {
id: string;
} | MoveStruct | null | MoveVariant;
export interface MoveVariant {
fields: {
[key: string]: MoveValue;
};
type: string;
variant: string;
}
export interface MultiSig {
bitmap: number;
multisig_pk: MultiSigPublicKey;
sigs: CompressedSignature[];
}
export interface MultiSigLegacy {
bitmap: string;
multisig_pk: MultiSigPublicKeyLegacy;
sigs: CompressedSignature[];
}
export interface MultiSigPublicKey {
pk_map: [PublicKey, number][];
threshold: number;
}
export interface MultiSigPublicKeyLegacy {
pk_map: [PublicKey, number][];
threshold: number;
}
export type WowObjectChange = {
digest: string;
modules: string[];
packageId: string;
type: "published";
version: string;
} | {
digest: string;
objectId: string;
objectType: string;
recipient: ObjectOwner;
sender: string;
type: "transferred";
version: string;
} | {
digest: string;
objectId: string;
objectType: string;
owner: ObjectOwner;
previousVersion: string;
sender: string;
type: "mutated";
version: string;
} | {
objectId: string;
objectType: string;
sender: string;
type: "deleted";
version: string;
} | {
objectId: string;
objectType: string;
sender: string;
type: "wrapped";
version: string;
} | {
digest: string;
objectId: string;
objectType: string;
owner: ObjectOwner;
sender: string;
type: "created";
version: string;
};
export interface WowObjectData {
bcs?: RawData | null;
content?: WowParsedData | null;
digest: string;
display?: DisplayFieldsResponse | null;
objectId: string;
owner?: ObjectOwner | null;
previousTransaction?: string | null;
storageRebate?: string | null;
type?: string | null;
version: string;
}
export interface WowObjectDataOptions {
showBcs?: boolean;
showContent?: boolean;
showDisplay?: boolean;
showOwner?: boolean;
showPreviousTransaction?: boolean;
showStorageRebate?: boolean;
showType?: boolean;
}
export type ObjectRead = {
details: WowObjectData;
status: "VersionFound";
} | {
details: string;
status: "ObjectNotExists";
} | {
details: WowObjectRef;
status: "ObjectDeleted";
} | {
details: [string, string];
status: "VersionNotFound";
} | {
details: {
asked_version: string;
latest_version: string;
object_id: string;
};
status: "VersionTooHigh";
};
export interface WowObjectRef {
digest: string;
objectId: string;
version: string;
}
export type ObjectResponseError = {
code: "notExists";
object_id: string;
} | {
code: "dynamicFieldNotFound";
parent_object_id: string;
} | {
code: "deleted";
digest: string;
object_id: string;
version: string;
} | {
code: "unknown";
} | {
code: "displayError";
error: string;
};
export interface WowObjectResponseQuery {
filter?: WowObjectDataFilter | null;
options?: WowObjectDataOptions | null;
}
export type ObjectValueKind = "ByImmutableReference" | "ByMutableReference" | "ByValue";
export interface OwnedObjectRef {
owner: ObjectOwner;
reference: WowObjectRef;
}
export type ObjectOwner = {
AddressOwner: string;
} | {
ObjectOwner: string;
} | {
Shared: {
initial_shared_version: string;
};
} | "Immutable" | {
ConsensusAddressOwner: {
owner: string;
start_version: string;
};
};
export interface PaginatedCheckpoints {
data: Checkpoint[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface PaginatedCoins {
data: CoinStruct[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface PaginatedDynamicFieldInfos {
data: DynamicFieldInfo[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface PaginatedEvents {
data: WowEvent[];
hasNextPage: boolean;
nextCursor?: EventId | null;
}
export interface PaginatedStrings {
data: string[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface PaginatedObjectsResponse {
data: WowObjectResponse[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface PaginatedTransactionResponse {
data: WowTransactionBlockResponse[];
hasNextPage: boolean;
nextCursor?: string | null;
}
export interface ProtocolConfig {
attributes: {
[key: string]: ProtocolConfigValue | null;
};
featureFlags: {
[key: string]: boolean;
};
maxSupportedProtocolVersion: string;
minSupportedProtocolVersion: string;
protocolVersion: string;
}
export type ProtocolConfigValue = {
u16: string;
} | {
u32: string;
} | {
u64: string;
} | {
f64: string;
} | {
bool: string;
};
export type PublicKey = {
Ed25519: string;
} | {
Secp256k1: string;
} | {
Secp256r1: string;
} | {
Falcon512: string;
};
export type RPCTransactionRequestParams = {
transferObjectRequestParams: TransferObjectParams;
} | {
moveCallRequestParams: MoveCallParams;
};
export type RawData = {
bcsBytes: string;
dataType: "moveObject";
hasPublicTransfer: boolean;
type: string;
version: string;
} | {
dataType: "package";
id: string;
linkageTable: {
[key: string]: UpgradeInfo;
};
moduleMap: {
[key: string]: string;
};
typeOriginTable: TypeOrigin[];
version: string;
};
export type Signature = {
Ed25519SuiSignature: string;
} | {
Secp256k1SuiSignature: string;
} | {
Secp256r1SuiSignature: string;
} | {
Falcon512SuiSignature: string;
};
export type StakeObject = {
principal: string;
stakeActiveEpoch: string;
stakeRequestEpoch: string;
stakedSuiId: string;
status: "Pending";
} | {
principal: string;
stakeActiveEpoch: string;
stakeRequestEpoch: string;
stakedSuiId: string;
estimatedReward: string;
status: "Active";
} | {
principal: string;
stakeActiveEpoch: string;
stakeRequestEpoch: string;
stakedSuiId: string;
status: "Unstaked";
};
export type SuiArgument = "GasCoin" | {
Input: number;
} | {
Result: number;
} | {
NestedResult: [number, number];
};
export type SuiCallArg = {
type: "object";
digest: string;
objectId: string;
objectType: "immOrOwnedObject";
version: string;
} | {
type: "object";
initialSharedVersion: string;
mutable: boolean;
objectId: string;
objectType: "sharedObject";
} | {
type: "object";
digest: string;
objectId: string;
objectType: "receiving";
version: string;
} | {
type: "pure";
value: unknown;
valueType?: string | null;
};
export interface SuiChangeEpoch {
computation_charge: string;
epoch: string;
epoch_start_timestamp_ms: string;
storage_charge: string;
storage_rebate: string;
}
export interface CoinMetadata {
decimals: number;
description: string;
iconUrl?: string | null;
id?: string | null;
name: string;
symbol: string;
}
export type SuiEndOfEpochTransactionKind = "RandomnessStateCreate" | "CoinDenyListStateCreate" | "StoreExecutionTimeObservations" | "AccumulatorRootCreate" | {
ChangeEpoch: SuiChangeEpoch;
} | {
BridgeStateCreate: string;
} | {
BridgeCommitteeUpdate: string;
};
export interface SuiExecutionResult {
mutableReferenceOutputs?: [SuiArgument, number[], string][];
returnValues?: [number[], string][];
}
export type SuiMoveAbility = "Copy" | "Drop" | "Store" | "Key";
export interface WowMoveAbilitySet {
abilities: SuiMoveAbility[];
}
export interface SuiMoveAbort {
error_code?: string | null;
function?: string | null;
line?: number | null;
module_id?: string | null;
}
export interface SuiMoveModuleId {
address: string;
name: string;
}
export interface SuiMoveNormalizedEnum {
abilities: WowMoveAbilitySet;
typeParameters: SuiMoveStructTypeParameter[];
variantDeclarationOrder?: string[] | null;
variants: {
[key: string]: SuiMoveNormalizedField[];
};
}
export interface SuiMoveNormalizedField {
name: string;
type: WowMoveNormalizedType;
}
export interface WowMoveNormalizedFunction {
isEntry: boolean;
parameters: WowMoveNormalizedType[];
return: WowMoveNormalizedType[];
typeParameters: WowMoveAbilitySet[];
visibility: WowMoveVisibility;
}
export interface WowMoveNormalizedModule {
address: string;
enums?: {
[key: string]: SuiMoveNormalizedEnum;
};
exposedFunctions: {
[key: string]: WowMoveNormalizedFunction;
};
fileFormatVersion: number;
friends: SuiMoveModuleId[];
name: string;
structs: {
[key: string]: WowMoveNormalizedStruct;
};
}
export interface WowMoveNormalizedStruct {
abilities: WowMoveAbilitySet;
fields: SuiMoveNormalizedField[];
typeParameters: SuiMoveStructTypeParameter[];
}
export type WowMoveNormalizedType = "Bool" | "U8" | "U16" | "U32" | "U64" | "U128" | "U256" | "Address" | "Signer" | {
Struct: {
address: string;
module: string;
name: string;
typeArguments: WowMoveNormalizedType[];
};
} | {
Vector: WowMoveNormalizedType;
} | {
TypeParameter: number;
} | {
Reference: WowMoveNormalizedType;
} | {
MutableReference: WowMoveNormalizedType;
};
export interface SuiMoveStructTypeParameter {
constraints: WowMoveAbilitySet;
isPhantom: boolean;
}
export type WowMoveVisibility = "Private" | "Public" | "Friend";
export type WowObjectDataFilter = {
MatchAll: WowObjectDataFilter[];
} | {
MatchAny: WowObjectDataFilter[];
} | {
MatchNone: WowObjectDataFilter[];
} | {
Package: string;
} | {
MoveModule: {
module: string;
package: string;
};
} | {
StructType: string;
} | {
AddressOwner: string;
} | {
ObjectOwner: string;
} | {
ObjectId: string;
} | {
ObjectIds: string[];
} | {
Version: string;
};
export interface WowObjectResponse {
data?: WowObjectData | null;
error?: ObjectResponseError | null;
}
export interface MoveCallSuiTransaction {
arguments?: SuiArgument[];
function: string;
module: string;
package: string;
type_arguments?: string[];
}
export interface WowSystemStateSummary {
activeValidators: SuiValidatorSummary[];
atRiskValidators: [string, string][];
epoch: string;
epochDurationMs: string;
epochStartTimestampMs: string;
inactivePoolsId: string;
inactivePoolsSize: string;
maxValidatorCount: string;
minValidatorJoiningStake: string;
pendingActiveValidatorsId: string;
pendingActiveValidatorsSize: string;
pendingRemovals: string[];
protocolVersion: string;
referenceGasPrice: string;
safeMode: boolean;
safeModeComputationRewards: string;
safeModeNonRefundableStorageFee: string;
safeModeStorageRebates: string;
safeModeStorageRewards: string;
stakeSubsidyBalance: string;
stakeSubsidyCurrentDistributionAmount: string;
stakeSubsidyDecreaseRate: number;
stakeSubsidyDistributionCounter: string;
stakeSubsidyPeriodLength: string;
stakeSubsidyStartEpoch: string;
stakingPoolMappingsId: string;
stakingPoolMappingsSize: string;
storageFundNonRefundableBalance: string;
storageFundTotalObjectStorageRebates: string;
systemStateVersion: string;
totalStake: string;
validatorCandidatesId: string;
validatorCandidatesSize: string;
validatorLowStakeGracePeriod: string;
validatorLowStakeThreshold: string;
validatorReportRecords: [string, string[]][];
validatorVeryLowStakeThreshold: string;
}
export type SuiTransaction = {
MoveCall: MoveCallSuiTransaction;
} | {
TransferObjects: [SuiArgument[], SuiArgument];
} | {
SplitCoins: [SuiArgument, SuiArgument[]];
} | {
MergeCoins: [SuiArgument, SuiArgument[]];
} | {
Publish: string[];
} | {
Upgrade: [string[], string, SuiArgument];
} | {
MakeMoveVec: [string | null, SuiArgument[]];
};
export type SuiTransactionBlockBuilderMode = "Commit" | "DevInspect";
export interface SuiValidatorSummary {
commissionRate: string;
description: string;
exchangeRatesId: string;
exchangeRatesSize: string;
gasPrice: string;
imageUrl: string;
name: string;
netAddress: string;
networkPubkeyBytes: string;
nextEpochCommissionRate: string;
nextEpochGasPrice: string;
nextEpochNetAddress?: string | null;
nextEpochNetworkPubkeyBytes?: string | null;
nextEpochP2pAddress?: string | null;
nextEpochPrimaryAddress?: string | null;
nextEpochProofOfPossession?: string | null;
nextEpochProtocolPubkeyBytes?: string | null;
nextEpochStake: string;
nextEpochWorkerAddress?: string | null;
nextEpochWorkerPubkeyBytes?: string | null;
operationCapId: string;
p2pAddress: string;
pendingPoolTokenWithdraw: string;
pendingStake: string;
pendingTotalSuiWithdraw: string;
poolTokenBalance: string;
primaryAddress: string;
projectUrl: string;
proofOfPossessionBytes: string;
protocolPubkeyBytes: string;
rewardsPool: string;
stakingPoolActivationEpoch?: string | null;
stakingPoolDeactivationEpoch?: string | null;
stakingPoolId: string;
stakingPoolWowBalance: string;
wowAddress: string;
votingPower: string;
workerAddress: string;
workerPubkeyBytes: string;
}
export interface CoinSupply {
value: string;
}
export interface SuiTransactionBlock {
data: TransactionBlockData;
txSignatures: string[];
}
export interface TransactionBlockBytes {
gas: WowObjectRef[];
inputObjects: InputObjectKind[];
txBytes: string;
}
export type TransactionBlockData = {
gasData: SuiGasData;
messageVersion: "v1";
sender: string;
transaction: SuiTransactionBlockKind;
};
export type TransactionEffects = {
abortError?: SuiMoveAbort | null;
created?: OwnedObjectRef[];
deleted?: WowObjectRef[];
dependencies?: string[];
eventsDigest?: string | null;
executedEpoch: string;
gasObject: OwnedObjectRef;
gasUsed: GasCostSummary;
messageVersion: "v1";
modifiedAtVersions?: TransactionBlockEffectsModifiedAtVersions[];
mutated?: OwnedObjectRef[];
sharedObjects?: WowObjectRef[];
status: ExecutionStatus;
transactionDigest: string;
unwrapped?: OwnedObjectRef[];
unwrappedThenDeleted?: WowObjectRef[];
wrapped?: WowObjectRef[];
};
export interface TransactionBlockEffectsModifiedAtVersions {
objectId: string;
sequenceNumber: string;
}
export type SuiTransactionBlockKind = {
computation_charge: string;
epoch: string;
epoch_start_timestamp_ms: string;
kind: "ChangeEpoch";
storage_charge: string;
storage_rebate: string;
} | {
kind: "Genesis";
objects: string[];
} | {
commit_timestamp_ms: string;
epoch: string;
kind: "ConsensusCommitPrologue";
round: string;
} | {
inputs: SuiCallArg[];
kind: "ProgrammableTransaction";
transactions: SuiTransaction[];
} | {
epoch: string;
kind: "RandomnessStateUpdate";
random_bytes: number[];
randomness_round: string;
} | {
kind: "EndOfEpochTransaction";
transactions: SuiEndOfEpochTransactionKind[];
} | {
commit_timestamp_ms: string;
consensus_commit_digest: string;
epoch: string;
kind: "ConsensusCommitPrologueV2";
round: string;
} | {
commit_timestamp_ms: string;
consensus_commit_digest: string;
consensus_determined_version_assignments: ConsensusDeterminedVersionAssignments;
epoch: string;
kind: "ConsensusCommitPrologueV3";
round: string;
sub_dag_index?: string | null;
} | {
additional_state_digest: string;
commit_timestamp_ms: string;
consensus_commit_digest: string;
consensus_determined_version_assignments: ConsensusDeterminedVersionAssignments;
epoch: string;
kind: "ConsensusCommitPrologueV4";
round: string;
sub_dag_index?: string | null;
} | {
inputs: SuiCallArg[];
kind: "ProgrammableSystemTransaction";
transactions: SuiTransaction[];
};
export interface WowTransactionBlockResponse {
balanceChanges?: BalanceChange[] | null;
checkpoint?: string | null;
confirmedLocalExecution?: boolean | null;
digest: string;
effects?: TransactionEffects | null;
errors?: string[];
events?: WowEvent[] | null;
objectChanges?: WowObjectChange[] | null;
rawEffects?: number[];
rawTransaction?: string;
timestampMs?: string | null;
transaction?: SuiTransactionBlock | null;
}
export interface WowTransactionBlockResponseOptions {
showBalanceChanges?: boolean;
showEffects?: boolean;
showEvents?: boolean;
showInput?: boolean;
showObjectChanges?: boolean;
showRawEffects?: boolean;
showRawInput?: boolean;
}
export interface WowTransactionBlockResponseQuery {
filter?: TransactionFilter | null;
options?: WowTransactionBlockResponseOptions | null;
}
export type TransactionFilter = {
Checkpoint: string;
} | {
MoveFunction: {
function?: string | null;
module?: string | null;
package: string;
};
} | {
InputObject: string;
} | {
ChangedObject: string;
} | {
AffectedObject: string;
} | {
FromAddress: string;
} | {
ToAddress: string;
} | {
FromAndToAddress: {
from: string;
to: string;
};
} | {
FromOrToAddress: {
addr: string;
};
} | {
TransactionKind: string;
} | {
TransactionKindIn: string[];
};
export interface TransferObjectParams {
objectId: string;
recipient: string;
}
export interface TypeOrigin {
datatype_name: string;
module_name: string;
package: string;
}
export interface UpgradeInfo {
upgraded_id: string;
upgraded_version: string;
}
export interface ValidatorApy {
address: string;
apy: number;
}
export interface ValidatorsApy {
apys: ValidatorApy[];
epoch: string;
}