diff --git a/global-wallets-env.d.ts b/global-wallets-env.d.ts index fcf8204185..6b6dad9d60 100644 --- a/global-wallets-env.d.ts +++ b/global-wallets-env.d.ts @@ -2,38 +2,42 @@ export {}; declare global { interface Window { - ethereum: any; - braveSolana: any; - BinanceChain: any; - clover: any; - clover_solana: any; - cosmostation: any; - exodus: any; - solana: any; - phantom: any; - xfi: any; - coinbaseWalletExtension: any; - coinbaseSolana: any; - coin98: any; - keplr: any; - isSafePal: any; - safepal: any; - safepalProvider: any; - trustwallet: any; - okxwallet: any; - starknet_argentX: any; - starknet_braavos: any; - tronLink: any; - kucoin: any; - leap: any; - frontier: any; - terraWallets: any; - enkrypt: any; - tally: any; - bitkeep: any; - mytonwallet: any; - offlineSigner: any; - tomo_evm: any; - solflare: any; + // Some dependencies can override global environments, so maybe we needed to make some changes to make them compatible. + // This should be optional to `provider-solfare` can be compiled. see: `@solflare-wallet/metamask-sdk/lib/cjs/types.d.ts(74,18)` + ethereum?: any; + braveSolana?: any; + BinanceChain?: any; + clover?: any; + clover_solana?: any; + cosmostation?: any; + exodus?: any; + solana?: any; + phantom?: any; + xfi?: any; + coinbaseWalletExtension?: any; + coinbaseSolana?: any; + coin98?: any; + keplr?: any; + isSafePal?: any; + safepal?: any; + safepalProvider?: any; + trustwallet?: any; + okxwallet?: any; + starknet_argentX?: any; + starknet_braavos?: any; + tronLink?: any; + kucoin?: any; + leap?: any; + frontier?: any; + // This is for Station provider, `@terra-money/wallet-controller` adds this property to window automatically. + // file: node_modules/@terra-money/wallet-controller/modules/extension-router/multiChannel.d.ts + // terraWallets: any; + enkrypt?: any; + tally?: any; + bitkeep?: any; + mytonwallet?: any; + offlineSigner?: any; + tomo_evm?: any; + solflare?: any; } } diff --git a/package.json b/package.json index b526b74267..0d4cec98c3 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,8 @@ "i18n": "yarn i18n:extract && yarn i18n:compile", "test": "vitest", "test:coverage": "vitest run --coverage", - "commitlint": "commitlint --edit" + "commitlint": "commitlint --edit", + "postinstall": "patch-package" }, "dependencies": { "husky": "^8.0.3", @@ -100,6 +101,8 @@ "nx": "16.2.1", "os-browserify": "^0.3.0", "parcel": "^2.11.0", + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0", "prettier": "^2.7.1", "punycode": "^1.4.1", "querystring-es3": "^0.2.1", diff --git a/patches/@solflare-wallet+sdk+1.4.2.patch b/patches/@solflare-wallet+sdk+1.4.2.patch new file mode 100644 index 0000000000..298f028978 --- /dev/null +++ b/patches/@solflare-wallet+sdk+1.4.2.patch @@ -0,0 +1,11 @@ +diff --git a/node_modules/@solflare-wallet/sdk/package.json b/node_modules/@solflare-wallet/sdk/package.json +index 6d43e38..8fd0274 100644 +--- a/node_modules/@solflare-wallet/sdk/package.json ++++ b/node_modules/@solflare-wallet/sdk/package.json +@@ -1,5 +1,6 @@ + { + "name": "@solflare-wallet/sdk", ++ "type": "module", + "version": "1.4.2", + "description": "", + "repository": "https://github.com/solflare-wallet/solflare-sdk", diff --git a/patches/@walletconnect+modal+2.6.2.patch b/patches/@walletconnect+modal+2.6.2.patch new file mode 100644 index 0000000000..280aa8f4d8 --- /dev/null +++ b/patches/@walletconnect+modal+2.6.2.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/@walletconnect/modal/dist/_types/src/client.d.ts b/node_modules/@walletconnect/modal/dist/_types/src/client.d.ts +index fc7c092..258e47f 100644 +--- a/node_modules/@walletconnect/modal/dist/_types/src/client.d.ts ++++ b/node_modules/@walletconnect/modal/dist/_types/src/client.d.ts +@@ -9,8 +9,8 @@ export type WalletConnectModalConfig = ConfigCtrlState & ThemeCtrlState; + export declare class WalletConnectModal { + constructor(config: WalletConnectModalConfig); + private initUi; +- openModal: (options?: import("packages/modal-core/dist/_types/src/controllers/ModalCtrl").OpenOptions | undefined) => Promise; ++ openModal: (options?: import("@walletconnect/modal-core/dist/_types/src/controllers/ModalCtrl").OpenOptions | undefined) => Promise; + closeModal: () => void; +- subscribeModal: (callback: (newState: import("packages/modal-core/dist/_types/src/types/controllerTypes").ModalCtrlState) => void) => () => void; ++ subscribeModal: (callback: (newState: import("@walletconnect/modal-core/dist/_types/src/types/controllerTypes").ModalCtrlState) => void) => () => void; + setTheme: (theme: ThemeCtrlState) => void; + } diff --git a/scripts/build/command.mjs b/scripts/build/command.mjs index 8c57aca0ac..ad057e7187 100644 --- a/scripts/build/command.mjs +++ b/scripts/build/command.mjs @@ -18,15 +18,16 @@ async function run() { { name: 'path', type: String }, // It accepts a comma separated file paths. e.g. src/main.ts,src/net.ts { name: 'inputs', type: String }, + // Comma separated list. https://esbuild.github.io/api/#external + { name: 'external', type: String }, ]; - const { path, inputs } = commandLineArgs(optionDefinitions); + const { path, inputs, external } = commandLineArgs(optionDefinitions); if (!path) { throw new Error('You need to specify package name.'); } const pkgPath = `${root}/${path}`; - const entryPoint = `${pkgPath}/src/index.ts`; const packageName = packageNameWithoutScope(packageJson(path).name); let entryPoints = []; @@ -36,6 +37,18 @@ async function run() { entryPoints = inputs.split(',').map((input) => `${pkgPath}/${input}`); } + // read more: https://esbuild.github.io/api/#packages + let externalPackages = {}; + if (!external) { + externalPackages = { + packages: 'external', + }; + } else { + externalPackages = { + external: external.split(','), + }; + } + console.log(`[build] Running for ${path}`); const typeCheckingTask = $({ @@ -50,10 +63,10 @@ async function run() { sourcemap: true, platform: 'node', format: 'esm', - packages: 'external', outdir: `${pkgPath}/dist`, entryPoints: entryPoints, metafile: true, + ...externalPackages, }); const result = await Promise.all([typeCheckingTask, esbuildTask]); console.log(`[build] ${path} built successfully.`); diff --git a/signers/signer-cosmos/package.json b/signers/signer-cosmos/package.json index f252d26f50..b20d096439 100644 --- a/signers/signer-cosmos/package.json +++ b/signers/signer-cosmos/package.json @@ -18,7 +18,8 @@ "ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json", "clean": "rimraf dist", "format": "prettier --write '{.,src}/**/*.{ts,tsx}'", - "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore" + "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore", + "postinstall": "patch-package" }, "dependencies": { "@cosmjs/launchpad": "^0.27.1", diff --git a/signers/signer-cosmos/patches/long+5.2.3.patch b/signers/signer-cosmos/patches/long+5.2.3.patch new file mode 100644 index 0000000000..16b73e86c7 --- /dev/null +++ b/signers/signer-cosmos/patches/long+5.2.3.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/long/umd/index.d.ts b/node_modules/long/umd/index.d.ts +index c623535..9722763 100644 +--- a/node_modules/long/umd/index.d.ts ++++ b/node_modules/long/umd/index.d.ts +@@ -1,2 +1,7 @@ ++// @ts-expect-error this library has a build issue which breaks `esnext` and `nodendex` module resolution. ++// Issues: ++// https://github.com/dcodeIO/long.js/issues/125 ++// https://github.com/dcodeIO/long.js/issues/131 ++// https://github.com/dcodeIO/long.js/issues/109 + import Long from "../index.js"; + export = Long; diff --git a/signers/signer-cosmos/src/index.ts b/signers/signer-cosmos/src/index.ts index 972181865e..4ef8a6471d 100644 --- a/signers/signer-cosmos/src/index.ts +++ b/signers/signer-cosmos/src/index.ts @@ -1,2 +1,2 @@ -export { DefaultCosmosSigner } from './signer'; -export { executeCosmosTransaction, getsignedTx } from './helpers'; +export { DefaultCosmosSigner } from './signer.js'; +export { executeCosmosTransaction, getsignedTx } from './helpers.js'; diff --git a/signers/signer-cosmos/src/signer.ts b/signers/signer-cosmos/src/signer.ts index 35022d161f..2efe5ab694 100644 --- a/signers/signer-cosmos/src/signer.ts +++ b/signers/signer-cosmos/src/signer.ts @@ -1,6 +1,7 @@ -import type { GenericSigner, CosmosTransaction } from 'rango-types'; -import { executeCosmosTransaction } from './helpers'; -import { Keplr } from '@keplr-wallet/types'; +import type { Keplr } from '@keplr-wallet/types'; +import type { CosmosTransaction, GenericSigner } from 'rango-types'; + +import { executeCosmosTransaction } from './helpers.js'; type CosmosExternalProvider = Keplr; @@ -16,7 +17,9 @@ export class DefaultCosmosSigner implements GenericSigner { address: string, chainId: string | null ): Promise { - if (!chainId) throw Error('ChainId is required'); + if (!chainId) { + throw Error('ChainId is required'); + } const { signature } = await this.provider.signArbitrary( chainId, address, diff --git a/signers/signer-cosmos/tsconfig.build.json b/signers/signer-cosmos/tsconfig.build.json index e18a31ceb5..369287d895 100644 --- a/signers/signer-cosmos/tsconfig.build.json +++ b/signers/signer-cosmos/tsconfig.build.json @@ -1,12 +1,10 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", - "lib": ["dom", "esnext"], - // match output dir to input dir. e.g. dist/index instead of dist/src/index - "allowSyntheticDefaultImports": true + "lib": ["dom", "esnext"] } } diff --git a/signers/signer-evm/src/helper.ts b/signers/signer-evm/src/helper.ts index 1e9595a579..e4537c548e 100644 --- a/signers/signer-evm/src/helper.ts +++ b/signers/signer-evm/src/helper.ts @@ -7,7 +7,7 @@ import { SignerErrorCode, } from 'rango-types'; -import { MetamaskErrorCodes, RPCErrorCode, RPCErrorMessage } from './types'; +import { MetamaskErrorCodes, RPCErrorCode, RPCErrorMessage } from './types.js'; export const cleanEvmError = (error: any): SignerErrorType => { if (!error) { diff --git a/signers/signer-evm/src/index.ts b/signers/signer-evm/src/index.ts index 58c7296e66..e78ccc5711 100644 --- a/signers/signer-evm/src/index.ts +++ b/signers/signer-evm/src/index.ts @@ -1,2 +1,2 @@ -export { DefaultEvmSigner } from './signer'; -export { waitMs, cleanEvmError } from './helper'; +export { DefaultEvmSigner } from './signer.js'; +export { waitMs, cleanEvmError } from './helper.js'; diff --git a/signers/signer-evm/src/signer.ts b/signers/signer-evm/src/signer.ts index a8e4becf64..131a5c5cb7 100644 --- a/signers/signer-evm/src/signer.ts +++ b/signers/signer-evm/src/signer.ts @@ -3,7 +3,7 @@ import type { TransactionResponse, } from '@ethersproject/abstract-provider'; import type { GenericSigner } from 'rango-types'; -import type { EvmTransaction } from 'rango-types/lib/api/main'; +import type { EvmTransaction } from 'rango-types/mainApi'; import { providers } from 'ethers'; import { @@ -12,8 +12,8 @@ import { SignerErrorCode, } from 'rango-types'; -import { cleanEvmError, getTenderlyError, waitMs } from './helper'; -import { RPCErrorCode } from './types'; +import { cleanEvmError, getTenderlyError, waitMs } from './helper.js'; +import { RPCErrorCode } from './types.js'; type ProviderType = ConstructorParameters[0]; diff --git a/signers/signer-evm/tests/index.test.ts b/signers/signer-evm/tests/index.test.ts index dfc6592212..4d78f06c02 100644 --- a/signers/signer-evm/tests/index.test.ts +++ b/signers/signer-evm/tests/index.test.ts @@ -1,7 +1,9 @@ -import { describe, beforeEach, it, expect } from 'vitest'; -import { DefaultEvmSigner } from '../src/index'; -import { MockEvmProvider } from '../../../test-utils/mock.evm.provider'; -import { EVM_TX, address, privateKey } from './mock.data'; +import { beforeEach, describe, expect, it } from 'vitest'; + +import { MockEvmProvider } from '../../../test-utils/mock.evm.provider.js'; +import { DefaultEvmSigner } from '../src/index.js'; + +import { address, EVM_TX, privateKey } from './mock.data.js'; describe('Test EVM Signer', () => { let provider: MockEvmProvider; diff --git a/signers/signer-evm/tests/mock.data.ts b/signers/signer-evm/tests/mock.data.ts index a5fabee42b..4d43ebee82 100644 --- a/signers/signer-evm/tests/mock.data.ts +++ b/signers/signer-evm/tests/mock.data.ts @@ -1,5 +1,6 @@ +import type { EvmTransaction } from 'rango-types/mainApi'; + import { TransactionType } from 'rango-types'; -import { EvmTransaction } from 'rango-types/lib/api/main'; export const address = '0x17ec8597ff92C3F44523bDc65BF0f1bE632917ff'; export const privateKey = diff --git a/signers/signer-evm/tsconfig.build.json b/signers/signer-evm/tsconfig.build.json index 579fb407b9..4f5441876c 100644 --- a/signers/signer-evm/tsconfig.build.json +++ b/signers/signer-evm/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", diff --git a/signers/signer-solana/src/index.ts b/signers/signer-solana/src/index.ts index e0f6856684..de319a0f62 100644 --- a/signers/signer-solana/src/index.ts +++ b/signers/signer-solana/src/index.ts @@ -1,10 +1,10 @@ -export { DefaultSolanaSigner } from './signer'; +export { DefaultSolanaSigner } from './signer.js'; export { executeSolanaTransaction, generalSolanaTransactionExecutor, prepareTransaction, getSolanaConnection, simulateTransaction, -} from './utils'; -export type { SolanaWeb3Signer } from './utils'; -export { setSolanaSignerConfig } from './config'; +} from './utils/index.js'; +export type { SolanaWeb3Signer } from './utils/index.js'; +export { setSolanaSignerConfig } from './config.js'; diff --git a/signers/signer-solana/src/signer.ts b/signers/signer-solana/src/signer.ts index d3e38f6544..d9db907a97 100644 --- a/signers/signer-solana/src/signer.ts +++ b/signers/signer-solana/src/signer.ts @@ -1,9 +1,9 @@ -import type { SolanaExternalProvider } from './utils/types'; +import type { SolanaExternalProvider } from './utils/types.js'; import type { GenericSigner, SolanaTransaction } from 'rango-types'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { executeSolanaTransaction } from './utils/main'; +import { executeSolanaTransaction } from './utils/main.js'; export class DefaultSolanaSigner implements GenericSigner { private provider: SolanaExternalProvider; diff --git a/signers/signer-solana/src/utils/helpers.ts b/signers/signer-solana/src/utils/helpers.ts index fc3bbffff2..97d81ae6ba 100644 --- a/signers/signer-solana/src/utils/helpers.ts +++ b/signers/signer-solana/src/utils/helpers.ts @@ -1,6 +1,6 @@ import { Connection } from '@solana/web3.js'; -import { getSolanaSignerConfig } from '../config'; +import { getSolanaSignerConfig } from '../config.js'; const IS_DEV = !process.env.NODE_ENV || process.env.NODE_ENV === 'development'; const SOLANA_RPC_URL = !IS_DEV diff --git a/signers/signer-solana/src/utils/index.ts b/signers/signer-solana/src/utils/index.ts index 92a2248f4e..16ba9dfe0e 100644 --- a/signers/signer-solana/src/utils/index.ts +++ b/signers/signer-solana/src/utils/index.ts @@ -1,8 +1,8 @@ -export type { SolanaWeb3Signer, SolanaExternalProvider } from './types'; +export type { SolanaWeb3Signer, SolanaExternalProvider } from './types.js'; export { executeSolanaTransaction, generalSolanaTransactionExecutor, -} from './main'; -export { prepareTransaction } from './prepare'; -export { getSolanaConnection } from './helpers'; -export { simulateTransaction } from './simulate'; +} from './main.js'; +export { prepareTransaction } from './prepare.js'; +export { getSolanaConnection } from './helpers.js'; +export { simulateTransaction } from './simulate.js'; diff --git a/signers/signer-solana/src/utils/main.ts b/signers/signer-solana/src/utils/main.ts index a675787d6e..ac3e979b0c 100644 --- a/signers/signer-solana/src/utils/main.ts +++ b/signers/signer-solana/src/utils/main.ts @@ -1,12 +1,12 @@ -import type { SolanaExternalProvider, SolanaWeb3Signer } from './types'; +import type { SolanaExternalProvider, SolanaWeb3Signer } from './types.js'; import type { SolanaTransaction } from 'rango-types'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { getSolanaConnection } from './helpers'; -import { prepareTransaction } from './prepare'; -import { transactionSenderAndConfirmationWaiter } from './send'; -import { simulateTransaction } from './simulate'; +import { getSolanaConnection } from './helpers.js'; +import { prepareTransaction } from './prepare.js'; +import { transactionSenderAndConfirmationWaiter } from './send.js'; +import { simulateTransaction } from './simulate.js'; /* * https://docs.phantom.app/integrating/sending-a-transaction diff --git a/signers/signer-solana/src/utils/send.ts b/signers/signer-solana/src/utils/send.ts index a8eee326d7..a6f3a92e37 100644 --- a/signers/signer-solana/src/utils/send.ts +++ b/signers/signer-solana/src/utils/send.ts @@ -1,12 +1,12 @@ import type { TransactionSenderAndConfirmationWaiterArgs, TransactionSenderAndConfirmationWaiterResponse, -} from './types'; +} from './types.js'; import { TransactionExpiredBlockheightExceededError } from '@solana/web3.js'; import promiseRetry from 'promise-retry'; -import { wait } from './helpers'; +import { wait } from './helpers.js'; const SEND_OPTIONS = { skipPreflight: true, diff --git a/signers/signer-solana/src/utils/simulate.ts b/signers/signer-solana/src/utils/simulate.ts index 0a578b0491..188a6ff456 100644 --- a/signers/signer-solana/src/utils/simulate.ts +++ b/signers/signer-solana/src/utils/simulate.ts @@ -2,7 +2,7 @@ import type { Transaction, VersionedTransaction } from '@solana/web3.js'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { getSolanaConnection } from './helpers'; +import { getSolanaConnection } from './helpers.js'; const INSUFFICIENT_FUNDS_ERROR_CODE = 1; const SLIPPAGE_ERROR_CODE = 6001; diff --git a/signers/signer-solana/tsconfig.build.json b/signers/signer-solana/tsconfig.build.json index 73171e007c..07758b39a6 100644 --- a/signers/signer-solana/tsconfig.build.json +++ b/signers/signer-solana/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", diff --git a/signers/signer-starknet/src/index.ts b/signers/signer-starknet/src/index.ts index 699910a3c1..b367e66430 100644 --- a/signers/signer-starknet/src/index.ts +++ b/signers/signer-starknet/src/index.ts @@ -1 +1 @@ -export { DefaultStarknetSigner } from './signer'; +export { DefaultStarknetSigner } from './signer.js'; diff --git a/signers/signer-starknet/tsconfig.build.json b/signers/signer-starknet/tsconfig.build.json index 0beb1913ca..301a2cceeb 100644 --- a/signers/signer-starknet/tsconfig.build.json +++ b/signers/signer-starknet/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "rootDir": "./src", diff --git a/signers/signer-terra/src/helpers.ts b/signers/signer-terra/src/helpers.ts index 9995311428..27e7a134ab 100644 --- a/signers/signer-terra/src/helpers.ts +++ b/signers/signer-terra/src/helpers.ts @@ -1,8 +1,10 @@ -import { JSONSerializable } from '@terra-money/terra.js/dist/util/json.js'; -import { Coin, CreateTxOptions, Msg as TerraMsg } from '@terra-money/terra.js'; -import { Fee } from '@terra-money/terra.js/dist/core/index.js'; +import type { CreateTxOptions, Msg as TerraMsg } from '@terra-money/terra.js'; import type { CosmosTransaction } from 'rango-types'; +import { Coin } from '@terra-money/terra.js'; +import { Fee } from '@terra-money/terra.js/dist/core/index.js'; +import { JSONSerializable } from '@terra-money/terra.js/dist/util/json.js'; + export const executeTerraTransaction = async ( cosmosTx: CosmosTransaction, provider: any diff --git a/signers/signer-terra/src/index.ts b/signers/signer-terra/src/index.ts index a67f3c785d..48f186501b 100644 --- a/signers/signer-terra/src/index.ts +++ b/signers/signer-terra/src/index.ts @@ -1,2 +1,2 @@ -export { DefaultTerraSigner } from './signer'; -export { executeTerraTransaction } from './helpers'; +export { DefaultTerraSigner } from './signer.js'; +export { executeTerraTransaction } from './helpers.js'; diff --git a/signers/signer-terra/src/signer.ts b/signers/signer-terra/src/signer.ts index 26ce39b42f..b57fbb7be3 100644 --- a/signers/signer-terra/src/signer.ts +++ b/signers/signer-terra/src/signer.ts @@ -1,6 +1,6 @@ import type { CosmosTransaction, GenericSigner } from 'rango-types'; -import { executeTerraTransaction } from './helpers'; +import { executeTerraTransaction } from './helpers.js'; type TerraExternalProvider = any; diff --git a/signers/signer-terra/tsconfig.build.json b/signers/signer-terra/tsconfig.build.json index 579fb407b9..4f5441876c 100644 --- a/signers/signer-terra/tsconfig.build.json +++ b/signers/signer-terra/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", diff --git a/signers/signer-ton/src/index.ts b/signers/signer-ton/src/index.ts index 2e33102b3b..9cde28770f 100644 --- a/signers/signer-ton/src/index.ts +++ b/signers/signer-ton/src/index.ts @@ -1 +1 @@ -export { DefaultTonSigner } from './signer'; +export { DefaultTonSigner } from './signer.js'; diff --git a/signers/signer-ton/src/signer.ts b/signers/signer-ton/src/signer.ts index 07c8b4e0a0..441d73eef0 100644 --- a/signers/signer-ton/src/signer.ts +++ b/signers/signer-ton/src/signer.ts @@ -1,4 +1,6 @@ -import { GenericSigner, SignerError, TonTransaction } from 'rango-types'; +import type { GenericSigner, TonTransaction } from 'rango-types'; + +import { SignerError } from 'rango-types'; export class DefaultTonSigner implements GenericSigner { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -18,9 +20,9 @@ export class DefaultTonSigner implements GenericSigner { params: [JSON.stringify(transactionObjectForSign)], }); /* - No hash is returned when signing a Ton transaction. - Returns a string for API consistency - */ + *No hash is returned when signing a Ton transaction. + *Returns a string for API consistency + */ return { hash: 'xxxxxxxx' }; } } diff --git a/signers/signer-ton/tsconfig.build.json b/signers/signer-ton/tsconfig.build.json index 9762314b8a..33308f0bc6 100644 --- a/signers/signer-ton/tsconfig.build.json +++ b/signers/signer-ton/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", diff --git a/signers/signer-tron/src/index.ts b/signers/signer-tron/src/index.ts index 7af923aa63..a6dd5368bd 100644 --- a/signers/signer-tron/src/index.ts +++ b/signers/signer-tron/src/index.ts @@ -1 +1 @@ -export { DefaultTronSigner } from './signer'; +export { DefaultTronSigner } from './signer.js'; diff --git a/signers/signer-tron/tsconfig.build.json b/signers/signer-tron/tsconfig.build.json index e6942a1ee7..a1edf48c04 100644 --- a/signers/signer-tron/tsconfig.build.json +++ b/signers/signer-tron/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", diff --git a/tsconfig.bundler.json b/tsconfig.bundler.json new file mode 100644 index 0000000000..caef733bcb --- /dev/null +++ b/tsconfig.bundler.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2022", + "module": "esnext", + "moduleResolution": "bundler", + "esModuleInterop": true, + "allowImportingTsExtensions": true, + "allowArbitraryExtensions": true, + "verbatimModuleSyntax": true + } +} diff --git a/tsconfig.libnext.json b/tsconfig.libnext.json index 4bfd438edb..412ebda959 100644 --- a/tsconfig.libnext.json +++ b/tsconfig.libnext.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "node16", - "target": "es2020", + "target": "es2022", "strict": true, "verbatimModuleSyntax": true, "declaration": true, diff --git a/wallets/provider-all/src/index.ts b/wallets/provider-all/src/index.ts index 99cf65ac9f..4e4e1ea99e 100644 --- a/wallets/provider-all/src/index.ts +++ b/wallets/provider-all/src/index.ts @@ -37,7 +37,7 @@ import * as walletconnect2 from '@rango-dev/provider-walletconnect-2'; import * as xdefi from '@rango-dev/provider-xdefi'; import { type WalletType, WalletTypes } from '@rango-dev/wallets-shared'; -import { isWalletExcluded } from './helpers'; +import { isWalletExcluded } from './helpers.js'; interface Options { walletconnect2: WalletConnectEnvironments; diff --git a/wallets/provider-all/tsconfig.build.json b/wallets/provider-all/tsconfig.build.json index 579fb407b9..cf4e16a927 100644 --- a/wallets/provider-all/tsconfig.build.json +++ b/wallets/provider-all/tsconfig.build.json @@ -1,11 +1,13 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", - "lib": ["dom", "esnext"] - // match output dir to input dir. e.g. dist/index instead of dist/src/index + "lib": ["dom", "esnext"], + + // `@trezor/connect-web` can not compile without this option, we should remove this option when they've fixed their issue + "skipLibCheck": true } } diff --git a/wallets/provider-argentx/src/index.ts b/wallets/provider-argentx/src/index.ts index 93bbb47029..72c29d6e83 100644 --- a/wallets/provider-argentx/src/index.ts +++ b/wallets/provider-argentx/src/index.ts @@ -10,8 +10,8 @@ import type { BlockchainMeta, SignerFactory } from 'rango-types'; import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import { starknetBlockchain } from 'rango-types'; -import { argentx as argentx_instances } from './helpers'; -import signer from './signer'; +import { argentx as argentx_instances } from './helpers.js'; +import signer from './signer.js'; /* * https://www.starknetjs.com/docs/API/signer diff --git a/wallets/provider-argentx/src/signer.ts b/wallets/provider-argentx/src/signer.ts index 05a168ba79..039b4d67e1 100644 --- a/wallets/provider-argentx/src/signer.ts +++ b/wallets/provider-argentx/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultStarknetSigner } from '@rango-dev/signer-starknet'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-argentx/tsconfig.build.json b/wallets/provider-argentx/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-argentx/tsconfig.build.json +++ b/wallets/provider-argentx/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-bitget/src/index.ts b/wallets/provider-bitget/src/index.ts index aa1c9b7303..6204554443 100644 --- a/wallets/provider-bitget/src/index.ts +++ b/wallets/provider-bitget/src/index.ts @@ -21,8 +21,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains, isEvmBlockchain, tronBlockchain } from 'rango-types'; -import { bitgetInstances } from './helpers'; -import signer from './signer'; +import { bitgetInstances } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.BITGET; diff --git a/wallets/provider-bitget/tsconfig.build.json b/wallets/provider-bitget/tsconfig.build.json index f61f979b87..5297e74971 100644 --- a/wallets/provider-bitget/tsconfig.build.json +++ b/wallets/provider-bitget/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-braavos/src/index.ts b/wallets/provider-braavos/src/index.ts index 42cc388e9b..506a13ce0b 100644 --- a/wallets/provider-braavos/src/index.ts +++ b/wallets/provider-braavos/src/index.ts @@ -10,8 +10,8 @@ import type { BlockchainMeta, SignerFactory } from 'rango-types'; import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import { starknetBlockchain } from 'rango-types'; -import { getBraavosInstance } from './helpers'; -import signer from './signer'; +import { getBraavosInstance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.BRAAVOS; diff --git a/wallets/provider-braavos/src/signer.ts b/wallets/provider-braavos/src/signer.ts index 05a168ba79..039b4d67e1 100644 --- a/wallets/provider-braavos/src/signer.ts +++ b/wallets/provider-braavos/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultStarknetSigner } from '@rango-dev/signer-starknet'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-braavos/tsconfig.build.json b/wallets/provider-braavos/tsconfig.build.json index f61f979b87..5297e74971 100644 --- a/wallets/provider-braavos/tsconfig.build.json +++ b/wallets/provider-braavos/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-brave/src/index.ts b/wallets/provider-brave/src/index.ts index 0efaaf7c91..3861eb5c4e 100644 --- a/wallets/provider-brave/src/index.ts +++ b/wallets/provider-brave/src/index.ts @@ -26,8 +26,8 @@ import { solanaBlockchain, } from 'rango-types'; -import { brave as brave_instances } from './helpers'; -import signer from './signer'; +import { brave as brave_instances } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.BRAVE; diff --git a/wallets/provider-brave/src/signer.ts b/wallets/provider-brave/src/signer.ts index d521fe72c1..882e664fff 100644 --- a/wallets/provider-brave/src/signer.ts +++ b/wallets/provider-brave/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-brave/tsconfig.build.json b/wallets/provider-brave/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-brave/tsconfig.build.json +++ b/wallets/provider-brave/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-clover/src/helpers.ts b/wallets/provider-clover/src/helpers.ts index 78a187c6b1..3213bb52e6 100644 --- a/wallets/provider-clover/src/helpers.ts +++ b/wallets/provider-clover/src/helpers.ts @@ -1,17 +1,21 @@ -import { - Network, - Networks, - ProviderConnectResult, -} from '@rango-dev/wallets-shared'; +import type { Network, ProviderConnectResult } from '@rango-dev/wallets-shared'; + +import { Networks } from '@rango-dev/wallets-shared'; export function clover() { const { clover, clover_solana } = window; - if (!clover) return null; + if (!clover) { + return null; + } const instances = new Map(); - if (clover) instances.set(Networks.ETHEREUM, clover); - if (clover_solana) instances.set(Networks.SOLANA, clover_solana); + if (clover) { + instances.set(Networks.ETHEREUM, clover); + } + if (clover_solana) { + instances.set(Networks.SOLANA, clover_solana); + } return instances; } diff --git a/wallets/provider-clover/src/index.ts b/wallets/provider-clover/src/index.ts index c1e880311d..86ab3f482f 100644 --- a/wallets/provider-clover/src/index.ts +++ b/wallets/provider-clover/src/index.ts @@ -20,8 +20,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains, isEvmBlockchain, solanaBlockchain } from 'rango-types'; -import { clover as clover_instance, getNonEvmAccounts } from './helpers'; -import signer from './signer'; +import { clover as clover_instance, getNonEvmAccounts } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.CLOVER; diff --git a/wallets/provider-clover/src/signer.ts b/wallets/provider-clover/src/signer.ts index d521fe72c1..882e664fff 100644 --- a/wallets/provider-clover/src/signer.ts +++ b/wallets/provider-clover/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-clover/tsconfig.build.json b/wallets/provider-clover/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-clover/tsconfig.build.json +++ b/wallets/provider-clover/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-coin98/src/helpers.ts b/wallets/provider-coin98/src/helpers.ts index da44689721..f0ddcd3d74 100644 --- a/wallets/provider-coin98/src/helpers.ts +++ b/wallets/provider-coin98/src/helpers.ts @@ -3,22 +3,30 @@ import { Networks } from '@rango-dev/wallets-shared'; export function coin98() { const { coin98, ethereum } = window; - if (!coin98) return null; + if (!coin98) { + return null; + } const instances = new Map(); // When disabled overring metamask - if (coin98.provider) instances.set(Networks.ETHEREUM, coin98.provider); - if (ethereum && ethereum.isCoin98) instances.set(Networks.ETHEREUM, ethereum); - if (coin98.sol) instances.set(Networks.SOLANA, coin98.sol); + if (coin98.provider) { + instances.set(Networks.ETHEREUM, coin98.provider); + } + if (ethereum && ethereum.isCoin98) { + instances.set(Networks.ETHEREUM, ethereum); + } + if (coin98.sol) { + instances.set(Networks.SOLANA, coin98.sol); + } return instances; } -/* - This is how coin98 is getting solana accounts. - That's the reason we haven't moved it to `shared` -*/ +/* + *This is how coin98 is getting solana accounts. + *That's the reason we haven't moved it to `shared` + */ export async function getSolanaAccounts(instance: any) { await instance.enable(); const accounts = await instance.request({ method: 'sol_accounts' }); diff --git a/wallets/provider-coin98/src/index.ts b/wallets/provider-coin98/src/index.ts index e293b23c07..466159e183 100644 --- a/wallets/provider-coin98/src/index.ts +++ b/wallets/provider-coin98/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains, solanaBlockchain } from 'rango-types'; -import { coin98 as coin98_instances, getSolanaAccounts } from './helpers'; -import signer from './signer'; +import { coin98 as coin98_instances, getSolanaAccounts } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.COIN98; diff --git a/wallets/provider-coin98/src/signer.ts b/wallets/provider-coin98/src/signer.ts index bc40f01294..4e6c1596a1 100644 --- a/wallets/provider-coin98/src/signer.ts +++ b/wallets/provider-coin98/src/signer.ts @@ -1,11 +1,10 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; -import { CustomSolanaSigner } from './solana-signer'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; + +import { CustomSolanaSigner } from './solana-signer.js'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-coin98/tsconfig.build.json b/wallets/provider-coin98/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-coin98/tsconfig.build.json +++ b/wallets/provider-coin98/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-coinbase/src/index.ts b/wallets/provider-coinbase/src/index.ts index 46a0966e90..ec9fb9e3b5 100644 --- a/wallets/provider-coinbase/src/index.ts +++ b/wallets/provider-coinbase/src/index.ts @@ -25,8 +25,8 @@ import { solanaBlockchain, } from 'rango-types'; -import { coinbase as coinbase_instance, getSolanaAccounts } from './helpers'; -import signer from './signer'; +import { coinbase as coinbase_instance, getSolanaAccounts } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.COINBASE; diff --git a/wallets/provider-coinbase/src/signer.ts b/wallets/provider-coinbase/src/signer.ts index d521fe72c1..882e664fff 100644 --- a/wallets/provider-coinbase/src/signer.ts +++ b/wallets/provider-coinbase/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-coinbase/tsconfig.build.json b/wallets/provider-coinbase/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-coinbase/tsconfig.build.json +++ b/wallets/provider-coinbase/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-cosmostation/src/helpers.ts b/wallets/provider-cosmostation/src/helpers.ts index a5a117b86a..1a6452bb08 100644 --- a/wallets/provider-cosmostation/src/helpers.ts +++ b/wallets/provider-cosmostation/src/helpers.ts @@ -4,15 +4,23 @@ export function cosmostation() { const { cosmostation } = window; const instances = new Map(); - if (!cosmostation || !cosmostation.providers) return null; + if (!cosmostation || !cosmostation.providers) { + return null; + } const evmInstance = cosmostation.providers.metamask; - if (evmInstance) instances.set(Networks.ETHEREUM, evmInstance); + if (evmInstance) { + instances.set(Networks.ETHEREUM, evmInstance); + } const cosmosInstance = cosmostation.providers.keplr; - if (cosmosInstance) instances.set(Networks.COSMOS, cosmosInstance); + if (cosmosInstance) { + instances.set(Networks.COSMOS, cosmosInstance); + } - if (instances.size === 0) return null; + if (instances.size === 0) { + return null; + } return instances; } diff --git a/wallets/provider-cosmostation/src/index.ts b/wallets/provider-cosmostation/src/index.ts index c0741b996f..06d9947303 100644 --- a/wallets/provider-cosmostation/src/index.ts +++ b/wallets/provider-cosmostation/src/index.ts @@ -29,8 +29,8 @@ import { isEvmBlockchain, } from 'rango-types'; -import { cosmostation as cosmostation_instance } from './helpers'; -import signer from './signer'; +import { cosmostation as cosmostation_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.COSMOSTATION; diff --git a/wallets/provider-cosmostation/src/signer.ts b/wallets/provider-cosmostation/src/signer.ts index 94485746d0..a1e73d6968 100644 --- a/wallets/provider-cosmostation/src/signer.ts +++ b/wallets/provider-cosmostation/src/signer.ts @@ -1,11 +1,9 @@ -import { DefaultEvmSigner } from '@rango-dev/signer-evm'; +import type { SignerFactory } from 'rango-types'; + import { DefaultCosmosSigner } from '@rango-dev/signer-cosmos'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultEvmSigner } from '@rango-dev/signer-evm'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-cosmostation/tsconfig.build.json b/wallets/provider-cosmostation/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-cosmostation/tsconfig.build.json +++ b/wallets/provider-cosmostation/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-default/src/index.ts b/wallets/provider-default/src/index.ts index 18bd9e25c2..8026c63b95 100644 --- a/wallets/provider-default/src/index.ts +++ b/wallets/provider-default/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { defaultInjected } from './helpers'; -import signer from './signer'; +import { defaultInjected } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.DEFAULT; diff --git a/wallets/provider-default/tsconfig.build.json b/wallets/provider-default/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-default/tsconfig.build.json +++ b/wallets/provider-default/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-enkrypt/src/index.ts b/wallets/provider-enkrypt/src/index.ts index 180accf480..a15ba12bd1 100644 --- a/wallets/provider-enkrypt/src/index.ts +++ b/wallets/provider-enkrypt/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { enkrypt as enkrypt_instance } from './helpers'; -import signer from './signer'; +import { enkrypt as enkrypt_instance } from './helpers.js'; +import signer from './signer.js'; export const getInstance = enkrypt_instance; diff --git a/wallets/provider-enkrypt/src/signer.ts b/wallets/provider-enkrypt/src/signer.ts index fa6d778fa1..375d8864dd 100644 --- a/wallets/provider-enkrypt/src/signer.ts +++ b/wallets/provider-enkrypt/src/signer.ts @@ -1,6 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { DefaultSignerFactory } from 'rango-types'; -import { SignerFactory, TransactionType as TxType } from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-enkrypt/tsconfig.build.json b/wallets/provider-enkrypt/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-enkrypt/tsconfig.build.json +++ b/wallets/provider-enkrypt/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-exodus/src/helpers.ts b/wallets/provider-exodus/src/helpers.ts index 27684e3bf1..f7cc68fa91 100644 --- a/wallets/provider-exodus/src/helpers.ts +++ b/wallets/provider-exodus/src/helpers.ts @@ -1,13 +1,21 @@ -import { Networks, ProviderConnectResult } from '@rango-dev/wallets-shared'; +import type { ProviderConnectResult } from '@rango-dev/wallets-shared'; + +import { Networks } from '@rango-dev/wallets-shared'; export function exodus_instances() { const { exodus } = window; - if (!exodus) return null; + if (!exodus) { + return null; + } const instances = new Map(); - if (exodus.ethereum) instances.set(Networks.ETHEREUM, exodus.ethereum); - if (exodus.solana) instances.set(Networks.SOLANA, exodus.solana); + if (exodus.ethereum) { + instances.set(Networks.ETHEREUM, exodus.ethereum); + } + if (exodus.solana) { + instances.set(Networks.SOLANA, exodus.solana); + } return instances; } diff --git a/wallets/provider-exodus/src/index.ts b/wallets/provider-exodus/src/index.ts index d852ec7932..cf02bd59d7 100644 --- a/wallets/provider-exodus/src/index.ts +++ b/wallets/provider-exodus/src/index.ts @@ -24,8 +24,8 @@ import { exodus_instances, EXODUS_WALLET_SUPPORTED_CHAINS, getSolanaAccounts, -} from './helpers'; -import signer from './signer'; +} from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.EXODUS; diff --git a/wallets/provider-exodus/src/signer.ts b/wallets/provider-exodus/src/signer.ts index b2b8f15e18..30f4372a23 100644 --- a/wallets/provider-exodus/src/signer.ts +++ b/wallets/provider-exodus/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-exodus/tsconfig.build.json b/wallets/provider-exodus/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-exodus/tsconfig.build.json +++ b/wallets/provider-exodus/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-frontier/src/helpers.ts b/wallets/provider-frontier/src/helpers.ts index 41c740b604..86e73d1623 100644 --- a/wallets/provider-frontier/src/helpers.ts +++ b/wallets/provider-frontier/src/helpers.ts @@ -1,12 +1,20 @@ -import { Networks, ProviderConnectResult } from '@rango-dev/wallets-shared'; +import type { ProviderConnectResult } from '@rango-dev/wallets-shared'; + +import { Networks } from '@rango-dev/wallets-shared'; export function frontier() { const { frontier } = window; - if (!frontier) return null; + if (!frontier) { + return null; + } const instances = new Map(); - if (frontier?.ethereum) instances.set(Networks.ETHEREUM, frontier?.ethereum); - if (frontier?.solana) instances.set(Networks.SOLANA, frontier?.solana); + if (frontier?.ethereum) { + instances.set(Networks.ETHEREUM, frontier?.ethereum); + } + if (frontier?.solana) { + instances.set(Networks.SOLANA, frontier?.solana); + } return instances; } diff --git a/wallets/provider-frontier/src/index.ts b/wallets/provider-frontier/src/index.ts index 72826925a3..bce3a21574 100644 --- a/wallets/provider-frontier/src/index.ts +++ b/wallets/provider-frontier/src/index.ts @@ -25,8 +25,8 @@ import { solanaBlockchain, } from 'rango-types'; -import { frontier as frontier_instance, getSolanaAccounts } from './helpers'; -import signer from './signer'; +import { frontier as frontier_instance, getSolanaAccounts } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.FRONTIER; diff --git a/wallets/provider-frontier/src/signer.ts b/wallets/provider-frontier/src/signer.ts index b2b8f15e18..30f4372a23 100644 --- a/wallets/provider-frontier/src/signer.ts +++ b/wallets/provider-frontier/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-frontier/tsconfig.build.json b/wallets/provider-frontier/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-frontier/tsconfig.build.json +++ b/wallets/provider-frontier/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-halo/src/index.ts b/wallets/provider-halo/src/index.ts index 99b13b3784..af48103593 100644 --- a/wallets/provider-halo/src/index.ts +++ b/wallets/provider-halo/src/index.ts @@ -19,8 +19,8 @@ import { import { getHaloInstance as halo_instance, HALO_WALLET_SUPPORTED_CHAINS, -} from './helpers'; -import signer from './signer'; +} from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.HALO; diff --git a/wallets/provider-halo/tsconfig.build.json b/wallets/provider-halo/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-halo/tsconfig.build.json +++ b/wallets/provider-halo/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-keplr/src/index.ts b/wallets/provider-keplr/src/index.ts index 99df436b51..f61e43e974 100644 --- a/wallets/provider-keplr/src/index.ts +++ b/wallets/provider-keplr/src/index.ts @@ -14,8 +14,8 @@ import { } from '@rango-dev/wallets-shared'; import { cosmosBlockchains } from 'rango-types'; -import { keplr as keplrInstance } from './helpers'; -import signer from './signer'; +import { keplr as keplrInstance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.KEPLR; diff --git a/wallets/provider-keplr/src/signer.ts b/wallets/provider-keplr/src/signer.ts index 48baee150e..66d2eff646 100644 --- a/wallets/provider-keplr/src/signer.ts +++ b/wallets/provider-keplr/src/signer.ts @@ -1,10 +1,8 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultCosmosSigner } from '@rango-dev/signer-cosmos'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const cosmosProvider = getNetworkInstance(provider, Networks.COSMOS); diff --git a/wallets/provider-keplr/tsconfig.build.json b/wallets/provider-keplr/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-keplr/tsconfig.build.json +++ b/wallets/provider-keplr/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-leap-cosmos/src/index.ts b/wallets/provider-leap-cosmos/src/index.ts index 5cf2f41ffc..2328a78c84 100644 --- a/wallets/provider-leap-cosmos/src/index.ts +++ b/wallets/provider-leap-cosmos/src/index.ts @@ -14,8 +14,8 @@ import { } from '@rango-dev/wallets-shared'; import { cosmosBlockchains } from 'rango-types'; -import { getSupportedChains, leap_cosmos_instance } from './helpers'; -import signer from './signer'; +import { getSupportedChains, leap_cosmos_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.LEAP_COSMOS; diff --git a/wallets/provider-leap-cosmos/src/signer.ts b/wallets/provider-leap-cosmos/src/signer.ts index 48baee150e..66d2eff646 100644 --- a/wallets/provider-leap-cosmos/src/signer.ts +++ b/wallets/provider-leap-cosmos/src/signer.ts @@ -1,10 +1,8 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultCosmosSigner } from '@rango-dev/signer-cosmos'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const cosmosProvider = getNetworkInstance(provider, Networks.COSMOS); diff --git a/wallets/provider-leap-cosmos/tsconfig.build.json b/wallets/provider-leap-cosmos/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-leap-cosmos/tsconfig.build.json +++ b/wallets/provider-leap-cosmos/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-ledger/package.json b/wallets/provider-ledger/package.json index f0ec756724..c9475402f9 100644 --- a/wallets/provider-ledger/package.json +++ b/wallets/provider-ledger/package.json @@ -25,6 +25,9 @@ "@ledgerhq/hw-app-eth": "^6.36.0", "@ledgerhq/hw-app-solana": "^7.1.6", "@ledgerhq/hw-transport-webhid": "^6.28.6", + "@ledgerhq/types-cryptoassets": "^7.11.0", + "@types/w3c-web-hid": "^1.0.2", + "@ledgerhq/types-devices": "^6.24.0", "@rango-dev/signer-solana": "^0.31.0", "@rango-dev/wallets-shared": "^0.36.0", "@solana/web3.js": "^1.91.4", @@ -35,4 +38,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/wallets/provider-ledger/src/helpers.ts b/wallets/provider-ledger/src/helpers.ts index a0c3cb6aec..ec97939e6b 100644 --- a/wallets/provider-ledger/src/helpers.ts +++ b/wallets/provider-ledger/src/helpers.ts @@ -4,7 +4,7 @@ import { getAltStatusMessage } from '@ledgerhq/errors'; import { ETHEREUM_CHAIN_ID, Networks } from '@rango-dev/wallets-shared'; import bs58 from 'bs58'; -import { getDerivationPath } from './state'; +import { getDerivationPath } from './state.js'; export const HEXADECIMAL_BASE = 16; diff --git a/wallets/provider-ledger/src/index.ts b/wallets/provider-ledger/src/index.ts index b197a7e4bc..f0e27130c1 100644 --- a/wallets/provider-ledger/src/index.ts +++ b/wallets/provider-ledger/src/index.ts @@ -13,9 +13,9 @@ import { getLedgerInstance, getSolanaAccounts, transportDisconnect, -} from './helpers'; -import signer from './signer'; -import { setDerivationPath } from './state'; +} from './helpers.js'; +import signer from './signer.js'; +import { setDerivationPath } from './state.js'; export const config = { type: WalletTypes.LEDGER, diff --git a/wallets/provider-ledger/src/signer.ts b/wallets/provider-ledger/src/signer.ts index 6170c89f9b..93973a9453 100644 --- a/wallets/provider-ledger/src/signer.ts +++ b/wallets/provider-ledger/src/signer.ts @@ -2,8 +2,8 @@ import type { SignerFactory } from 'rango-types'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { EthereumSigner } from './signers/ethereum'; -import { SolanaSigner } from './signers/solana'; +import { EthereumSigner } from './signers/ethereum.js'; +import { SolanaSigner } from './signers/solana.js'; export default function getSigners(): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-ledger/src/signers/ethereum.ts b/wallets/provider-ledger/src/signers/ethereum.ts index 9d40c05bd6..5417b0e429 100644 --- a/wallets/provider-ledger/src/signers/ethereum.ts +++ b/wallets/provider-ledger/src/signers/ethereum.ts @@ -1,6 +1,6 @@ import type { TransactionLike } from 'ethers'; import type { GenericSigner } from 'rango-types'; -import type { EvmTransaction } from 'rango-types/lib/api/main'; +import type { EvmTransaction } from 'rango-types/mainApi'; import { DEFAULT_ETHEREUM_RPC_URL } from '@rango-dev/wallets-shared'; import { JsonRpcProvider, Transaction } from 'ethers'; @@ -10,8 +10,8 @@ import { getLedgerError, transportConnect, transportDisconnect, -} from '../helpers'; -import { getDerivationPath } from '../state'; +} from '../helpers.js'; +import { getDerivationPath } from '../state.js'; export class EthereumSigner implements GenericSigner { async signMessage(msg: string): Promise { diff --git a/wallets/provider-ledger/src/signers/solana.ts b/wallets/provider-ledger/src/signers/solana.ts index e70dcd5937..75971102a7 100644 --- a/wallets/provider-ledger/src/signers/solana.ts +++ b/wallets/provider-ledger/src/signers/solana.ts @@ -10,8 +10,8 @@ import { getLedgerError, transportConnect, transportDisconnect, -} from '../helpers'; -import { getDerivationPath } from '../state'; +} from '../helpers.js'; +import { getDerivationPath } from '../state.js'; export function isVersionedTransaction( transaction: Transaction | VersionedTransaction diff --git a/wallets/provider-ledger/tsconfig.build.json b/wallets/provider-ledger/tsconfig.build.json index 7f49cdfc54..9bb3c269bf 100644 --- a/wallets/provider-ledger/tsconfig.build.json +++ b/wallets/provider-ledger/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-math-wallet/src/index.ts b/wallets/provider-math-wallet/src/index.ts index 7f3858414d..81ec08d11a 100644 --- a/wallets/provider-math-wallet/src/index.ts +++ b/wallets/provider-math-wallet/src/index.ts @@ -21,8 +21,8 @@ import { evmBlockchains, solanaBlockchain } from 'rango-types'; import { getNonEvmAccounts, mathWallet as mathWallet_instance, -} from './helpers'; -import signer from './signer'; +} from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.MATH; diff --git a/wallets/provider-math-wallet/src/signer.ts b/wallets/provider-math-wallet/src/signer.ts index 3221350a81..a884ce06cd 100644 --- a/wallets/provider-math-wallet/src/signer.ts +++ b/wallets/provider-math-wallet/src/signer.ts @@ -5,7 +5,7 @@ import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { MathWalletCosmosSigner } from './signers/cosmosSigner'; +import { MathWalletCosmosSigner } from './signers/cosmosSigner.js'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-math-wallet/tsconfig.build.json b/wallets/provider-math-wallet/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-math-wallet/tsconfig.build.json +++ b/wallets/provider-math-wallet/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-metamask/src/index.ts b/wallets/provider-metamask/src/index.ts index e017da54eb..8fa6a56cf6 100644 --- a/wallets/provider-metamask/src/index.ts +++ b/wallets/provider-metamask/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { metamask as metamask_instance } from './helpers'; -import signer from './signer'; +import { metamask as metamask_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.META_MASK; diff --git a/wallets/provider-metamask/src/signer.ts b/wallets/provider-metamask/src/signer.ts index d53ed39e5c..375d8864dd 100644 --- a/wallets/provider-metamask/src/signer.ts +++ b/wallets/provider-metamask/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-metamask/tsconfig.build.json b/wallets/provider-metamask/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-metamask/tsconfig.build.json +++ b/wallets/provider-metamask/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-mytonwallet/src/index.ts b/wallets/provider-mytonwallet/src/index.ts index e023e32481..bc989467e9 100644 --- a/wallets/provider-mytonwallet/src/index.ts +++ b/wallets/provider-mytonwallet/src/index.ts @@ -1,4 +1,4 @@ -import type { TonProvider } from './types'; +import type { TonProvider } from './types.js'; import type { CanEagerConnect, CanSwitchNetwork, @@ -11,10 +11,10 @@ import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import { toUserFriendlyAddress } from '@tonconnect/sdk/'; import { tonBlockchain } from 'rango-types'; -import { TONCONNECT_MANIFEST_URL } from './constants'; -import { myTonWallet as myTonWallet_instance } from './helpers'; -import signer from './signer'; -import { isTonAddressItemReply } from './types'; +import { TONCONNECT_MANIFEST_URL } from './constants.js'; +import { myTonWallet as myTonWallet_instance } from './helpers.js'; +import signer from './signer.js'; +import { isTonAddressItemReply } from './types.js'; const WALLET = WalletTypes.MY_TON_WALLET; diff --git a/wallets/provider-mytonwallet/src/signer.ts b/wallets/provider-mytonwallet/src/signer.ts index aa8b61d4ff..0d182c7dc4 100644 --- a/wallets/provider-mytonwallet/src/signer.ts +++ b/wallets/provider-mytonwallet/src/signer.ts @@ -1,10 +1,8 @@ -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import type { TonProvider } from './types.js'; +import type { SignerFactory } from 'rango-types'; + import { DefaultTonSigner } from '@rango-dev/signer-ton'; -import { TonProvider } from './types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: TonProvider): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-mytonwallet/tsconfig.build.json b/wallets/provider-mytonwallet/tsconfig.build.json index 97f65ee12a..d2ac5e673f 100644 --- a/wallets/provider-mytonwallet/tsconfig.build.json +++ b/wallets/provider-mytonwallet/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-okx/src/index.ts b/wallets/provider-okx/src/index.ts index 645cedee22..ac51fdc169 100644 --- a/wallets/provider-okx/src/index.ts +++ b/wallets/provider-okx/src/index.ts @@ -24,8 +24,8 @@ import { getSolanaAccounts, okx_instance, OKX_WALLET_SUPPORTED_CHAINS, -} from './helpers'; -import signer from './signer'; +} from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.OKX; diff --git a/wallets/provider-okx/src/signer.ts b/wallets/provider-okx/src/signer.ts index d521fe72c1..882e664fff 100644 --- a/wallets/provider-okx/src/signer.ts +++ b/wallets/provider-okx/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-okx/tsconfig.build.json b/wallets/provider-okx/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-okx/tsconfig.build.json +++ b/wallets/provider-okx/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-phantom/src/index.ts b/wallets/provider-phantom/src/index.ts index fe900efe80..1ede860d3f 100644 --- a/wallets/provider-phantom/src/index.ts +++ b/wallets/provider-phantom/src/index.ts @@ -14,8 +14,8 @@ import { } from '@rango-dev/wallets-shared'; import { solanaBlockchain } from 'rango-types'; -import { phantom as phantom_instance } from './helpers'; -import signer from './signer'; +import { phantom as phantom_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.PHANTOM; diff --git a/wallets/provider-phantom/src/signer.ts b/wallets/provider-phantom/src/signer.ts index 9fdedfeeb7..09f8eab4e2 100644 --- a/wallets/provider-phantom/src/signer.ts +++ b/wallets/provider-phantom/src/signer.ts @@ -1,10 +1,8 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const solProvider = getNetworkInstance(provider, Networks.SOLANA); diff --git a/wallets/provider-phantom/tsconfig.build.json b/wallets/provider-phantom/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-phantom/tsconfig.build.json +++ b/wallets/provider-phantom/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-rabby/src/index.ts b/wallets/provider-rabby/src/index.ts index f3fb371a15..c108a70000 100644 --- a/wallets/provider-rabby/src/index.ts +++ b/wallets/provider-rabby/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { rabby as rabby_instance } from './helpers'; -import signer from './signer'; +import { rabby as rabby_instance } from './helpers.js'; +import signer from './signer.js'; export const config = { type: WalletTypes.Rabby, diff --git a/wallets/provider-rabby/tsconfig.build.json b/wallets/provider-rabby/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-rabby/tsconfig.build.json +++ b/wallets/provider-rabby/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-safe/src/evm-signer.ts b/wallets/provider-safe/src/evm-signer.ts index 198ea186cd..0d2560187b 100644 --- a/wallets/provider-safe/src/evm-signer.ts +++ b/wallets/provider-safe/src/evm-signer.ts @@ -1,11 +1,11 @@ import type { TransactionResponse } from '@ethersproject/abstract-provider'; import type { OffChainSignMessageResponse } from '@safe-global/safe-apps-sdk'; import type { GenericSigner } from 'rango-types'; -import type { EvmTransaction } from 'rango-types/lib/api/main'; +import type { EvmTransaction } from 'rango-types/mainApi'; import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { getTxHash, sdk } from './helpers'; +import { getTxHash, sdk } from './helpers.js'; export class CustomEvmSigner implements GenericSigner { private signer; diff --git a/wallets/provider-safe/src/index.ts b/wallets/provider-safe/src/index.ts index ef8edc22e1..638d2f4d5c 100644 --- a/wallets/provider-safe/src/index.ts +++ b/wallets/provider-safe/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains, isEvmBlockchain } from 'rango-types'; -import { getSafeInstance } from './helpers'; -import signer from './signer'; +import { getSafeInstance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.SAFE; diff --git a/wallets/provider-safe/src/signer.ts b/wallets/provider-safe/src/signer.ts index b8f8c9f14a..b404e1c5af 100644 --- a/wallets/provider-safe/src/signer.ts +++ b/wallets/provider-safe/src/signer.ts @@ -1,9 +1,8 @@ -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; -import { CustomEvmSigner } from './evm-signer'; +import type { SignerFactory } from 'rango-types'; + +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; + +import { CustomEvmSigner } from './evm-signer.js'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-safe/tsconfig.build.json b/wallets/provider-safe/tsconfig.build.json index f61f979b87..b578536384 100644 --- a/wallets/provider-safe/tsconfig.build.json +++ b/wallets/provider-safe/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-safepal/src/helpers.ts b/wallets/provider-safepal/src/helpers.ts index 11e09f6fb7..0c6875ed64 100644 --- a/wallets/provider-safepal/src/helpers.ts +++ b/wallets/provider-safepal/src/helpers.ts @@ -1,8 +1,6 @@ -import { - Network, - Networks, - ProviderConnectResult, -} from '@rango-dev/wallets-shared'; +import type { Network, ProviderConnectResult } from '@rango-dev/wallets-shared'; + +import { Networks } from '@rango-dev/wallets-shared'; type Provider = Map; @@ -10,15 +8,21 @@ export function safepal() { const instances = new Map(); const { isSafePal, safepal, safepalProvider } = window; - if (!isSafePal) return null; + if (!isSafePal) { + return null; + } - if (!!safepal && safepal.isSafePalWallet) + if (!!safepal && safepal.isSafePalWallet) { instances.set(Networks.SOLANA, safepal); + } - if (safepalProvider && safepalProvider) + if (safepalProvider && safepalProvider) { instances.set(Networks.ETHEREUM, safepalProvider); + } - if (instances.size === 0) return null; + if (instances.size === 0) { + return null; + } return instances; } diff --git a/wallets/provider-safepal/src/index.ts b/wallets/provider-safepal/src/index.ts index 5ace2fa569..21248d719c 100644 --- a/wallets/provider-safepal/src/index.ts +++ b/wallets/provider-safepal/src/index.ts @@ -19,8 +19,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains, solanaBlockchain } from 'rango-types'; -import { getNonEvmAccounts, safepal as safepal_instance } from './helpers'; -import signer from './signer'; +import { getNonEvmAccounts, safepal as safepal_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.SAFEPAL; diff --git a/wallets/provider-safepal/src/signer.ts b/wallets/provider-safepal/src/signer.ts index d521fe72c1..882e664fff 100644 --- a/wallets/provider-safepal/src/signer.ts +++ b/wallets/provider-safepal/src/signer.ts @@ -1,11 +1,9 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-safepal/tsconfig.build.json b/wallets/provider-safepal/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-safepal/tsconfig.build.json +++ b/wallets/provider-safepal/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-solflare-snap/src/index.ts b/wallets/provider-solflare-snap/src/index.ts index 70ddbbe59d..8f190f5cd9 100644 --- a/wallets/provider-solflare-snap/src/index.ts +++ b/wallets/provider-solflare-snap/src/index.ts @@ -9,8 +9,8 @@ import type { BlockchainMeta, SignerFactory } from 'rango-types'; import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import { solanaBlockchain } from 'rango-types'; -import { getSolflareSnapInstance } from './helpers'; -import signer from './signer'; +import { getSolflareSnapInstance } from './helpers.js'; +import signer from './signer.js'; export const config = { type: WalletTypes.SOLFLARE_SNAP, diff --git a/wallets/provider-solflare-snap/src/signer.ts b/wallets/provider-solflare-snap/src/signer.ts index b49f5639a2..e47625e6b7 100644 --- a/wallets/provider-solflare-snap/src/signer.ts +++ b/wallets/provider-solflare-snap/src/signer.ts @@ -2,7 +2,7 @@ import type { SignerFactory } from 'rango-types'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { SolflareSnapSolanaSigner } from './signers/solanaSigner'; +import { SolflareSnapSolanaSigner } from './signers/solanaSigner.js'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-solflare-snap/tsconfig.build.json b/wallets/provider-solflare-snap/tsconfig.build.json index 7f49cdfc54..9bb3c269bf 100644 --- a/wallets/provider-solflare-snap/tsconfig.build.json +++ b/wallets/provider-solflare-snap/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-solflare/package.json b/wallets/provider-solflare/package.json index af96ce4469..11de0c68d2 100644 --- a/wallets/provider-solflare/package.json +++ b/wallets/provider-solflare/package.json @@ -29,4 +29,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/wallets/provider-solflare/src/index.ts b/wallets/provider-solflare/src/index.ts index 99736951b4..4a81113882 100644 --- a/wallets/provider-solflare/src/index.ts +++ b/wallets/provider-solflare/src/index.ts @@ -10,7 +10,7 @@ import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import Solflare from '@solflare-wallet/sdk'; import { solanaBlockchain } from 'rango-types'; -import signer from './signer'; +import signer from './signer.js'; const WALLET = WalletTypes.SOLFLARE; diff --git a/wallets/provider-solflare/src/signer.ts b/wallets/provider-solflare/src/signer.ts index 6b504ee093..81a55f9f46 100644 --- a/wallets/provider-solflare/src/signer.ts +++ b/wallets/provider-solflare/src/signer.ts @@ -3,7 +3,7 @@ import type { SignerFactory } from 'rango-types'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { CustomSolanaSigner } from './signers/solanaSigner'; +import { CustomSolanaSigner } from './signers/solanaSigner.js'; export default function getSigners(provider: Solflare): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-solflare/tsconfig.build.json b/wallets/provider-solflare/tsconfig.build.json index 7f49cdfc54..8922e87a09 100644 --- a/wallets/provider-solflare/tsconfig.build.json +++ b/wallets/provider-solflare/tsconfig.build.json @@ -1,11 +1,10 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", - "include": ["src", "types", "../../global-wallets-env.d.ts"], + "extends": "../../tsconfig.bundler.json", + "include": ["src", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", "lib": ["dom", "esnext"] - // match output dir to input dir. e.g. dist/index instead of dist/src/index } } diff --git a/wallets/provider-station/src/helpers.ts b/wallets/provider-station/src/helpers.ts index 058570c5c6..dc738e8f62 100644 --- a/wallets/provider-station/src/helpers.ts +++ b/wallets/provider-station/src/helpers.ts @@ -1,4 +1,5 @@ import type { NetworkInfo } from '@terra-money/wallet-controller'; + import { WalletController } from '@terra-money/wallet-controller'; export const TERRA_STATION_WALLET_ID = 'station'; diff --git a/wallets/provider-station/src/index.ts b/wallets/provider-station/src/index.ts index 76f0e6b222..43f7f0fb95 100644 --- a/wallets/provider-station/src/index.ts +++ b/wallets/provider-station/src/index.ts @@ -9,8 +9,8 @@ import type { BlockchainMeta, SignerFactory } from 'rango-types'; import { WalletTypes } from '@rango-dev/wallets-shared'; import { ConnectType } from '@terra-money/wallet-controller'; -import { station as station_instance } from './helpers'; -import signer from './signer'; +import { station as station_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.STATION; const STATION_WALLET_ID = 'station'; diff --git a/wallets/provider-station/src/signer.ts b/wallets/provider-station/src/signer.ts index 9310f8c91e..e5b26c9f9f 100644 --- a/wallets/provider-station/src/signer.ts +++ b/wallets/provider-station/src/signer.ts @@ -1,6 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultTerraSigner } from '@rango-dev/signer-terra'; -import { DefaultSignerFactory } from 'rango-types'; -import { SignerFactory, TransactionType as TxType } from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-station/tsconfig.build.json b/wallets/provider-station/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-station/tsconfig.build.json +++ b/wallets/provider-station/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-taho/src/index.ts b/wallets/provider-taho/src/index.ts index 33f544cc8e..1abd74133c 100644 --- a/wallets/provider-taho/src/index.ts +++ b/wallets/provider-taho/src/index.ts @@ -21,8 +21,8 @@ import { import { taho as taho_instances, TAHO_WALLET_SUPPORTED_CHAINS, -} from './helpers'; -import signer from './signer'; +} from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.TAHO; diff --git a/wallets/provider-taho/src/signer.ts b/wallets/provider-taho/src/signer.ts index d53ed39e5c..375d8864dd 100644 --- a/wallets/provider-taho/src/signer.ts +++ b/wallets/provider-taho/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-taho/tsconfig.build.json b/wallets/provider-taho/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-taho/tsconfig.build.json +++ b/wallets/provider-taho/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-tokenpocket/src/index.ts b/wallets/provider-tokenpocket/src/index.ts index 24062c1bf9..d83767cd2c 100644 --- a/wallets/provider-tokenpocket/src/index.ts +++ b/wallets/provider-tokenpocket/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { tokenpocket as tokenpocket_instance } from './helpers'; -import signer from './signer'; +import { tokenpocket as tokenpocket_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.TOKEN_POCKET; diff --git a/wallets/provider-tokenpocket/src/signer.ts b/wallets/provider-tokenpocket/src/signer.ts index 8442314ed8..7a61f18928 100644 --- a/wallets/provider-tokenpocket/src/signer.ts +++ b/wallets/provider-tokenpocket/src/signer.ts @@ -1,10 +1,8 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-tokenpocket/tsconfig.build.json b/wallets/provider-tokenpocket/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-tokenpocket/tsconfig.build.json +++ b/wallets/provider-tokenpocket/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-tomo/src/index.ts b/wallets/provider-tomo/src/index.ts index aabfe99b7b..7230499234 100644 --- a/wallets/provider-tomo/src/index.ts +++ b/wallets/provider-tomo/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { tomo as tomo_instance } from './helpers'; -import signer from './signer'; +import { tomo as tomo_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.TOMO; diff --git a/wallets/provider-tomo/tsconfig.build.json b/wallets/provider-tomo/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-tomo/tsconfig.build.json +++ b/wallets/provider-tomo/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-trezor/package.json b/wallets/provider-trezor/package.json index 28e94868ae..4d0e2ad3d6 100644 --- a/wallets/provider-trezor/package.json +++ b/wallets/provider-trezor/package.json @@ -6,7 +6,10 @@ "source": "./src/index.ts", "main": "./dist/index.js", "exports": { - ".": "./dist/index.js" + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } }, "typings": "dist/index.d.ts", "files": [ @@ -14,20 +17,20 @@ "src" ], "scripts": { - "build": "node ../../scripts/build/command.mjs --path wallets/provider-trezor", + "build": "node ../../scripts/build/command.mjs --path wallets/provider-trezor --external ethers,@rango-dev/signer-evm,@rango-dev/wallets-shared,rango-types", "ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json", "clean": "rimraf dist", "format": "prettier --write '{.,src}/**/*.{ts,tsx}'", "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore" }, "dependencies": { + "@trezor/connect-web": "^9.2.4", "@rango-dev/signer-evm": "^0.29.0", "@rango-dev/wallets-shared": "^0.36.0", - "@trezor/connect-web": "^9.2.4", "ethers": "^6.11.1", "rango-types": "^0.1.59" }, "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/wallets/provider-trezor/src/helpers.ts b/wallets/provider-trezor/src/helpers.ts index 5c83f33dcf..1423093484 100644 --- a/wallets/provider-trezor/src/helpers.ts +++ b/wallets/provider-trezor/src/helpers.ts @@ -3,7 +3,7 @@ import type { TrezorConnect } from '@trezor/connect-web'; import { cleanEvmError } from '@rango-dev/signer-evm'; import { ETHEREUM_CHAIN_ID, Networks } from '@rango-dev/wallets-shared'; -import { getDerivationPath } from './state'; +import { getDerivationPath } from './state.js'; // `@trezor/connect-web` is commonjs, when we are importing it dynamically, it has some differences in different tooling. for example vite (you can check widget-examples), goes throw error. this is a workaround for solving this interop issue. export async function getTrezorModule() { diff --git a/wallets/provider-trezor/src/index.ts b/wallets/provider-trezor/src/index.ts index d93b1afcd8..3ef0fc1543 100644 --- a/wallets/provider-trezor/src/index.ts +++ b/wallets/provider-trezor/src/index.ts @@ -1,4 +1,4 @@ -import type { Environments } from './types'; +import type { Environments } from './types.js'; import type { Connect, ProviderConnectResult, @@ -13,9 +13,9 @@ import { getTrezorInstance, getTrezorModule, getTrezorNormalizedDerivationPath, -} from './helpers'; -import signer from './signer'; -import { setDerivationPath } from './state'; +} from './helpers.js'; +import signer from './signer.js'; +import { setDerivationPath } from './state.js'; let trezorManifest: Environments['manifest'] = { appUrl: '', diff --git a/wallets/provider-trezor/src/signer.ts b/wallets/provider-trezor/src/signer.ts index 2fad8a9ee7..5557dc6b06 100644 --- a/wallets/provider-trezor/src/signer.ts +++ b/wallets/provider-trezor/src/signer.ts @@ -2,7 +2,7 @@ import type { SignerFactory } from 'rango-types'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { EthereumSigner } from './signers/ethereum'; +import { EthereumSigner } from './signers/ethereum.js'; export default function getSigners(): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-trezor/src/signers/ethereum.ts b/wallets/provider-trezor/src/signers/ethereum.ts index d5c9bf49f0..c7cc993236 100644 --- a/wallets/provider-trezor/src/signers/ethereum.ts +++ b/wallets/provider-trezor/src/signers/ethereum.ts @@ -1,11 +1,15 @@ -import type { EvmTransaction } from 'rango-types/lib/api/main'; +import type { EvmTransaction } from 'rango-types/mainApi'; import { DEFAULT_ETHEREUM_RPC_URL } from '@rango-dev/wallets-shared'; import { JsonRpcProvider, Transaction } from 'ethers'; import { type GenericSigner } from 'rango-types'; -import { getTrezorErrorMessage, getTrezorModule, valueToHex } from '../helpers'; -import { getDerivationPath } from '../state'; +import { + getTrezorErrorMessage, + getTrezorModule, + valueToHex, +} from '../helpers.js'; +import { getDerivationPath } from '../state.js'; export class EthereumSigner implements GenericSigner { async signMessage(msg: string): Promise { diff --git a/wallets/provider-trezor/tsconfig.build.json b/wallets/provider-trezor/tsconfig.build.json index 7f49cdfc54..8c3b6ae906 100644 --- a/wallets/provider-trezor/tsconfig.build.json +++ b/wallets/provider-trezor/tsconfig.build.json @@ -1,11 +1,12 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", - "lib": ["dom", "esnext"] - // match output dir to input dir. e.g. dist/index instead of dist/src/index + + // `@trezor/connect-web` can not compile without this option, we should remove this option when they've fixed their issue + "skipLibCheck": true } } diff --git a/wallets/provider-tron-link/src/index.ts b/wallets/provider-tron-link/src/index.ts index 766b766c32..c913fb31f8 100644 --- a/wallets/provider-tron-link/src/index.ts +++ b/wallets/provider-tron-link/src/index.ts @@ -9,8 +9,8 @@ import type { BlockchainMeta, SignerFactory } from 'rango-types'; import { Networks, WalletTypes } from '@rango-dev/wallets-shared'; import { tronBlockchain } from 'rango-types'; -import { tronLink as tronLink_instance } from './helpers'; -import signer from './signer'; +import { tronLink as tronLink_instance } from './helpers.js'; +import signer from './signer.js'; /* * https://docs.tronlink.org/dapp/start-developing diff --git a/wallets/provider-tron-link/src/signer.ts b/wallets/provider-tron-link/src/signer.ts index b0dc9a9ca0..121e815130 100644 --- a/wallets/provider-tron-link/src/signer.ts +++ b/wallets/provider-tron-link/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultTronSigner } from '@rango-dev/signer-tron'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-tron-link/tsconfig.build.json b/wallets/provider-tron-link/tsconfig.build.json index 7f49cdfc54..5297e74971 100644 --- a/wallets/provider-tron-link/tsconfig.build.json +++ b/wallets/provider-tron-link/tsconfig.build.json @@ -1,11 +1,10 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", "lib": ["dom", "esnext"] - // match output dir to input dir. e.g. dist/index instead of dist/src/index } } diff --git a/wallets/provider-trustwallet/src/index.ts b/wallets/provider-trustwallet/src/index.ts index b37345cb75..bd25f484fa 100644 --- a/wallets/provider-trustwallet/src/index.ts +++ b/wallets/provider-trustwallet/src/index.ts @@ -18,8 +18,8 @@ import { } from '@rango-dev/wallets-shared'; import { evmBlockchains } from 'rango-types'; -import { trustWallet as trustwallet_instance } from './helpers'; -import signer from './signer'; +import { trustWallet as trustwallet_instance } from './helpers.js'; +import signer from './signer.js'; const WALLET = WalletTypes.TRUST_WALLET; diff --git a/wallets/provider-trustwallet/src/signer.ts b/wallets/provider-trustwallet/src/signer.ts index 8442314ed8..7a61f18928 100644 --- a/wallets/provider-trustwallet/src/signer.ts +++ b/wallets/provider-trustwallet/src/signer.ts @@ -1,10 +1,8 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { Networks, getNetworkInstance } from '@rango-dev/wallets-shared'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-trustwallet/tsconfig.build.json b/wallets/provider-trustwallet/tsconfig.build.json index 7f49cdfc54..5297e74971 100644 --- a/wallets/provider-trustwallet/tsconfig.build.json +++ b/wallets/provider-trustwallet/tsconfig.build.json @@ -1,11 +1,10 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", "rootDir": "./src", "lib": ["dom", "esnext"] - // match output dir to input dir. e.g. dist/index instead of dist/src/index } } diff --git a/wallets/provider-walletconnect-2/package.json b/wallets/provider-walletconnect-2/package.json index aab926dbce..62fec0d829 100644 --- a/wallets/provider-walletconnect-2/package.json +++ b/wallets/provider-walletconnect-2/package.json @@ -35,7 +35,7 @@ "@walletconnect/sign-client": "^2.11.2", "@walletconnect/utils": "^2.11.2", "bs58": "^5.0.0", - "caip": "^1.1.0", + "caip": "^1.1.1", "cosmos-wallet": "^1.2.0", "rango-types": "^0.1.69" }, @@ -45,4 +45,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/wallets/provider-walletconnect-2/src/helpers.ts b/wallets/provider-walletconnect-2/src/helpers.ts index ea2377c990..adc98b5bce 100644 --- a/wallets/provider-walletconnect-2/src/helpers.ts +++ b/wallets/provider-walletconnect-2/src/helpers.ts @@ -17,8 +17,8 @@ import { DEFAULT_SOLANA_CHAIN_ID, EthereumRPCMethods, NAMESPACES, -} from './constants'; -import { getLastSession } from './session'; +} from './constants.js'; +import { getLastSession } from './session.js'; let web3Modal: WalletConnectModal; export function createModalInstance(projectId: string) { diff --git a/wallets/provider-walletconnect-2/src/index.ts b/wallets/provider-walletconnect-2/src/index.ts index 705fbba8ab..751b1ae7b8 100644 --- a/wallets/provider-walletconnect-2/src/index.ts +++ b/wallets/provider-walletconnect-2/src/index.ts @@ -1,4 +1,4 @@ -import type { Environments, WCInstance } from './types'; +import type { Environments, WCInstance } from './types.js'; import type { CanSwitchNetwork, Connect, @@ -25,13 +25,13 @@ import { EthereumRPCMethods, NAMESPACES, RELAY_URL, -} from './constants'; +} from './constants.js'; import { createModalInstance, filterEvmAccounts, simulateRequest, switchOrAddEvmChain, -} from './helpers'; +} from './helpers.js'; import { cleanupSingleSession, disconnectSessions, @@ -42,8 +42,8 @@ import { persistCurrentChainId, tryConnect, updateSessionAccounts, -} from './session'; -import signer from './signer'; +} from './session.js'; +import signer from './signer.js'; const WALLET = WalletTypes.WALLET_CONNECT_2; diff --git a/wallets/provider-walletconnect-2/src/session.ts b/wallets/provider-walletconnect-2/src/session.ts index 2b04d4e162..0a955daf86 100644 --- a/wallets/provider-walletconnect-2/src/session.ts +++ b/wallets/provider-walletconnect-2/src/session.ts @@ -1,4 +1,8 @@ -import type { ConnectParams, CreateSessionParams, Environments } from './types'; +import type { + ConnectParams, + CreateSessionParams, + Environments, +} from './types.js'; import type { SignClient } from '@walletconnect/sign-client/dist/types/client'; import type { PairingTypes, @@ -11,14 +15,14 @@ import { Networks, timeout } from '@rango-dev/wallets-shared'; import { getSdkError } from '@walletconnect/utils'; import { AccountId } from 'caip'; -import { CHAIN_ID_STORAGE, PING_TIMEOUT } from './constants'; +import { CHAIN_ID_STORAGE, PING_TIMEOUT } from './constants.js'; import { generateOptionalNamespace, getCurrentEvmAccountAddress, getEvmAccount, getModal, solanaChainIdToNetworkName, -} from './helpers'; +} from './helpers.js'; export function getLastSession(client: SignClient) { return client.session.values[client.session.values.length - 1]; @@ -93,7 +97,7 @@ export async function createSession( .flat() as string[]; const modal = getModal(); - void modal.openModal({ uri, standaloneChains }); + void modal.openModal({ uri, chains: standaloneChains }); onCloseModal = new Promise((_, reject) => { modal.subscribeModal((state) => { diff --git a/wallets/provider-walletconnect-2/src/signer.ts b/wallets/provider-walletconnect-2/src/signer.ts index d40eaa9d79..fef0f3675e 100644 --- a/wallets/provider-walletconnect-2/src/signer.ts +++ b/wallets/provider-walletconnect-2/src/signer.ts @@ -1,11 +1,11 @@ -import type { WCInstance } from './types'; +import type { WCInstance } from './types.js'; import type { SignerFactory } from 'rango-types'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import COSMOSSigner from './signers/cosmos'; -import EVMSigner from './signers/evm'; -import SOLANASigner from './signers/solana'; +import COSMOSSigner from './signers/cosmos.js'; +import EVMSigner from './signers/evm.js'; +import SOLANASigner from './signers/solana.js'; export default function getSigners(instance: WCInstance): SignerFactory { if (!instance.session) { diff --git a/wallets/provider-walletconnect-2/src/signers/cosmos.ts b/wallets/provider-walletconnect-2/src/signers/cosmos.ts index 31f2d67678..5429a3d436 100644 --- a/wallets/provider-walletconnect-2/src/signers/cosmos.ts +++ b/wallets/provider-walletconnect-2/src/signers/cosmos.ts @@ -11,10 +11,10 @@ import { AccountId, ChainId } from 'caip'; import { formatDirectSignDoc, stringifySignDocValues } from 'cosmos-wallet'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { CosmosRPCMethods, NAMESPACES } from '../constants'; +import { CosmosRPCMethods, NAMESPACES } from '../constants.js'; -import { sendTx } from './helper'; -import { supportedChains } from './mock'; +import { sendTx } from './helper.js'; +import { supportedChains } from './mock.js'; const NAMESPACE_NAME = NAMESPACES.COSMOS; type DirectSignResponse = { diff --git a/wallets/provider-walletconnect-2/src/signers/evm.ts b/wallets/provider-walletconnect-2/src/signers/evm.ts index 5b5fc1228c..fba1f97c52 100644 --- a/wallets/provider-walletconnect-2/src/signers/evm.ts +++ b/wallets/provider-walletconnect-2/src/signers/evm.ts @@ -1,13 +1,13 @@ import type { SignClient } from '@walletconnect/sign-client/dist/types/client'; import type { SessionTypes } from '@walletconnect/types'; -import type { EvmTransaction } from 'rango-types/lib/api/main'; +import type { EvmTransaction } from 'rango-types/mainApi'; import { cleanEvmError, DefaultEvmSigner } from '@rango-dev/signer-evm'; import * as encoding from '@walletconnect/encoding'; import { AccountId, ChainId } from 'caip'; import { type GenericSigner } from 'rango-types'; -import { EthereumRPCMethods, NAMESPACES } from '../constants'; +import { EthereumRPCMethods, NAMESPACES } from '../constants.js'; const NAMESPACE_NAME = NAMESPACES.ETHEREUM; diff --git a/wallets/provider-walletconnect-2/src/signers/solana.ts b/wallets/provider-walletconnect-2/src/signers/solana.ts index f838fd99d8..a421750dcc 100644 --- a/wallets/provider-walletconnect-2/src/signers/solana.ts +++ b/wallets/provider-walletconnect-2/src/signers/solana.ts @@ -10,7 +10,7 @@ import base58 from 'bs58'; import { AccountId, ChainId } from 'caip'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { NAMESPACES, SolanaRPCMethods } from '../constants'; +import { NAMESPACES, SolanaRPCMethods } from '../constants.js'; const NAMESPACE_NAME = NAMESPACES.SOLANA; class SOLANASigner implements GenericSigner { diff --git a/wallets/provider-walletconnect-2/src/types.ts b/wallets/provider-walletconnect-2/src/types.ts index c1d2eeb533..d33a49e383 100644 --- a/wallets/provider-walletconnect-2/src/types.ts +++ b/wallets/provider-walletconnect-2/src/types.ts @@ -1,6 +1,6 @@ import type { SignClient } from '@walletconnect/sign-client/dist/types/client'; import type { ProposalTypes, SessionTypes } from '@walletconnect/types'; -import type { BlockchainMeta, CosmosBlockchainMeta } from 'rango-types/lib'; +import type { BlockchainMeta, CosmosBlockchainMeta } from 'rango-types'; export interface Environments extends Record { WC_PROJECT_ID: string; diff --git a/wallets/provider-walletconnect-2/tsconfig.build.json b/wallets/provider-walletconnect-2/tsconfig.build.json index 7f49cdfc54..9bb3c269bf 100644 --- a/wallets/provider-walletconnect-2/tsconfig.build.json +++ b/wallets/provider-walletconnect-2/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.bundler.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/provider-xdefi/src/cosmos-signer.ts b/wallets/provider-xdefi/src/cosmos-signer.ts index 169c27dcff..243b3b3ce9 100644 --- a/wallets/provider-xdefi/src/cosmos-signer.ts +++ b/wallets/provider-xdefi/src/cosmos-signer.ts @@ -4,7 +4,7 @@ import { executeCosmosTransaction } from '@rango-dev/signer-cosmos'; import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { xdefiTransfer } from './helpers'; +import { xdefiTransfer } from './helpers.js'; /* * TODO - replace with real type diff --git a/wallets/provider-xdefi/src/helpers.ts b/wallets/provider-xdefi/src/helpers.ts index bc5c3a3a2e..cf6a47d288 100644 --- a/wallets/provider-xdefi/src/helpers.ts +++ b/wallets/provider-xdefi/src/helpers.ts @@ -3,7 +3,7 @@ import type { Network, ProviderConnectResult } from '@rango-dev/wallets-shared'; import { Networks } from '@rango-dev/wallets-shared'; import { SignerError, SignerErrorCode } from 'rango-types'; -import { SUPPORTED_ETH_CHAINS, SUPPORTED_NETWORKS } from './constants'; +import { SUPPORTED_ETH_CHAINS, SUPPORTED_NETWORKS } from './constants.js'; type Provider = Map; diff --git a/wallets/provider-xdefi/src/index.ts b/wallets/provider-xdefi/src/index.ts index b482853643..8eab2cd439 100644 --- a/wallets/provider-xdefi/src/index.ts +++ b/wallets/provider-xdefi/src/index.ts @@ -24,9 +24,9 @@ import { import { type BlockchainMeta, type SignerFactory } from 'rango-types'; import { cosmosBlockchains, isCosmosBlockchain } from 'rango-types'; -import { SUPPORTED_COSMOS_CHAINS, SUPPORTED_ETH_CHAINS } from './constants'; -import { getNonEvmAccounts, xdefi as xdefi_instances } from './helpers'; -import signer from './signer'; +import { SUPPORTED_COSMOS_CHAINS, SUPPORTED_ETH_CHAINS } from './constants.js'; +import { getNonEvmAccounts, xdefi as xdefi_instances } from './helpers.js'; +import signer from './signer.js'; const DEFAULT_NETWORK = Networks.ETHEREUM; const WALLET = WalletTypes.XDEFI; @@ -159,4 +159,4 @@ export const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = ( }; // it is required in /examples/queue-manager-demo -export { SUPPORTED_ETH_CHAINS } from './constants'; +export { SUPPORTED_ETH_CHAINS } from './constants.js'; diff --git a/wallets/provider-xdefi/src/signer.ts b/wallets/provider-xdefi/src/signer.ts index 00d6dc8735..97c9636543 100644 --- a/wallets/provider-xdefi/src/signer.ts +++ b/wallets/provider-xdefi/src/signer.ts @@ -5,8 +5,8 @@ import { DefaultSolanaSigner } from '@rango-dev/signer-solana'; import { getNetworkInstance, Networks } from '@rango-dev/wallets-shared'; import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; -import { CustomCosmosSigner } from './cosmos-signer'; -import { CustomTransferSigner } from './utxo-signer'; +import { CustomCosmosSigner } from './cosmos-signer.js'; +import { CustomTransferSigner } from './utxo-signer.js'; export default function getSigners(provider: any): SignerFactory { const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM); diff --git a/wallets/provider-xdefi/src/utxo-signer.ts b/wallets/provider-xdefi/src/utxo-signer.ts index aea1da3d61..f223251af3 100644 --- a/wallets/provider-xdefi/src/utxo-signer.ts +++ b/wallets/provider-xdefi/src/utxo-signer.ts @@ -1,13 +1,18 @@ -import { GenericSigner, SignerError, Transfer } from 'rango-types'; -import { xdefiTransfer } from './helpers'; +import type { Networks } from '@rango-dev/wallets-shared'; +import type { GenericSigner, Transfer } from 'rango-types'; + import { - XDEFI_WALLET_SUPPORTED_NATIVE_CHAINS, getNetworkInstance, + XDEFI_WALLET_SUPPORTED_NATIVE_CHAINS, } from '@rango-dev/wallets-shared'; -import { Networks } from '@rango-dev/wallets-shared'; +import { SignerError } from 'rango-types'; + +import { xdefiTransfer } from './helpers.js'; -// TODO - replace with real type -// tslint:disable-next-line: no-any +/* + * TODO - replace with real type + * tslint:disable-next-line: no-any + */ type TransferExternalProvider = any; export class CustomTransferSigner implements GenericSigner { @@ -24,10 +29,13 @@ export class CustomTransferSigner implements GenericSigner { const { blockchain } = tx.asset; // Everything except ETH - if (!XDEFI_WALLET_SUPPORTED_NATIVE_CHAINS.includes(blockchain as Networks)) + if ( + !XDEFI_WALLET_SUPPORTED_NATIVE_CHAINS.includes(blockchain as Networks) + ) { throw new Error( `blockchain: ${blockchain} transfer not implemented yet.` ); + } const transferProvider = getNetworkInstance(this.provider, blockchain); const { diff --git a/wallets/provider-xdefi/tsconfig.build.json b/wallets/provider-xdefi/tsconfig.build.json index 7f49cdfc54..d9181ce0cd 100644 --- a/wallets/provider-xdefi/tsconfig.build.json +++ b/wallets/provider-xdefi/tsconfig.build.json @@ -1,6 +1,6 @@ { // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.libnext.json", "include": ["src", "types", "../../global-wallets-env.d.ts"], "compilerOptions": { "outDir": "dist", diff --git a/wallets/wallets-adapter/tsconfig.build.json b/wallets/wallets-adapter/tsconfig.build.json index f4b1b07167..044aea9a33 100644 --- a/wallets/wallets-adapter/tsconfig.build.json +++ b/wallets/wallets-adapter/tsconfig.build.json @@ -7,6 +7,5 @@ "rootDir": "./src", "lib": ["dom", "esnext"], "jsx": "react" - // match output dir to input dir. e.g. dist/index instead of dist/src/index } } diff --git a/yarn.lock b/yarn.lock index d65bef1d6b..35d292ceeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4173,6 +4173,16 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.12.0.tgz#ad903528bf3687a44da435d7b2479d724d374f5d" integrity sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA== +"@ledgerhq/types-cryptoassets@^7.11.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/types-cryptoassets/-/types-cryptoassets-7.14.0.tgz#1114599ba524c78655744c587b13be93cf65ec96" + integrity sha512-lndedmKIoaVOzQO+pGUNKKRCKWD7sdIxOdXz0drVGEBKMUSQKGOX8fhM4lta/qps4yBDjIwSzXAXVBMo+qFaeg== + +"@ledgerhq/types-devices@^6.24.0": + version "6.25.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/types-devices/-/types-devices-6.25.2.tgz#12379d3638b40cd0655c63d657451bf5aec140fe" + integrity sha512-MW7sA8bkBU7JR9hKaPVelQMqNlC5/Z4CJ/rqkWowy0FYJpAoYeXHahtRXC8bI8t5/GkcVvu/dwDU1J64OpwJ6A== + "@ledgerhq/types-live@^6.46.0": version "6.46.0" resolved "https://registry.yarnpkg.com/@ledgerhq/types-live/-/types-live-6.46.0.tgz#85e4c0b59b9e177bc279739a0ab419e24c064785" @@ -8166,6 +8176,11 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.8.tgz#7545ba4fc3c003d6c756f651f3bf163d8f0f29ba" integrity sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA== +"@types/w3c-web-hid@^1.0.2": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/w3c-web-hid/-/w3c-web-hid-1.0.6.tgz#45435513f34544d8c9d650699cf5050a3a4fd104" + integrity sha512-IWyssXmRDo6K7s31dxf+U+x/XUWuVsl9qUIYbJmpUHPcTv/COfBCKw/F0smI45+gPV34brjyP30BFcIsHgYWLA== + "@types/w3c-web-usb@^1.0.6": version "1.0.10" resolved "https://registry.yarnpkg.com/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz#cf89cccd2d93b6245e784c19afe0a9f5038d4528" @@ -9342,6 +9357,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + atomic-sleep@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" @@ -9949,10 +9969,10 @@ cac@^6.7.14: resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== -caip@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/caip/-/caip-1.1.0.tgz#0ccd5bf1bff822459389ccec0a8555712a30c374" - integrity sha512-yOO3Fu4ygyKYAdznuoaqschMKIZzcdgyMpBNtrIfrUhnOeaOWG+dh0c13wcOS6B/46IGGbncoyzJlio79jU7rw== +caip@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/caip/-/caip-1.1.1.tgz#c2c2b598b5e052d72c35c8d81b31f864e19c61e3" + integrity sha512-a3v5lteUUOoyRI0U6qe5ayCCGkF2mCmJ5zQMDnOD2vRjgRg6sm9p8TsRC2h4D4beyqRN9RYniphAPnj/+jQC6g== call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: version "1.0.5" @@ -10144,6 +10164,11 @@ chrome-trace-event@^1.0.2, chrome-trace-event@^1.0.3: resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== +ci-info@^3.7.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -12636,6 +12661,13 @@ find-up@^6.3.0: locate-path "^7.1.0" path-exists "^5.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.2.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" @@ -12775,6 +12807,16 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -14021,7 +14063,7 @@ is-weakset@^2.0.1: call-bind "^1.0.2" get-intrinsic "^1.1.1" -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -14358,7 +14400,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@^1.1.1: +json-stable-stringify@^1.0.2, json-stable-stringify@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz#52d4361b47d49168bcc4e564189a42e5a7439454" integrity sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg== @@ -14484,6 +14526,13 @@ kind-of@^6.0.2, kind-of@^6.0.3: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -16005,6 +16054,14 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.0.4, open@^8.4.0: version "8.4.2" resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" @@ -16263,6 +16320,27 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" +patch-package@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61" + integrity sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^4.1.2" + ci-info "^3.7.0" + cross-spawn "^7.0.3" + find-yarn-workspace-root "^2.0.0" + fs-extra "^9.0.0" + json-stable-stringify "^1.0.2" + klaw-sync "^6.0.0" + minimist "^1.2.6" + open "^7.4.2" + rimraf "^2.6.3" + semver "^7.5.3" + slash "^2.0.0" + tmp "^0.0.33" + yaml "^2.2.2" + path-browserify@^1.0.0, path-browserify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" @@ -16595,6 +16673,11 @@ posthtml@^0.16.4, posthtml@^0.16.5: posthtml-parser "^0.11.0" posthtml-render "^3.0.0" +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -17676,6 +17759,13 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== +rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -18182,6 +18272,11 @@ sisteransi@^1.0.5: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -18430,16 +18525,7 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -18531,14 +18617,7 @@ stringify-object@^5.0.0: is-obj "^3.0.0" is-regexp "^3.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -19947,7 +20026,7 @@ wordwrapjs@^4.0.0: reduce-flatten "^2.0.0" typical "^5.2.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -19965,15 +20044,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -20080,6 +20150,11 @@ yaml@^1.10.0, yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.2.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d" + integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw== + yargs-parser@21.1.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"