-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 1009-usk-swaps
- Loading branch information
Showing
34 changed files
with
786 additions
and
3,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
'@xchainjs/xchain-thorchain': major | ||
--- | ||
|
||
Breaking changes | ||
- `getPrivateKey` is now async and response is Uint8Array type | ||
- `getPubKey` is now async and response is Uint8Array type | ||
- `getDepositTransaction` is deprecated in favour of `getTransactionData` | ||
- `fetchTransaction` removed | ||
- `setClientUrl` removed | ||
- `getClientUrl` removed | ||
- `setExplorerUrls` removed | ||
- `getCosmosClient` removed | ||
- `setNetwork` removed | ||
- `setChainId` removed | ||
- `getChainId` removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@xchainjs/xchain-cosmos-sdk': minor | ||
--- | ||
|
||
New util functions: makeClientPath, bech32toBase64 format and base64ToBech32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@xchainjs/xchain-thorchain': major | ||
--- | ||
|
||
Client compatible with @xchainjs/xchain-cosmos-sdk package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@xchainjs/xchain-cosmos-sdk': minor | ||
--- | ||
|
||
New constructor parameter 'registry' to allow the client to work with custom message types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@xchainjs/xchain-cosmos-sdk': patch | ||
--- | ||
|
||
Broadcast bug fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@xchainjs/xchain-kujira': patch | ||
--- | ||
|
||
New version compatible with cosmos-sdk version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './client' | ||
export { base64ToBech32, bech32ToBase64, makeClientPath } from './utils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { HdPath, stringToPath } from '@cosmjs/crypto' | ||
import { toBech32 } from '@cosmjs/encoding' | ||
import { base64, bech32 } from '@scure/base' | ||
|
||
/** | ||
* Transform string path in HdPath compatible with cosmjs | ||
* | ||
* @example | ||
* makeClientPath(`44'/118'/0'/0/0`) // returns [Slip10RawIndex.hardened(44), Slip10RawIndex.hardened(118), Slip10RawIndex.hardened(0), Slip10RawIndex.normal(0), Slip10RawIndex.normal(0) ] | ||
* * @example | ||
* makeClientPath(`m/44'/118'/0'/0/0`) // returns [Slip10RawIndex.hardened(44), Slip10RawIndex.hardened(118), Slip10RawIndex.hardened(0), Slip10RawIndex.normal(0), Slip10RawIndex.normal(0) ] | ||
* @param fullDerivationPath | ||
* @returns {HdPath} | ||
*/ | ||
export function makeClientPath(fullDerivationPath: string): HdPath { | ||
const path = fullDerivationPath.startsWith('m/') ? fullDerivationPath : `m/${fullDerivationPath}` // To be compatible with previous versions | ||
return stringToPath(path) | ||
} | ||
|
||
/** | ||
* Transform address from Bech32 to Base64 | ||
* | ||
* @param {string} address The address to change the format | ||
* @returns the address in Base64 format | ||
*/ | ||
export const bech32ToBase64 = (address: string) => | ||
base64.encode(Uint8Array.from(bech32.fromWords(bech32.decode(address).words))) | ||
|
||
/** | ||
* Transform address from Base64 to Bech32 | ||
* | ||
* @param {string} address The address to change the format | ||
* @returns the address in Bech32 format | ||
*/ | ||
export const base64ToBech32 = (address: string, prefix: string) => toBech32(prefix, base64.decode(address)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.