From 1c5519d9eef9de178d6baf29b97312a63eecd2c9 Mon Sep 17 00:00:00 2001 From: highlander Date: Mon, 13 Mar 2023 17:50:12 -0500 Subject: [PATCH] osmo work --- .pnp.cjs | 6 +++--- .yarnrc.yml | 2 +- packages/hdwallet-keepkey-rest/package.json | 2 +- packages/hdwallet-keepkey-rest/src/kkrest.ts | 12 ++++++------ packages/keepkey-sdk/package.json | 2 +- packages/keepkey-sdk/src/index.ts | 2 ++ 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 90c4e5981..aecd7f659 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -9878,9 +9878,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/@shapeshiftoss-hdwallet-core-npm-1.41.0-2b1ffb2a1d-0d3ba4a30c.zip/node_modules/@shapeshiftoss/hdwallet-core/",\ "packageDependencies": [\ ["@shapeshiftoss/hdwallet-core", "npm:1.41.0"],\ - ["@ethersproject/bytes", "npm:5.7.0"],\ - ["@types/google-protobuf", "npm:3.15.6"],\ - ["@types/node", "npm:18.11.9"],\ ["eip-712", "npm:1.0.0"],\ ["eventemitter2", "npm:5.0.1"],\ ["lodash", "npm:4.17.21"],\ @@ -9893,6 +9890,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/@shapeshiftoss-hdwallet-core-npm-1.46.0-e1741b8ca5-e541f85522.zip/node_modules/@shapeshiftoss/hdwallet-core/",\ "packageDependencies": [\ ["@shapeshiftoss/hdwallet-core", "npm:1.46.0"],\ + ["@ethersproject/bytes", "npm:5.7.0"],\ + ["@types/google-protobuf", "npm:3.15.6"],\ + ["@types/node", "npm:18.11.9"],\ ["eip-712", "npm:1.0.0"],\ ["eventemitter2", "npm:5.0.1"],\ ["lodash", "npm:4.17.21"],\ diff --git a/.yarnrc.yml b/.yarnrc.yml index 088fade54..c62801094 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -34,7 +34,7 @@ packageExtensions: dependencies: '@ethersproject/contracts': ^5.7.0 '@shapeshiftoss/logger': ^1.1.3 - '@shapeshiftoss/hdwallet-core@1.41.0': + '@shapeshiftoss/hdwallet-core@1.46.0': dependencies: '@ethersproject/bytes': ^5.7.0 '@types/google-protobuf': ^3.5.16 diff --git a/packages/hdwallet-keepkey-rest/package.json b/packages/hdwallet-keepkey-rest/package.json index 0794982dd..1daaa959a 100644 --- a/packages/hdwallet-keepkey-rest/package.json +++ b/packages/hdwallet-keepkey-rest/package.json @@ -1,6 +1,6 @@ { "name": "@keepkey/hdwallet-keepkey-rest", - "version": "1.40.16", + "version": "1.40.17", "license": "MIT", "repository": { "type": "git", diff --git a/packages/hdwallet-keepkey-rest/src/kkrest.ts b/packages/hdwallet-keepkey-rest/src/kkrest.ts index f33dbe945..eb693f9e7 100644 --- a/packages/hdwallet-keepkey-rest/src/kkrest.ts +++ b/packages/hdwallet-keepkey-rest/src/kkrest.ts @@ -791,12 +791,12 @@ export class KeepKeyRestHDWallet }) } - public osmosisGetAccountPaths(msg: core.CosmosGetAccountPaths): core.CosmosAccountPath[] { + public osmosisGetAccountPaths(msg: core.OsmosisGetAccountPaths): core.OsmosisAccountPath[] { return [ { addressNList: [ 0x80000000 + 44, - 0x80000000 + core.slip44ByCoin('Atom'), + 0x80000000 + core.slip44ByCoin('Osmo'), 0x80000000 + msg.accountIdx, 0, 0, @@ -806,7 +806,7 @@ export class KeepKeyRestHDWallet } readonly osmosisGetAddress = _.memoize( - async (msg: core.CosmosGetAddress): Promise => { + async (msg: core.OsmosisGetAddress): Promise => { return await this.abortable(async signal => { return ( await this.sdk.address.osmosisGetAddress( @@ -822,17 +822,17 @@ export class KeepKeyRestHDWallet msg => JSON.stringify(msg), ) - public async osmosisSignTx(msg: core.CosmosSignTx): Promise { + public async osmosisSignTx(msg: core.OsmosisSignTx): Promise { return await this.abortable(async signal => { const signerAddress = ( - await this.sdk.address.cosmosGetAddress( + await this.sdk.address.osmosisGetAddress( { address_n: msg.addressNList, }, { signal }, ) ).address - const signed = await this.sdk.cosmos.cosmosSignAmino( + const signed = await this.sdk.osmosis.cosmosSignAmino( { signDoc: { account_number: msg.account_number, diff --git a/packages/keepkey-sdk/package.json b/packages/keepkey-sdk/package.json index e5431e95f..52c1bca7c 100644 --- a/packages/keepkey-sdk/package.json +++ b/packages/keepkey-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@keepkey/keepkey-sdk", - "version": "0.2.30", + "version": "0.2.31", "license": "MIT", "repository": { "type": "git", diff --git a/packages/keepkey-sdk/src/index.ts b/packages/keepkey-sdk/src/index.ts index ac103b54d..155e6e112 100644 --- a/packages/keepkey-sdk/src/index.ts +++ b/packages/keepkey-sdk/src/index.ts @@ -9,6 +9,7 @@ export class KeepKeySdk { readonly auth: apis.AuthApi readonly bnb: apis.BNBApi readonly cosmos: apis.CosmosApi + readonly osmosis: apis.CosmosApi readonly eth: apis.ETHApi readonly raw: apis.RawApi readonly utxo: apis.UTXOApi @@ -26,6 +27,7 @@ export class KeepKeySdk { this.utxo = new apis.UTXOApi(configuration) this.bnb = new apis.BNBApi(configuration) this.cosmos = new apis.CosmosApi(configuration) + this.osmosis = new apis.CosmosApi(configuration) this.eth = new apis.ETHApi(configuration) this.raw = new apis.RawApi(configuration) this.system = Object.freeze(