@mysten/sui.js
Advanced tools
Comparing version 0.0.0-experimental-20231121174042 to 0.0.0-experimental-20231129041929
# @mysten/sui.js | ||
## 0.0.0-experimental-20231121174042 | ||
## 0.0.0-experimental-20231129041929 | ||
### Minor Changes | ||
- cdcfa76c4: Add a new client method for retrieving epoch metrics (suix_getEpochMetrics) | ||
## 0.47.0 | ||
### Minor Changes | ||
- 0259aec82: Removed dependency on @open-rpc/client-js and replaced it with standard fetch and WebSocket based APIs | ||
@@ -8,0 +14,0 @@ |
import type { TransactionBlock } from '../builder/index.js'; | ||
import type { Keypair } from '../cryptography/index.js'; | ||
import type { SuiTransport } from './http-transport.js'; | ||
import type { AddressMetrics, AllEpochsAddressMetrics, Checkpoint, CheckpointPage, CoinBalance, CoinMetadata, CoinSupply, CommitteeInfo, DelegatedStake, DevInspectResults, DevInspectTransactionBlockParams, DryRunTransactionBlockParams, DryRunTransactionBlockResponse, DynamicFieldPage, EpochInfo, EpochPage, ExecuteTransactionBlockParams, GetAllBalancesParams, GetAllCoinsParams, GetBalanceParams, GetCheckpointParams, GetCheckpointsParams, GetCoinMetadataParams, GetCoinsParams, GetCommitteeInfoParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetMoveFunctionArgTypesParams, GetNormalizedMoveFunctionParams, GetNormalizedMoveModuleParams, GetNormalizedMoveModulesByPackageParams, GetNormalizedMoveStructParams, GetObjectParams, GetOwnedObjectsParams, GetProtocolConfigParams, GetStakesByIdsParams, GetStakesParams, GetTotalSupplyParams, GetTransactionBlockParams, MoveCallMetrics, MultiGetObjectsParams, MultiGetTransactionBlocksParams, NetworkMetrics, ObjectRead, Order, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedTransactionResponse, ProtocolConfig, QueryEventsParams, QueryTransactionBlocksParams, ResolvedNameServiceNames, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SubscribeEventParams, SubscribeTransactionParams, SuiEvent, SuiMoveFunctionArgType, SuiMoveNormalizedFunction, SuiMoveNormalizedModule, SuiMoveNormalizedModules, SuiMoveNormalizedStruct, SuiObjectResponse, SuiSystemStateSummary, SuiTransactionBlockResponse, TransactionEffects, TryGetPastObjectParams, Unsubscribe, ValidatorsApy } from './types/index.js'; | ||
import type { AddressMetrics, AllEpochsAddressMetrics, Checkpoint, CheckpointPage, CoinBalance, CoinMetadata, CoinSupply, CommitteeInfo, DelegatedStake, DevInspectResults, DevInspectTransactionBlockParams, DryRunTransactionBlockParams, DryRunTransactionBlockResponse, DynamicFieldPage, EpochInfo, EpochMetricsPage, EpochPage, ExecuteTransactionBlockParams, GetAllBalancesParams, GetAllCoinsParams, GetBalanceParams, GetCheckpointParams, GetCheckpointsParams, GetCoinMetadataParams, GetCoinsParams, GetCommitteeInfoParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetMoveFunctionArgTypesParams, GetNormalizedMoveFunctionParams, GetNormalizedMoveModuleParams, GetNormalizedMoveModulesByPackageParams, GetNormalizedMoveStructParams, GetObjectParams, GetOwnedObjectsParams, GetProtocolConfigParams, GetStakesByIdsParams, GetStakesParams, GetTotalSupplyParams, GetTransactionBlockParams, MoveCallMetrics, MultiGetObjectsParams, MultiGetTransactionBlocksParams, NetworkMetrics, ObjectRead, Order, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedTransactionResponse, ProtocolConfig, QueryEventsParams, QueryTransactionBlocksParams, ResolvedNameServiceNames, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SubscribeEventParams, SubscribeTransactionParams, SuiEvent, SuiMoveFunctionArgType, SuiMoveNormalizedFunction, SuiMoveNormalizedModule, SuiMoveNormalizedModules, SuiMoveNormalizedStruct, SuiObjectResponse, SuiSystemStateSummary, SuiTransactionBlockResponse, TransactionEffects, TryGetPastObjectParams, Unsubscribe, ValidatorsApy } from './types/index.js'; | ||
export interface PaginationArguments<Cursor> { | ||
@@ -184,2 +184,5 @@ /** Optional paging cursor */ | ||
getAddressMetrics(): Promise<AddressMetrics>; | ||
getEpochMetrics(input?: { | ||
descendingOrder?: boolean; | ||
} & PaginationArguments<EpochMetricsPage['nextCursor']>): Promise<EpochMetricsPage>; | ||
getAllEpochAddressMetrics(input?: { | ||
@@ -186,0 +189,0 @@ descendingOrder?: boolean; |
@@ -478,2 +478,8 @@ "use strict"; | ||
} | ||
async getEpochMetrics(input) { | ||
return await this.transport.request({ | ||
method: "suix_getEpochMetrics", | ||
params: [input?.cursor, input?.limit, input?.descendingOrder] | ||
}); | ||
} | ||
async getAllEpochAddressMetrics(input) { | ||
@@ -480,0 +486,0 @@ return await this.transport.request({ |
@@ -16,2 +16,9 @@ import type { Checkpoint, DynamicFieldInfo, SuiCallArg, SuiMoveNormalizedModule, SuiParsedData, SuiTransaction, SuiValidatorSummary } from './generated.js'; | ||
}; | ||
export type EpochMetrics = { | ||
epoch: string; | ||
epochTotalTransactions: string; | ||
firstCheckpointId: string; | ||
epochStartTimestamp: string; | ||
endOfEpochInfo: EndOfEpochInfo | null; | ||
}; | ||
export type EpochPage = { | ||
@@ -22,2 +29,7 @@ data: EpochInfo[]; | ||
}; | ||
export type EpochMetricsPage = { | ||
data: EpochMetrics[]; | ||
nextCursor: string | null; | ||
hasNextPage: boolean; | ||
}; | ||
export type EndOfEpochInfo = { | ||
@@ -24,0 +36,0 @@ lastCheckpointId: string; |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20231121174042"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20231129041929"; | ||
export declare const TARGETED_RPC_VERSION = "1.15.0"; |
@@ -25,4 +25,4 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const PACKAGE_VERSION = "0.0.0-experimental-20231121174042"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20231129041929"; | ||
const TARGETED_RPC_VERSION = "1.15.0"; | ||
//# sourceMappingURL=version.js.map |
import type { TransactionBlock } from '../builder/index.js'; | ||
import type { Keypair } from '../cryptography/index.js'; | ||
import type { SuiTransport } from './http-transport.js'; | ||
import type { AddressMetrics, AllEpochsAddressMetrics, Checkpoint, CheckpointPage, CoinBalance, CoinMetadata, CoinSupply, CommitteeInfo, DelegatedStake, DevInspectResults, DevInspectTransactionBlockParams, DryRunTransactionBlockParams, DryRunTransactionBlockResponse, DynamicFieldPage, EpochInfo, EpochPage, ExecuteTransactionBlockParams, GetAllBalancesParams, GetAllCoinsParams, GetBalanceParams, GetCheckpointParams, GetCheckpointsParams, GetCoinMetadataParams, GetCoinsParams, GetCommitteeInfoParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetMoveFunctionArgTypesParams, GetNormalizedMoveFunctionParams, GetNormalizedMoveModuleParams, GetNormalizedMoveModulesByPackageParams, GetNormalizedMoveStructParams, GetObjectParams, GetOwnedObjectsParams, GetProtocolConfigParams, GetStakesByIdsParams, GetStakesParams, GetTotalSupplyParams, GetTransactionBlockParams, MoveCallMetrics, MultiGetObjectsParams, MultiGetTransactionBlocksParams, NetworkMetrics, ObjectRead, Order, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedTransactionResponse, ProtocolConfig, QueryEventsParams, QueryTransactionBlocksParams, ResolvedNameServiceNames, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SubscribeEventParams, SubscribeTransactionParams, SuiEvent, SuiMoveFunctionArgType, SuiMoveNormalizedFunction, SuiMoveNormalizedModule, SuiMoveNormalizedModules, SuiMoveNormalizedStruct, SuiObjectResponse, SuiSystemStateSummary, SuiTransactionBlockResponse, TransactionEffects, TryGetPastObjectParams, Unsubscribe, ValidatorsApy } from './types/index.js'; | ||
import type { AddressMetrics, AllEpochsAddressMetrics, Checkpoint, CheckpointPage, CoinBalance, CoinMetadata, CoinSupply, CommitteeInfo, DelegatedStake, DevInspectResults, DevInspectTransactionBlockParams, DryRunTransactionBlockParams, DryRunTransactionBlockResponse, DynamicFieldPage, EpochInfo, EpochMetricsPage, EpochPage, ExecuteTransactionBlockParams, GetAllBalancesParams, GetAllCoinsParams, GetBalanceParams, GetCheckpointParams, GetCheckpointsParams, GetCoinMetadataParams, GetCoinsParams, GetCommitteeInfoParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetMoveFunctionArgTypesParams, GetNormalizedMoveFunctionParams, GetNormalizedMoveModuleParams, GetNormalizedMoveModulesByPackageParams, GetNormalizedMoveStructParams, GetObjectParams, GetOwnedObjectsParams, GetProtocolConfigParams, GetStakesByIdsParams, GetStakesParams, GetTotalSupplyParams, GetTransactionBlockParams, MoveCallMetrics, MultiGetObjectsParams, MultiGetTransactionBlocksParams, NetworkMetrics, ObjectRead, Order, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedTransactionResponse, ProtocolConfig, QueryEventsParams, QueryTransactionBlocksParams, ResolvedNameServiceNames, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SubscribeEventParams, SubscribeTransactionParams, SuiEvent, SuiMoveFunctionArgType, SuiMoveNormalizedFunction, SuiMoveNormalizedModule, SuiMoveNormalizedModules, SuiMoveNormalizedStruct, SuiObjectResponse, SuiSystemStateSummary, SuiTransactionBlockResponse, TransactionEffects, TryGetPastObjectParams, Unsubscribe, ValidatorsApy } from './types/index.js'; | ||
export interface PaginationArguments<Cursor> { | ||
@@ -184,2 +184,5 @@ /** Optional paging cursor */ | ||
getAddressMetrics(): Promise<AddressMetrics>; | ||
getEpochMetrics(input?: { | ||
descendingOrder?: boolean; | ||
} & PaginationArguments<EpochMetricsPage['nextCursor']>): Promise<EpochMetricsPage>; | ||
getAllEpochAddressMetrics(input?: { | ||
@@ -186,0 +189,0 @@ descendingOrder?: boolean; |
@@ -459,2 +459,8 @@ import { fromB58, toB64, toHEX } from "@mysten/bcs"; | ||
} | ||
async getEpochMetrics(input) { | ||
return await this.transport.request({ | ||
method: "suix_getEpochMetrics", | ||
params: [input?.cursor, input?.limit, input?.descendingOrder] | ||
}); | ||
} | ||
async getAllEpochAddressMetrics(input) { | ||
@@ -461,0 +467,0 @@ return await this.transport.request({ |
@@ -16,2 +16,9 @@ import type { Checkpoint, DynamicFieldInfo, SuiCallArg, SuiMoveNormalizedModule, SuiParsedData, SuiTransaction, SuiValidatorSummary } from './generated.js'; | ||
}; | ||
export type EpochMetrics = { | ||
epoch: string; | ||
epochTotalTransactions: string; | ||
firstCheckpointId: string; | ||
epochStartTimestamp: string; | ||
endOfEpochInfo: EndOfEpochInfo | null; | ||
}; | ||
export type EpochPage = { | ||
@@ -22,2 +29,7 @@ data: EpochInfo[]; | ||
}; | ||
export type EpochMetricsPage = { | ||
data: EpochMetrics[]; | ||
nextCursor: string | null; | ||
hasNextPage: boolean; | ||
}; | ||
export type EndOfEpochInfo = { | ||
@@ -24,0 +36,0 @@ lastCheckpointId: string; |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20231121174042"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20231129041929"; | ||
export declare const TARGETED_RPC_VERSION = "1.15.0"; |
@@ -1,2 +0,2 @@ | ||
const PACKAGE_VERSION = "0.0.0-experimental-20231121174042"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20231129041929"; | ||
const TARGETED_RPC_VERSION = "1.15.0"; | ||
@@ -3,0 +3,0 @@ export { |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://sui-typescript-docs.vercel.app", | ||
"version": "0.0.0-experimental-20231121174042", | ||
"version": "0.0.0-experimental-20231129041929", | ||
"license": "Apache-2.0", | ||
@@ -9,0 +9,0 @@ "sideEffects": false, |
@@ -54,5 +54,3 @@ # Docs site | ||
> All `pnpm` commands are intended to be run in the root of the Sui repo. You can also run them | ||
> within the `sdk/typescript` directory, and remove change `pnpm sdk` to just `pnpm` when running | ||
> commands. | ||
> All `pnpm` commands below are intended to be run in the root of the Sui repo. | ||
@@ -73,3 +71,3 @@ ## Type Doc | ||
``` | ||
pnpm sdk test:unit | ||
pnpm --filter @mysten/sui.js test:unit | ||
``` | ||
@@ -80,6 +78,6 @@ | ||
``` | ||
pnpm sdk prepare:e2e | ||
pnpm --filter @mysten/sui.js prepare:e2e | ||
// This will run all e2e tests | ||
pnpm sdk test:e2e | ||
pnpm --filter @mysten/sui.js test:e2e | ||
@@ -103,3 +101,3 @@ // Alternatively you can choose to run only one test file | ||
``` | ||
VITE_FAUCET_URL='https://faucet.devnet.sui.io:443/gas' VITE_FULLNODE_URL='https://fullnode.devnet.sui.io' pnpm sdk exec vitest e2e | ||
VITE_FAUCET_URL='https://faucet.devnet.sui.io:443/gas' VITE_FULLNODE_URL='https://fullnode.devnet.sui.io' pnpm --filter @mysten/sui.js exec vitest e2e | ||
``` | ||
@@ -106,0 +104,0 @@ |
@@ -33,2 +33,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
EpochInfo, | ||
EpochMetricsPage, | ||
EpochPage, | ||
@@ -674,2 +675,11 @@ ExecuteTransactionBlockParams, | ||
async getEpochMetrics( | ||
input?: { descendingOrder?: boolean } & PaginationArguments<EpochMetricsPage['nextCursor']>, | ||
): Promise<EpochMetricsPage> { | ||
return await this.transport.request({ | ||
method: 'suix_getEpochMetrics', | ||
params: [input?.cursor, input?.limit, input?.descendingOrder], | ||
}); | ||
} | ||
async getAllEpochAddressMetrics(input?: { | ||
@@ -676,0 +686,0 @@ descendingOrder?: boolean; |
@@ -30,2 +30,10 @@ // Copyright (c) Mysten Labs, Inc. | ||
export type EpochMetrics = { | ||
epoch: string; | ||
epochTotalTransactions: string; | ||
firstCheckpointId: string; | ||
epochStartTimestamp: string; | ||
endOfEpochInfo: EndOfEpochInfo | null; | ||
}; | ||
export type EpochPage = { | ||
@@ -37,2 +45,8 @@ data: EpochInfo[]; | ||
export type EpochMetricsPage = { | ||
data: EpochMetrics[]; | ||
nextCursor: string | null; | ||
hasNextPage: boolean; | ||
}; | ||
export type EndOfEpochInfo = { | ||
@@ -39,0 +53,0 @@ lastCheckpointId: string; |
@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20231121174042'; | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20231129041929'; | ||
export const TARGETED_RPC_VERSION = '1.15.0'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2368878
42575
520