Skip to content

Commit

Permalink
update syntax 'import moneroTs from "monero-ts"'
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jan 27, 2024
1 parent 6560168 commit 45ce185
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -35,7 +35,7 @@ A TypeScript library for creating Monero applications using RPC and WebAssembly

```typescript
// import monero-ts (or import types individually)
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

// connect to daemon
let daemon = await moneroTs.connectToDaemonRpc("http://localhost:28081");
Expand Down Expand Up @@ -124,7 +124,7 @@ await walletFull.close(true);

1. `cd your_project` or `mkdir your_project && cd your_project && npm init`
2. `npm install monero-ts`
3. Add `import * as moneroTs from "monero-ts"` in your application code (or import types individually).
3. Add `import moneroTs from "monero-ts"` in your application code (or import types individually).

#### Running in Node.js

Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/connection_manager.md
Expand Up @@ -8,7 +8,7 @@ See [MoneroConnectionManager](https://woodser.github.io/monero-ts/typedocs/class

```typescript
// import monero-ts (or import types individually)
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

// create connection manager
let connectionManager = new moneroTs.MoneroConnectionManager();
Expand Down
8 changes: 4 additions & 4 deletions docs/developer_guide/getting_started_p1.md
Expand Up @@ -38,7 +38,7 @@ The keys-only wallet has a file size just under 1/5 that of a standard Wasm wall
Open your preferred text editor or IDE and copy the following code to a new, blank file:

```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

main();
async function main() {
Expand All @@ -48,7 +48,7 @@ async function main() {

Note the program's two components:
1. An "import" statement to import the monero-ts library:
`import * as moneroTs from "monero-ts";`
`import moneroTs from "monero-ts";`
2. An asynchronous "main" function so that calls to monero-ts can be "awaited" (most calls are asynchronous):
`async function main() {}`

Expand All @@ -57,7 +57,7 @@ Note the program's two components:
monero-javscript implements keys-only wallets in the [MoneroWalletKeys](https://woodser.github.io/monero-ts/typedocs/classes/MoneroWalletKeys.html) class. You can create a random keys-only wallet as follows:
```typescript
// create a random keys-only (offline) stagenet wallet
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";
let keysOnlyWallet = await moneroTs.createWalletKeys({networkType: moneroTs.MoneroNetworkType.STAGENET, language: "English"});
```

Expand All @@ -79,7 +79,7 @@ console.log("View key: " + await walletKeys.getPrivateViewKey());

The finished program should match the following:
```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

main();
async function main() {
Expand Down
4 changes: 2 additions & 2 deletions docs/developer_guide/getting_started_p2.md
Expand Up @@ -61,7 +61,7 @@ _Note: In order for the server to reflect changes to source files, you need to s
4. Save the file.
5. While still in the "src" directory, create the file "offline_wallet_generator.ts" and insert the following from [part 1 of this guide](getting_started_p1.md):
```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

main();
async function main() {
Expand Down Expand Up @@ -144,7 +144,7 @@ The final HTML and JavaScript files should match the following:
### offline_wallet_generator.ts

```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

main();
async function main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/multisig_wallets.md
Expand Up @@ -5,7 +5,7 @@ The following is an example of creating multisig wallets.
For a full example of creating and sending funds from multisig wallets, see "Supports multisig wallets" in [TestMoneroWalletCommon.ts](https://github.com/monero-ecosystem/monero-ts/blob/master/src/test/TestMoneroWalletCommon.ts).

```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

// create multisig wallets which require 3 out of 5 participants to send funds
let M = 3;
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/view_only_offline.md
Expand Up @@ -18,7 +18,7 @@ To sign and submit transactions using view-only and offline wallets:
The following code demonstrates creating, signing, and submitting transactions using view-only and offline wallets:

```typescript
import * as moneroTs from "monero-ts";
import moneroTs from "monero-ts";

// create and sync view-only wallet without spend key
let viewOnlyWallet = await moneroTs.createWalletFull({
Expand Down
4 changes: 2 additions & 2 deletions src/test/TestSampleCode.ts
Expand Up @@ -44,7 +44,7 @@ export default class TestSampleCode {
it("Sample code demonstration", async function() {

// import monero-ts (or import as needed)
// import * as moneroTs from "monero-ts"; // *** UNCOMMENT IN README ***
// import moneroTs from "monero-ts"; // *** UNCOMMENT IN README ***

// connect to daemon
let daemon = await moneroTs.connectToDaemonRpc("http://localhost:28081");
Expand Down Expand Up @@ -117,7 +117,7 @@ export default class TestSampleCode {
it("Connection manager demonstration", async function() {

// import monero-ts (or import types individually)
// import * as moneroTs from "monero-ts"; // *** UNCOMMENT IN README ***
// import moneroTs from "monero-ts"; // *** UNCOMMENT IN README ***

// create connection manager
let connectionManager = new moneroTs.MoneroConnectionManager();
Expand Down

0 comments on commit 45ce185

Please sign in to comment.