Skip to content

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilaneDen committed Nov 21, 2024
1 parent 2cf86c0 commit 046be75
Show file tree
Hide file tree
Showing 15 changed files with 6,606 additions and 6,247 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"entry": ["src/Concordium.ts"],
"ignoreUnimported": []
}
511 changes: 394 additions & 117 deletions CHANGELOG.md

Large diffs are not rendered by default.

110 changes: 36 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,67 @@
<img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />
<img src="https://user-images.githubusercontent.com/4631227/191834116-59cf590e-25cc-4956-ae5c-812ea464f324.png" height="100" />

[Github](https://github.com/blooo-io/)
[GitHub](https://github.com/LedgerHQ/ledger-live/),
[Ledger Devs Discord](https://developers.ledger.com/discord-pro),
[Developer Portal](https://developers.ledger.com/)

## @blooo/hw-app-klaytn
## @ledgerhq/hw-app-algorand

Ledger Hardware Wallet Klaytn JavaScript bindings.
Ledger Hardware Wallet Algorand JavaScript bindings.

## API

#### Table of Contents

- [Klaytn](#klaytn)
- [Parameters](#parameters)
- [Examples](#examples)
- [Basic Information Methods](#basic-information-methods)
- [getVersion()](#getversion)
- [Examples](#examples-1)
- [getAddress()](#getaddress)
- [Parameters](#parameters-1)
- [Examples](#examples-2)
- [Transaction signing methods](#transaction-signing-methods)
- [Parameters](#parameters-2)
- [Examples](#examples-3)

## Klaytn

Klaytn API

### Parameters
***

- `transport`. A transport for sending commands to a device
- `scrambleKey`. A scramble key (optional, default `"klaytn_default_scramble_key"`)
## Are you adding Ledger support to your software wallet?

#### Examples
You may be using this package to communicate with the Algorand Nano App.

```javascript
import Klaytn from "blooo/hw-app-klaytn";
const klaytn = new Klaytn(transport);
```
For a smooth and quick integration:

### Basic Information methods
* See the developers’ documentation on the [Developer Portal](https://developers.ledger.com/docs/transport/overview/) and
* Go on [Discord](https://developers.ledger.com/discord-pro/) to chat with developer support and the developer community.

#### getVersion()
***

Get application version.
## API

##### Examples
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

```javascript
klaytn.getVersion().then((r) => r.version);
```
#### Table of Contents

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{version: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** version object
* [Algorand](#algorand)
* [Parameters](#parameters)
* [Examples](#examples)
* [getAddress](#getaddress)
* [Parameters](#parameters-1)
* [Examples](#examples-1)

#### getAddress
### Algorand

Get Klaytn address (public key) for a BIP32 path.
Algorand API

##### Parameters
#### Parameters

- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a BIP32 path without the address index
- `display` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** flag to show display (default)
- `accountIndex` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** index of account address (optional, default `0`)
* `transport` **Transport**&#x20;

##### Examples
#### Examples

```javascript
klaytn.getAddress("44'/8217'/0'/0/", false, 0).then((r) => r.address);
import Algorand from "@ledgerhq/hw-app-algorand";
const algo = new Algorand(transport)
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{address: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)}>** an object with the address field

### Transaction Signing Method
#### getAddress

To sign a Klaytn transaction use the method: **signTransaction** .
get Algorant address for a given BIP 32 path.

#### Parameters
##### Parameters

- `txn`. A **[caver transaction](https://archive-docs.klaytn.foundation/content/dapp/sdk/caver-js/api-references/caver.transaction)**.
- `accountIndex` index of account address (optional, default `0`)
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
* `boolDisplay` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**&#x20;

##### Examples

```javascript
import Caver from "caver-js";

const caver = new Caver();

const accountIndex = 1;

const txn = caver.transaction.valueTransfer.create({
from: "enter address here",
to: "enter address here",
value: 1,
gasPrice: 50000000000,
gas: 300000,
nonce: 1,
chainId: 1001,
});

klaytn.signTransaction(txn, accountIndex).then((r) => r.signature);
cosmos.getAddress("44'/283'/0'/0/0").then(o => o.address)
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{signature: \[[v](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/string),[r](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/string),[s](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/string)\], signedTxn: [caver transaction](https://archive-docs.klaytn.foundation/content/dapp/sdk/caver-js/api-references/caver.transaction).}>** an object with the signed transaction and signature
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), address: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** an object with a publicKey, address and (optionally) chainCode
11 changes: 10 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ export default {
testRegex: ".test.ts$",
collectCoverage: true,
testPathIgnorePatterns: ["packages/*/lib-es", "packages/*/lib"],
transformIgnorePatterns: ['/node_modules/(?!@concordium)'],
coveragePathIgnorePatterns: ["packages/create-dapp"],
passWithNoTests: true,
rootDir: __dirname,
transform: {
'^.+\\.tsx?$': ['ts-jest', {
useESM: true,
}],
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};
Loading

0 comments on commit 046be75

Please sign in to comment.