Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:InjectiveLabs/injective-ts into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Nov 13, 2024
2 parents f19f819 + 954cb4d commit 1d4d2c9
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 51 deletions.
2 changes: 1 addition & 1 deletion 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.19",
"version": "1.14.20-beta.1",
"sideEffects": false,
"license": "Apache-2.0",
"author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ExitConfig,
StrategyType,
TrailingArithmetic,
TrailingArithmeticLP,
} from '../types.js'
export declare namespace ExecArgCreateSpotGridStrategy {
export interface Params {
Expand All @@ -21,7 +22,11 @@ export declare namespace ExecArgCreateSpotGridStrategy {
takeProfit?: ExitConfig
exitType?: ExitType
strategyType?: StrategyType
trailingArithmetic?: TrailingArithmetic
trailingArithmetic?: {
upperTrailing: string
lowerTrailing: string
lpMode?: boolean
}
}

export interface Data {
Expand All @@ -38,7 +43,7 @@ export declare namespace ExecArgCreateSpotGridStrategy {
exit_price: string
}
exit_type?: ExitType
strategy_type?: StrategyType | TrailingArithmetic
strategy_type?: StrategyType | TrailingArithmetic | TrailingArithmeticLP
}
}

Expand All @@ -58,6 +63,20 @@ export default class ExecArgCreateSpotGridStrategy extends ExecArgBase<
toData(): ExecArgCreateSpotGridStrategy.Data {
const { params } = this

const trailingBounds = params.trailingArithmetic
? {
upper_trailing_bound: params.trailingArithmetic.upperTrailing,
lower_trailing_bound: params.trailingArithmetic.lowerTrailing,
}
: undefined

const strategyType =
params.trailingArithmetic && trailingBounds
? params.trailingArithmetic.lpMode
? { trailing_arithmetic_l_p: trailingBounds }
: { trailing_arithmetic: trailingBounds }
: params.strategyType ?? StrategyType.Arithmetic

return {
subaccount_id: params.subaccountId,
levels: params.levels,
Expand All @@ -76,7 +95,7 @@ export default class ExecArgCreateSpotGridStrategy extends ExecArgBase<
exit_price: params.takeProfit.exitPrice,
}
: undefined,
strategy_type: params.trailingArithmetic ?? params.strategyType,
strategy_type: strategyType,
}
}

Expand Down
8 changes: 8 additions & 0 deletions packages/sdk-ts/src/core/modules/wasm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum ExitType {

export enum StrategyType {
Arithmetic = 'arithmetic',
ArithmeticLP = 'arithmetic_l_p',
Geometric = 'geometric',
}

Expand All @@ -16,6 +17,13 @@ export type TrailingArithmetic = {
}
}

export type TrailingArithmeticLP = {
trailing_arithmetic_l_p: {
lower_trailing_bound: string
upper_trailing_bound: string
}
}

export type ExitConfig = {
exitType: ExitType
exitPrice: string
Expand Down
4 changes: 2 additions & 2 deletions packages/wallet-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-ts",
"description": "A convenient way to use and interact with different types of wallets on Injective.",
"version": "1.14.19",
"version": "1.14.20-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -41,7 +41,7 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@keplr-wallet/cosmos": "^0.12.71",
Expand Down
4 changes: 2 additions & 2 deletions packages/wallets/wallet-base/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-base",
"description": "Base wallet strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -37,7 +37,7 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"alchemy-sdk": "^3.4.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/wallets/wallet-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-core",
"description": "Core wallet strategy",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"eip1193-provider": "^1.0.1"
Expand Down
12 changes: 6 additions & 6 deletions packages/wallets/wallet-cosmos-strategy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-cosmos-strategy",
"description": "Wallet Cosmos Strategy with instantiated wallets",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -37,13 +37,13 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-core": "^0.0.6",
"@injectivelabs/wallet-cosmos": "^0.0.6",
"@injectivelabs/wallet-cosmostation": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@injectivelabs/wallet-core": "^0.0.7-beta.1",
"@injectivelabs/wallet-cosmos": "^0.0.7-beta.1",
"@injectivelabs/wallet-cosmostation": "^0.0.7-beta.1",
"alchemy-sdk": "^3.4.7",
"eip1193-provider": "^1.0.1",
"eth-sig-util": "^3.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-cosmos/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-cosmos",
"description": "Cosmos wallet strategies for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -39,10 +39,10 @@
"@cosmjs/stargate": "^0.32.3",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@keplr-wallet/cosmos": "^0.12.71",
"@keplr-wallet/types": "^0.12.71",
"shx": "^0.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-cosmostation/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-cosmostation",
"description": "Cosmostation strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -36,10 +36,10 @@
"@cosmjs/proto-signing": "^0.32.3",
"@cosmostation/extension-client": "^0.1.15",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@walletconnect/ethereum-provider": "^2.12.2"
},
"gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445",
Expand Down
4 changes: 2 additions & 2 deletions packages/wallets/wallet-evm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-evm",
"description": "EVM wallet strategies for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"ethers": "^6.5.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-ledger",
"description": "Ledger wallet strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -37,10 +37,10 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@ledgerhq/hw-app-cosmos": "^6.29.5",
"@ledgerhq/hw-app-eth": "6.35.6",
"@ledgerhq/hw-transport": "6.30.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-magic/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-magic",
"description": "Magic wallet strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -34,10 +34,10 @@
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@magic-ext/cosmos": "23.9.1",
"@magic-ext/oauth2": "9.9.0",
"magic-sdk": "28.9.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-private-key/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-private-key",
"description": "Private key wallet strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -34,10 +34,10 @@
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6"
"@injectivelabs/wallet-base": "^0.0.7-beta.1"
},
"gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445",
"typedoc": {
Expand Down
24 changes: 12 additions & 12 deletions packages/wallets/wallet-strategy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-strategy",
"description": "Wallet strategy with instantiated wallets",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -37,19 +37,19 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-core": "^0.0.6",
"@injectivelabs/wallet-cosmos": "^0.0.6",
"@injectivelabs/wallet-cosmostation": "^0.0.6",
"@injectivelabs/wallet-evm": "^0.0.6",
"@injectivelabs/wallet-ledger": "^0.0.6",
"@injectivelabs/wallet-magic": "^0.0.6",
"@injectivelabs/wallet-private-key": "^0.0.6",
"@injectivelabs/wallet-trezor": "^0.0.6",
"@injectivelabs/wallet-wallet-connect": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@injectivelabs/wallet-core": "^0.0.7-beta.1",
"@injectivelabs/wallet-cosmos": "^0.0.7-beta.1",
"@injectivelabs/wallet-cosmostation": "^0.0.7-beta.1",
"@injectivelabs/wallet-evm": "^0.0.7-beta.1",
"@injectivelabs/wallet-ledger": "^0.0.7-beta.1",
"@injectivelabs/wallet-magic": "^0.0.7-beta.1",
"@injectivelabs/wallet-private-key": "^0.0.7-beta.1",
"@injectivelabs/wallet-trezor": "^0.0.7-beta.1",
"@injectivelabs/wallet-wallet-connect": "^0.0.7-beta.1",
"alchemy-sdk": "^3.4.7",
"eip1193-provider": "^1.0.1",
"eth-sig-util": "^3.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-trezor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-trezor",
"description": "Trezor wallet strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -37,10 +37,10 @@
"@ethereumjs/tx": "^4.1.1",
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/networks": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@trezor/connect-web": "9.2.1",
"alchemy-sdk": "^3.4.7",
"eip1193-provider": "^1.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/wallets/wallet-wallet-connect/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/wallet-wallet-connect",
"description": "Wallet connect strategy for use with @injectivelabs/wallet-core.",
"version": "0.0.6",
"version": "0.0.7-beta.1",
"sideEffects": false,
"author": {
"name": "InjectiveLabs",
Expand Down Expand Up @@ -34,10 +34,10 @@
},
"dependencies": {
"@injectivelabs/exceptions": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.19",
"@injectivelabs/sdk-ts": "^1.14.20-beta.1",
"@injectivelabs/ts-types": "^1.14.19",
"@injectivelabs/utils": "^1.14.19",
"@injectivelabs/wallet-base": "^0.0.6",
"@injectivelabs/wallet-base": "^0.0.7-beta.1",
"@walletconnect/ethereum-provider": "^2.12.2"
},
"gitHead": "6442ae377bbfb3459d2fb3a44c650630a5b7f445",
Expand Down

0 comments on commit 1d4d2c9

Please sign in to comment.