Skip to content
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
16 changes: 3 additions & 13 deletions src/pages/arcade/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,12 @@ First, configure your game's Torii instances to index the asset, and then config
#### Configure your Torii

Every digital asset on the Marketplace must be indexed by Torii.
The [Arcade Setup](./setup#torii-configuration) page provides detailed information about configuring Torii for various use cases including marketplace assets.
The [Arcade Setup](./setup) page provides detailed information about configuring Torii for asset indexing.

For basic marketplace asset indexing, add the token address to the configuration file:

```toml
# torii.toml

[indexing]
contracts = [
"erc20:<contract-address>",
"erc721:<contract-address>"
]
```
For marketplace-specific configuration, ensure your Torii instance includes the token addresses for any assets you want to display.

:::info
See the [Torii docs](https://book.dojoengine.org/toolchain/torii/configuration#indexing-configuration) for more information about indexing token contracts.
See the [Arcade Setup](./setup#torii-configuration) page for complete Torii configuration instructions including marketplace assets.
:::

#### Add Torii to Controller
Expand Down
6 changes: 3 additions & 3 deletions src/pages/arcade/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ As the game owner, you control which editions are visible or hidden.
As the edition owner, you can choose to publish or hide your edition from public view.

:::info
No permission is required to register an edition in an existin game, meaning anyone can register a new edition to your game such as registering a Game onto Arcade, however you get the control on their visibility.
No permission is required to register an edition in an existing game, meaning anyone can register a new edition to your game such as registering a Game onto Arcade, however you get the control on their visibility.
:::

![Update Edition](/arcade-update-edition.png)

### 🚀 Publish and whitelist an Edition

As the edition owner you have the ability to publish your edition once created.
Once published, the game owner has the ability to whitelist you Edition to make it public.
Once published, the game owner has the ability to whitelist your edition to make it public.

:::info
Any update within the Edition will turn off both the publish and the whitelist, the process should be repeat to make it public again
Any update within the edition will turn off both the publish and the whitelist, the process should be repeat to make it public again
:::

![Publish Edition](/arcade-publish-edition.png)
2 changes: 1 addition & 1 deletion src/pages/arcade/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Learn how to register, configure, and index your game with Arcade,

## Torii Configuration

To provide a rich user experience in Arcade, we recommend enhancing your Torii configuration to enable live activity feeds, asset indexing, and leaderboards. This configuration also supports marketplace functionality for asset display.
To provide a rich user experience in Arcade, we recommend enhancing your Torii configuration to enable live activity feeds, asset indexing, and leaderboards. This configuration also supports [marketplace functionality](/arcade/marketplace) for asset display.

### ⚡️ Activity Feed

Expand Down
26 changes: 13 additions & 13 deletions src/pages/arcade/starter-packs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ description: Create and register starter packs on the Arcade registry to distrib
# Starter Packs

Starter packs let you bundle game assets and distribute them to players through a purchase flow integrated with [Cartridge Controller](/controller/starter-packs).
The Arcade starter pack registry is a permissionless onchain system anyone can register a starter pack by deploying an implementation contract and calling `register`.
The Arcade starter pack registry is a permissionless onchain system --- anyone can register a starter pack by deploying an implementation contract and calling `register`.

## How It Works

The registry follows a two-contract pattern:

1. **Implementation contract** a contract you deploy that implements the `IStarterpackImplementation` interface.
1. **Implementation contract** --- a contract you deploy that implements the `IStarterpackImplementation` interface.
When a player purchases your starter pack, the registry calls your contract's `on_issue` function to distribute assets.
2. **Registry contract** the Arcade registry where you register your implementation, set pricing, and configure options.
2. **Registry contract** --- the Arcade registry where you register your implementation, set pricing, and configure options.

```
Player purchases → Registry collects payment → Registry calls on_issue → Your contract distributes assets
Expand Down Expand Up @@ -100,8 +100,8 @@ The returned ID is what players use to purchase the starter pack via [`controlle

Controls whether the same player can purchase the starter pack more than once.

- `false` each player can only purchase once, and `quantity` is forced to 1
- `true` players can purchase multiple times with any quantity
- `false` --- each player can only purchase once, and `quantity` is forced to 1
- `true` --- players can purchase multiple times with any quantity

### `referral_percentage`

Expand All @@ -113,7 +113,7 @@ Self-referrals (referrer == payer) are ignored.

Where the base price (minus any referral fee) is sent.
If `None`, payment goes to the starter pack owner (the address that called `register`).
If `Some(address)`, payment goes to that address instead useful for treasury contracts or revenue sharing.
If `Some(address)`, payment goes to that address instead --- useful for treasury contracts or revenue sharing.

### `conditional`

Expand Down Expand Up @@ -146,17 +146,17 @@ let metadata = MetadataTrait::new(

After registration, the owner can manage the starter pack:

- **`update`** change implementation, pricing, referral percentage, or other parameters
- **`update_metadata`** update the display metadata
- **`pause`** / **`resume`** temporarily disable or re-enable purchases
- **`update`** --- change implementation, pricing, referral percentage, or other parameters
- **`update_metadata`** --- update the display metadata
- **`pause`** / **`resume`** --- temporarily disable or re-enable purchases

## Payment Flow

When a player purchases a starter pack, the registry handles payment distribution:

1. **Referral fee** if a referrer is provided, their percentage is deducted from the base price and sent to them
2. **Protocol fee** a fee is added on top of the base price and sent to the Arcade fee receiver
3. **Owner payment** the remaining base price (after referral fee) is sent to the `payment_receiver` or owner
4. **Asset distribution** the registry calls `on_issue` on the implementation contract
1. **Referral fee** --- if a referrer is provided, their percentage is deducted from the base price and sent to them
2. **Protocol fee** --- a fee is added on top of the base price and sent to the Arcade fee receiver
3. **Owner payment** --- the remaining base price (after referral fee) is sent to the `payment_receiver` or owner
4. **Asset distribution** --- the registry calls `on_issue` on the implementation contract

If `price` is zero, all payment steps are skipped and `on_issue` is called directly.
2 changes: 1 addition & 1 deletion src/pages/controller/achievements.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ AchievableComponent.progress(

### Controller Configuration

For policy configuration details, see [Sessions](./sessions).
For session policies configuration details, see [Sessions](./sessions).

```typescript
new ControllerConnector({
Expand Down
3 changes: 2 additions & 1 deletion src/pages/controller/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Technical overview of the Controller smart contract architecture, s
# Architecture

This page provides a technical overview of the Controller smart contract for developers who need to understand the on-chain mechanisms.
For user-facing documentation, see [Sessions](/controller/sessions) and [Signer Management](/controller/signer-management).
For user-facing documentation, see [Sessions](./sessions) and [Signer Management](./signer-management).

## Account Model

Expand Down Expand Up @@ -55,6 +55,7 @@ When a signer is added, a `SignerLinked` event is emitted with the GUID and full
## Sessions (On-Chain)

Sessions allow dapps to submit transactions on behalf of users without per-transaction approval.
For detailed session configuration examples, see [Sessions](./sessions).

### Session Structure

Expand Down
4 changes: 2 additions & 2 deletions src/pages/controller/booster-packs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Booster Packs
# Booster Packs

Booster packs are a reward distribution system that allows eligible users to claim various game assets, credits, and exclusive game passes.
Unlike starter packs which are purchased, booster packs are claimed for free by users who meet specific eligibility criteria, often based on holding certain NFTs or participating in events.
Unlike [starter packs](./starter-packs) which are purchased, booster packs are claimed for free by users who meet specific eligibility criteria, often based on holding certain NFTs or participating in events.

## Overview

Expand Down Expand Up @@ -169,7 +169,7 @@ Asset eligibility is typically determined by:

## Differences from Starter Packs

While both use Merkle Drop technology, booster packs differ from starter packs in key ways:
While both use Merkle Drop technology, booster packs differ from [starter packs](./starter-packs) in key ways:

| Feature | Booster Packs | Starter Packs |
|---------|---------------|---------------|
Expand Down
10 changes: 6 additions & 4 deletions src/pages/controller/coinbase-onramp.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ The integration includes comprehensive error handling for:
- **Network Issues**: Retry logic and fallback options for connectivity problems
- **Compliance Blocks**: Appropriate messaging when regulatory restrictions apply

For detailed error handling patterns, see [Configuration](./configuration) for comprehensive error management documentation.

## Development Testing

When testing Coinbase onramp integration:
Expand All @@ -139,7 +141,7 @@ Coinbase onramp integration is automatically included in Controller v0.12.0+ and

## Next Steps

- Learn about [Starter Pack Integration](/controller/starter-packs) for complete purchase flows
- Review [Configuration Options](/controller/configuration) for customization
- Explore [Credit Purchases](/controller/starter-packs#credit-purchases) for account top-ups
- See [Cross-Chain Payments](/controller/starter-packs#cross-chain-bridging-with-layerswap) for alternative payment methods
- Learn about [Starter Pack Integration](./starter-packs) for complete purchase flows
- Review [Configuration Options](./configuration) for customization
- Explore [Credit Purchases](./starter-packs#credit-purchases) for account top-ups
- See [Cross-Chain Payments](./starter-packs#cross-chain-bridging-with-layerswap) for alternative payment methods
9 changes: 5 additions & 4 deletions src/pages/controller/examples/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ controller username

### `lookup`

Resolves Cartridge controller usernames to addresses or vice versa.
Resolves Cartridge Controller usernames to addresses or vice versa.

```bash
# Look up addresses for usernames
Expand Down Expand Up @@ -354,7 +354,7 @@ controller starterpack purchase <ID> --chain-id SN_MAIN
controller starterpack purchase <ID> --ui --chain-id SN_MAIN
```

**Direct mode:** Executes the purchase on-chain using the active session. Requires session policies that include `approve` on the payment token and `issue` on the starter pack contract.
**Direct mode:** Executes the purchase onchain using the active session. Requires session policies that include `approve` on the payment token and `issue` on the starter pack contract.

```bash
controller starterpack purchase <ID> --direct --chain-id SN_MAIN
Expand Down Expand Up @@ -491,17 +491,18 @@ Precedence: CLI flags > environment variables > config file.

## Error Handling

For detailed error handling guidance, see [Configuration](/controller/configuration).
Common errors and how to fix them:

| Error | Meaning | Fix |
|-------|---------|-----|
| `NoSession` | No keypair found | Run `session auth` |
| `SessionExpired` | Session has expired | Run `session auth` again |
| `InvalidSessionData` | Corrupted session data | Run `session clear` and start over |
| `TransactionFailed` | Execution failed | Check policies and calldata |
| `TransactionFailed` | Execution failed | Check policies and `calldata` |
| `CallbackTimeout` | Authorization timed out | Run `session auth` again |
| `ManualExecutionRequired` | No authorized session for this transaction | Register session with appropriate policies |
| `InvalidInput` | Invalid input parameters | Check command syntax and calldata |
| `InvalidInput` | Invalid input parameters | Check command syntax and `calldata` |

When using `--json`, errors return structured responses with machine-readable codes and recovery hints:

Expand Down
4 changes: 2 additions & 2 deletions src/pages/controller/examples/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function main() {
main().catch(console.error);
```

### Using Manual Policies
### Using Manual Session Policies

```typescript
import SessionProvider, {
Expand All @@ -100,7 +100,7 @@ async function main() {
process.env.CARTRIDGE_STORAGE_PATH ||
path.join(process.cwd(), ".cartridge");

// Create a session provider with manual policies
// Create a session provider with manual session policies
const provider = new SessionProvider({
rpc: "https://api.cartridge.gg/x/starknet/sepolia",
chainId: constants.StarknetChainId.SN_SEPOLIA,
Expand Down
12 changes: 7 additions & 5 deletions src/pages/controller/examples/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ First, set up the Starknet provider with the Cartridge Controller connector:

You can customize the `ControllerConnector` by providing configuration options
during instantiation. The `ControllerConnector` accepts an options object that
allows you to configure various settings such as policies, RPC URLs, theme, and
allows you to configure various settings such as session policies, RPC URLs, theme, and
more.

> ⚠️ **Important**: The `ControllerConnector` instance must be created outside of any React components. Creating it inside a component will cause the connector to be recreated on every render, which can lead to connection issues.
Expand Down Expand Up @@ -118,6 +118,8 @@ export function StarknetProvider({ children }: { children: React.ReactNode }) {
}
```

For more detailed configuration options, see the [Controller configuration guide](/controller/configuration).

### 2. Create a Wallet Connection Component

Use the `useConnect`, `useDisconnect`, and `useAccount` hooks to manage wallet
Expand Down Expand Up @@ -260,7 +262,7 @@ export function MultiAuthConnectWallet() {

### 4. Headless Authentication

For programmatic authentication without opening any UI, you can use headless mode in your React components:
For programmatic authentication without opening any UI, you can use headless mode in your React components. For detailed information on headless authentication, see the [headless authentication guide](/controller/headless-authentication).

```tsx
import { useCallback, useState } from 'react'
Expand Down Expand Up @@ -352,7 +354,7 @@ export function HeadlessLogin() {
```

:::warning
Headless mode requires that the user already has the specified signer (passkey, OAuth account, EVM wallet) associated with their Cartridge username. For new user registration, use the regular `connect()` flow which opens the UI.
Headless mode requires that the user already has the specified authentication method associated with their Cartridge username. For new user registration, use the regular `connect()` flow which opens the UI.
:::

### 5. Performing Transactions
Expand Down Expand Up @@ -425,7 +427,7 @@ export const TransferEth = () => {
}
```

### 4. Username Lookup
### 6. Username Lookup

The Controller provides a `lookupUsername` method that allows you to check if a username exists and see what authentication options are available for existing accounts. This is particularly useful for headless flows where you want to determine login vs signup flows:

Expand Down Expand Up @@ -549,7 +551,7 @@ Available `AuthOption` values include:
- `"rabby"` - Rabby wallet
- `"phantom-evm"` - Phantom wallet (EVM)

### 5. Add Components to Your App
### 7. Add Components to Your App

```typescript
import { StarknetProvider } from './context/StarknetProvider'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/controller/examples/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ async fn main() {
chain_id,
);

// Deploy the controller
// Deploy the Controller
controller.deploy().await.unwrap();

// Interact with the controller
// Interact with the Controller
// For example, execute a transaction
let call = your_function_call(); // Define your function call
controller.execute(vec![call], None).await.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/pages/controller/examples/svelte.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ description: Learn how to integrate the Cartridge Controller into your Svelte ap

:::code-group

```bash \[npm]
```bash [npm]
npm install @cartridge/controller starknet
```

```bash \[pnpm]
```bash [pnpm]
pnpm install @cartridge/controller starknet
```

```bash \[yarn]
```bash [yarn]
yarn add @cartridge/controller starknet
```

```bash \[bun]
```bash [bun]
bun add @cartridge/controller starknet
```

Expand Down
6 changes: 3 additions & 3 deletions src/pages/controller/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ const phantomAccount = await controller.connect(["phantom-evm"]);

### Headless Authentication

For programmatic authentication without opening any UI, you can use [headless mode](/controller/headless-authentication) by providing a `username` and `signer`:
For programmatic authentication without opening any UI, you can use [headless mode](/controller/headless-authentication):

```typescript
import Controller from "@cartridge/controller";

const controller = new Controller({});

// Headless authentication with WebAuthn/Passkey
// Headless authentication with passkey
const account = await controller.connect({
username: "alice",
signer: "webauthn",
Expand Down Expand Up @@ -130,7 +130,7 @@ const controller = new Controller({ policies });

### With custom configuration

The Controller ships with sensible defaults for chain RPCs, but you can override them if needed.
The Controller ships with sensible defaults for chain RPCs, but you can override them if needed. For more detailed configuration options, see [Configuration](/controller/configuration).

```typescript
import { constants } from "starknet";
Expand Down
Loading