Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-tortora committed Jul 26, 2023
1 parent 377d4e0 commit d820a2a
Showing 1 changed file with 49 additions and 54 deletions.
103 changes: 49 additions & 54 deletions shimmer/docs/iota-sdk/docs/how-tos/exchange-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,33 @@ Most of the APIs are the same and the changes are fairly minimal, here are some
[`@iota/sdk`](https://www.npmjs.com/package/@iota/sdk).
- [`AccountManager`](https://wiki.iota.org/shimmer/wallet.rs/references/nodejs/classes/AccountManager/)
becomes
[`Wallet`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Wallet/).
[`Wallet`](../references/nodejs/classes/Wallet/).
- [`manager.generateMnemonic()`](https://wiki.iota.org/shimmer/wallet.rs/references/nodejs/classes/AccountManager/#generatemnemonic)
becomes
[`Utils.generateMnemonic()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Utils/#generatemnemonic).
[`Utils.generateMnemonic()`](../references/nodejs/classes/Utils/#generatemnemonic).
- [`AccountManager.generateAddress`](https://wiki.iota.org/shimmer/wallet.rs/references/nodejs/classes/AccountManager/#generateaddress)
becomes
[`Wallet.generateEd25519Addresses`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Wallet/#generateed25519address).
[`Wallet.generateEd25519Addresses`](../references/nodejs/classes/Wallet/#generateed25519address).
- [`Account.sendAmount`](https://wiki.iota.org/shimmer/wallet.rs/references/nodejs/classes/Account/) becomes
[`send`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#send).
[`send`](../references/nodejs/classes/Account/#send).
- The callbacks to `listen` now provide a properly typed
[`Event`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Event/).
[`Event`](../references/nodejs/classes/Event/).

</TabItem>
<TabItem value="python" label="Python">

- The pip package changes from `iota-wallet` to [`iota-sdk`](https://pypi.org/project/iota-sdk/).
- [`wallet.generate_mnemonic()`](https://wiki.iota.org/shimmer/wallet.rs/references/python/iota_wallet/wallet/#generate_mnemonic)
becomes
[`utils.generate_mnemonic()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/utils/#generate_mnemonic).
[`utils.generate_mnemonic()`](../references/python/iota_sdk/utils/#generate_mnemonic).
- [`wallet.generate_address()`](https://wiki.iota.org/shimmer/wallet.rs/references/python/iota_wallet/wallet/#generate_address)
becomes
[`wallet.generate_ed25519_addresses()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/#generate_ed25519_address).
[`wallet.generate_ed25519_addresses()`](../references/python/iota_sdk/wallet/#generate_ed25519_address).
- [`account.send_amount`](https://wiki.iota.org/shimmer/wallet.rs/references/python/iota_wallet/account/#send_amount)
becomes
[`account.send`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#send).
[`account.send`](../references/python/iota_sdk/wallet/account/#send).
- The callbacks to `listen` now provide a properly typed
[`event`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/types/event/).
[`event`](../references/python/iota_sdk/types/event/).

</TabItem>
</Tabs>
Expand Down Expand Up @@ -324,40 +324,40 @@ instance include:
<TabItem value="typescript-node" label="Typescript (Node.js)">

You get an instance of any created account using
[`Wallet.getAccount(accountId|alias)`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Wallet/#getaccount)
[`Wallet.getAccount(accountId|alias)`](../references/nodejs/classes/Wallet/#getaccount)
or get all accounts with
[`Wallet.getAccounts()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Wallet/#getaccounts).
[`Wallet.getAccounts()`](../references/nodejs/classes/Wallet/#getaccounts).

Common methods of an [`Account`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/)
Common methods of an [`Account`](../references/nodejs/classes/Account/)
instance include:

- [`account.addresses()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#addresses):
- [`account.addresses()`](../references/nodejs/classes/Account/#addresses):
Returns a list of addresses related to the account.
- [`account.generateEd25519Addresses()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#generateed25519addresses):
- [`account.generateEd25519Addresses()`](../references/nodejs/classes/Account/#generateed25519addresses):
Generates one or more new address(es) for the address index incremented by 1.
- [`account.getBalance()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#getbalance):
- [`account.getBalance()`](../references/nodejs/classes/Account/#getbalance):
Returns the balance for the given account.
- [`account.sync()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#sync): Sync the
- [`account.sync()`](../references/nodejs/classes/Account/#sync): Sync the
account information with the Tangle.

</TabItem>
<TabItem value="python" label="Python">

You get an instance of any created account using
[`wallet.get_account(accountId|alias)`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/#get_account)
[`wallet.get_account(accountId|alias)`](../references/python/iota_sdk/wallet/#get_account)
or get all accounts with
[`wallet.get_accounts()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/#get_accounts).
[`wallet.get_accounts()`](../references/python/iota_sdk/wallet/#get_accounts).

Common methods of an
[`Account`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/) instance include:
[`Account`](../references/python/iota_sdk/wallet/account/) instance include:

- [`account.addresses()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#addresses):
- [`account.addresses()`](../references/python/iota_sdk/wallet/account/#addresses):
Returns a list of addresses related to the account.
- [`account.generate_ed25519_addresses()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#generate_ed25519_addresses):
- [`account.generate_ed25519_addresses()`](../references/python/iota_sdk/wallet/account/#generate_ed25519_addresses):
Generates one or more new address(es) for the address index incremented by 1.
- [`account.get_balance()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#get_balance):
- [`account.get_balance()`](../references/python/iota_sdk/wallet/account/#get_balance):
Returns the balance for the given account.
- [`account.sync()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#sync):
- [`account.sync()`](../references/python/iota_sdk/wallet/account/#sync):
Sync the account information with the Tangle.

</TabItem>
Expand Down Expand Up @@ -470,7 +470,8 @@ https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/how

### 6. Listen to Events

The IOTA SDK supports several events for listening. A provided callback is triggered as soon as an event occurs (which usually happens during syncing).
The IOTA SDK supports several events for listening. A provided callback is triggered as soon as an event occurs
(which usually happens during syncing).

You can use the following example to listen to new output events:

Expand Down Expand Up @@ -521,30 +522,24 @@ NewOutput: {
<TabItem value="rust" label="Rust">

Alternatively you can use
[`account.outputs()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#outputs) to get
all the
outputs that are stored in the account, or
[`account.unspentOutputs()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#unspentoutputs),
to get the unspent outputs only.
[`account.outputs()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.outputs)
to get all the outputs that are stored in the account, or
[`account.unspent_outputs()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.unspent_outputs)
, to get the unspent outputs only.

</TabItem>
<TabItem value="typescript-node" label="Typescript (Node.js)">

Alternatively you can use
[`account.outputs()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.outputs)
to get
all the outputs that are stored in the account, or
[`account.unspent_outputs()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.unspent_outputs)
, to get the unspent outputs only.
Alternatively you can use [`account.outputs()`](../references/nodejs/classes/Account/#outputs) to get all the outputs
that are stored in the account, or [`account.unspentOutputs()`](../references/nodejs/classes/Account/#unspentoutputs),
to get the unspent outputs only.

</TabItem>
<TabItem value="python" label="Python">

Alternatively you can use
[`account.outputs()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#outputs)
to get
all the outputs that are stored in the account, or
[`account.unspent_outputs()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#unspent_outputs),
[`account.outputs()`](../references/python/iota_sdk/wallet/account/#outputs) to get all the outputs that are stored in
the account, or [`account.unspent_outputs()`](../references/python/iota_sdk/wallet/account/#unspent_outputs),
to get the unspent outputs only.

</TabItem>
Expand Down Expand Up @@ -604,30 +599,30 @@ https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/exc

The full function signature is
[`Account.send(amount, address,
transactionOptions?)`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#send).
transactionOptions?)`](../references/nodejs/classes/Account/#send).

The default
[`TransactionOptions`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/interfaces/TransactionOptions/)
[`TransactionOptions`](../references/nodejs/interfaces/TransactionOptions/)
are fine and successful. However, you can provide additional options, such as
[`remainderValueStrategy`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/interfaces/TransactionOptions/#remaindervaluestrategy),
[`remainderValueStrategy`](../references/nodejs/interfaces/TransactionOptions/#remaindervaluestrategy),
which can have the following values:

- [`changeAddress`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/api_ref/#changeaddress): Send the
- [`changeAddress`](../references/nodejs/api_ref/#changeaddress): Send the
remainder value to an internal address.
- [`reuseAddress`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/api_ref/#reuseaddress): Send the
- [`reuseAddress`](../references/nodejs/api_ref/#reuseaddress): Send the
remainder value back to its original address.
- [`customAddress`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/api_ref/#customaddress): Send the
- [`customAddress`](../references/nodejs/api_ref/#customaddress): Send the
remainder value back to a provided account address.

The `account.send()` function returns a
[`Transaction`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Transaction/)
[`Transaction`](../references/nodejs/classes/Transaction/)
with its id. You can use the `blockId` to check the confirmation status. You can obtain individual
transactions related to the given account using the
[`account.transactions()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#transactions)
[`account.transactions()`](../references/nodejs/classes/Account/#transactions)
function.

You can use the
[`account.sendWithParams()`](https://wiki.iota.org/shimmer/iota-sdk/references/nodejs/classes/Account/#sendwithparams)
[`account.sendWithParams()`](../references/nodejs/classes/Account/#sendwithparams)
to send to multiple addresses in a single transaction.

</TabItem>
Expand All @@ -639,27 +634,27 @@ https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/exc

The full function signature is
[`Account.send(send(amount: str, address: str, options: Optional[TransactionOptions] =
None)`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#send).
None)`](../references/python/iota_sdk/wallet/account/#send).

The default
[`TransactionOptions`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/types/transaction_options/)
[`TransactionOptions`](../references/python/iota_sdk/types/transaction_options/)
are fine and successful. However, you can provide additional options, such as
[`remainderValueStrategy`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/types/transaction_options/#remaindervaluestrategy-objects),
[`remainderValueStrategy`](../references/python/iota_sdk/types/transaction_options/#remaindervaluestrategy-objects),
which can have the following values:

- `changeAddress`: Send the remainder value to an internal address.
- `reuseAddress`: Send the remainder value back to its original address.
- `customAddress`: Send the remainder value back to a provided account address.

The `account.send()` function returns a
[`Transaction`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/types/transaction/)
[`Transaction`](../references/python/iota_sdk/types/transaction/)
with its id. You can use the `blockId` to check the confirmation status. You can obtain individual
transactions related to the given account using the
[`account.transactions()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#transactions)
[`account.transactions()`](../references/python/iota_sdk/wallet/account/#transactions)
function.

You can use the
[`account.send_with_params()`](https://wiki.iota.org/shimmer/iota-sdk/references/python/iota_sdk/wallet/account/#send_with_params)
[`account.send_with_params()`](../references/python/iota_sdk/wallet/account/#send_with_params)
to send to multiple addresses in a single transaction.

</TabItem>
Expand Down

0 comments on commit d820a2a

Please sign in to comment.