Skip to content

Commit

Permalink
Merge pull request #67 from Zondax/add_unique_interlay
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Jul 18, 2022
2 parents b66d881 + 3ea2724 commit 45ade38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ const CLA = {
REEF: 0xa2,
XXNETWORK: 0xa3,
ALEPHZERO: 0xa4,
INTERLAY: 0xa5,
PARALLEL: 0xa6,
COMPOSABLE: 0xa8,
ASTAR: 0xa9,
STAFI: 0xac,
UNIQUE: 0xad,

}

// https://github.com/satoshilabs/slips/blob/master/slip-0044.md
Expand Down Expand Up @@ -49,6 +52,8 @@ const SLIP0044 = {
COMPOSABLE: 0x80000162,
STAFI: 0x8000038b,
ALEPHZERO: 0x80000283,
INTERLAY: 0x80000162,
UNIQUE: 0x80000162,
}

const SS58_ADDR_TYPE = {
Expand All @@ -75,6 +80,8 @@ const SS58_ADDR_TYPE = {
COMPOSABLE:49,
STAFI: 20,
ALEPHZERO: 42,
INTERLAY: 2032,
UNIQUE: 7391,
}

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ export const newAstarApp: SubstrateAppCreator
export const newComposableApp: SubstrateAppCreator
export const newStafiApp: SubstrateAppCreator
export const newAlephZeroApp: SubstrateAppCreator
export const newInterlayApp: SubstrateAppCreator
export const newUniqueApp: SubstrateAppCreator
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ function newStafiApp(transport) {
function newAlephZeroApp(transport) {
return new SubstrateApp(transport, CLA.ALEPHZERO, SLIP0044.ALEPHZERO)
}
function newInterlayApp(transport) {
return new SubstrateApp(transport, CLA.INTERLAY, SLIP0044.INTERLAY)
}
function newUniqueApp(transport) {
return new SubstrateApp(transport, CLA.UNIQUE, SLIP0044.UNIQUE)
}

function sha512(data) {
var digest = hash.sha512().update(data).digest()
Expand Down Expand Up @@ -532,4 +538,6 @@ module.exports = {
newComposableApp,
newStafiApp,
newAlephZeroApp,
newInterlayApp,
newUniqueApp,
}

0 comments on commit 45ade38

Please sign in to comment.