-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from near/fix-examples
Homogenize example and remove reference to borsh-js
- Loading branch information
Showing
4 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import * as borsh from 'borsh-js'; | ||
import * as borsh from 'borsh'; | ||
|
||
const encodedU16 = borsh.serialize('u16', 2); | ||
const decodedU16 = borsh.deserialize('u16', encodedU16); | ||
console.log(decodedU16); | ||
|
||
const encodedStr = borsh.serialize('u64', '100000000000000000'); | ||
const decodedStr = borsh.deserialize('u64', encodedStr); | ||
console.log(decodedStr); | ||
const encodedStr = borsh.serialize('string', 'testing'); | ||
const decodedStr = borsh.deserialize('string', encodedStr); | ||
console.log(decodedStr); | ||
|
||
const encodedU64 = borsh.serialize('u64', '100000000000000000'); | ||
const decodedU64 = borsh.deserialize('u64', encodedU64); | ||
console.log(decodedU64); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters