Skip to content

Commit

Permalink
snake_case in comment, move example description to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M committed Jul 10, 2023
1 parent 42ad7bd commit e0c36f1
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions bindings/nodejs/examples/exchange/0-generate-mnemonic.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { Utils } from '@iota/sdk';

// This example generates a new random mnemonic.
// Run with command:
// yarn run-example ./exchange/0-generate-mnemonic.ts

// This example generates a new random mnemonic.
import { Utils } from '@iota/sdk';

async function run() {
try {
// Set the generated mnemonic as env variable MNEMONIC so it can be used in the next examples.
Expand Down
8 changes: 4 additions & 4 deletions bindings/nodejs/examples/exchange/1-create-account.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This example creates a new database and account.
// Run with command:
// yarn run-example ./exchange/1-create-account.ts

import { Wallet, WalletOptions, CoinType } from '@iota/sdk';

// This example uses secrets in environment variables for simplicity which should not be done in production.
require('dotenv').config({ path: '.env' });

// Run with command:
// yarn run-example ./exchange/1-create-account.ts

// This example creates a new database and account.
async function run() {
try {
if (!process.env.WALLET_DB_PATH) {
Expand Down
8 changes: 4 additions & 4 deletions bindings/nodejs/examples/exchange/2-generate-address.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This example generates an address for an account.
// Run with command:
// yarn run-example ./exchange/2-generate-address.ts

import { Wallet } from '@iota/sdk';

// This example uses secrets in environment variables for simplicity which should not be done in production.
require('dotenv').config({ path: '.env' });

// Run with command:
// yarn run-example ./exchange/2-generate-address.ts

// This example generates an address for an account.
async function run() {
try {
if (!process.env.WALLET_DB_PATH) {
Expand Down
8 changes: 4 additions & 4 deletions bindings/nodejs/examples/exchange/3-check-balance.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This example gets the balance of an account.
// Run with command:
// yarn run-example ./exchange/3-check-balance.ts

import { Wallet } from '@iota/sdk';

// This example uses secrets in environment variables for simplicity which should not be done in production.
require('dotenv').config({ path: '.env' });

// Run with command:
// yarn run-example ./exchange/3-check-balance.ts

// This example gets the balance of an account.
async function run() {
try {
if (!process.env.WALLET_DB_PATH) {
Expand Down
8 changes: 4 additions & 4 deletions bindings/nodejs/examples/exchange/4-listen-events.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This example listens to the NewOutput event.
// Run with command:
// yarn run-example ./exchange/4-listen-events.ts

import { Wallet, Event, WalletEventType } from '@iota/sdk';

// This example uses secrets in environment variables for simplicity which should not be done in production.
require('dotenv').config({ path: '.env' });

// Run with command:
// yarn run-example ./exchange/4-listen-events.ts

// This example listens to the NewOutput event.
async function run() {
try {
if (!process.env.WALLET_DB_PATH) {
Expand Down
8 changes: 4 additions & 4 deletions bindings/nodejs/examples/exchange/5-send-amount.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This example sends tokens to an address.
// Run with command:
// yarn run-example ./exchange/5-send-amount.ts

import { Wallet } from '@iota/sdk';

// This example uses secrets in environment variables for simplicity which should not be done in production.
require('dotenv').config({ path: '.env' });

// Run with command:
// yarn run-example ./exchange/5-send-amount.ts

// This example sends tokens to an address.
async function run() {
try {
if (!process.env.WALLET_DB_PATH) {
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/examples/exchange/1_create_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from dotenv import load_dotenv
import os

# This example creates a new database and account.

# This example uses secrets in environment variables for simplicity which should not be done in production.
load_dotenv()

# This example creates a new database and account.

if 'WALLET_DB_PATH' not in os.environ:
raise Exception(".env WALLET_DB_PATH is undefined, see .env.example")
if 'NODE_URL' not in os.environ:
Expand Down Expand Up @@ -41,7 +41,7 @@
created_account = wallet.create_account('Alice')
account = wallet.get_account('Alice')

# Set syncOnlyMostBasicOutputs to true if not interested in outputs that are timelocked,
# Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked,
# have a storage deposit return, expiration or are nft/alias/foundry outputs.
account.set_default_sync_options(
SyncOptions(sync_only_most_basic_outputs=True))
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/examples/exchange/2_generate_address.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

# This example generates an address for an account.

from iota_sdk import Wallet
from dotenv import load_dotenv
import os

# This example uses secrets in environment variables for simplicity which should not be done in production.
load_dotenv()

# This example generates an address for an account.

if 'WALLET_DB_PATH' not in os.environ:
raise Exception(".env WALLET_DB_PATH is undefined, see .env.example")
if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/examples/exchange/3_check_balance.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

# This example gets the balance of an account.

from iota_sdk import Wallet, SyncOptions
from dotenv import load_dotenv
import os

# This example uses secrets in environment variables for simplicity which should not be done in production.
load_dotenv()

# This example gets the balance of an account.

if 'WALLET_DB_PATH' not in os.environ:
raise Exception(".env WALLET_DB_PATH is undefined, see .env.example")

Expand All @@ -20,7 +20,7 @@
addresses = account.addresses()
print(f'Addresses:', addresses)

# Set syncOnlyMostBasicOutputs to true if not interested in outputs that are timelocked,
# Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked,
# have a storage deposit return, expiration or are nft/alias/foundry outputs.
balance = account.sync(SyncOptions(sync_only_most_basic_outputs=True))
print('Balance', balance)
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/examples/exchange/4_listen_events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

# This example listens to the NewOutput event.

from iota_sdk import Wallet, SyncOptions
from dotenv import load_dotenv
import json
Expand All @@ -10,8 +12,6 @@
# This example uses secrets in environment variables for simplicity which should not be done in production.
load_dotenv()

# This example listens to the NewOutput event.

if 'WALLET_DB_PATH' not in os.environ:
raise Exception(".env WALLET_DB_PATH is undefined, see .env.example")

Expand Down Expand Up @@ -42,6 +42,6 @@ def callback(event):
time.sleep(5)

# Sync to detect new outputs
# Set syncOnlyMostBasicOutputs to true if not interested in outputs that are timelocked,
# Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked,
# have a storage deposit return , expiration or are nft/alias/foundry outputs.
account.sync(SyncOptions(sync_only_most_basic_outputs=True))
6 changes: 3 additions & 3 deletions bindings/python/examples/exchange/5_send_amount.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

# This example sends tokens to an address.

from iota_sdk import Wallet, SyncOptions
from dotenv import load_dotenv
import os

# This example uses secrets in environment variables for simplicity which should not be done in production.
load_dotenv()

# This example sends tokens to an address.

if 'WALLET_DB_PATH' not in os.environ:
raise Exception(".env WALLET_DB_PATH is undefined, see .env.example")
if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand All @@ -24,7 +24,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Set syncOnlyMostBasicOutputs to true if not interested in outputs that are timelocked,
# Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked,
# have a storage deposit return, expiration or are nft/alias/foundry outputs.
balance = account.sync(SyncOptions(sync_only_most_basic_outputs=True))
print('Balance', balance)
Expand Down

0 comments on commit e0c36f1

Please sign in to comment.