Skip to content

Commit 7abccc4

Browse files
committed
fix: typing
1 parent 843731d commit 7abccc4

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set -e
22

3+
pnpm type-check || exit 1
34
pnpm lint || exit 1
45
pnpm build || exit 1

packages/sdk-ts/src/client/indexer/grpc_stream/stream/IndexerGrpcOracleStream.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { mockFactory } from '@injectivelabs/utils/test-utils'
12
import { Network, getNetworkEndpoints } from '@injectivelabs/networks'
23
import { IndexerGrpcOracleStream } from './IndexerGrpcOracleStream.js'
34

5+
const marketId = mockFactory.derivativeMarketId
6+
47
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
58

69
describe('IndexerGrpcOracleStream', () => {
@@ -87,9 +90,7 @@ describe('IndexerGrpcOracleStream', () => {
8790
describe('streamOraclePricesByMarkets', () => {
8891
it('should create subscription with unsubscribe method', () => {
8992
const subscription = oracleStream.streamOraclePricesByMarkets({
90-
oracleType: 'band',
91-
baseSymbol: 'INJ',
92-
quoteSymbol: 'USDT',
93+
marketIds: [marketId],
9394
callback: () => {},
9495
})
9596

@@ -102,9 +103,7 @@ describe('IndexerGrpcOracleStream', () => {
102103
it('should throw error if callback is not a function', () => {
103104
expect(() => {
104105
oracleStream.streamOraclePricesByMarkets({
105-
oracleType: 'band',
106-
baseSymbol: 'INJ',
107-
quoteSymbol: 'USDT',
106+
marketIds: [marketId],
108107
callback: null as any,
109108
})
110109
}).toThrow('callback must be a function')

packages/sdk-ts/src/core/modules/distribution/msgs/MsgFundCommunityPool.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ const params: MsgFundCommunityPool['params'] = {
2525

2626
const protoType = '/cosmos.distribution.v1beta1.MsgFundCommunityPool'
2727
const protoTypeShort = 'cosmos-sdk/MsgFundCommunityPool'
28+
2829
const protoParams = {
29-
amount: [params.amount[0], params.amount[1]],
30+
amount: params.amount,
3031
depositor: params.depositor,
3132
}
3233
const aminoParams = snakecaseKeys(protoParams)

packages/sdk-ts/src/core/tx/arbitrary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const generateArbitrarySignDoc = (message: string, signer: string) => {
3030

3131
return {
3232
signDoc,
33-
signDocBuff: stringified,
33+
signDocBuff: stringToUint8Array(stringified),
3434
stringifiedSignDoc: stringified,
3535
}
3636
}

packages/sdk-ts/tsconfig.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"isolatedModules": true,
5+
"types": ["node", "vitest/globals"],
56
"paths": {
6-
"@injectivelabs/utils/test-utils": [
7-
"../utils/src/test-utils/index.ts"
8-
],
9-
"@injectivelabs/exceptions": [
10-
"../exceptions/src/index.ts"
11-
]
7+
"@injectivelabs/utils/test-utils": ["../utils/src/test-utils/index.ts"],
8+
"@injectivelabs/exceptions": ["../exceptions/src/index.ts"]
129
}
1310
},
14-
"include": [
15-
"./src/**/*.ts"
16-
],
17-
"exclude": [
18-
"./src/**/*.spec.ts",
19-
"./src/**/*.test.ts"
20-
]
11+
"include": ["./src/**/*.ts"],
12+
"exclude": ["node_modules", "dist"]
2113
}

packages/ts-types/src/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const StreamOperation = {
2323
*/
2424
export type StreamOperation =
2525
(typeof StreamOperation)[keyof typeof StreamOperation]
26+
2627
export interface PaginationOption {
2728
key: string
2829
offset?: number

packages/wallets/wallet-cosmos/src/cosmos.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { Window as KeplrWindow } from '@keplr-wallet/types'
66
*/
77
export interface CosmostationCosmos {
88
request<T>(message: { method: string; params?: unknown }): Promise<T>
9+
on(eventName: string, handler: () => void): void
10+
off(eventName: string, handler: () => void): void
911
}
1012

1113
/**
@@ -14,7 +16,7 @@ export interface CosmostationCosmos {
1416
*/
1517
export interface CosmostationProvider {
1618
cosmos: CosmostationCosmos
17-
providers: {
19+
providers?: {
1820
keplr?: KeplrWindow['keplr']
1921
}
2022
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Global type augmentation for Cosmostation wallet.
3+
* This ensures window.cosmostation is properly typed.
4+
*/
5+
6+
import type { CosmostationProvider } from './types.js'
7+
8+
declare global {
9+
interface Window {
10+
cosmostation?: CosmostationProvider
11+
}
12+
}
13+
14+
export {}

packages/wallets/wallet-cosmostation/src/types.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,3 @@ export const SEND_TRANSACTION_MODE = {
153153

154154
export type SendTransactionMode =
155155
(typeof SEND_TRANSACTION_MODE)[keyof typeof SEND_TRANSACTION_MODE]
156-
157-
// ============================================================================
158-
// Global Window Type Extension
159-
// ============================================================================
160-
161-
declare global {
162-
interface Window {
163-
cosmostation?: CosmostationProvider
164-
}
165-
}

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"incremental": true,
2020
"resolveJsonModule": true,
2121
"skipLibCheck": true,
22-
"types": ["node"],
22+
"types": ["node", "vitest/globals"],
2323
"paths": {
2424
"@injectivelabs/ts-types": ["./packages/ts-types"],
2525
"@injectivelabs/exceptions": ["./packages/exceptions"],

0 commit comments

Comments
 (0)