diff --git a/dapps/kiosk-cli/index.js b/dapps/kiosk-cli/index.js index a54976a9a9a..aff1f965b12 100644 --- a/dapps/kiosk-cli/index.js +++ b/dapps/kiosk-cli/index.js @@ -34,7 +34,7 @@ import { } from '@iota/iota-sdk/utils'; import { bcs } from '@iota/iota-sdk/bcs'; import { program } from 'commander'; -import { KIOSK_LISTING, KioskClient, KioskTransaction, Network } from '@iota/kiosk'; +import { KIOSK_LISTING, KioskClient, KioskTransaction } from '@iota/kiosk'; import { IotaClient, getFullnodeUrl } from '@iota/iota-sdk/client'; import { Ed25519Keypair } from '@iota/iota-sdk/keypairs/ed25519'; import { Transaction } from '@iota/iota-sdk/transactions'; @@ -49,7 +49,7 @@ const client = new IotaClient({ url: getFullnodeUrl('testnet') }); const kioskClient = new KioskClient({ client, - network: Network.TESTNET, + network: 'testnet', }); /** diff --git a/dapps/kiosk/src/context/KioskClientContext.tsx b/dapps/kiosk/src/context/KioskClientContext.tsx index e193465a553..1aa6339edfd 100644 --- a/dapps/kiosk/src/context/KioskClientContext.tsx +++ b/dapps/kiosk/src/context/KioskClientContext.tsx @@ -3,7 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 import { useIotaClient, useIotaClientContext } from '@iota/dapp-kit'; -import { KioskClient, Network } from '@iota/kiosk'; +import { NetworkId } from '@iota/iota-sdk/client'; +import { KioskClient } from '@iota/kiosk'; import { createContext, ReactNode, useContext, useMemo } from 'react'; export const KioskClientContext = createContext(undefined); @@ -15,7 +16,7 @@ export function KioskClientProvider({ children }: { children: ReactNode }) { () => new KioskClient({ client: iotaClient, - network: network as Network, + network: network as NetworkId, }), [iotaClient, network], ); diff --git a/docs/content/developer/standards/wallet-standard.mdx b/docs/content/developer/standards/wallet-standard.mdx index 8cc9142dde4..4a529531af1 100644 --- a/docs/content/developer/standards/wallet-standard.mdx +++ b/docs/content/developer/standards/wallet-standard.mdx @@ -20,7 +20,7 @@ Create a class that represents your wallet. Use the `Wallet` interface from `@iota/wallet-standard` to help ensure your class adheres to the standard. ```tsx -import { IOTA_DEVNET_CHAIN, Wallet } from '@iota/wallet-standard'; +import { SUPPORTED_CHAINS, Wallet } from '@iota/wallet-standard'; class YourWallet implements Wallet { get version() { @@ -35,7 +35,7 @@ class YourWallet implements Wallet { } // Return the IOTA chains that your wallet supports. get chains() { - return [IOTA_DEVNET_CHAIN]; + return SUPPORTED_CHAINS; } } ``` @@ -152,7 +152,7 @@ class YourWallet implements Wallet { address: walletAccount.iotaAddress, publicKey: walletAccount.pubkey, // The IOTA chains that your wallet supports. - chains: [IOTA_DEVNET_CHAIN], + chains: [SUPPORTED_CHAINS], // The features that this account supports. This can be a subset of the wallet's supported features. // These features must exist on the wallet as well. features: [ diff --git a/docs/content/references/ts-sdk/kiosk/advanced-examples.mdx b/docs/content/references/ts-sdk/kiosk/advanced-examples.mdx index 181ec1ed41d..1948d65c4f1 100644 --- a/docs/content/references/ts-sdk/kiosk/advanced-examples.mdx +++ b/docs/content/references/ts-sdk/kiosk/advanced-examples.mdx @@ -12,9 +12,9 @@ const otherType = `${packageId}::other_module::OtherStruct<${packageId}::other_c // initialize a kioskClient. const kioskClient = new KioskClient({ client: new IotaClient({ - url: getFullnodeUrl('testnet'), + url: getFullnodeUrl(Network.Testnet), }), - network: Network.TESTNET, + network: Network.Testnet, }); ``` diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx b/docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx index 73bea1b8fce..e52f56bc105 100644 --- a/docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx +++ b/docs/content/references/ts-sdk/kiosk/kiosk-client/introduction.mdx @@ -7,38 +7,33 @@ Kiosk Client is the base for all Kiosk SDK functionality. ## Creating a kiosk client -You can follow the example to create a `KioskClient`. The client currently supports `MAINNET` and -`TESTNET`. View next section for usage in other networks. - -_IOTA Kiosk rules and extensions are not supported in Devnet due to network wipes (that would -require constantly changing the package IDs)._ - +You can follow the example to create a `KioskClient`. View next section for usage in custom networks. ```typescript -import { KioskClient, Network } from '@iota/kiosk'; -import { getFullnodeUrl, IotaClient } from '@iota/iota-sdk/client'; +import { KioskClient } from '@iota/kiosk'; +import { getFullnodeUrl, IotaClient, Network } from '@iota/iota-sdk/client'; // We need a IOTA Client. You can re-use the IotaClient of your project // (it's not recommended to create a new one). -const client = new IotaClient({ url: getFullnodeUrl('testnet') }); +const client = new IotaClient({ url: getFullnodeUrl(Network.Testnet) }); // Now we can use it to create a kiosk Client. const kioskClient = new KioskClient({ client, - network: Network.TESTNET, + network: Network.Testnet, }); ``` -### Using KioskClient on devnet or localnet +### Using KioskClient on custom networks -To use all the functionality of Kiosk SDK outside of `MAINNET` and `TESTNET`, use `Network.CUSTOM` +To use all the functionality of Kiosk SDK outside of official networks, use `Network.Custom` as the network, and pass the `packageIds` for the rules and extensions you want to use. ```typescript // constructing it for custom network use. const kioskClient = new KioskClient({ client, - network: Network.CUSTOM, + network: Network.Custom, packageIds: { kioskLockRulePackageId: '0x...', royaltyRulePackageId: '0x...', diff --git a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx b/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx index 0e2492241ce..771150f2592 100644 --- a/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx +++ b/docs/content/references/ts-sdk/kiosk/kiosk-client/kiosk-transaction/purchasing.mdx @@ -1,9 +1,8 @@ # Purchasing from a kiosk One of the base functionalities of the SDK is a seamless purchasing flow, allowing for ease of rules -resolving (hiding away the calls). The SDK supports all four rules by default, and works for -`TESTNET` and `MAINNET`. To support other networks, -[follow the instructions in the Introduction](../introduction#using-kioskclient-on-devnet-or-localnet). +resolving (hiding away the calls). To use custom networks, +[follow the instructions in the Introduction](../introduction#using-kioskclient-on-custom-networks). ## How to purchase