From 9ac0a4ec0100abc37f6375ccf9051516127fc38c Mon Sep 17 00:00:00 2001 From: hayes-mysten <135670682+hayes-mysten@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:44:40 -0800 Subject: [PATCH] Add extensions to all SDK import paths (#15595) ## Description Describe the changes or additions included in this PR. ## Test Plan How did you test the new or updated feature? --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes --- .changeset/empty-carrots-kneel.md | 11 ++++++++ .eslintrc.js | 3 ++- sdk/bcs/src/bcs-type.ts | 13 +++++----- sdk/bcs/src/bcs.ts | 4 +-- sdk/bcs/src/index.ts | 8 +++--- sdk/bcs/src/legacy-registry.ts | 5 ++-- sdk/bcs/src/reader.ts | 2 +- sdk/bcs/src/types.ts | 2 +- sdk/bcs/src/utils.ts | 8 +++--- sdk/bcs/src/writer.ts | 6 ++--- sdk/bcs/tests/utils.ts | 2 +- .../react-e2e-counter/src/Counter.tsx | 2 +- sdk/deepbook/src/client.ts | 23 ++++++----------- sdk/deepbook/src/index.ts | 2 +- sdk/deepbook/src/types/index.ts | 4 +-- sdk/deepbook/src/utils/index.ts | 2 +- sdk/deepbook/test/e2e/setup.ts | 11 ++++---- sdk/docs/examples/wallet-hooks.tsx | 3 ++- sdk/kiosk/src/bcs.ts | 2 +- sdk/kiosk/src/client/kiosk-client.ts | 25 +++++++++---------- sdk/kiosk/src/client/kiosk-transaction.ts | 20 +++++++-------- sdk/kiosk/src/client/tp-transaction.ts | 10 ++++---- sdk/kiosk/src/constants.ts | 6 +++-- sdk/kiosk/src/index.ts | 12 ++++----- sdk/kiosk/src/query/kiosk.ts | 10 ++++---- sdk/kiosk/src/query/transfer-policy.ts | 11 ++++---- sdk/kiosk/src/tx/kiosk.ts | 5 ++-- sdk/kiosk/src/tx/personal-kiosk.ts | 4 +-- sdk/kiosk/src/tx/rules/attach.ts | 4 +-- sdk/kiosk/src/tx/rules/resolve.ts | 4 +-- sdk/kiosk/src/tx/transfer-policy.ts | 5 ++-- sdk/kiosk/src/types/index.ts | 10 ++++---- sdk/kiosk/src/types/kiosk.ts | 6 ++--- sdk/kiosk/src/types/transfer-policy.ts | 6 ++--- sdk/kiosk/src/utils.ts | 16 ++++-------- sdk/kiosk/test/e2e/helper.ts | 8 +++--- sdk/kiosk/test/e2e/setup.ts | 8 +++--- sdk/suins-toolkit/src/client.ts | 10 ++++---- sdk/suins-toolkit/src/index.ts | 6 ++--- sdk/suins-toolkit/src/types/index.ts | 2 +- sdk/suins-toolkit/src/utils/parser.ts | 2 +- sdk/suins-toolkit/src/utils/queries.ts | 2 +- sdk/typescript/scripts/generate.ts | 6 ++--- sdk/typescript/test/e2e/utils/setup.ts | 20 +++++++-------- sdk/wallet-standard/src/detect.ts | 4 +-- sdk/wallet-standard/src/features/index.ts | 16 ++++++------ .../suiSignAndExecuteTransactionBlock.ts | 2 +- .../src/features/suiSignTransactionBlock.ts | 2 +- sdk/wallet-standard/src/index.ts | 8 +++--- 49 files changed, 184 insertions(+), 179 deletions(-) create mode 100644 .changeset/empty-carrots-kneel.md diff --git a/.changeset/empty-carrots-kneel.md b/.changeset/empty-carrots-kneel.md new file mode 100644 index 0000000000000..f543eb95d753f --- /dev/null +++ b/.changeset/empty-carrots-kneel.md @@ -0,0 +1,11 @@ +--- +'@mysten/wallet-standard': patch +'@mysten/suins-toolkit': patch +'@mysten/create-dapp': patch +'@mysten/sui.js': patch +'@mysten/deepbook': patch +'@mysten/kiosk': patch +'@mysten/bcs': patch +--- + +Add extensions to all sdk import paths diff --git a/.eslintrc.js b/.eslintrc.js index 51baecffcbd04..8fca94fb13503 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -73,7 +73,7 @@ module.exports = { }, overrides: [ { - files: ['sdk/typescript/src/**/*', 'sdk/dapp-kit/**/*', 'sdk/zklogin/**/*', 'sdk/enoki/**/*'], + files: ['sdk/**/*'], rules: { 'require-extensions/require-extensions': 'error', 'require-extensions/require-index': 'error', @@ -271,6 +271,7 @@ module.exports = { files: ['sdk/create-dapp/templates/**/*'], rules: { 'header/header': 'off', + 'require-extensions/require-extensions': 'off', }, }, ], diff --git a/sdk/bcs/src/bcs-type.ts b/sdk/bcs/src/bcs-type.ts index 2c5286b0310a8..0c324e2f45072 100644 --- a/sdk/bcs/src/bcs-type.ts +++ b/sdk/bcs/src/bcs-type.ts @@ -1,12 +1,13 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { toB58 } from './b58'; -import { toB64 } from './b64'; -import { toHEX } from './hex'; -import { BcsReader } from './reader'; -import { ulebEncode } from './uleb'; -import { BcsWriter, BcsWriterOptions } from './writer'; +import { toB58 } from './b58.js'; +import { toB64 } from './b64.js'; +import { toHEX } from './hex.js'; +import { BcsReader } from './reader.js'; +import { ulebEncode } from './uleb.js'; +import type { BcsWriterOptions } from './writer.js'; +import { BcsWriter } from './writer.js'; export interface BcsTypeOptions { name?: string; diff --git a/sdk/bcs/src/bcs.ts b/sdk/bcs/src/bcs.ts index 38627e0c79517..92691aac4cde4 100644 --- a/sdk/bcs/src/bcs.ts +++ b/sdk/bcs/src/bcs.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +import type { BcsTypeOptions } from './bcs-type.js'; import { BcsType, - BcsTypeOptions, bigUIntBcsType, dynamicSizeBcsType, fixedSizeBcsType, @@ -11,7 +11,7 @@ import { stringLikeBcsType, uIntBcsType, } from './bcs-type.js'; -import { GenericPlaceholder, ReplaceBcsGenerics } from './types.js'; +import type { GenericPlaceholder, ReplaceBcsGenerics } from './types.js'; import { ulebEncode } from './uleb.js'; export const bcs = { diff --git a/sdk/bcs/src/index.ts b/sdk/bcs/src/index.ts index 00f61f7046ffa..f0f9db8dd51b1 100644 --- a/sdk/bcs/src/index.ts +++ b/sdk/bcs/src/index.ts @@ -13,13 +13,15 @@ import { fromB58, toB58 } from './b58.js'; import { fromB64, toB64 } from './b64.js'; -import { BcsType, BcsTypeOptions, isSerializedBcs, SerializedBcs } from './bcs-type.js'; +import type { BcsTypeOptions } from './bcs-type.js'; +import { BcsType, isSerializedBcs, SerializedBcs } from './bcs-type.js'; import { bcs } from './bcs.js'; import { fromHEX, toHEX } from './hex.js'; import { BcsReader } from './reader.js'; -import { type InferBcsInput, type InferBcsType } from './types.js'; +import type { InferBcsInput, InferBcsType } from './types.js'; import { decodeStr, encodeStr, splitGenericParameters } from './utils.js'; -import { BcsWriter, BcsWriterOptions } from './writer.js'; +import type { BcsWriterOptions } from './writer.js'; +import { BcsWriter } from './writer.js'; export * from './legacy-registry.js'; diff --git a/sdk/bcs/src/legacy-registry.ts b/sdk/bcs/src/legacy-registry.ts index c928ba1f25f03..63f56a6298a51 100644 --- a/sdk/bcs/src/legacy-registry.ts +++ b/sdk/bcs/src/legacy-registry.ts @@ -6,9 +6,10 @@ import { fromB64, toB64 } from './b64.js'; import { BcsType } from './bcs-type.js'; import { fromHEX, toHEX } from './hex.js'; import { BcsReader } from './reader.js'; -import { Encoding } from './types.js'; +import type { Encoding } from './types.js'; import { decodeStr, splitGenericParameters } from './utils.js'; -import { BcsWriter, BcsWriterOptions } from './writer.js'; +import type { BcsWriterOptions } from './writer.js'; +import { BcsWriter } from './writer.js'; /** * Allows for array definitions for names. diff --git a/sdk/bcs/src/reader.ts b/sdk/bcs/src/reader.ts index 450e23da0fe1f..c364a94b0f061 100644 --- a/sdk/bcs/src/reader.ts +++ b/sdk/bcs/src/reader.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { ulebDecode } from './uleb'; +import { ulebDecode } from './uleb.js'; /** * Class used for reading BCS data chunk by chunk. Meant to be used diff --git a/sdk/bcs/src/types.ts b/sdk/bcs/src/types.ts index 98c2c010be043..c6d69688d06b2 100644 --- a/sdk/bcs/src/types.ts +++ b/sdk/bcs/src/types.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type BcsType } from './bcs-type'; +import type { BcsType } from './bcs-type.js'; /** * Supported encodings. diff --git a/sdk/bcs/src/utils.ts b/sdk/bcs/src/utils.ts index 2a43fa3813ec2..b781c9ebc7c3b 100644 --- a/sdk/bcs/src/utils.ts +++ b/sdk/bcs/src/utils.ts @@ -1,10 +1,10 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { fromB58, toB58 } from './b58'; -import { fromB64, toB64 } from './b64'; -import { fromHEX, toHEX } from './hex'; -import { Encoding } from './types'; +import { fromB58, toB58 } from './b58.js'; +import { fromB64, toB64 } from './b64.js'; +import { fromHEX, toHEX } from './hex.js'; +import type { Encoding } from './types.js'; /** * Encode data with either `hex` or `base64`. diff --git a/sdk/bcs/src/writer.ts b/sdk/bcs/src/writer.ts index f985a49bbeeb8..b73a891b6f030 100644 --- a/sdk/bcs/src/writer.ts +++ b/sdk/bcs/src/writer.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { Encoding } from './types'; -import { ulebEncode } from './uleb'; -import { encodeStr } from './utils'; +import type { Encoding } from './types.js'; +import { ulebEncode } from './uleb.js'; +import { encodeStr } from './utils.js'; export interface BcsWriterOptions { /** The initial size (in bytes) of the buffer tht will be allocated */ diff --git a/sdk/bcs/tests/utils.ts b/sdk/bcs/tests/utils.ts index f4205831f9d2b..5f9e43513470f 100644 --- a/sdk/bcs/tests/utils.ts +++ b/sdk/bcs/tests/utils.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { BCS } from '../src/index'; +import type { BCS } from '../src/index.js'; /** Serialize and deserialize the result. */ export function serde(bcs: BCS, type: any, data: any): any { diff --git a/sdk/create-dapp/templates/react-e2e-counter/src/Counter.tsx b/sdk/create-dapp/templates/react-e2e-counter/src/Counter.tsx index 4b9bff9a24078..c2b36d01b087e 100644 --- a/sdk/create-dapp/templates/react-e2e-counter/src/Counter.tsx +++ b/sdk/create-dapp/templates/react-e2e-counter/src/Counter.tsx @@ -4,7 +4,7 @@ import { useSuiClient, useSuiClientQuery, } from "@mysten/dapp-kit"; -import { SuiObjectData } from "@mysten/sui.js/client"; +import type { SuiObjectData } from "@mysten/sui.js/client"; import { TransactionBlock } from "@mysten/sui.js/transactions"; import { Button, Flex, Heading, Text } from "@radix-ui/themes"; import { useNetworkVariable } from "./networkConfig"; diff --git a/sdk/deepbook/src/client.ts b/sdk/deepbook/src/client.ts index 8641708bfe891..54da26920ef1a 100644 --- a/sdk/deepbook/src/client.ts +++ b/sdk/deepbook/src/client.ts @@ -1,19 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { - getFullnodeUrl, - OrderArguments, - PaginatedEvents, - PaginationArguments, - SuiClient, -} from '@mysten/sui.js/client'; -import { +import type { OrderArguments, PaginatedEvents, PaginationArguments } from '@mysten/sui.js/client'; +import { getFullnodeUrl, SuiClient } from '@mysten/sui.js/client'; +import type { TransactionArgument, - TransactionBlock, TransactionObjectInput, TransactionResult, } from '@mysten/sui.js/transactions'; +import { TransactionBlock } from '@mysten/sui.js/transactions'; import { normalizeStructTag, normalizeSuiAddress, @@ -22,17 +17,15 @@ import { SUI_CLOCK_OBJECT_ID, } from '@mysten/sui.js/utils'; -import { - bcs, +import type { Level2BookStatusPoint, - LimitOrderType, MarketPrice, Order, PaginatedPoolSummary, PoolSummary, - SelfMatchingPreventionStyle, UserPosition, -} from './types'; +} from './types/index.js'; +import { bcs, LimitOrderType, SelfMatchingPreventionStyle } from './types/index.js'; import { CREATION_FEE, MODULE_CLOB, @@ -40,7 +33,7 @@ import { NORMALIZED_SUI_COIN_TYPE, ORDER_DEFAULT_EXPIRATION_IN_MS, PACKAGE_ID, -} from './utils'; +} from './utils/index.js'; const DUMMY_ADDRESS = normalizeSuiAddress('0x0'); diff --git a/sdk/deepbook/src/index.ts b/sdk/deepbook/src/index.ts index 1148dc16fd6cd..789ec4808ebaf 100644 --- a/sdk/deepbook/src/index.ts +++ b/sdk/deepbook/src/index.ts @@ -1,4 +1,4 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './client'; +export * from './client.js'; diff --git a/sdk/deepbook/src/types/index.ts b/sdk/deepbook/src/types/index.ts index c425008bbc644..7e137505654f8 100644 --- a/sdk/deepbook/src/types/index.ts +++ b/sdk/deepbook/src/types/index.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { EventId } from '@mysten/sui.js/client'; +import type { EventId } from '@mysten/sui.js/client'; -export * from './bcs'; +export * from './bcs.js'; export interface PoolSummary { poolId: string; diff --git a/sdk/deepbook/src/utils/index.ts b/sdk/deepbook/src/utils/index.ts index da9409ded31fd..f4facccdd6207 100644 --- a/sdk/deepbook/src/utils/index.ts +++ b/sdk/deepbook/src/utils/index.ts @@ -1,4 +1,4 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './constants'; +export * from './constants.js'; diff --git a/sdk/deepbook/test/e2e/setup.ts b/sdk/deepbook/test/e2e/setup.ts index b443b045e7d7f..155efd63c335a 100644 --- a/sdk/deepbook/test/e2e/setup.ts +++ b/sdk/deepbook/test/e2e/setup.ts @@ -2,14 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import { execSync } from 'child_process'; -import { +import type { DevInspectResults, - getFullnodeUrl, - SuiClient, SuiObjectChangeCreated, SuiObjectChangePublished, SuiTransactionBlockResponse, } from '@mysten/sui.js/client'; +import { getFullnodeUrl, SuiClient } from '@mysten/sui.js/client'; import { FaucetRateLimitError, getFaucetHost, requestSuiFromFaucetV0 } from '@mysten/sui.js/faucet'; import { Ed25519Keypair } from '@mysten/sui.js/keypairs/ed25519'; import { TransactionBlock } from '@mysten/sui.js/transactions'; @@ -17,9 +16,9 @@ import tmp from 'tmp'; import { retry } from 'ts-retry-promise'; import { expect } from 'vitest'; -import { DeepBookClient } from '../../src'; -import { PoolSummary } from '../../src/types'; -import { FLOAT_SCALING_FACTOR, NORMALIZED_SUI_COIN_TYPE } from '../../src/utils'; +import { DeepBookClient } from '../../src/index.js'; +import type { PoolSummary } from '../../src/types/index.js'; +import { FLOAT_SCALING_FACTOR, NORMALIZED_SUI_COIN_TYPE } from '../../src/utils/index.js'; const DEFAULT_FAUCET_URL = import.meta.env.VITE_FAUCET_URL ?? getFaucetHost('localnet'); const DEFAULT_FULLNODE_URL = import.meta.env.VITE_FULLNODE_URL ?? getFullnodeUrl('localnet'); diff --git a/sdk/docs/examples/wallet-hooks.tsx b/sdk/docs/examples/wallet-hooks.tsx index e4166bc354bc2..be2c8b3a0b697 100644 --- a/sdk/docs/examples/wallet-hooks.tsx +++ b/sdk/docs/examples/wallet-hooks.tsx @@ -20,7 +20,8 @@ import { import { getFullnodeUrl } from '@mysten/sui.js/client'; import { TransactionBlock } from '@mysten/sui.js/transactions'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps } from 'react'; +import { useEffect, useState } from 'react'; import '@mysten/dapp-kit/dist/index.css'; diff --git a/sdk/kiosk/src/bcs.ts b/sdk/kiosk/src/bcs.ts index 2749ecbe52650..54aac820e1fc0 100644 --- a/sdk/kiosk/src/bcs.ts +++ b/sdk/kiosk/src/bcs.ts @@ -8,7 +8,7 @@ import { KIOSK_TYPE, TRANSFER_POLICY_CREATED_EVENT, TRANSFER_POLICY_TYPE, -} from './types'; +} from './types/index.js'; // Register the `Kiosk` struct for faster queries. bcs.registerStructType(KIOSK_TYPE, { diff --git a/sdk/kiosk/src/client/kiosk-client.ts b/sdk/kiosk/src/client/kiosk-client.ts index c6a16c5910e67..a11ba65ab713b 100644 --- a/sdk/kiosk/src/client/kiosk-client.ts +++ b/sdk/kiosk/src/client/kiosk-client.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type SuiClient } from '@mysten/sui.js/client'; +import type { SuiClient } from '@mysten/sui.js/client'; import { FLOOR_PRICE_RULE_ADDRESS, @@ -10,22 +10,21 @@ import { PERSONAL_KIOSK_RULE_ADDRESS, ROYALTY_RULE_ADDRESS, rules, - type BaseRulePackageIds, - type TransferPolicyRule, -} from '../constants'; -import { fetchKiosk, fetchKioskExtension, getOwnedKiosks } from '../query/kiosk'; +} from '../constants.js'; +import type { BaseRulePackageIds, TransferPolicyRule } from '../constants.js'; +import { fetchKiosk, fetchKioskExtension, getOwnedKiosks } from '../query/kiosk.js'; import { queryOwnedTransferPolicies, queryTransferPolicy, queryTransferPolicyCapsByType, -} from '../query/transfer-policy'; -import { - Network, - type FetchKioskOptions, - type KioskClientOptions, - type KioskData, - type OwnedKiosks, -} from '../types'; +} from '../query/transfer-policy.js'; +import { Network } from '../types/index.js'; +import type { + FetchKioskOptions, + KioskClientOptions, + KioskData, + OwnedKiosks, +} from '../types/index.js'; /** * A Client that allows you to interact with kiosk. diff --git a/sdk/kiosk/src/client/kiosk-transaction.ts b/sdk/kiosk/src/client/kiosk-transaction.ts index a1022dc2aacdf..87ea52127e465 100644 --- a/sdk/kiosk/src/client/kiosk-transaction.ts +++ b/sdk/kiosk/src/client/kiosk-transaction.ts @@ -1,16 +1,16 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { +import type { + TransactionArgument, + TransactionBlock, TransactionObjectArgument, - type TransactionArgument, - type TransactionBlock, } from '@mysten/sui.js/transactions'; -import * as kioskTx from '../tx/kiosk'; -import { convertToPersonalTx, transferPersonalCapTx } from '../tx/personal-kiosk'; -import { confirmRequest } from '../tx/transfer-policy'; -import { +import * as kioskTx from '../tx/kiosk.js'; +import { convertToPersonalTx, transferPersonalCapTx } from '../tx/personal-kiosk.js'; +import { confirmRequest } from '../tx/transfer-policy.js'; +import type { ItemId, ItemReference, ItemValue, @@ -18,9 +18,9 @@ import { ObjectArgument, Price, PurchaseOptions, -} from '../types'; -import { getNormalizedRuleType } from '../utils'; -import { type KioskClient } from './kiosk-client'; +} from '../types/index.js'; +import { getNormalizedRuleType } from '../utils.js'; +import type { KioskClient } from './kiosk-client.js'; export type KioskTransactionParams = { /** The TransactionBlock for this run */ diff --git a/sdk/kiosk/src/client/tp-transaction.ts b/sdk/kiosk/src/client/tp-transaction.ts index 40ea9dff273d1..b90c800ffaddd 100644 --- a/sdk/kiosk/src/client/tp-transaction.ts +++ b/sdk/kiosk/src/client/tp-transaction.ts @@ -1,23 +1,23 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { TransactionObjectArgument, type TransactionBlock } from '@mysten/sui.js/transactions'; +import type { TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions'; import { attachFloorPriceRuleTx, attachKioskLockRuleTx, attachPersonalKioskRuleTx, attachRoyaltyRuleTx, -} from '../tx/rules/attach'; +} from '../tx/rules/attach.js'; import { createTransferPolicy, createTransferPolicyWithoutSharing, removeTransferPolicyRule, shareTransferPolicy, withdrawFromPolicy, -} from '../tx/transfer-policy'; -import { TransferPolicyCap, type ObjectArgument } from '../types'; -import { KioskClient } from './kiosk-client'; +} from '../tx/transfer-policy.js'; +import type { ObjectArgument, TransferPolicyCap } from '../types/index.js'; +import type { KioskClient } from './kiosk-client.js'; export type TransferPolicyBaseParams = { type: string; diff --git a/sdk/kiosk/src/constants.ts b/sdk/kiosk/src/constants.ts index 8b1ceb4195c3c..a97b57c5c6508 100644 --- a/sdk/kiosk/src/constants.ts +++ b/sdk/kiosk/src/constants.ts @@ -1,13 +1,15 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 +// eslint-disable-next-line import/no-cycle import { resolveFloorPriceRule, resolveKioskLockRule, resolvePersonalKioskRule, resolveRoyaltyRule, -} from './tx/rules//resolve'; -import { Network, type ObjectArgument, type RuleResolvingParams } from './types'; +} from './tx/rules//resolve.js'; +import { Network } from './types/index.js'; +import type { ObjectArgument, RuleResolvingParams } from './types/index.js'; /** * The base rule package ids that can be extended diff --git a/sdk/kiosk/src/index.ts b/sdk/kiosk/src/index.ts index f67ec217db436..9a5378e4e1536 100644 --- a/sdk/kiosk/src/index.ts +++ b/sdk/kiosk/src/index.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './utils'; -export * from './types'; -export * from './constants'; -export * from './client/kiosk-client'; -export * from './client/tp-transaction'; -export * from './client/kiosk-transaction'; +export * from './utils.js'; +export * from './types/index.js'; +export * from './constants.js'; +export * from './client/kiosk-client.js'; +export * from './client/tp-transaction.js'; +export * from './client/kiosk-transaction.js'; diff --git a/sdk/kiosk/src/query/kiosk.ts b/sdk/kiosk/src/query/kiosk.ts index 8ebdf396718b9..5de86ca18b133 100644 --- a/sdk/kiosk/src/query/kiosk.ts +++ b/sdk/kiosk/src/query/kiosk.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { +import type { PaginationArguments, SuiClient, SuiObjectData, @@ -10,14 +10,14 @@ import { } from '@mysten/sui.js/client'; import { isValidSuiAddress } from '@mysten/sui.js/utils'; -import { +import type { FetchKioskOptions, - KIOSK_OWNER_CAP, KioskExtension, KioskListing, OwnedKiosks, PagedKioskData, -} from '../types'; +} from '../types/index.js'; +import { KIOSK_OWNER_CAP } from '../types/index.js'; import { attachListingsAndPrices, attachLockedItems, @@ -26,7 +26,7 @@ import { getAllDynamicFields, getAllObjects, getKioskObject, -} from '../utils'; +} from '../utils.js'; export async function fetchKiosk( client: SuiClient, diff --git a/sdk/kiosk/src/query/transfer-policy.ts b/sdk/kiosk/src/query/transfer-policy.ts index bd8140558b7f5..1ff8754154d03 100644 --- a/sdk/kiosk/src/query/transfer-policy.ts +++ b/sdk/kiosk/src/query/transfer-policy.ts @@ -1,18 +1,17 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { SuiClient } from '@mysten/sui.js/client'; +import type { SuiClient } from '@mysten/sui.js/client'; import { isValidSuiAddress } from '@mysten/sui.js/utils'; -import { bcs } from '../bcs'; +import { bcs } from '../bcs.js'; +import type { TransferPolicy, TransferPolicyCap } from '../types/index.js'; import { TRANSFER_POLICY_CAP_TYPE, TRANSFER_POLICY_CREATED_EVENT, TRANSFER_POLICY_TYPE, - TransferPolicy, - TransferPolicyCap, -} from '../types'; -import { getAllOwnedObjects, parseTransferPolicyCapObject } from '../utils'; +} from '../types/index.js'; +import { getAllOwnedObjects, parseTransferPolicyCapObject } from '../utils.js'; /** * Searches the `TransferPolicy`-s for the given type. The seach is performed via diff --git a/sdk/kiosk/src/tx/kiosk.ts b/sdk/kiosk/src/tx/kiosk.ts index b9e605439ac3c..3f5bd4602fd3e 100644 --- a/sdk/kiosk/src/tx/kiosk.ts +++ b/sdk/kiosk/src/tx/kiosk.ts @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import { bcs } from '@mysten/sui.js/bcs'; -import { +import type { TransactionArgument, TransactionBlock, TransactionObjectArgument, } from '@mysten/sui.js/transactions'; -import { KIOSK_MODULE, KIOSK_TYPE, ObjectArgument } from '../types'; +import type { ObjectArgument } from '../types/index.js'; +import { KIOSK_MODULE, KIOSK_TYPE } from '../types/index.js'; /** * Create a new shared Kiosk and returns the [kiosk, kioskOwnerCap] tuple. diff --git a/sdk/kiosk/src/tx/personal-kiosk.ts b/sdk/kiosk/src/tx/personal-kiosk.ts index 051dc79e3dff9..b2fa5c0694958 100644 --- a/sdk/kiosk/src/tx/personal-kiosk.ts +++ b/sdk/kiosk/src/tx/personal-kiosk.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions'; +import type { TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions'; -import { ObjectArgument } from '../types'; +import type { ObjectArgument } from '../types/index.js'; export function convertToPersonalTx( tx: TransactionBlock, diff --git a/sdk/kiosk/src/tx/rules/attach.ts b/sdk/kiosk/src/tx/rules/attach.ts index adb3525614e30..d54920171c8c9 100644 --- a/sdk/kiosk/src/tx/rules/attach.ts +++ b/sdk/kiosk/src/tx/rules/attach.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type TransactionBlock } from '@mysten/sui.js/transactions'; +import type { TransactionBlock } from '@mysten/sui.js/transactions'; -import { type ObjectArgument } from '../../types'; +import type { ObjectArgument } from '../../types/index.js'; export function attachKioskLockRuleTx( tx: TransactionBlock, diff --git a/sdk/kiosk/src/tx/rules/resolve.ts b/sdk/kiosk/src/tx/rules/resolve.ts index aac2294518634..ea0ab818dfde5 100644 --- a/sdk/kiosk/src/tx/rules/resolve.ts +++ b/sdk/kiosk/src/tx/rules/resolve.ts @@ -1,8 +1,8 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type RuleResolvingParams } from '../../types'; -import { lock } from '../kiosk'; +import type { RuleResolvingParams } from '../../types/index.js'; +import { lock } from '../kiosk.js'; /** * A helper to resolve the royalty rule. diff --git a/sdk/kiosk/src/tx/transfer-policy.ts b/sdk/kiosk/src/tx/transfer-policy.ts index 45c3059bf6be5..9d9828d4faeeb 100644 --- a/sdk/kiosk/src/tx/transfer-policy.ts +++ b/sdk/kiosk/src/tx/transfer-policy.ts @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import { bcs } from '@mysten/sui.js/bcs'; -import { +import type { TransactionArgument, TransactionBlock, TransactionObjectArgument, } from '@mysten/sui.js/transactions'; -import { ObjectArgument, TRANSFER_POLICY_MODULE, TRANSFER_POLICY_TYPE } from '../types'; +import type { ObjectArgument } from '../types/index.js'; +import { TRANSFER_POLICY_MODULE, TRANSFER_POLICY_TYPE } from '../types/index.js'; /** * Call the `transfer_policy::new` function to create a new transfer policy. diff --git a/sdk/kiosk/src/types/index.ts b/sdk/kiosk/src/types/index.ts index 437a1a689e0ac..bdf714bbe16d6 100644 --- a/sdk/kiosk/src/types/index.ts +++ b/sdk/kiosk/src/types/index.ts @@ -1,13 +1,13 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type SuiClient } from '@mysten/sui.js/client'; -import { TransactionObjectArgument } from '@mysten/sui.js/transactions'; +import type { SuiClient } from '@mysten/sui.js/client'; +import type { TransactionObjectArgument } from '@mysten/sui.js/transactions'; -import { BaseRulePackageIds } from '../constants'; +import type { BaseRulePackageIds } from '../constants.js'; -export * from './kiosk'; -export * from './transfer-policy'; +export * from './kiosk.js'; +export * from './transfer-policy.js'; /** * A valid argument for any of the Kiosk functions. diff --git a/sdk/kiosk/src/types/kiosk.ts b/sdk/kiosk/src/types/kiosk.ts index b095910990272..31b68d65f12b5 100644 --- a/sdk/kiosk/src/types/kiosk.ts +++ b/sdk/kiosk/src/types/kiosk.ts @@ -1,14 +1,14 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { +import type { PaginatedObjectsResponse, SuiObjectData, SuiObjectDataOptions, } from '@mysten/sui.js/client'; -import { TransactionArgument } from '@mysten/sui.js/transactions'; +import type { TransactionArgument } from '@mysten/sui.js/transactions'; -import { ObjectArgument } from '.'; +import type { ObjectArgument } from './index.js'; /** The Kiosk module. */ export const KIOSK_MODULE = '0x2::kiosk'; diff --git a/sdk/kiosk/src/types/transfer-policy.ts b/sdk/kiosk/src/types/transfer-policy.ts index a51b4f6eb8929..3a4c5f8e720af 100644 --- a/sdk/kiosk/src/types/transfer-policy.ts +++ b/sdk/kiosk/src/types/transfer-policy.ts @@ -1,10 +1,10 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { type ObjectOwner } from '@mysten/sui.js/client'; -import { TransactionObjectArgument, type TransactionBlock } from '@mysten/sui.js/transactions'; +import type { ObjectOwner } from '@mysten/sui.js/client'; +import type { TransactionBlock, TransactionObjectArgument } from '@mysten/sui.js/transactions'; -import { ObjectArgument } from '.'; +import type { ObjectArgument } from './index.js'; /** The Transfer Policy module. */ export const TRANSFER_POLICY_MODULE = '0x2::transfer_policy'; diff --git a/sdk/kiosk/src/utils.ts b/sdk/kiosk/src/utils.ts index 0123c6b5c9570..7bc4ce8c0ae19 100644 --- a/sdk/kiosk/src/utils.ts +++ b/sdk/kiosk/src/utils.ts @@ -1,26 +1,20 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { +import type { + DynamicFieldInfo, PaginationArguments, SuiClient, SuiObjectData, SuiObjectDataFilter, SuiObjectDataOptions, SuiObjectResponse, - type DynamicFieldInfo, } from '@mysten/sui.js/client'; import { normalizeStructTag, normalizeSuiAddress, parseStructTag } from '@mysten/sui.js/utils'; -import { bcs } from './bcs'; -import { - Kiosk, - KIOSK_TYPE, - KioskData, - KioskListing, - TRANSFER_POLICY_CAP_TYPE, - TransferPolicyCap, -} from './types'; +import { bcs } from './bcs.js'; +import type { Kiosk, KioskData, KioskListing, TransferPolicyCap } from './types/index.js'; +import { KIOSK_TYPE, TRANSFER_POLICY_CAP_TYPE } from './types/index.js'; const DEFAULT_QUERY_LIMIT = 50; diff --git a/sdk/kiosk/test/e2e/helper.ts b/sdk/kiosk/test/e2e/helper.ts index 71ae62d845981..6961e4d418162 100644 --- a/sdk/kiosk/test/e2e/helper.ts +++ b/sdk/kiosk/test/e2e/helper.ts @@ -4,14 +4,14 @@ import { TransactionBlock } from '@mysten/sui.js/transactions'; import { expect } from 'vitest'; +import type { KioskClient, KioskOwnerCap } from '../../src/index.js'; import { - KioskClient, - KioskOwnerCap, KioskTransaction, percentageToBasisPoints, TransferPolicyTransaction, -} from '../../src'; -import { executeTransactionBlock, getPublisherObject, TestToolbox } from './setup'; +} from '../../src/index.js'; +import type { TestToolbox } from './setup.js'; +import { executeTransactionBlock, getPublisherObject } from './setup.js'; // Creates a fresh transfer policy for Heroes and attaches all the rules. export async function prepareHeroRuleset({ diff --git a/sdk/kiosk/test/e2e/setup.ts b/sdk/kiosk/test/e2e/setup.ts index 66576170dad90..e1145851ee556 100644 --- a/sdk/kiosk/test/e2e/setup.ts +++ b/sdk/kiosk/test/e2e/setup.ts @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import { execSync } from 'child_process'; -import { +import type { DevInspectResults, - getFullnodeUrl, - SuiClient, SuiObjectChangePublished, SuiTransactionBlockResponse, } from '@mysten/sui.js/client'; +import { getFullnodeUrl, SuiClient } from '@mysten/sui.js/client'; import { FaucetRateLimitError, getFaucetHost, requestSuiFromFaucetV0 } from '@mysten/sui.js/faucet'; import { Ed25519Keypair } from '@mysten/sui.js/keypairs/ed25519'; import { TransactionBlock } from '@mysten/sui.js/transactions'; @@ -16,7 +15,8 @@ import tmp from 'tmp'; import { retry } from 'ts-retry-promise'; import { expect } from 'vitest'; -import { KioskClient, KioskTransaction } from '../../src'; +import type { KioskClient } from '../../src/index.js'; +import { KioskTransaction } from '../../src/index.js'; //@ts-ignore-next-line const DEFAULT_FAUCET_URL = import.meta.env.VITE_FAUCET_URL ?? getFaucetHost('localnet'); diff --git a/sdk/suins-toolkit/src/client.ts b/sdk/suins-toolkit/src/client.ts index 19c634ac54ca3..e9cfda2d7c6b9 100644 --- a/sdk/suins-toolkit/src/client.ts +++ b/sdk/suins-toolkit/src/client.ts @@ -1,12 +1,12 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { SuiClient } from '@mysten/sui.js/client'; +import type { SuiClient } from '@mysten/sui.js/client'; -import { DataFields, NameObject, NetworkType, SuiNSContract } from './types/objects'; -import { DEVNET_JSON_FILE, GCS_URL, TESTNET_JSON_FILE } from './utils/constants'; -import { camelCase, parseObjectDataResponse, parseRegistryResponse } from './utils/parser'; -import { getAvatar, getOwner } from './utils/queries'; +import type { DataFields, NameObject, NetworkType, SuiNSContract } from './types/objects.js'; +import { DEVNET_JSON_FILE, GCS_URL, TESTNET_JSON_FILE } from './utils/constants.js'; +import { camelCase, parseObjectDataResponse, parseRegistryResponse } from './utils/parser.js'; +import { getAvatar, getOwner } from './utils/queries.js'; export const AVATAR_NOT_OWNED = 'AVATAR_NOT_OWNED'; diff --git a/sdk/suins-toolkit/src/index.ts b/sdk/suins-toolkit/src/index.ts index 0e18ddf62872e..77c2f2d982d4f 100644 --- a/sdk/suins-toolkit/src/index.ts +++ b/sdk/suins-toolkit/src/index.ts @@ -1,6 +1,6 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './client'; -export * from './types'; -export * from './utils/parser'; +export * from './client.js'; +export * from './types/index.js'; +export * from './utils/parser.js'; diff --git a/sdk/suins-toolkit/src/types/index.ts b/sdk/suins-toolkit/src/types/index.ts index 74573fd91fb21..d74014b27d253 100644 --- a/sdk/suins-toolkit/src/types/index.ts +++ b/sdk/suins-toolkit/src/types/index.ts @@ -1,4 +1,4 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './objects'; +export * from './objects.js'; diff --git a/sdk/suins-toolkit/src/utils/parser.ts b/sdk/suins-toolkit/src/utils/parser.ts index 86ac753335c2e..d5d24b413cffb 100644 --- a/sdk/suins-toolkit/src/utils/parser.ts +++ b/sdk/suins-toolkit/src/utils/parser.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { SuiMoveObject, SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client'; +import type { SuiMoveObject, SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client'; import { normalizeSuiAddress } from '@mysten/sui.js/utils'; export const camelCase = (string: string) => string.replace(/(_\w)/g, (g) => g[1].toUpperCase()); diff --git a/sdk/suins-toolkit/src/utils/queries.ts b/sdk/suins-toolkit/src/utils/queries.ts index 72568c8876079..d07ae25b1b755 100644 --- a/sdk/suins-toolkit/src/utils/queries.ts +++ b/sdk/suins-toolkit/src/utils/queries.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { SuiClient, SuiObjectResponse } from '@mysten/sui.js/client'; +import type { SuiClient, SuiObjectResponse } from '@mysten/sui.js/client'; // get NFT's owner from RPC. export const getOwner = async (client: SuiClient, nftId: string): Promise => { diff --git a/sdk/typescript/scripts/generate.ts b/sdk/typescript/scripts/generate.ts index 3a62a7a59e571..35d6eda3ac21f 100644 --- a/sdk/typescript/scripts/generate.ts +++ b/sdk/typescript/scripts/generate.ts @@ -8,13 +8,13 @@ import ts from 'typescript'; /** @ts-ignore */ import prettierConfig from '../../../prettier.config.js'; -import { +import type { OpenRpcMethod, OpenRpcParam, + OpenRpcSpec, OpenRpcType, OpenRpcTypeRef, - type OpenRpcSpec, -} from './open-rpc'; +} from './open-rpc.js'; const packageRoot = path.resolve(import.meta.url.slice(5), '../..'); const openRpcSpec: OpenRpcSpec = JSON.parse( diff --git a/sdk/typescript/test/e2e/utils/setup.ts b/sdk/typescript/test/e2e/utils/setup.ts index d3391bc3cdca9..7132ef7ef49f1 100644 --- a/sdk/typescript/test/e2e/utils/setup.ts +++ b/sdk/typescript/test/e2e/utils/setup.ts @@ -7,17 +7,17 @@ import { retry } from 'ts-retry-promise'; import { expect } from 'vitest'; import { WebSocket } from 'ws'; -import { TransactionBlock, UpgradePolicy } from '../../../src/builder'; +import { TransactionBlock, UpgradePolicy } from '../../../src/builder/index.js'; +import type { SuiObjectChangePublished } from '../../../src/client/index.js'; +import { getFullnodeUrl, SuiClient, SuiHTTPTransport } from '../../../src/client/index.js'; +import type { Keypair } from '../../../src/cryptography/index.js'; import { - getFullnodeUrl, - SuiClient, - SuiHTTPTransport, - SuiObjectChangePublished, -} from '../../../src/client'; -import { Keypair } from '../../../src/cryptography'; -import { FaucetRateLimitError, getFaucetHost, requestSuiFromFaucetV0 } from '../../../src/faucet'; -import { Ed25519Keypair } from '../../../src/keypairs/ed25519'; -import { SUI_TYPE_ARG } from '../../../src/utils'; + FaucetRateLimitError, + getFaucetHost, + requestSuiFromFaucetV0, +} from '../../../src/faucet/index.js'; +import { Ed25519Keypair } from '../../../src/keypairs/ed25519/index.js'; +import { SUI_TYPE_ARG } from '../../../src/utils/index.js'; const DEFAULT_FAUCET_URL = import.meta.env.VITE_FAUCET_URL ?? getFaucetHost('localnet'); const DEFAULT_FULLNODE_URL = import.meta.env.VITE_FULLNODE_URL ?? getFullnodeUrl('localnet'); diff --git a/sdk/wallet-standard/src/detect.ts b/sdk/wallet-standard/src/detect.ts index 1174984ee4ed5..14c78d2ca83a2 100644 --- a/sdk/wallet-standard/src/detect.ts +++ b/sdk/wallet-standard/src/detect.ts @@ -1,9 +1,9 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { Wallet, WalletWithFeatures } from '@wallet-standard/core'; +import type { Wallet, WalletWithFeatures } from '@wallet-standard/core'; -import { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features'; +import type { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features/index.js'; // These features are absolutely required for wallets to function in the Sui ecosystem. // Eventually, as wallets have more consistent support of features, we may want to extend this list. diff --git a/sdk/wallet-standard/src/features/index.ts b/sdk/wallet-standard/src/features/index.ts index f16aee28bb33b..7f6163acf0999 100644 --- a/sdk/wallet-standard/src/features/index.ts +++ b/sdk/wallet-standard/src/features/index.ts @@ -9,10 +9,10 @@ import type { WalletWithFeatures, } from '@wallet-standard/core'; -import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock'; -import { SuiSignMessageFeature } from './suiSignMessage'; -import { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage'; -import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock'; +import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock.js'; +import type { SuiSignMessageFeature } from './suiSignMessage.js'; +import type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js'; +import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js'; /** * Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement. @@ -43,7 +43,7 @@ export type WalletWithRequiredFeatures = WalletWithFeatures< export type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature; -export * from './suiSignMessage'; -export * from './suiSignTransactionBlock'; -export * from './suiSignAndExecuteTransactionBlock'; -export * from './suiSignPersonalMessage'; +export * from './suiSignMessage.js'; +export * from './suiSignTransactionBlock.js'; +export * from './suiSignAndExecuteTransactionBlock.js'; +export * from './suiSignPersonalMessage.js'; diff --git a/sdk/wallet-standard/src/features/suiSignAndExecuteTransactionBlock.ts b/sdk/wallet-standard/src/features/suiSignAndExecuteTransactionBlock.ts index 2e597308c67dd..b6acc4ca959a6 100644 --- a/sdk/wallet-standard/src/features/suiSignAndExecuteTransactionBlock.ts +++ b/sdk/wallet-standard/src/features/suiSignAndExecuteTransactionBlock.ts @@ -7,7 +7,7 @@ import type { SuiTransactionBlockResponseOptions, } from '@mysten/sui.js/client'; -import type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock'; +import type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock.js'; /** The latest API version of the signAndExecuteTransactionBlock API. */ export type SuiSignAndExecuteTransactionBlockVersion = '1.0.0'; diff --git a/sdk/wallet-standard/src/features/suiSignTransactionBlock.ts b/sdk/wallet-standard/src/features/suiSignTransactionBlock.ts index 083f18ec1dc22..207e7f4d0c267 100644 --- a/sdk/wallet-standard/src/features/suiSignTransactionBlock.ts +++ b/sdk/wallet-standard/src/features/suiSignTransactionBlock.ts @@ -1,7 +1,7 @@ // Copyright (c) Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 -import { TransactionBlock } from '@mysten/sui.js/transactions'; +import type { TransactionBlock } from '@mysten/sui.js/transactions'; import type { IdentifierString, WalletAccount } from '@wallet-standard/core'; /** The latest API version of the signTransactionBlock API. */ diff --git a/sdk/wallet-standard/src/index.ts b/sdk/wallet-standard/src/index.ts index 4b1d41797589f..5cd9c073b4287 100644 --- a/sdk/wallet-standard/src/index.ts +++ b/sdk/wallet-standard/src/index.ts @@ -3,7 +3,7 @@ export * from '@wallet-standard/core'; -export type { Wallet } from './wallet'; -export * from './features'; -export * from './detect'; -export * from './chains'; +export type { Wallet } from './wallet.js'; +export * from './features/index.js'; +export * from './detect.js'; +export * from './chains.js';