Skip to content

Commit

Permalink
chore: regenerate base doc and update changelog for 0.10.1 (#4249)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusso authored Oct 16, 2023
1 parent 9919c75 commit e8c2569
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
* `-fno-shared-code` (default)
* `-fshared-code` (legacy)
(Helps mitigate the effect of the IC's new cost model, that increases
the cost of function calls).
the cost of function calls).

* motoko-base

* Added `Principal.toLedgerAccount` (#582).

* Added `Text.toLowercase` and `Text.toUppercase` (#590).


## 0.10.0 (2023-09-11)

Expand All @@ -31,6 +38,8 @@

* Exposed conversions between adjacent fixed-width types (dfinity/motoko-base⁠#585).

* Added library `Region.mo` offering isolated regions of IC stable memory (#580).

## 0.9.8 (2023-08-11)

* motoko (`moc`)
Expand Down
14 changes: 14 additions & 0 deletions doc/md/base/Principal.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ actor MyCanister {
}
```

## Function `toLedgerAccount`
``` motoko no-repl
func toLedgerAccount(principal : Principal, subAccount : ?Blob) : Blob
```

Compute the Ledger account identifier of a principal. Optionally specify a sub-account.

Example:
```motoko include=import
let principal = Principal.fromText("un4fu-tqaaa-aaaab-qadjq-cai");
let subAccount : Blob = "\4A\8D\3F\2B\6E\01\C8\7D\9E\03\B4\56\7C\F8\9A\01\D2\34\56\78\9A\BC\DE\F0\12\34\56\78\9A\BC\DE\F0";
let account = Principal.toLedgerAccount(principal, ?subAccount); // => \8C\5C\20\C6\15\3F\7F\51\E2\0D\0F\0F\B5\08\51\5B\47\65\63\A9\62\B4\A9\91\5F\4F\02\70\8A\ED\4F\82
```

## Function `toBlob`
``` motoko no-repl
func toBlob(p : Principal) : Blob
Expand Down

0 comments on commit e8c2569

Please sign in to comment.