@solana/keys
Advanced tools
Comparing version 2.0.0-experimental.a1e77c4 to 2.0.0-experimental.a3f93f3
@@ -26,1 +26,3 @@ import bs58 from 'bs58'; | ||
export { assertIsBase58EncodedAddress }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
{ | ||
"name": "@solana/keys", | ||
"version": "2.0.0-experimental.a1e77c4", | ||
"version": "2.0.0-experimental.a3f93f3", | ||
"description": "Helpers for generating and transforming key material", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -0,1 +1,15 @@ | ||
[![npm][npm-image]][npm-url] | ||
[![npm-downloads][npm-downloads-image]][npm-url] | ||
[![semantic-release][semantic-release-image]][semantic-release-url] | ||
<br /> | ||
[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url] | ||
[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square | ||
[code-style-prettier-url]: https://github.com/prettier/prettier | ||
[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/keys/experimental.svg?style=flat | ||
[npm-image]: https://img.shields.io/npm/v/@solana/keys/experimental.svg?style=flat | ||
[npm-url]: https://www.npmjs.com/package/@solana/keys/v/experimental | ||
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg | ||
[semantic-release-url]: https://github.com/semantic-release/semantic-release | ||
# @solana/keys | ||
@@ -26,14 +40,14 @@ | ||
function handleSubmit() { | ||
// We know only that what the user typed conforms to the `string` type. | ||
const address: string = accountAddressInput.value; | ||
try { | ||
// If this type assertion function doesn't throw, then | ||
// Typescript will upcast `address` to `Base58EncodedAddress`. | ||
assertIsBase58EncodedAddress(address); | ||
// At this point, `address` is a `Base58EncodedAddress` that can be used with the RPC. | ||
const balanceInLamports = await rpc.getBalance(address); | ||
} catch (e) { | ||
// `address` turned out not to be a base58-encoded address | ||
} | ||
// We know only that what the user typed conforms to the `string` type. | ||
const address: string = accountAddressInput.value; | ||
try { | ||
// If this type assertion function doesn't throw, then | ||
// Typescript will upcast `address` to `Base58EncodedAddress`. | ||
assertIsBase58EncodedAddress(address); | ||
// At this point, `address` is a `Base58EncodedAddress` that can be used with the RPC. | ||
const balanceInLamports = await rpc.getBalance(address); | ||
} catch (e) { | ||
// `address` turned out not to be a base58-encoded address | ||
} | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41765
378
53