Skip to content

Commit

Permalink
build: format ledger-icp README after docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Sep 26, 2023
1 parent ca1d82b commit c1fee71
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"protoc": "bash ./scripts/update_proto.sh",
"test": "jest",
"test-all": "npm ci && npm run build --workspace=packages/utils && npm run build --workspace=packages/ledger && npm run test --workspaces",
"docs": "node scripts/docs.js && prettier --write packages/nns/README.md packages/sns/README.md packages/cmc/README.md packages/utils/README.md packages/ledger/README.md packages/ckbtc/README.md packages/ic-management/README.md",
"docs": "node scripts/docs.js && prettier --write packages/nns/README.md packages/sns/README.md packages/cmc/README.md packages/utils/README.md packages/ledger-icp/README.md packages/ledger/README.md packages/ckbtc/README.md packages/ic-management/README.md",
"build": "npm run build --workspaces",
"size": "size-limit --json",
"update:agent": "./scripts/update-agent"
Expand Down
52 changes: 23 additions & 29 deletions packages/ledger-icp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const data = await metadata();

##### :gear: create

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| -------- | ---------------------------------------------------------------------- |
| `create` | `(options: IcrcLedgerCanisterOptions<_SERVICE>) => IcrcLedgerCanister` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L28)
Expand All @@ -83,8 +83,8 @@ const data = await metadata();

The token metadata (name, symbol, etc.).

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| ---------- | ------------------------------------------------------------- |
| `metadata` | `(params: QueryParams) => Promise<IcrcTokenMetadataResponse>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L42)
Expand All @@ -93,8 +93,8 @@ The token metadata (name, symbol, etc.).

The ledger transaction fees.

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| ---------------- | ------------------------------------------ |
| `transactionFee` | `(params: QueryParams) => Promise<bigint>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L50)
Expand All @@ -103,38 +103,36 @@ The ledger transaction fees.

Returns the balance for a given account provided as owner and with optional subaccount.

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| --------- | -------------------------------------------- |
| `balance` | `(params: BalanceParams) => Promise<bigint>` |

Parameters:

* `params`: The parameters to get the balance of an account.

- `params`: The parameters to get the balance of an account.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L59)

##### :gear: transfer

Transfers tokens from the sender to the given account.

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| ---------- | --------------------------------------------- |
| `transfer` | `(params: TransferParams) => Promise<bigint>` |

Parameters:

* `params`: The parameters to transfer tokens.

- `params`: The parameters to transfer tokens.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L72)

##### :gear: totalTokensSupply

Returns the total supply of tokens.

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| ------------------- | ------------------------------------------ |
| `totalTokensSupply` | `(params: QueryParams) => Promise<bigint>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L88)
Expand All @@ -145,14 +143,13 @@ Transfers a token amount from the `from` account to the `to` account using the a

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_transfer_from

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| -------------- | ------------------------------------------------- |
| `transferFrom` | `(params: TransferFromParams) => Promise<bigint>` |

Parameters:

* `params`: The parameters to transfer tokens from to.

- `params`: The parameters to transfer tokens from to.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L101)

Expand All @@ -162,14 +159,13 @@ This method entitles the `spender` to transfer token `amount` on behalf of the c

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_approve

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| --------- | -------------------------------------------- |
| `approve` | `(params: ApproveParams) => Promise<bigint>` |

Parameters:

* `params`: The parameters to approve.

- `params`: The parameters to approve.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L123)

Expand All @@ -179,18 +175,16 @@ Returns the token allowance that the `spender` account can transfer from the spe

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md#icrc2_allowance

| Method | Type |
| ---------- | ---------- |
| Method | Type |
| ----------- | ------------------------------------------------- |
| `allowance` | `(params: AllowanceParams) => Promise<Allowance>` |

Parameters:

* `params`: The parameters to call the allowance.

- `params`: The parameters to call the allowance.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ledger/src/ledger.canister.ts#L145)


<!-- TSDOC_END -->

## Resources
Expand Down

0 comments on commit c1fee71

Please sign in to comment.