Skip to content

Commit

Permalink
Merge pull request #4 from chiru-labs/tea/export-parsekeys
Browse files Browse the repository at this point in the history
export parseKeys + bump to 0.0.4
  • Loading branch information
ethtea authored Jan 11, 2023
2 parents cb0b255 + d2855fc commit 1efbf5e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@ Return value
Promise<string | undefined>
```

### `parseKeys`

This function takes a single positional argument:

| Parameter | Type | Description | Required |
| ------------- | ------------- | ------------- | ------------- |
| payload | string | A hex representation of the signature read from scan | Yes |

Return value

```ts
{
primaryPublicKeyHash: string;
primaryPublicKeyRaw: string;
secondaryPublicKeyHash: string;
secondaryPublicKeyRaw: string;
tertiaryPublicKeyHash: string;
tertiaryPublicKeyRaw: string;
} | undefined
```

## Requirements

- The library must be hosted with secure transport (SSL), even in a development environment.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pbt-chip-client",
"version": "0.0.3",
"version": "0.0.4",
"description": "Javascript library to make it easy to integrate with PBT for browsers",
"scripts": {
"pre-commit": "lint-staged",
Expand Down
2 changes: 1 addition & 1 deletion src/kong/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function generateCmd(
return inputBytes;
}

function parseKeys(payload: string) {
export function parseKeys(payload: string) {
try {
const primaryPublicKeyLength = parseInt("0x" + payload.slice(0, 2)) * 2;
const primaryPublicKeyRaw = payload.slice(2, primaryPublicKeyLength + 2);
Expand Down

0 comments on commit 1efbf5e

Please sign in to comment.