Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/CCIP/Chain/Chain.astro
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const chainStructuredData = generateChainStructuredData(
<div class="ccip-heading">
<h2>Tokens <span>({allTokens.length})</span></h2>
{
network.chainType !== "solana" && (
network.chainType !== "solana" && network.chainType !== "aptos" && (
<a class="button secondary" href="/ccip/tutorials/evm/token-manager#verifying-your-token">
<img
src="/assets/icons/plus.svg"
Expand Down
86 changes: 80 additions & 6 deletions src/components/CCIP/ChainHero/ChainHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
})
const explorer = network.explorer || {}
const address = token[network.chain]?.tokenAddress
const contractUrl = address ? getExplorerAddressUrl(explorer)(address) : ""
const contractUrl = address ? getExplorerAddressUrl(explorer, network.chainType)(address) : ""

return {
logo,
Expand Down Expand Up @@ -152,7 +152,15 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">Router</div>
<div className="ccip-chain-hero__details__value" data-clipboard-type="router">
<Address endLength={4} contractUrl={network.routerExplorerUrl} address={network.router?.address} />
<Address
endLength={4}
contractUrl={
network.router?.address
? getExplorerAddressUrl(network.explorer, network.chainType)(network.router.address)
: ""
}
address={network.router?.address}
/>
</div>
</div>
<div className="ccip-chain-hero__details__item">
Expand Down Expand Up @@ -195,7 +203,7 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
{network.armProxy ? (
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network.explorer)(network.armProxy.address)}
contractUrl={getExplorerAddressUrl(network.explorer, network.chainType)(network.armProxy.address)}
address={network.armProxy.address}
/>
) : (
Expand Down Expand Up @@ -249,7 +257,10 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
{network.tokenAdminRegistry ? (
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network.explorer)(network.tokenAdminRegistry)}
contractUrl={getExplorerAddressUrl(
network.explorer,
network.chainType
)(network.tokenAdminRegistry)}
address={network.tokenAdminRegistry}
/>
) : (
Expand Down Expand Up @@ -277,7 +288,7 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
{network.registryModule ? (
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network.explorer)(network.registryModule)}
contractUrl={getExplorerAddressUrl(network.explorer, network.chainType)(network.registryModule)}
address={network.registryModule}
/>
) : (
Expand All @@ -288,6 +299,69 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
</>
)}

{network.chainType === "aptos" && (
<>
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">
Token admin registry
<Tooltip
label=""
tip="The TokenAdminRegistry module is responsible for managing the configuration of token pools for all cross chain tokens."
labelStyle={{
marginRight: "8px",
}}
style={{
display: "inline-block",
verticalAlign: "middle",
marginBottom: "2px",
}}
/>
</div>
<div className="ccip-chain-hero__details__value" data-clipboard-type="token-registry">
{network.tokenAdminRegistry ? (
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(
network.explorer,
network.chainType
)(network.tokenAdminRegistry)}
address={network.tokenAdminRegistry}
/>
) : (
"n/a"
)}
</div>
</div>

{network.mcms && (
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">
MCMS
<Tooltip
label=""
tip="The MCMS address must be added as a dependency in your Move.toml file when building modules that interact with CCIP on Aptos chains."
labelStyle={{
marginRight: "8px",
}}
style={{
display: "inline-block",
verticalAlign: "middle",
marginBottom: "2px",
}}
/>
</div>
<div className="ccip-chain-hero__details__value" data-clipboard-type="mcms">
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network.explorer, network.chainType)(network.mcms)}
address={network.mcms}
/>
</div>
</div>
)}
</>
)}

{network.chainType === "solana" && (
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">
Expand All @@ -309,7 +383,7 @@ function ChainHero({ chains, tokens, network, token, environment, lanes }: Chain
{network.feeQuoter ? (
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network.explorer)(network.feeQuoter)}
contractUrl={getExplorerAddressUrl(network.explorer, network.chainType)(network.feeQuoter)}
address={network.feeQuoter}
/>
) : (
Expand Down
12 changes: 10 additions & 2 deletions src/components/CCIP/ChainHero/LaneDetailsHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,23 @@ function LaneDetailsHero({
{/* Display address information based on lane type */}
{inOutbound === LaneFilter.Inbound ? (
<DetailItem label="OffRamp address" clipboardType="offramp">
<AddressComponent address={offRamp} endLength={6} contractUrl={getExplorerAddressUrl(explorer)(offRamp)} />
<AddressComponent
address={offRamp}
endLength={6}
contractUrl={getExplorerAddressUrl(explorer, destinationNetwork.chainType)(offRamp)}
/>
</DetailItem>
) : (
<DetailItem
label="OnRamp address"
clipboardType="onramp"
tooltip={sourceNetwork.chainType === "solana" ? <StyledTooltip tip="Same as Router." /> : undefined}
>
<AddressComponent address={onRamp} endLength={6} contractUrl={getExplorerAddressUrl(explorer)(onRamp)} />
<AddressComponent
address={onRamp}
endLength={6}
contractUrl={getExplorerAddressUrl(explorer, sourceNetwork.chainType)(onRamp)}
/>
</DetailItem>
)}

Expand Down
7 changes: 4 additions & 3 deletions src/components/CCIP/ChainHero/TokenDetailsHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { getExplorerAddressUrl, fallbackTokenIconUrl } from "~/features/utils/in
import { PoolType } from "~/config/data/ccip/types.ts"
import { tokenPoolDisplay } from "~/config/data/ccip/utils.ts"
import "./ChainHero.css"
import { ExplorerInfo } from "~/config/types.ts"
import { ExplorerInfo, ChainType } from "~/config/types.ts"

interface TokenDetailsHeroProps {
network: {
name: string
logo: string
explorer: ExplorerInfo
chainType?: ChainType
}
token: {
id: string
Expand Down Expand Up @@ -59,7 +60,7 @@ function TokenDetailsHero({ network, token }: TokenDetailsHeroProps) {
<div className="ccip-chain-hero__details__value" data-clipboard-type="token">
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network?.explorer)(token.address)}
contractUrl={getExplorerAddressUrl(network?.explorer, network?.chainType)(token.address)}
address={token.address}
/>
</div>
Expand All @@ -73,7 +74,7 @@ function TokenDetailsHero({ network, token }: TokenDetailsHeroProps) {
<div className="ccip-chain-hero__details__value" data-clipboard-type="token-pool">
<Address
endLength={4}
contractUrl={getExplorerAddressUrl(network?.explorer)(token.poolAddress)}
contractUrl={getExplorerAddressUrl(network?.explorer, network?.chainType)(token.poolAddress)}
address={token.poolAddress}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/CCIP/Drawer/TokenDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function TokenDrawer({
name: network.name,
logo: network.logo,
explorer: network.explorer,
chainType: network.chainType,
}}
/>
<div className="ccip-table__drawer-container">
Expand Down
6 changes: 5 additions & 1 deletion src/components/CCIP/Tables/ChainTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface TableProps {
}
key: string
directory: SupportedChain
chainType?: ChainType
}[]
explorer: ExplorerInfo
}
Expand Down Expand Up @@ -156,7 +157,10 @@ function ChainTable({ lanes, explorer, sourceNetwork, environment }: TableProps)
<Address
address={inOutbound === LaneFilter.Outbound ? network.onRamp?.address : network.offRamp?.address}
endLength={4}
contractUrl={getExplorerAddressUrl(explorer)(
contractUrl={getExplorerAddressUrl(
explorer,
inOutbound === LaneFilter.Outbound ? sourceNetwork.chainType : network.chainType
)(
(inOutbound === LaneFilter.Outbound ? network.onRamp?.address : network.offRamp?.address) || ""
)}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/VersionSelector/base/VersionSelector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const { product, currentPath, enableEnhanced = true } = Astro.props

// Support multiple path patterns for version detection
const standardPathMatch = currentPath.match(new RegExp(`/${product}/api-reference/(v[^/]+)`))
const extendedPathMatch = currentPath.match(new RegExp(`/${product}/api-reference/(?:evm|svm)/(v[^/]+)`))
const extendedPathMatch = currentPath.match(new RegExp(`/${product}/api-reference/(?:evm|svm|aptos)/(v[^/]+)`))
let pathVersion = extendedPathMatch?.[1] || standardPathMatch?.[1]

// Extract VM type from the path (for CCIP)
let vmType: string | undefined = undefined
if (extendedPathMatch) {
const vmTypeMatch = currentPath.match(new RegExp(`/${product}/api-reference/(evm|svm)/`))
const vmTypeMatch = currentPath.match(new RegExp(`/${product}/api-reference/(evm|svm|aptos)/`))
vmType = vmTypeMatch?.[1]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const VersionSelectorClient = <T extends string>({
// 2. Extended: /{product}/api-reference/{vm_type}/v{version}/{page}
const standardPathMatch = currentPath.match(new RegExp(`/${config.product.name}/api-reference/v[^/]+/(.+?)/?$`))
const extendedPathMatch = currentPath.match(
new RegExp(`/${config.product.name}/api-reference/(?:evm|svm)/v[^/]+/(.+?)/?$`)
new RegExp(`/${config.product.name}/api-reference/(?:evm|svm|aptos)/v[^/]+/(.+?)/?$`)
)

const pagePath = extendedPathMatch?.[1] || standardPathMatch?.[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const {
// Extract page path to check availability
// Support both path patterns
const standardPageMatch = currentPath.match(new RegExp(`/${product}/api-reference/v[^/]+/(.+?)/?$`))
const extendedPageMatch = currentPath.match(new RegExp(`/${product}/api-reference/(?:evm|svm)/v[^/]+/(.+?)/?$`))
const extendedPageMatch = currentPath.match(new RegExp(`/${product}/api-reference/(?:evm|svm|aptos)/v[^/]+/(.+?)/?$`))
const pagePath = extendedPageMatch?.[1] || standardPageMatch?.[1] || null
const productAvailability = PAGE_AVAILABILITY[product]

Expand Down
1 change: 1 addition & 0 deletions src/config/data/ccip/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ export const getAllNetworks = ({ filter }: { filter: Environment }): Network[] =
armProxy: chains[chain].armProxy,
feeQuoter: chainType === "solana" ? chains[chain]?.feeQuoter : undefined,
rmnPermeable: chains[chain]?.rmnPermeable,
mcms: chainType === "aptos" ? chains[chain]?.mcms?.address : undefined,
})
}

Expand Down
4 changes: 4 additions & 0 deletions src/config/data/ccip/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export type ChainConfig = {
symbol: string
logo: string
}
mcms?: {
address: string
}
}

export type ChainsConfig = {
Expand Down Expand Up @@ -194,6 +197,7 @@ export interface Network {
routerExplorerUrl: string
feeQuoter?: string
rmnPermeable: boolean
mcms?: string
}

export type DecomConfig = {
Expand Down
20 changes: 20 additions & 0 deletions src/config/data/ccip/v1_2_0/mainnet/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@
"version": "1.5.0"
}
},
"aptos-mainnet": {
"armProxy": {
"address": "0x20f808de3375db34d17cc946ec6b43fc26962f6afa125182dc903359756caf6b",
"version": "RMNRemote 1.6.0"
},
"chainSelector": "4741433654826277614",
"feeTokens": ["APT", "LINK"],
"mcms": {
"address": "0x2d3254b5c860a75d8d5095d44388ae8e9c23a234a85abfcff6264d298fbef6cc"
},
"rmnPermeable": false,
"router": {
"address": "0x20f808de3375db34d17cc946ec6b43fc26962f6afa125182dc903359756caf6b",
"version": "Router 1.6.0"
},
"tokenAdminRegistry": {
"address": "0x20f808de3375db34d17cc946ec6b43fc26962f6afa125182dc903359756caf6b",
"version": "TokenAdminRegistry 1.6.0"
}
},
"avalanche-mainnet": {
"armProxy": {
"address": "0xcBD48A8eB077381c3c4Eb36b402d7283aB2b11Bc",
Expand Down
Loading
Loading