learn.cow.fi Open in urlscan Pro
76.76.21.164  Public Scan

Submitted URL: http://learn.cow.fi/
Effective URL: https://learn.cow.fi/tutorial/getting-started-order
Submission: On March 20 via api from US — Scanned from FI

Form analysis 1 forms found in the DOM

/search

<form class="search-container svelte-15l0yne" action="/search"><input type="search" name="q" placeholder="Search" aria-label="Search" spellcheck="false" class="svelte-15l0yne">
  <div class="shortcut svelte-15l0yne"><kbd class="svelte-15l0yne">Ctrl</kbd> <kbd class="svelte-15l0yne">K</kbd></div>
</form>

Text Content

Skip to main content
tutorials
Ctrl K
Tutorial

--------------------------------------------------------------------------------

CoW DAO Documentation

--------------------------------------------------------------------------------

Discord GitHub
Theme


GETTING STARTED
SIMPLE ORDERS / BASIC ORDERS
PART 1/ BASIC ORDERS/GETTING STARTED

Tutorials are designed to be followed in order, as each tutorial builds on the
previous one. The tutorial system is built with Web Containers, which means that
you can run the code in your browser without having to install anything on your
computer.


PREREQUISITES

 * Rabby or Metamask installed in your browser
 * A web browser with WASM support (Chrome, Firefox, Edge, Safari)

> If you are using Brave, you will need to disable shields for the webcontainers
> to work.


CODE SNIPPETS

All code snippets are in TypeScript, and are executed in a sandboxed
environment. You can edit the code and run it again.

Let's look at the current code snippet:

run.ts

import type { Web3Provider } from '@ethersproject/providers'

export async function run(provider: Web3Provider): Promise<unknown> {
  // TODO: Implement
}


WEB3 PROVIDER

The tutorials allows for the use of a browser's Web3 provider, such as Rabby or
Metamask. The provider argument is a Web3Provider from the ethers.js library.

This is automatically injected into the code snippet, and you can use it to
interact with the blockchain via your browser's wallet.


RUN FUNCTION

Tutorials are very simple plain TypeScript, and the run function is the entry
point for the code snippet. This function is called when you click the "Run"
button.


RUNNING THE CODE

Let's finish the code snippet by adding some debugging and returning a value:

run.ts

import type { Web3Provider } from '@ethersproject/providers'

export async function run(provider: Web3Provider): Promise<unknown> {
  console.log('Hello world!');
  return {
	message: "Hello world!"
  };
}

Once you click the "Run" button, you should see the following output:

output.json

{
  "message": "Hello world!"
}

> You will see that the console output is not visible. To see this, you must
> open the browser's developer tools (F12) and select the "Console" tab.

Next: Approving sell token

Edit this page
 * src
 * run.ts

solve
9
1
2
3
4
5
›

⌄
import type { Web3Provider } from '@ethersproject/providers'


export async function run(provider: Web3Provider): Promise<unknown> {
// TODO: Implement
}




writing virtual files



Tutorial Show editor Editor