Skip to content

fix: Update link format and broken links #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
55 changes: 55 additions & 0 deletions .github/scripts/checkLinksFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const fs = require('fs')
const path = require('path')

const rootDir = ['./pages', './components', './examples']
const allowedExtensions = ['.md', '.mdx']

// If links are not pointing to an external resource (http/https...) they MUST have a file extension to avoid problems in the future
const markdownLinkRegex = /\[.+?\]\(([^)]+)\)/g
const ignorePatterns = [
/^\/$/,
/^#/,
/^http/,
/^mailto:/,
/\.png/,
/\.json/,
/\.md/,
/\.mdx/,
/\.gif/,
]

let hasIssues = false

function checkDir(dir: string) {
const entries = fs.readdirSync(dir, { withFileTypes: true })

for (const entry of entries) {
const fullPath = path.join(dir, entry.name)
if (entry.isDirectory()) {
checkDir(fullPath)
} else if (entry.isFile() && allowedExtensions.includes(path.extname(entry.name))) {
checkFile(fullPath)
}
}
}

function checkFile(filePath: string) {
const content = fs.readFileSync(filePath, 'utf8')
const matches = [...content.matchAll(markdownLinkRegex)]
matches.forEach(match => {
const link = match[1]
const isIgnored = ignorePatterns.some(pattern => pattern.test(link))
if (!isIgnored) {
console.log(`${filePath}: ${match[0]}`)
hasIssues = true
}
})
}

rootDir.map(dir => checkDir(dir))

if (hasIssues) {
process.exit(1)
} else {
console.log('All links formatted correctly')
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"generate-supported-networks": "pnpm ts-node --project tsconfig.json .github/scripts/generateSupportedNetworks.ts",
"get-resources-og": "node .github/scripts/getResourcesOg.js",
"validate-resources": "node .github/scripts/validateResources.js",
"linkcheck": "find ./pages -name '*.md*' -print0 | xargs -0 -n1 pnpm markdown-link-check --quiet --progress --config linkchecker-config.json",
"linkcheck": "pnpm ts-node --project tsconfig.json .github/scripts/checkLinksFormat.ts && find ./pages -name '*.md*' -print0 | xargs -0 -n1 pnpm markdown-link-check --progress --config linkchecker-config.json",
"lint": "eslint . && vale pages/ --minAlertLevel=error",
"start": "serve out",
"test": "env-cmd cypress run --headless",
Expand Down
2 changes: 1 addition & 1 deletion pages/advanced/passkeys/passkeys-safe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These contracts can utilize EIP-7212 precompiles for signature verification on s
## Passkey contracts

<Callout type="info" emoji="ℹ️">
This section covers implementation details of the passkeys with Safe. If you'd rather get straight to building, head over to our [guides](./passkeys-guides/safe-sdk) and [tutorials](./passkeys-tutorials/safe-passkeys-tutorial) sections.
This section covers implementation details of the passkeys with Safe. If you'd rather get straight to building, head over to our [guide](../../sdk/signers/passkeys.mdx) and [tutorials](./tutorials/react.mdx) sections.
</Callout>

### `SafeWebAuthnSignerProxy`
Expand Down
4 changes: 2 additions & 2 deletions pages/advanced/passkeys/tutorials/react-native.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Callout } from 'nextra/components'
import { Bleed, Tabs } from 'nextra-theme-docs'
import { Callout } from 'nextra/components'

# How to build a React Native app with Safe and passkeys

Expand Down Expand Up @@ -244,7 +244,7 @@ Delete the `/ios` and `/android` folders and restart the app (`npx expo run:ios`

We learned how to use passkeys (create them, store them, and use them securely) and how they can interact with a Safe (deploy it and send transactions). We hope you enjoyed this tutorial and that the combination of passkeys and the ERC-4337 will unlock new forms of ownership for your project and users.

You can now integrate passkeys with more transactions and functionalities of the Safe ecosystem. You can read more about passkeys in our [overview](/advanced/passkeys/overview) or in the [WebAuthn API documentation](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API).
You can now integrate passkeys with more transactions and functionalities of the Safe ecosystem. You can read more about passkeys in the [overview](../overview.mdx) page or in the [WebAuthn API documentation](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API).

Did you encounter any difficulties? Let us know by opening [an issue](https://github.com/5afe/react-native-passkeys-tutorial/issues/new) or asking a question on [Stack Exchange](https://ethereum.stackexchange.com/questions/tagged/safe-core) with the `safe-core` tag.

Expand Down
14 changes: 7 additions & 7 deletions pages/advanced/smart-account-concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

#### Owners

Each Safe account maintains its own list of [owners](/home/glossary#owner) in the storage in the form of Ethereum addresses. Owners can be added or removed by other owners.
Each Safe account maintains its own list of [owners](../home/glossary.md#owner) in the storage in the form of Ethereum addresses. Owners can be added or removed by other owners.

#### Threshold

Safe Smart Account maintains a [threshold](/home/glossary#threshold), the minimum number of owners required to confirm a transaction before it gets executed. The threshold of owners required to confirm a transaction is also stored in the storage. Owners of a Safe account can change the threshold value as well. A Safe account can have any number of owners, and the threshold value can be set between one and the total number of owners.
Safe Smart Account maintains a [threshold](../home/glossary.md#threshold), the minimum number of owners required to confirm a transaction before it gets executed. The threshold of owners required to confirm a transaction is also stored in the storage. Owners of a Safe account can change the threshold value as well. A Safe account can have any number of owners, and the threshold value can be set between one and the total number of owners.

#### Signature verification

Safe Smart Account, being a contract account, does not have a private key to sign transactions, and EVM cannot verify incoming transactions to a contract account. Hence, a contract account has to do the authentication and authorization in its code. When a transaction is submitted to a Safe account, it is first verified by the Safe account to ensure that the transaction is valid. If the required number of owners has signed the transaction, the transaction is allowed to be executed. If the required number of owners has not signed the transaction, the transaction reverts to the signature validation step.
A Safe Smart Account verifies if each signer is an owner of the Safe account and verifies the signature based on the signature type. To learn more about the signature types supported by Safe and encoding, refer to the [Signatures](/smart-account-signatures) page.
A Safe Smart Account verifies if each signer is an owner of the Safe account and verifies the signature based on the signature type. To learn more about the signature types supported by Safe and encoding, refer to the [Signatures](../advanced/smart-account-signatures.md) page.

#### Transaction flow

Expand Down Expand Up @@ -47,15 +47,15 @@ Here are some core components of a Safe Smart Account that you will learn about:

#### Safe Modules

[Safe Modules](/home/glossary#safe-module) are smart contracts that extend Safe's functionality with added custom features while the module logic remains separate from Safe's core contracts.
[Safe Modules](../home/glossary.md#safe-module) are smart contracts that extend Safe's functionality with added custom features while the module logic remains separate from Safe's core contracts.

More information is available in the [Safe Modules ](smart-account-modules.mdx) page.
More information is available in the [Safe Modules](./smart-account-modules.mdx) page.

#### Safe Guards

[Safe Guards](/home/glossary#safe-guard) make checks before and after a Safe transaction.
[Safe Guards](../home/glossary.md#safe-guard) make checks before and after a Safe transaction.

More information is available in the [Safe Guards](smart-account-guards.mdx) page.
More information is available in the [Safe Guards](./smart-account-guards.mdx) page.

#### Signatures

Expand Down
2 changes: 1 addition & 1 deletion pages/advanced/smart-account-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ A great way to understand how Safe Modules work is by creating one. An excellent

## Reference

- [Safe Module Reference](/reference-smart-account/modules/enableModule)
- [Safe Module Reference](../reference-smart-account/modules/enableModule.mdx)
4 changes: 2 additions & 2 deletions pages/advanced/smart-account-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import SafeSmartAccount from '../../assets/svg/ic-smart-account.svg'

## EOAs

[EOAs](/home/glossary#externally-owned-account), for short, are Ethereum accounts that use traditional key pairs. That is, they consist of a single private key that can be used to make transactions and sign messages. If you gain access to that private key, you gain complete control of the account. This means that your private key is a single point of failure between you and your funds being lost.
[EOAs](../home/glossary.md#externally-owned-account), for short, are Ethereum accounts that use traditional key pairs. That is, they consist of a single private key that can be used to make transactions and sign messages. If you gain access to that private key, you gain complete control of the account. This means that your private key is a single point of failure between you and your funds being lost.

## Smart Accounts

The other type of Ethereum account is a [Smart Account](/home/glossary#smart-account), also sometimes called Smart Contract Account. Like EOAs, smart contract accounts each have a unique public Ethereum address, and it is impossible to tell them apart from EOAs by looking at an Ethereum address. Smart contract accounts, too, can receive funds and make transactions like EOAs but cannot initiate them. Generally, the key difference is that no single private key is used to verify transactions. Instead, the smart contract code defines the logic behind how the account completes transactions. Smart contracts are programs that run on the Ethereum blockchain and execute when specific conditions are met. Their functionality within contract accounts means that such accounts, in contrast to EOAs, can, for example, implement access rights that specify by whom, how, and under which conditions transactions can be executed, as well as more complex logic.
The other type of Ethereum account is a [Smart Account](../home/glossary.md#smart-account), also sometimes called Smart Contract Account. Like EOAs, smart contract accounts each have a unique public Ethereum address, and it is impossible to tell them apart from EOAs by looking at an Ethereum address. Smart contract accounts, too, can receive funds and make transactions like EOAs but cannot initiate them. Generally, the key difference is that no single private key is used to verify transactions. Instead, the smart contract code defines the logic behind how the account completes transactions. Smart contracts are programs that run on the Ethereum blockchain and execute when specific conditions are met. Their functionality within contract accounts means that such accounts, in contrast to EOAs, can, for example, implement access rights that specify by whom, how, and under which conditions transactions can be executed, as well as more complex logic.

# Difference between EOAs and Contract Accounts

Expand Down
2 changes: 1 addition & 1 deletion pages/config-service-configuration/add-or-edit-chain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The chain's native currency logo to upload. This will be displayed in the UI.

### `Transaction service uri`

The URI of the chain's [Transaction Service](/core-api/api-safe-transaction-service). This will be used to fetch transaction data from the chain. You will need to deploy one Transaction Service per chain, as well as `txs-db`, `amqp` and `celery` instances.
The URI of the chain's [Transaction Service](../core-api/api-safe-transaction-service.mdx). This will be used to fetch transaction data from the chain. You will need to deploy one Transaction Service per chain, as well as `txs-db`, `amqp` and `celery` instances.

### `Vpc transaction service uri`

Expand Down
4 changes: 2 additions & 2 deletions pages/config-service-configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ This document describes how to configure the Config Service through the Django a

The Config Service is a Django application that allows you to manage configurations for your clients. It provides a web interface where you can create, update, and delete configurations, as well as manage groups of permissions to control who can access the configurations.

It assumes you have already set up your [Safe instance](https://github.com/safe-global/safe-infrastructure). If you haven't, please refer to the [Safe Infrastructure Deployment](/core-api/safe-infrastructure-deployment) guide.
It assumes you have already set up your [Safe Infrastructure](https://github.com/safe-global/safe-infrastructure) instance. If you haven't, please refer to the [Safe\{Core\} Infrastructure Deployment](../core-api/safe-infrastructure-deployment.mdx) guide.

The following document concerns only the Safe Config Service. For other services of Safe infrastructure, please refer to the [Safe API documentation](/core-api).
The following document concerns only the Safe Config Service. For other services of Safe\{Core\} Infrastructure, please refer to the [Safe\{Core\} Infrastructure](../core-api/api-overview.mdx) documentation.
4 changes: 2 additions & 2 deletions pages/core-api/transaction-service-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Cards, Card } from 'nextra/components'
import { Card, Cards } from 'nextra/components'
import Guides from '../../assets/svg/guides.svg'
import Reference from '../../assets/svg/reference.svg'

# Safe Transaction Service API

The Safe Transaction Service offers a REST API to track transactions sent via the Safe Smart Account. It also provides endpoints to send transactions, allow off-chain collecting of signatures, or informing the owners about a pending transaction to be sent to the blockchain.

Additionally, the Safe\{Core\} SDK provides the [API Kit](../sdk/api-kit), a TypeScript client for the Safe Transaction Service API.
Additionally, the Safe\{Core\} SDK provides the [API Kit](../sdk/api-kit.mdx), a TypeScript client for the Safe Transaction Service API.

<Cards>
<Card icon={<Guides />} title="Guides" href="./transaction-service-guides/transactions" />
Expand Down
2 changes: 1 addition & 1 deletion pages/home/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ See also:
Gasless transactions (also known as meta-transactions) are Ethereum transactions that are executed by a third party called [relayer](#relayer) on behalf of a [smart account](#smart-account) to abstract the use of gas. Users must sign a message (instead of the transaction itself) with information about the transaction they want to execute. A relayer will create the Ethereum transaction, sign and execute it, and pay for the gas costs. The main benefit is that users can interact with the blockchain without holding the native token in their account.

See also:
- [Relay Kit documentation](../sdk/relay-kit) on docs.safe.global
- [Relay Kit documentation](../sdk/relay-kit.mdx) on docs.safe.global

## Multi-signature

Expand Down
2 changes: 1 addition & 1 deletion pages/reference-sdk-react-hooks/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Safe React Hooks Reference

[Safe React Hooks](../sdk/react-hooks) is a collection of React hooks written in TypeScript that simplify the usage of the Safe\{Core\} SDK for React developers.
[Safe React Hooks](../sdk/react-hooks.mdx) is a collection of React hooks written in TypeScript that simplify the usage of the Safe\{Core\} SDK for React developers.

## Install dependencies

Expand Down
2 changes: 1 addition & 1 deletion pages/reference-sdk-starter-kit/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Starter Kit Reference

The [Starter Kit](../sdk/starter-kit) is the starting point for integrating the Safe account in the front-end, as it provides the most simplified way to handle the Safe transaction flow in its different forms:
The [Starter Kit](../sdk/starter-kit.mdx) is the starting point for integrating the Safe account in the front-end, as it provides the most simplified way to handle the Safe transaction flow in its different forms:

- User operations
- Multi-signature transactions
Expand Down
6 changes: 3 additions & 3 deletions pages/reference-sdk-starter-kit/safe-client/extend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Extends the functionality of the `SafeClient` class.

The Starter Kit offers some extensions that allow this, but you can also implement your own.

- [`onChainMessages`](../onchain-messages): Enables the use of on-chain messages.
- [`offChainMessages`](../offchain-messages): Enables the use of off-chain messages.
- [`safeOperations`](../safe-operations): Enables using a bundler and paymaster to submit ERC-4337 user operations.
- [`onChainMessages`](../onchain-messages/sendonchainmessage.mdx): Enables the use of on-chain messages.
- [`offChainMessages`](../offchain-messages/sendoffchainmessage.mdx): Enables the use of off-chain messages.
- [`safeOperations`](../safe-operations/sendsafeoperation.mdx): Enables using a bundler and paymaster to submit ERC-4337 user operations.

## Usage

Expand Down
8 changes: 4 additions & 4 deletions pages/sdk/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Callout } from 'nextra/components'
import { Grid } from '@mui/material'
import CustomCard from '../../components/CustomCard'
import { Callout } from 'nextra/components'
import SafeCoreAPI from '../../assets/svg/ic-api.svg'
import SafeCoreSDK from '../../assets/svg/ic-sdk.svg'
import SafeSmartAccount from '../../assets/svg/ic-smart-account.svg'
import SafeCoreAPI from '../../assets/svg/ic-api.svg'
import CustomCard from '../../components/CustomCard'

# Safe\{Core\} SDK

Expand All @@ -13,7 +13,7 @@ The Safe\{Core\} SDK groups its functionality into four different kits:

## Starter Kit

The [Starter Kit](../sdk/starter-kit) is the starting point for interacting with the Safe smart account. It leverages and abstracts the complex logic from other kits while being modular and customizable, offering the most simplified way to deploy new accounts and handle the Safe transaction flow in all its different forms:
The [Starter Kit](../sdk/starter-kit.mdx) is the starting point for interacting with the Safe smart account. It leverages and abstracts the complex logic from other kits while being modular and customizable, offering the most simplified way to deploy new accounts and handle the Safe transaction flow in all its different forms:

- User operations
- Multi-signature transactions
Expand Down
20 changes: 10 additions & 10 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -694,16 +694,6 @@
"destination": "/advanced/api-supported-networks",
"permanent": true
},
{
"source": "/api-supported-networks",
"destination": "/core-api/transaction-service-supported-networks",
"permanent": true
},
{
"source": "/advanced/api-supported-networks",
"destination": "/core-api/transaction-service-supported-networks",
"permanent": true
},
{
"source": "/advanced/api-new-networks",
"destination": "/core-api/safe-installation-overview",
Expand Down Expand Up @@ -819,6 +809,16 @@
"destination": "https://github.com/5afe/safe-core-protocol",
"permanent": true
},
{
"source": "/api-supported-networks",
"destination": "/advanced/smart-account-supported-networks?service=Transaction+Service",
"permanent": true
},
{
"source": "/advanced/api-supported-networks",
"destination": "/advanced/smart-account-supported-networks?service=Transaction+Service",
"permanent": true
},
{
"source": "/core-api/transaction-service-supported-networks",
"destination": "/advanced/smart-account-supported-networks?service=Transaction+Service",
Expand Down