Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exports #15

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/little-tomatoes-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@delvtech/evm-client-ethers": patch
"@delvtech/evm-client-viem": patch
"@delvtech/evm-client": patch
---

Modify exports
70 changes: 52 additions & 18 deletions packages/evm-client-ethers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
// Errors
export * from '@delvtech/evm-client/errors';

// Contract
export { createCachedReadContract } from 'src/contract/createCachedReadContract';
export { createCachedReadWriteContract } from 'src/contract/createCachedReadWriteContract';
export { createReadContract } from 'src/contract/createReadContract';
export { createReadWriteContract } from 'src/contract/createReadWriteContract';
export {
createCachedReadContract,
type CreateCachedReadContractOptions,
} from 'src/contract/createCachedReadContract';
export {
createCachedReadWriteContract,
type CreateCachedReadWriteContractOptions,
} from 'src/contract/createCachedReadWriteContract';
export {
createReadContract,
type CreateReadContractOptions,
type EthersReadContract,
} from 'src/contract/createReadContract';
export {
createReadWriteContract,
type ReadWriteContractOptions,
} from 'src/contract/createReadWriteContract';

// Network
export { createNetwork } from 'src/network/createNetwork';

// Types
export type { CreateCachedReadContractOptions } from 'src/contract/createCachedReadContract';
export type { CreateCachedReadWriteContractOptions } from 'src/contract/createCachedReadWriteContract';
// Re-exports
export * from '@delvtech/evm-client/cache';

export {
arrayToFriendly,
friendlyToArray,
getAbiEntry,
} from '@delvtech/evm-client/contract';
export type {
CreateReadContractOptions,
EthersReadContract,
} from 'src/contract/createReadContract';
export type { ReadWriteContractOptions } from 'src/contract/createReadWriteContract';
AbiArrayType,
AbiEntry,
AbiEntryName,
AbiFriendlyType,
CachedReadContract,
CachedReadWriteContract,
ContractDecodeFunctionDataArgs,
ContractEncodeFunctionDataArgs,
ContractGetEventsArgs,
ContractGetEventsOptions,
ContractReadArgs,
ContractReadOptions,
ContractWriteArgs,
ContractWriteOptions,
DecodedFunctionData,
Event,
EventArgs,
EventFilter,
EventName,
FunctionArgs,
FunctionName,
FunctionReturn,
ReadContract,
ReadWriteContract,
} from '@delvtech/evm-client/contract';

// Re-exports
export { createLruSimpleCache } from '@delvtech/evm-client/factories';
export * from '@delvtech/evm-client/types';
export * from '@delvtech/evm-client/utils';
export * from '@delvtech/evm-client/errors';
export * from '@delvtech/evm-client/network';
70 changes: 52 additions & 18 deletions packages/evm-client-viem/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
// Errors
export * from '@delvtech/evm-client/errors';

// Contract
export { createCachedReadContract } from 'src/contract/createCachedReadContract';
export { createCachedReadWriteContract } from 'src/contract/createCachedReadWriteContract';
export { createReadContract } from 'src/contract/createReadContract';
export { createReadWriteContract } from 'src/contract/createReadWriteContract';
export {
createCachedReadContract,
type CreateCachedReadContractOptions,
} from 'src/contract/createCachedReadContract';
export {
createCachedReadWriteContract,
type CreateCachedReadWriteContractOptions,
} from 'src/contract/createCachedReadWriteContract';
export {
createReadContract,
type CreateReadContractOptions,
type ViemReadContract,
} from 'src/contract/createReadContract';
export {
createReadWriteContract,
type ReadWriteContractOptions,
} from 'src/contract/createReadWriteContract';

// Network
export { createNetwork } from 'src/network/createNetwork';

// Types
export type { CreateCachedReadContractOptions } from 'src/contract/createCachedReadContract';
export type { CreateCachedReadWriteContractOptions } from 'src/contract/createCachedReadWriteContract';
// Re-exports
export * from '@delvtech/evm-client/cache';

export {
arrayToFriendly,
friendlyToArray,
getAbiEntry,
} from '@delvtech/evm-client/contract';
export type {
CreateReadContractOptions,
ViemReadContract,
} from 'src/contract/createReadContract';
export type { ReadWriteContractOptions } from 'src/contract/createReadWriteContract';
AbiArrayType,
AbiEntry,
AbiEntryName,
AbiFriendlyType,
CachedReadContract,
CachedReadWriteContract,
ContractDecodeFunctionDataArgs,
ContractEncodeFunctionDataArgs,
ContractGetEventsArgs,
ContractGetEventsOptions,
ContractReadArgs,
ContractReadOptions,
ContractWriteArgs,
ContractWriteOptions,
DecodedFunctionData,
Event,
EventArgs,
EventFilter,
EventName,
FunctionArgs,
FunctionName,
FunctionReturn,
ReadContract,
ReadWriteContract,
} from '@delvtech/evm-client/contract';

// Re-exports
export { createLruSimpleCache } from '@delvtech/evm-client/factories';
export * from '@delvtech/evm-client/types';
export * from '@delvtech/evm-client/utils';
export * from '@delvtech/evm-client/errors';
export * from '@delvtech/evm-client/network';
22 changes: 11 additions & 11 deletions packages/evm-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./cache": {
"types": "./dist/cache.d.ts",
"default": "./dist/cache.js"
},
"./contract": {
"types": "./dist/contract.d.ts",
"default": "./dist/contract.js"
},
"./errors": {
"types": "./dist/errors.d.ts",
"default": "./dist/errors.js"
},
"./factories": {
"types": "./dist/factories.d.ts",
"default": "./dist/factories.js"
"./network": {
"types": "./dist/network.d.ts",
"default": "./dist/network.js"
},
"./stubs": {
"types": "./dist/stubs.d.ts",
"default": "./dist/stubs.js"
},
"./types": {
"types": "./dist/types.d.ts",
"default": "./dist/types.js"
},
"./utils": {
"types": "./dist/utils.d.ts",
"default": "./dist/utils.js"
},
"./package.json": "./package.json"
},
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions packages/evm-client/src/exports/cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { createLruSimpleCache } from 'src/cache/factories/createLruSimpleCache';
export type { SimpleCache, SimpleCacheKey } from 'src/cache/types/SimpleCache';
export { createSimpleCacheKey } from 'src/cache/utils/createSimpleCacheKey';
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
// Cache
export type { SimpleCache, SimpleCacheKey } from 'src/cache/types/SimpleCache';
// Factories
export {
createCachedReadContract,
type CreateCachedReadContractOptions,
} from 'src/contract/factories/createCachedReadContract';
export {
createCachedReadWriteContract,
type CreateCachedReadWriteContractOptions,
} from 'src/contract/factories/createCachedReadWriteContract';

// Contract
export type { CreateCachedReadContractOptions } from 'src/contract/factories/createCachedReadContract';
export type { CreateCachedReadWriteContractOptions } from 'src/contract/factories/createCachedReadWriteContract';
// Types
export type {
AbiArrayType,
AbiEntry,
Expand Down Expand Up @@ -39,16 +44,7 @@ export type {
FunctionReturn,
} from 'src/contract/types/Function';

// Network
export type { Block, BlockTag } from 'src/network/types/Block';
export type {
Network,
NetworkGetBlockArgs,
NetworkGetBlockOptions,
NetworkGetTransactionArgs,
} from 'src/network/types/Network';
export type {
MinedTransaction,
Transaction,
TransactionInfo,
} from 'src/network/types/Transaction';
// Utils
export { arrayToFriendly } from 'src/contract/utils/arrayToFriendly';
export { friendlyToArray } from 'src/contract/utils/friendlyToArray';
export { getAbiEntry } from 'src/contract/utils/getAbiEntry';
6 changes: 0 additions & 6 deletions packages/evm-client/src/exports/factories.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/evm-client/src/exports/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from 'src/exports/cache';
export * from 'src/exports/contract';
export * from 'src/exports/errors';
export * from 'src/exports/factories';
export * from 'src/exports/types';
export * from 'src/exports/utils';
export * from 'src/exports/network';
12 changes: 12 additions & 0 deletions packages/evm-client/src/exports/network.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export type { Block, BlockTag } from 'src/network/types/Block';
export type {
Network,
NetworkGetBlockArgs,
NetworkGetBlockOptions,
NetworkGetTransactionArgs,
} from 'src/network/types/Network';
export type {
MinedTransaction,
Transaction,
TransactionInfo,
} from 'src/network/types/Transaction';
7 changes: 0 additions & 7 deletions packages/evm-client/src/exports/utils.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/evm-client/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export default defineConfig({
// easier for wrapper packages to selectively re-export `*` from some entry
// points and while augmenting or modifying others.
entry: [
'src/exports/cache.ts',
'src/exports/contract.ts',
'src/exports/errors.ts',
'src/exports/factories.ts',
'src/exports/index.ts',
'src/exports/network.ts',
'src/exports/stubs.ts',
'src/exports/types.ts',
'src/exports/utils.ts',
],
format: ['esm'],
sourcemap: true,
Expand Down
Loading