Skip to content

Commit

Permalink
Update all explorer references (MystenLabs#6052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Mysten authored Nov 14, 2022
1 parent 0ae74f3 commit 0998a3d
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 79 deletions.
2 changes: 1 addition & 1 deletion apps/explorer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sui Explorer Frontend

[Sui Explorer](https://explorer.devnet.sui.io/) is a network explorer for the Sui network, similar in functionality to [Etherscan](https://etherscan.io/) or [Solana Explorer](https://explorer.solana.com/). Use Sui Explorer to see the latest transactions and objects.
[Sui Explorer](https://explorer.sui.io/) is a network explorer for the Sui network, similar in functionality to [Etherscan](https://etherscan.io/) or [Solana Explorer](https://explorer.solana.com/). Use Sui Explorer to see the latest transactions and objects.

# Set Up

Expand Down
4 changes: 0 additions & 4 deletions apps/wallet/configs/environment/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ API_ENDPOINT_STAGING_FULLNODE=https://fullnode.staging.sui.io/
API_ENDPOINT_STAGING_FAUCET=https://faucet.staging.sui.io/
API_ENDPOINT_TEST_NET_FULLNODE=https://fullnode.testnet.sui.io/
API_ENDPOINT_TEST_NET_FAUCET=https://faucet.testnet.sui.io/
EXPLORER_URL_LOCAL=http://localhost:3000/
EXPLORER_URL_DEV_NET=https://explorer.devnet.sui.io/
EXPLORER_URL_STAGING=https://explorer.staging.sui.io/
EXPLORER_URL_TEST_NET=https://explorer.testnet.sui.io/
SHOW_STAGING=false
STAKING_ENABLED=false
SUI_APPS_API_ENDPOINT=https://raw.githubusercontent.com/MystenLabs/sui/main/apps/wallet/apps/dapps.json
60 changes: 29 additions & 31 deletions apps/wallet/src/ui/app/components/explorer-link/Explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,38 @@ import { API_ENV, DEFAULT_API_ENV } from '_app/ApiProvider';

import type { ObjectId, SuiAddress, TransactionDigest } from '@mysten/sui.js';

const API_ENV_TO_EXPLORER_URL: Record<API_ENV, string | undefined> = {
[API_ENV.local]: process.env.EXPLORER_URL_LOCAL,
[API_ENV.devNet]: process.env.EXPLORER_URL_DEV_NET,
[API_ENV.staging]: process.env.EXPLORER_URL_STAGING,
[API_ENV.testNet]: process.env.EXPLORER_URL_TEST_NET,
//No explorer url for Custom PRC
const API_ENV_TO_EXPLORER_ENV: Record<API_ENV, string | undefined> = {
[API_ENV.local]: 'local',
[API_ENV.devNet]: 'devnet',
[API_ENV.staging]: 'staging',
[API_ENV.testNet]: 'testnet',
[API_ENV.customRPC]: '',
};

// TODO: rewrite this
function getDefaultUrl(apiEnv?: API_ENV) {
const url = API_ENV_TO_EXPLORER_URL[apiEnv || DEFAULT_API_ENV];
if (!url && !API_ENV.customRPC) {
throw new Error(`Url for API_ENV ${DEFAULT_API_ENV} is not defined`);
}
return url;
function getExplorerUrl(path: string, apiEnv: API_ENV = DEFAULT_API_ENV) {
const base =
apiEnv === API_ENV.local
? 'http://localhost:3000/'
: 'https://explorer.sui.io/';

return new URL(`${path}/?network=${API_ENV_TO_EXPLORER_ENV[apiEnv]}`, base)
.href;
}

export function getObjectUrl(objectID: ObjectId, apiEnv: API_ENV) {
return getExplorerUrl(`/objects/${objectID}`, apiEnv);
}

export function getTransactionUrl(
txDigest: TransactionDigest,
apiEnv: API_ENV
) {
return getExplorerUrl(
`/transactions/${encodeURIComponent(txDigest)}`,
apiEnv
);
}

export class Explorer {
public static getObjectUrl(objectID: ObjectId, apiEnv: API_ENV) {
return new URL(`/objects/${objectID}`, getDefaultUrl(apiEnv)).href;
}

public static getTransactionUrl(
txDigest: TransactionDigest,
apiEnv: API_ENV
) {
return new URL(
`/transactions/${encodeURIComponent(txDigest)}`,
getDefaultUrl(apiEnv)
).href;
}

public static getAddressUrl(address: SuiAddress, apiEnv: API_ENV) {
return new URL(`/addresses/${address}`, getDefaultUrl(apiEnv)).href;
}
export function getAddressUrl(address: SuiAddress, apiEnv: API_ENV) {
return getExplorerUrl(`/addresses/${address}`, apiEnv);
}
8 changes: 4 additions & 4 deletions apps/wallet/src/ui/app/components/explorer-link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { memo, useCallback, useMemo } from 'react';

import { Explorer } from './Explorer';
import { getObjectUrl, getAddressUrl, getTransactionUrl } from './Explorer';
import { ExplorerLinkType } from './ExplorerLinkType';
import { API_ENV } from '_app/ApiProvider';
import ExternalLink from '_components/external-link';
Expand Down Expand Up @@ -60,19 +60,19 @@ function ExplorerLink(props: ExplorerLinkProps) {
return (
address &&
notCustomRPC &&
Explorer.getAddressUrl(address, selectedApiEnv)
getAddressUrl(address, selectedApiEnv)
);
case ExplorerLinkType.object:
return (
objectID &&
notCustomRPC &&
Explorer.getObjectUrl(objectID, selectedApiEnv)
getObjectUrl(objectID, selectedApiEnv)
);
case ExplorerLinkType.transaction:
return (
transactionID &&
notCustomRPC &&
Explorer.getTransactionUrl(transactionID, selectedApiEnv)
getTransactionUrl(transactionID, selectedApiEnv)
);
}
}, [type, address, notCustomRPC, selectedApiEnv, objectID, transactionID]);
Expand Down
10 changes: 5 additions & 5 deletions doc/src/build/devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Sui Devnet network lets you experiment with Sui and provide feedback to help
The Sui Devnet network currently consists of:

* Four validator nodes operated by Mysten Labs. Clients send transactions and read requests via this endpoint: `https://fullnode.devnet.sui.io:443` using [JSON-RPC](../build/json-rpc.md).
* A public network [Sui Explorer](https://explorer.devnet.sui.io) for browsing transaction history.
* A public network [Sui Explorer](https://explorer.sui.io) for browsing transaction history.
* A [Discord channel](https://discordapp.com/channels/916379725201563759/971488439931392130) for requesting test coins that can be used to pay for gas on the test network. These coins have no financial value and will disappear each time we reset the network.

Watch for update announcements in the [#devnet-updates](https://discord.com/channels/916379725201563759/1004638487078772736) Discord channel.
Expand Down Expand Up @@ -114,8 +114,8 @@ Type: 0x2::devnet_nft::DevNetNFT

The preceding command created an object with ID `ED883F6812AF447B9B0CE220DA5EA9E0F58012FE`. Use the `Sui CLI client` to [view objects owned by the address](../build/cli-client.md#view-objects-owned-by-the-address).

Now you can view the created object in the [Sui Explorer](https://explorer.devnet.sui.io) by appending the object ID to:
https://explorer.devnet.sui.io/objects/
Now you can view the created object in the [Sui Explorer](https://explorer.sui.io) by appending the object ID to:
https://explorer.sui.io/objects/

![Example NFT](../../static/example-nft.png "Example NFT")

Expand All @@ -135,7 +135,7 @@ Type: 0x2::devnet_nft::DevNetNFT
```

You can view details about the object in Sui Explorer:
https://explorer.devnet.sui.io/objects/EC97467A40A1305FFDEF7019C3045FBC7AA31E29
https://explorer.sui.io/objects/EC97467A40A1305FFDEF7019C3045FBC7AA31E29

## Publish a Move module

Expand Down Expand Up @@ -216,7 +216,7 @@ Mutated Objects:
Go to the Sui Explorer to observe a newly created object (ID `2E34983D59E9FC5310CFBAA953D2188E6A84FD21`, in this example). You should see a sword object created with `Magic` property of `42` and `Strength` property of `7` and transferred to the new owner.
As above, replace the object ID in the Explorer link with the object ID of the created object you observed in your own command output, appended to:
https://explorer.devnet.sui.io/objects/
https://explorer.sui.io/objects/
![Magic sword](../../static/magic-sword.png "Magic sword")
Expand Down
6 changes: 3 additions & 3 deletions doc/src/build/fullnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ API](../build/json-rpc.md#sui-json-rpc-api) at:

## Sui Explorer with your Full node

[Sui Explorer](https://explorer.devnet.sui.io/) supports connections to custom RPC URLS and local networks. You can point the Explorer to your local Full node and see the
[Sui Explorer](https://explorer.sui.io/) supports connections to custom RPC URLS and local networks. You can point the Explorer to your local Full node and see the
transactions it syncs from the network. To make this change:

1. Open a browser and go to: https://explorer.devnet.sui.io/
1. Open a browser and go to: https://explorer.sui.io/
1. Click the **Devnet** button in the top right-hand corner of Sui Explorer and select
**Local** from the drop-down menu.
1. Close the **Choose a Network** menu to see the latest transactions.
1. Close the **Choose a Network** menu to see the latest transactions.

Sui Explorer now uses your local Full node to explore the state of the chain.

Expand Down
2 changes: 1 addition & 1 deletion doc/src/build/rust-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn main() -> Result<(), anyhow::Error> {
}
```

You can verify the result with the [Sui Explorer](https://explorer.devnet.sui.io/) if you are using the Sui Devnet Full node.
You can verify the result with the [Sui Explorer](https://explorer.sui.io/) if you are using the Sui Devnet Full node.

### Example 2 - Create and execute transaction

Expand Down
8 changes: 4 additions & 4 deletions doc/src/explore/panzerdogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Panzerdogs x Sui

Lucky Kat teamed up with Mysten Labs to create a demo showcasing how Sui’s performance will help lead the synergies between gaming and blockchain technologies. In particular, our goal is to highlight how Sui can be used to create a tight feedback loop between on-chain asset ownership and gameplay.

Panzerdogs, developed by Lucky Kat Studios, is an NFT gaming project where users can own their in-game assets and use them to battle against each other in tanks. Brawl Stars x Tanks x Play-To-Earn.
Panzerdogs, developed by Lucky Kat Studios, is an NFT gaming project where users can own their in-game assets and use them to battle against each other in tanks. Brawl Stars x Tanks x Play-To-Earn.

## About Lucky Kat Studios
## About Lucky Kat Studios

Lucky Kat Studios is an independent game studio located in the Hague, Netherlands. The studio’s mission is to create fun and challenging mobile games that are easily accessible for users of all age. Consisting of a young and driven team of artists, Lucky Kat is specialized in creating pixel art games that aim to make retro the present future.

Expand Down Expand Up @@ -37,12 +37,12 @@ The user can then visualize their overall NFT portfolio and choose which to Echo
![SuiEchoNFTPortfolio](/static/suipanzerdogs3.png)
*And showcases the address’s NFT portfolio*

Finally, users prove ownership to the Sui network by providing a signature confirming they indeed hold the private keys to the associated address and include the Sui address where the Sui-based NFT will be minted.
Finally, users prove ownership to the Sui network by providing a signature confirming they indeed hold the private keys to the associated address and include the Sui address where the Sui-based NFT will be minted.

![SuiEchoNFTMint](/static/suipanzerdogs4.png)
*Letting the user select an NFT, prove ownership, and SuiEcho it*

And that’s it! After following these steps, the user now owns a new Sui-based NFT that was brought into Sui through the SuiEcho white-label solution. To confirm ownership, the user can check the [Sui Explorer](https://explorer.devnet.sui.io/) and read additional information relevant to each NFT.
And that’s it! After following these steps, the user now owns a new Sui-based NFT that was brought into Sui through the SuiEcho white-label solution. To confirm ownership, the user can check the [Sui Explorer](https://explorer.sui.io/) and read additional information relevant to each NFT.

![SuiExplorer](/static/suipanzerdogs5.png)
*Sui NFTs can be viewed in the Sui Explorer*
Expand Down
20 changes: 10 additions & 10 deletions doc/src/explore/sui-explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Sui Explorer
---

[Sui Explorer](https://explorer.devnet.sui.io/) lets you view data about transactions and activity on the Sui network. In addition to viewing activity on the network, you can use the Explorer to:
[Sui Explorer](https://explorer.sui.io/) lets you view data about transactions and activity on the Sui network. In addition to viewing activity on the network, you can use the Explorer to:
* View up-to-date information about the activity and metrics on the Sui network.
* Look up, verify, and track your assets and contracts.
* Utilize fast, reliable, and transparent debugging and auditing data to help identify and resolve issues.
* Utilize fast, reliable, and transparent debugging and auditing data to help identify and resolve issues.
* Get go-to-definition support for all smart contracts, referred to as packages in Sui.
* View validators and geographic locations of currently active full nodes.

Expand All @@ -17,12 +17,12 @@ When you start Sui Explorer, it displays the transactions for the Devnet network

## Finding your transaction

You can search for the transactions using an address, object ID, or transaction ID. For example, you can search for your wallet address to confirm a transaction or view additional details about a transaction you’ve approved. See [Sui Wallet](../explore/wallet-browser.md) to learn how to create a wallet.
You can search for the transactions using an address, object ID, or transaction ID. For example, you can search for your wallet address to confirm a transaction or view additional details about a transaction you’ve approved. See [Sui Wallet](../explore/wallet-browser.md) to learn how to create a wallet.

**To search for a transaction made using the Sui Wallet**
1. Open your Sui Wallet.
1. Click the clipboard icon to copy your wallet address.
1. Open the Sui Explorer.
1. Open the Sui Explorer.
1. Select the **Coins** tab if it is not currently selected.
1. In the search field, paste your wallet address and then press **Enter**.

Expand All @@ -45,7 +45,7 @@ The **Transactions** page lists all transactions on the network. You can display
The **Transactions** table on the page includes the following columns:
* **Time** - The time at which the transaction occurred.
* **Type** - The type of transaction, one of Call, TransferSui, TransferObject, or Publish.
* **Call** - A transaction that calls a move module. For Call transactions, the table includes only the sender address.
* **Call** - A transaction that calls a move module. For Call transactions, the table includes only the sender address.
* **TransferSui** - A transaction to transfer Sui from one address to another.
* **TransferObject** - A transaction to transfer an object to a different address.
* **Publish** - A transaction to publish a package.
Expand Down Expand Up @@ -76,7 +76,7 @@ The transaction details pages include the following tabs:
* **Signatures** - Lists the signatures from validators for the transaction.

The **Details** tab includes the following fields:
* **Package Details** - Displayed only for Call transactions.
* **Package Details** - Displayed only for Call transactions.
* **Package ID** - The ID of the package associated with the Call transaction.
* **Module** - The module used for the transaction.
* **Function** - The function called for the transaction.
Expand All @@ -87,9 +87,9 @@ The **Details** tab includes the following fields:
* **Sender** - The address of the sender of the transaction. Displayed only for Publish transactions.
* **Sender & Recipients** - The addresses associated with the transaction. The first value is the sender's address, and the address next to the green checkmark is the recipient's address. When there are multiple recipients, the field includes multiple addresses.
* **Modules** - Shows the module code used to create and execute the transaction.
* **Gas and storage fees** - Details about the gas and fees for the transaction.
* **Gas and storage fees** - Details about the gas and fees for the transaction.
The value for **Gas Payment** is the object ID for the coin object used for the transaction.
* **Gas Fees** - The number of gas units used for the transaction.
* **Gas Fees** - The number of gas units used for the transaction.
* **Gas Budget** - The maximum number of gas units allowed for the transaction.

The **Events** tab lists the events the transaction generated and the details about each event. TransferSui transactions do not include events.
Expand All @@ -106,9 +106,9 @@ The page includes the following details:

* **Description**
* **Type** - The type of the object, such as coin.
* **Object ID** - The ID of the object.
* **Object ID** - The ID of the object.
* **Last Transaction ID** - The ID of the most recent transaction associated with the object.
* **Version** - The version of the object.
* **Version** - The version of the object.
* **Owner** - The address of the owner of the object.
* **Properties** - Details such as the coin balance for the object.
* **Child Objects** - The objects that this object owns.
Expand Down
Loading

0 comments on commit 0998a3d

Please sign in to comment.