Skip to content

Commit

Permalink
Merge pull request #257 from InjectiveLabs/dev
Browse files Browse the repository at this point in the history
chore: patch release
  • Loading branch information
bangjelkoski authored Nov 7, 2023
2 parents 0acb98b + cd5577c commit 1459a2a
Show file tree
Hide file tree
Showing 54 changed files with 971 additions and 381 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: '16.18.1'

- name: 'Setup [email protected]'
run: yarn global add [email protected] --ignore-engines
run: yarn global add [email protected] --ignore-engines

- name: Set up Git user
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Build dependencies
run: |
node etc/bootstrapEnv
yarn install --ignore-engines
yarn install --ignore-engines
yarn build
- name: 'Setup npm'
Expand Down
8 changes: 8 additions & 0 deletions packages/bridge-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.14.1](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-10-27)

**Note:** Version bump only for package @injectivelabs/bridge-ts





## [1.14.1-beta.2](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-09-24)

**Note:** Version bump only for package @injectivelabs/bridge-ts
Expand Down
12 changes: 6 additions & 6 deletions packages/bridge-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/bridge-ts",
"description": "Bridge utilities and abstractions in TypeScript to be used in Injective products",
"version": "1.14.1-beta.24",
"version": "1.14.2-beta.14",
"sideEffects": false,
"author": {
"name": "Bojan Angjelkoski",
Expand Down Expand Up @@ -32,11 +32,11 @@
},
"dependencies": {
"@axelar-network/axelarjs-sdk": "^0.11.7",
"@injectivelabs/exceptions": "^1.14.1-beta.7",
"@injectivelabs/networks": "^1.14.1-beta.8",
"@injectivelabs/sdk-ts": "^1.14.1-beta.24",
"@injectivelabs/ts-types": "^1.14.1-beta.7",
"@injectivelabs/utils": "^1.14.1-beta.6",
"@injectivelabs/exceptions": "^1.14.2-beta.2",
"@injectivelabs/networks": "^1.14.2-beta.3",
"@injectivelabs/sdk-ts": "^1.14.2-beta.14",
"@injectivelabs/ts-types": "^1.14.2-beta.0",
"@injectivelabs/utils": "^1.14.2-beta.2",
"@injectivelabs/wormhole-sdk": "^1.12.0-beta.0",
"@solana/spl-token": "^0.3.6",
"@solana/wallet-adapter-base": "^0.9.18",
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.14.1](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-10-27)

**Note:** Version bump only for package @injectivelabs/contracts





## [1.14.1-beta.0](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-09-23)

**Note:** Version bump only for package @injectivelabs/contracts
Expand Down
10 changes: 5 additions & 5 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/contracts",
"description": "Contracts wrapper that can be reused throughout Injective's projects.",
"version": "1.14.1-beta.8",
"version": "1.14.2-beta.3",
"sideEffects": false,
"license": "Apache-2.0",
"main": "dist/cjs/index.js",
Expand Down Expand Up @@ -31,10 +31,10 @@
"start": "node dist/index.js"
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.1-beta.7",
"@injectivelabs/networks": "^1.14.1-beta.8",
"@injectivelabs/ts-types": "^1.14.1-beta.7",
"@injectivelabs/utils": "^1.14.1-beta.6",
"@injectivelabs/exceptions": "^1.14.2-beta.2",
"@injectivelabs/networks": "^1.14.2-beta.3",
"@injectivelabs/ts-types": "^1.14.2-beta.0",
"@injectivelabs/utils": "^1.14.2-beta.2",
"ethers": "^5.7.2",
"link-module-alias": "^1.2.0",
"shx": "^0.3.3"
Expand Down
8 changes: 8 additions & 0 deletions packages/exceptions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.14.1](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-10-27)

**Note:** Version bump only for package @injectivelabs/exceptions





## [1.14.1-beta.0](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-09-23)

**Note:** Version bump only for package @injectivelabs/exceptions
Expand Down
4 changes: 2 additions & 2 deletions packages/exceptions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/exceptions",
"description": "List of exceptions that can be reused throughout Injective's projects.",
"version": "1.14.1-beta.7",
"version": "1.14.2-beta.2",
"sideEffects": false,
"license": "Apache-2.0",
"main": "dist/cjs/index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@injectivelabs/grpc-web": "^0.0.1",
"@injectivelabs/ts-types": "^1.14.1-beta.7",
"@injectivelabs/ts-types": "^1.14.2-beta.0",
"http-status-codes": "^2.2.0",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
Expand Down
3 changes: 3 additions & 0 deletions packages/exceptions/src/exceptions/LedgerException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const isCommonLockedError = (error: string) => {
'Ledger device: Incorrect length',
'Ledger device: INS_NOT_SUPPORTED',
'Ledger device: CLA_NOT_SUPPORTED',
'CLA_NOT_SUPPORTED',
'CLA',
'Locked',
'Failed to open the device',
'Failed to open the device',
'Ledger Device is busy',
Expand Down
1 change: 1 addition & 0 deletions packages/exceptions/src/types/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export enum IndexerErrorModule {
ChronosDerivative = 'indexer-chronos-derivative',
ChronosSpot = 'indexer-chronos-spot',
ChronosMarkets = 'indexer-chronos-markets',
Campaign = 'indexer-campaign',
}

export enum WalletErrorActionModule {
Expand Down
8 changes: 8 additions & 0 deletions packages/networks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.14.1](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-10-27)

**Note:** Version bump only for package @injectivelabs/networks





## [1.14.1-beta.0](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-09-23)

**Note:** Version bump only for package @injectivelabs/networks
Expand Down
8 changes: 4 additions & 4 deletions packages/networks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/networks",
"description": "Endpoints, networks, etc. Can be reused throughout Injective's projects.",
"version": "1.14.1-beta.8",
"version": "1.14.2-beta.3",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -31,9 +31,9 @@
"start": "node dist/index.js"
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.1-beta.7",
"@injectivelabs/ts-types": "^1.14.1-beta.7",
"@injectivelabs/utils": "^1.14.1-beta.6",
"@injectivelabs/exceptions": "^1.14.2-beta.2",
"@injectivelabs/ts-types": "^1.14.2-beta.0",
"@injectivelabs/utils": "^1.14.2-beta.2",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
},
Expand Down
18 changes: 9 additions & 9 deletions packages/networks/src/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { NetworkEndpoints } from './types'

export const endpointsMainnetSentry: NetworkEndpoints = {
indexer: 'https://sentry.exchange.grpc-web.injective.network/',
grpc: 'https://sentry.chain.grpc-web.injective.network/',
rpc: 'https://sentry.tm.injective.network/',
rest: 'https://sentry.lcd.injective.network/',
chronos: 'https://sentry.exchange.grpc-web.injective.network/',
explorer: 'https://sentry.exchange.grpc-web.injective.network/',
cache: 'https://sentry.exchange.grpc-web.injective.network/'
indexer: 'https://sentry.exchange.grpc-web.injective.network',
grpc: 'https://sentry.chain.grpc-web.injective.network',
rpc: 'https://sentry.tm.injective.network',
rest: 'https://sentry.lcd.injective.network',
chronos: 'https://sentry.exchange.grpc-web.injective.network',
explorer: 'https://sentry.exchange.grpc-web.injective.network',
cache: 'https://sentry.exchange.grpc-web.injective.network',
}

export const endpointsMainnetK8s: NetworkEndpoints = {
Expand All @@ -17,7 +17,7 @@ export const endpointsMainnetK8s: NetworkEndpoints = {
rest: 'https://k8s.mainnet.lcd.injective.network',
chronos: 'https://k8s.mainnet.chronos.grpc-web.injective.network',
explorer: 'https://k8s.mainnet.explorer.grpc-web.injective.network',
cache: 'https://k8s.testnet.gateway.grpc-web.injective.network/',
cache: 'https://k8s.testnet.gateway.grpc-web.injective.network',
}

export const endpointsMainnetLB: NetworkEndpoints = {
Expand Down Expand Up @@ -76,7 +76,7 @@ export const endpointsTestnetK8s: NetworkEndpoints = {
rest: 'https://k8s.testnet.lcd.injective.network',
chronos: 'https://k8s.testnet.exchange.grpc-web.injective.network',
explorer: 'https://k8s.testnet.explorer.grpc-web.injective.network',
cache: 'https://k8s.testnet.gateway.grpc-web.injective.network/',
cache: 'https://k8s.testnet.gateway.grpc-web.injective.network',
}

export const endpointsTestnet: NetworkEndpoints = {
Expand Down
8 changes: 8 additions & 0 deletions packages/sdk-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.14.1](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-10-27)

**Note:** Version bump only for package @injectivelabs/sdk-ts





## [1.14.1-beta.2](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/[email protected]...@injectivelabs/[email protected]) (2023-09-24)

**Note:** Version bump only for package @injectivelabs/sdk-ts
Expand Down
17 changes: 8 additions & 9 deletions packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/sdk-ts",
"description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
"version": "1.14.1-beta.24",
"version": "1.14.2-beta.14",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -40,23 +40,22 @@
"@ethersproject/bytes": "^5.7.0",
"@injectivelabs/core-proto-ts": "^0.0.18",
"@injectivelabs/dmm-proto-ts": "1.0.16",
"@injectivelabs/exceptions": "^1.14.1-beta.7",
"@injectivelabs/exceptions": "^1.14.2-beta.2",
"@injectivelabs/grpc-web": "^0.0.1",
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
"@injectivelabs/indexer-proto-ts": "1.11.10",
"@injectivelabs/indexer-proto-ts": "1.11.11",
"@injectivelabs/mito-proto-ts": "1.0.50",
"@injectivelabs/networks": "^1.14.1-beta.8",
"@injectivelabs/test-utils": "^1.14.1-beta.5",
"@injectivelabs/token-metadata": "^1.14.1-beta.15",
"@injectivelabs/ts-types": "^1.14.1-beta.7",
"@injectivelabs/utils": "^1.14.1-beta.6",
"@injectivelabs/networks": "^1.14.2-beta.3",
"@injectivelabs/test-utils": "^1.14.1",
"@injectivelabs/token-metadata": "^1.14.2-beta.10",
"@injectivelabs/ts-types": "^1.14.2-beta.0",
"@injectivelabs/utils": "^1.14.2-beta.2",
"@metamask/eth-sig-util": "^4.0.0",
"axios": "^0.27.2",
"bech32": "^2.0.0",
"bip39": "^3.0.4",
"cosmjs-types": "^0.7.1",
"eth-crypto": "^2.6.0",
"ethereumjs-util": "^7.1.4",
"ethers": "^5.7.2",
"google-protobuf": "^3.21.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { IndexerCampaignTransformer } from '../transformers'
import { IndexerGrpcCampaignApi } from './IndexerGrpcCampaignApi'

const CAMPAIGN_ID = 'spot-grid-inj-usdt-test'
const MARKET_ID =
'0xa508cb32923323679f29a032c70342c147c17d0145625922b0ef22e955c844c0'
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const indexerGrpcCampaignApi = new IndexerGrpcCampaignApi(endpoints.indexer)

describe('IndexerGrpcCampaignApi', () => {
test('fetchCampaign', async () => {
try {
const response = await indexerGrpcCampaignApi.fetchCampaign({
marketId: MARKET_ID,
campaignId: CAMPAIGN_ID,
})

expect(response).toBeDefined()
expect(response).toEqual(
expect.objectContaining<
ReturnType<
typeof IndexerCampaignTransformer.CampaignResponseToCampaign
>
>(response),
)
} catch (e) {
console.error(
'IndexerGrpcCampaignApi.fetchCampaign => ' + (e as any).message,
)
}
})
})
82 changes: 82 additions & 0 deletions packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcCampaignApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import {
UnspecifiedErrorCode,
GrpcUnaryRequestException,
} from '@injectivelabs/exceptions'
import { InjectiveMetaRpc } from '@injectivelabs/indexer-proto-ts'
import { InjectiveCampaignRpc } from '@injectivelabs/indexer-proto-ts'
import BaseGrpcConsumer from '../../BaseGrpcConsumer'
import { IndexerCampaignTransformer } from '../transformers'
import { IndexerModule } from '../types'

/**
* @category Indexer Grpc API
*/
export class IndexerGrpcCampaignApi extends BaseGrpcConsumer {
protected module: string = IndexerModule.Campaign

protected client: InjectiveCampaignRpc.InjectiveCampaignRPCClientImpl

constructor(endpoint: string) {
super(endpoint)

this.client = new InjectiveCampaignRpc.InjectiveCampaignRPCClientImpl(
this.getGrpcWebImpl(endpoint),
)
}

async fetchCampaign({
skip,
limit,
marketId,
campaignId,
accountAddress,
}: {
skip?: string
limit?: number
marketId?: string
campaignId: string
accountAddress?: string
}) {
const request = InjectiveCampaignRpc.RankingRequest.create()

request.campaignId = campaignId

if (skip) {
request.skip = skip
}

if (limit) {
request.limit = limit
}

if (marketId) {
request.marketId = marketId
}

if (accountAddress) {
request.accountAddress = accountAddress
}

try {
const response = await this.retry<InjectiveCampaignRpc.RankingResponse>(
() => this.client.Ranking(request),
)

return IndexerCampaignTransformer.CampaignResponseToCampaign(response)
} catch (e: unknown) {
if (e instanceof InjectiveMetaRpc.GrpcWebError) {
throw new GrpcUnaryRequestException(new Error(e.toString()), {
code: e.code,
context: 'FetchCampaign',
contextModule: this.module,
})
}

throw new GrpcUnaryRequestException(e as Error, {
code: UnspecifiedErrorCode,
context: 'FetchCampaign',
contextModule: this.module,
})
}
}
}
Loading

0 comments on commit 1459a2a

Please sign in to comment.