Skip to content

Commit

Permalink
feat: naming and folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Jun 2, 2022
1 parent 016b9b8 commit f059fb7
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 38 deletions.
12 changes: 6 additions & 6 deletions packages/wallet-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"exports": {
".": "./dist/index.js",
"./transaction": "./dist/transaction/index.js",
"./Keplr": "./dist/Keplr/index.js",
"./Cosmos": "./dist/Cosmos/index.js"
"./keplr": "./dist/keplr/index.js",
"./cosmos": "./dist/cosmos/index.js"
},
"typesVersions": {
"*": {
Expand All @@ -25,11 +25,11 @@
"transaction": [
"./dist/transaction/index.d.ts"
],
"Keplr": [
"./dist/Keplr/index.d.ts"
"keplr": [
"./dist/keplr/index.d.ts"
],
"Cosmos": [
"./dist/Cosmos/index.d.ts"
"cosmos": [
"./dist/cosmos/index.d.ts"
]
}
},
Expand Down
3 changes: 1 addition & 2 deletions packages/wallet-ts/src/Keplr/KeplrWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
getExperimentalChainConfigBasedOnChainId,
keplrSupportedChainIds,
getEndpointsFromChainId,
CosmosChainId,
TestnetCosmosChainId,
} from './utils'
import { CosmosChainId, TestnetCosmosChainId } from './types'

export class KeplrWallet {
private chainId: CosmosChainId | TestnetCosmosChainId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,3 @@ export enum TestnetCosmosChainId {
Injective = 'injective-888',
Cosmoshub = 'cosmoshub-testnet',
}

export const keplrSupportedChainIds = [
'cosmoshub-4',
'osmosis-1',
'secret-3',
'akashnet-2',
'crypto-org-chain-mainnet-1',
'iov-mainnet-ibc',
'sifchain-1',
'shentu-2.2',
'irishub-1',
'regen-1',
'core-1',
'sentinelhub-2',
'kava-8',
'impacthub-3',
'emoney-3',
'euler-6',
'juno-1',
'straightedge-2',
'axelar-dojo-1',
'evmos-9001-2',
]
2 changes: 1 addition & 1 deletion packages/wallet-ts/src/Keplr/utils/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CosmosChainId, TestnetCosmosChainId } from './types'
import { CosmosChainId, TestnetCosmosChainId } from '../types'

export const getEndpointsFromChainId = (
chainId: TestnetCosmosChainId | CosmosChainId,
Expand Down
25 changes: 24 additions & 1 deletion packages/wallet-ts/src/Keplr/utils/experimental-chains.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bech32Address } from '@keplr-wallet/cosmos'
import { getEndpointsFromChainId } from './endpoints'
import { TestnetCosmosChainId, CosmosChainId } from './types'
import { TestnetCosmosChainId, CosmosChainId } from './../types'

export const experimentalChainsConfig = {
[TestnetCosmosChainId.Cosmoshub]: {
Expand Down Expand Up @@ -212,3 +212,26 @@ export const experimentalChainsConfig = {
export const getExperimentalChainConfigBasedOnChainId = (
chainId: string,
): any | undefined => experimentalChainsConfig[chainId]

export const keplrSupportedChainIds = [
'cosmoshub-4',
'osmosis-1',
'secret-3',
'akashnet-2',
'crypto-org-chain-mainnet-1',
'iov-mainnet-ibc',
'sifchain-1',
'shentu-2.2',
'irishub-1',
'regen-1',
'core-1',
'sentinelhub-2',
'kava-8',
'impacthub-3',
'emoney-3',
'euler-6',
'juno-1',
'straightedge-2',
'axelar-dojo-1',
'evmos-9001-2',
]
1 change: 0 additions & 1 deletion packages/wallet-ts/src/Keplr/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './endpoints'
export * from './types'
export * from './experimental-chains'
6 changes: 3 additions & 3 deletions packages/wallet-ts/src/wallet-strategy/strategies/Keplr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
DEFAULT_GAS_PRICE,
} from '@injectivelabs/utils'
import Web3 from 'web3'
import { KeplrWallet } from '../../Keplr'
import { KeplrWallet } from '../../keplr'
import { ConcreteWalletStrategy } from '../types'
import BaseConcreteStrategy from './Base'
import { CosmJsWallet } from '../../Cosmos/CosmosWallet'
import { CosmosChainId } from '../../Keplr/utils'
import { CosmJsWallet } from '../../cosmos/CosmosWallet'
import { CosmosChainId } from '../../keplr/types'
import { createSignedTx } from '../../transaction'

export default class Keplr
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-ts/src/wallet-strategy/types/strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AccountAddress, ChainId } from '@injectivelabs/ts-types'
import type Web3 from 'web3'
import { CosmosChainId } from '../../Keplr/utils'
import { CosmosChainId } from '../../keplr/types'

export type onAccountChangeCallback = (account: AccountAddress) => void
export type onChainIdChangeCallback = () => void
Expand Down

0 comments on commit f059fb7

Please sign in to comment.