Skip to content

Commit

Permalink
Merge branch 'InjectiveLabs:dev' into welldone
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth authored Jan 8, 2024
2 parents 669278d + 2cb82f6 commit 1f8dbee
Show file tree
Hide file tree
Showing 25 changed files with 205 additions and 84 deletions.
10 changes: 5 additions & 5 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.5-beta.61",
"version": "1.14.5-beta.65",
"sideEffects": false,
"author": {
"name": "Bojan Angjelkoski",
Expand Down Expand Up @@ -32,11 +32,11 @@
},
"dependencies": {
"@axelar-network/axelarjs-sdk": "0.13.6",
"@injectivelabs/exceptions": "^1.14.5-beta.4",
"@injectivelabs/networks": "^1.14.5-beta.7",
"@injectivelabs/sdk-ts": "^1.14.5-beta.59",
"@injectivelabs/exceptions": "^1.14.5-beta.5",
"@injectivelabs/networks": "^1.14.5-beta.8",
"@injectivelabs/sdk-ts": "^1.14.5-beta.63",
"@injectivelabs/ts-types": "^1.14.5-beta.0",
"@injectivelabs/utils": "^1.14.5-beta.4",
"@injectivelabs/utils": "^1.14.5-beta.5",
"@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: 4 additions & 4 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.5-beta.7",
"version": "1.14.5-beta.8",
"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.5-beta.4",
"@injectivelabs/networks": "^1.14.5-beta.7",
"@injectivelabs/exceptions": "^1.14.5-beta.5",
"@injectivelabs/networks": "^1.14.5-beta.8",
"@injectivelabs/ts-types": "^1.14.5-beta.0",
"@injectivelabs/utils": "^1.14.5-beta.4",
"@injectivelabs/utils": "^1.14.5-beta.5",
"ethers": "^5.7.2",
"link-module-alias": "^1.2.0",
"shx": "^0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion 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.5-beta.4",
"version": "1.14.5-beta.5",
"sideEffects": false,
"license": "Apache-2.0",
"main": "dist/cjs/index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/exceptions/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ const exchangeErrorMap = {
'Subaccount nonce is invalid',
[ChainExchangeModuleErrorCode.ErrInsufficientFunds]: 'Insufficient funds',
[ChainExchangeModuleErrorCode.ErrPostOnlyMode]:
'Only post-only actions available for approximately 30 minutes after a chain upgrade.',
[ChainExchangeModuleErrorCode.ErrClientOrderIdAlreadyExists]:
'Client order id already exists',
[ChainExchangeModuleErrorCode.ErrInvalidCid]:
'Client order id is invalid. Max length is 36 chars',
Expand Down
6 changes: 3 additions & 3 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.5-beta.7",
"version": "1.14.5-beta.8",
"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.5-beta.4",
"@injectivelabs/exceptions": "^1.14.5-beta.5",
"@injectivelabs/ts-types": "^1.14.5-beta.0",
"@injectivelabs/utils": "^1.14.5-beta.4",
"@injectivelabs/utils": "^1.14.5-beta.5",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
},
Expand Down
14 changes: 7 additions & 7 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.5-beta.59",
"version": "1.14.5-beta.63",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -38,19 +38,19 @@
"@ensdomains/ens-validation": "^0.1.0",
"@ensdomains/eth-ens-namehash": "^2.0.15",
"@ethersproject/bytes": "^5.7.0",
"@injectivelabs/core-proto-ts": "^0.0.18",
"@injectivelabs/core-proto-ts": "^0.0.21",
"@injectivelabs/dmm-proto-ts": "1.0.19",
"@injectivelabs/exceptions": "^1.14.5-beta.4",
"@injectivelabs/exceptions": "^1.14.5-beta.5",
"@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.30",
"@injectivelabs/indexer-proto-ts": "1.11.32",
"@injectivelabs/mito-proto-ts": "1.0.55",
"@injectivelabs/networks": "^1.14.5-beta.7",
"@injectivelabs/networks": "^1.14.5-beta.8",
"@injectivelabs/test-utils": "^1.14.3",
"@injectivelabs/token-metadata": "^1.14.5-beta.40",
"@injectivelabs/token-metadata": "^1.14.5-beta.42",
"@injectivelabs/ts-types": "^1.14.5-beta.0",
"@injectivelabs/utils": "^1.14.5-beta.4",
"@injectivelabs/utils": "^1.14.5-beta.5",
"@metamask/eth-sig-util": "^4.0.0",
"axios": "^0.27.2",
"bech32": "^2.0.0",
Expand Down
40 changes: 40 additions & 0 deletions packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcCampaignApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,46 @@ export class IndexerGrpcCampaignApi extends BaseGrpcConsumer {
}
}

async fetchRound({
roundId,
accountAddress,
}: {
roundId?: string
accountAddress?: string
}) {
const request = InjectiveCampaignRpc.CampaignsRequest.create()

if (roundId) {
request.roundId = roundId
}

if (accountAddress) {
request.accountAddress = accountAddress
}

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

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

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

async fetchGuilds({
skip,
limit,
Expand Down
20 changes: 10 additions & 10 deletions packages/sdk-ts/src/core/modules/gov/ProposalContentDecomposer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CosmosGovV1Beta1Gov,
CosmosParamsV1Beta1Params,
CosmosUpgradeV1Beta1Upgrade,
InjectiveExchangeV1Beta1Tx,
InjectiveExchangeV1Beta1Proposal,
InjectiveOracleV1Beta1Proposal,
} from '@injectivelabs/core-proto-ts'

Expand Down Expand Up @@ -45,49 +45,49 @@ export class ProposalDecomposer {
}

static spotMarketLaunch(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.SpotMarketLaunchProposal.decode(content)
return InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.decode(content)
}

static exchangeEnableProposal(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.ExchangeEnableProposal.decode(content)
return InjectiveExchangeV1Beta1Proposal.ExchangeEnableProposal.decode(content)
}

static spotMarketUpdate(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.SpotMarketParamUpdateProposal.decode(
return InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.decode(
content,
)
}

static perpetualMarketLaunch(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.PerpetualMarketLaunchProposal.decode(
return InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.decode(
content,
)
}

static expiryFuturesMarketLaunch(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.ExpiryFuturesMarketLaunchProposal.decode(
return InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.decode(
content,
)
}

static derivativeMarketUpdate(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.DerivativeMarketParamUpdateProposal.decode(
return InjectiveExchangeV1Beta1Proposal.DerivativeMarketParamUpdateProposal.decode(
content,
)
}

static FeeDiscount(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.FeeDiscountProposal.decode(content)
return InjectiveExchangeV1Beta1Proposal.FeeDiscountProposal.decode(content)
}

static TradingRewardCampaignLaunch(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.TradingRewardCampaignLaunchProposal.decode(
return InjectiveExchangeV1Beta1Proposal.TradingRewardCampaignLaunchProposal.decode(
content,
)
}

static TradingRewardCampaignUpdate(content: Uint8Array) {
return InjectiveExchangeV1Beta1Tx.TradingRewardCampaignUpdateProposal.decode(
return InjectiveExchangeV1Beta1Proposal.TradingRewardCampaignUpdateProposal.decode(
content,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GoogleProtobufAny,
CosmosGovV1Beta1Tx,
CosmosBaseV1Beta1Coin,
InjectiveExchangeV1Beta1Tx,
InjectiveExchangeV1Beta1Proposal,
InjectiveOracleV1Beta1Oracle,
} from '@injectivelabs/core-proto-ts'
import { MsgBase } from '../../MsgBase'
Expand All @@ -13,7 +13,7 @@ const createProposalExpiryFuturesMarketLaunch = (
params: MsgSubmitProposalExpiryFuturesMarketLaunch.Params,
) => {
const content =
InjectiveExchangeV1Beta1Tx.ExpiryFuturesMarketLaunchProposal.create()
InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.create()
content.title = params.market.title
content.description = params.market.description
content.quoteDenom = params.market.quoteDenom
Expand All @@ -30,7 +30,7 @@ const createProposalExpiryFuturesMarketLaunch = (
content.minPriceTickSize = params.market.minPriceTickSize
content.minQuantityTickSize = params.market.minQuantityTickSize

return InjectiveExchangeV1Beta1Tx.ExpiryFuturesMarketLaunchProposal.fromPartial(
return InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.fromPartial(
content,
)
}
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class MsgSubmitProposalExpiryFuturesMarketLaunch extends MsgBase<

const contentAny = GoogleProtobufAny.Any.create()
contentAny.value =
InjectiveExchangeV1Beta1Tx.ExpiryFuturesMarketLaunchProposal.encode(
InjectiveExchangeV1Beta1Proposal.ExpiryFuturesMarketLaunchProposal.encode(
content,
).finish()
contentAny.typeUrl =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GoogleProtobufAny,
CosmosGovV1Beta1Tx,
CosmosBaseV1Beta1Coin,
InjectiveExchangeV1Beta1Tx,
InjectiveExchangeV1Beta1Proposal,
InjectiveOracleV1Beta1Oracle,
} from '@injectivelabs/core-proto-ts'
import { MsgBase } from '../../MsgBase'
Expand Down Expand Up @@ -48,7 +48,7 @@ const createPerpetualMarketLaunch = (
params: MsgSubmitProposalPerpetualMarketLaunch.Params,
) => {
const content =
InjectiveExchangeV1Beta1Tx.PerpetualMarketLaunchProposal.create()
InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.create()

content.title = params.market.title
content.description = params.market.description
Expand All @@ -65,7 +65,7 @@ const createPerpetualMarketLaunch = (
content.minPriceTickSize = params.market.minPriceTickSize
content.minQuantityTickSize = params.market.minQuantityTickSize

return InjectiveExchangeV1Beta1Tx.PerpetualMarketLaunchProposal.fromPartial(
return InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.fromPartial(
content,
)
}
Expand Down Expand Up @@ -115,7 +115,7 @@ export default class MsgSubmitProposalPerpetualMarketLaunch extends MsgBase<

const contentAny = GoogleProtobufAny.Any.create()
contentAny.value =
InjectiveExchangeV1Beta1Tx.PerpetualMarketLaunchProposal.encode(
InjectiveExchangeV1Beta1Proposal.PerpetualMarketLaunchProposal.encode(
content,
).finish()
contentAny.typeUrl =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GoogleProtobufAny,
CosmosGovV1Beta1Tx,
CosmosBaseV1Beta1Coin,
InjectiveExchangeV1Beta1Tx,
InjectiveExchangeV1Beta1Proposal,
} from '@injectivelabs/core-proto-ts'
import { MsgBase } from '../../MsgBase'
import { amountToCosmosSdkDecAmount } from '../../../../utils/numbers'
Expand Down Expand Up @@ -41,7 +41,7 @@ export declare namespace MsgSubmitProposalSpotMarketLaunch {
const createSpotMarketLaunchContent = (
params: MsgSubmitProposalSpotMarketLaunch.Params,
) => {
const content = InjectiveExchangeV1Beta1Tx.SpotMarketLaunchProposal.create()
const content = InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.create()

content.title = params.market.title
content.description = params.market.description
Expand All @@ -53,7 +53,7 @@ const createSpotMarketLaunchContent = (
content.makerFeeRate = params.market.makerFeeRate
content.takerFeeRate = params.market.makerFeeRate

return InjectiveExchangeV1Beta1Tx.SpotMarketLaunchProposal.fromPartial(
return InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.fromPartial(
content,
)
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export default class MsgSubmitProposalSpotMarketLaunch extends MsgBase<

const contentAny = GoogleProtobufAny.Any.create()
contentAny.value =
InjectiveExchangeV1Beta1Tx.SpotMarketLaunchProposal.encode(
InjectiveExchangeV1Beta1Proposal.SpotMarketLaunchProposal.encode(
content,
).finish()
contentAny.typeUrl = proposalType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GoogleProtobufAny,
CosmosGovV1Beta1Tx,
CosmosBaseV1Beta1Coin,
InjectiveExchangeV1Beta1Tx,
InjectiveExchangeV1Beta1Proposal,
InjectiveExchangeV1Beta1Exchange,
} from '@injectivelabs/core-proto-ts'
import { MsgBase } from '../../MsgBase'
Expand All @@ -13,7 +13,7 @@ const createSpotMarketParamUpdate = (
params: MsgSubmitProposalSpotMarketParamUpdate.Params,
) => {
const content =
InjectiveExchangeV1Beta1Tx.SpotMarketParamUpdateProposal.create()
InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.create()
content.title = params.market.title
content.description = params.market.description
content.makerFeeRate = params.market.makerFeeRate
Expand All @@ -24,7 +24,7 @@ const createSpotMarketParamUpdate = (
content.minPriceTickSize = params.market.minPriceTickSize
content.minQuantityTickSize = params.market.minQuantityTickSize

return InjectiveExchangeV1Beta1Tx.SpotMarketParamUpdateProposal.fromPartial(
return InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.fromPartial(
content,
)
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export default class MsgSubmitProposalSpotMarketParamUpdate extends MsgBase<

const contentAny = GoogleProtobufAny.Any.create()
contentAny.value =
InjectiveExchangeV1Beta1Tx.SpotMarketParamUpdateProposal.encode(
InjectiveExchangeV1Beta1Proposal.SpotMarketParamUpdateProposal.encode(
content,
).finish()
contentAny.typeUrl =
Expand Down
Loading

0 comments on commit 1f8dbee

Please sign in to comment.