@rosen-bridge/address-codec 0.3.0 → 0.4.0-66382a71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/const.ts CHANGED
@@ -2,3 +2,4 @@ export const BITCOIN_CHAIN = 'bitcoin';
2
2
  export const CARDANO_CHAIN = 'cardano';
3
3
  export const ERGO_CHAIN = 'ergo';
4
4
  export const ETHEREUM_CHAIN = 'ethereum';
5
+ export const BINANCE_CHAIN = 'binance';
package/lib/decoder.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ BINANCE_CHAIN,
2
3
  BITCOIN_CHAIN,
3
4
  CARDANO_CHAIN,
4
5
  ERGO_CHAIN,
@@ -34,6 +35,7 @@ export const decodeAddress = (
34
35
  return bitcoinLib.address.fromOutputScript(
35
36
  Buffer.from(encodedAddress, 'hex')
36
37
  );
38
+ case BINANCE_CHAIN:
37
39
  case ETHEREUM_CHAIN:
38
40
  if (encodedAddress.length != 40) {
39
41
  throw new UnsupportedAddressError(chain, encodedAddress);
package/lib/encoder.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ BINANCE_CHAIN,
2
3
  BITCOIN_CHAIN,
3
4
  CARDANO_CHAIN,
4
5
  ERGO_CHAIN,
@@ -33,6 +34,7 @@ export const encodeAddress = (chain: string, address: string): string => {
33
34
  bitcoinLib.address.toOutputScript(address)
34
35
  ).toString('hex');
35
36
  break;
37
+ case BINANCE_CHAIN:
36
38
  case ETHEREUM_CHAIN:
37
39
  if (address.length != 42 || address.substring(0, 2) != '0x') {
38
40
  throw new UnsupportedAddressError(chain, address);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rosen-bridge/address-codec",
3
- "version": "0.3.0",
3
+ "version": "0.4.0-66382a71",
4
4
  "description": "A Typescript package for encoding and decoding of addresses in Rosen bridge supported chains",
5
5
  "repository": "https://github.com/rosen-bridge/utils",
6
6
  "license": "GPL-3.0",
@@ -33,7 +33,7 @@
33
33
  "node": ">=20.11.0"
34
34
  },
35
35
  "dependencies": {
36
- "@emurgo/cardano-serialization-lib-nodejs": "^11.5.0",
36
+ "@emurgo/cardano-serialization-lib-nodejs": "^13.2.1",
37
37
  "bitcoinjs-lib": "^6.1.5",
38
38
  "ergo-lib-wasm-nodejs": "^0.24.1",
39
39
  "ethers": "^6.13.2"