Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.
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
8 changes: 4 additions & 4 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ values={[

```js
const Darchlabs = require("darchlabs");
const { Synchronizers } = new Darchlabs("<YOUR_API_KEY>");
const { synchronizers } = new Darchlabs("<YOUR_API_KEY>");

// new contract to synchronize
const created = await Synchronizers.Contracts.createContract({
const created = await synchronizers.Contracts.createContract({
name: "MyContract",
network: "ethereum",
address: "0x1234abcd...",
abi: [/* ABI contract json */];
abi: [/* ABI contract json */];
});
console.log("contract", created);

Expand All @@ -76,7 +76,7 @@ const created = await synchronizers.contracts.createContract({
name: "MyContract",
network: "ethereum",
address: "0x1234abcd...",
abi: [/* ABI contract json */];
abi: [/* ABI contract json */];
});
console.log("contract", created);

Expand Down
6 changes: 4 additions & 2 deletions docs/syncs/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const created = await synchronizers.contracts.createContract({
name: "MyContract",
network: "ethereum",
address: "0x1234abcd...",
abi: [/* ABI contract json */];
abi: [/* ABI contract json */];
});

console.log("created contract", created);
Expand All @@ -64,7 +64,7 @@ const created = await synchronizers.contracts.createContract({
name: "MyContract",
network: "ethereum",
address: "0x1234abcd...",
abi: [/* ABI contract json */];
abi: [/* ABI contract json */];
});

console.log("created contract", created);
Expand Down Expand Up @@ -331,6 +331,7 @@ const { synchronizers } = new Darchlabs("<YOUR_API_KEY>");

await synchronizers.contracts.updateContract("0x1234abcd...", {
name: "UpdatedContractName",
webhook: "https://www.fakeapi.com/api/v1/webhook",
});

console.log("Contract updated successfully");
Expand All @@ -346,6 +347,7 @@ const { synchronizers } = new Darchlabs("<YOUR_API_KEY>");

await synchronizers.contracts.updateContract("0x1234abcd...", {
name: "UpdatedContractName",
webhook: "https://www.fakeapi.com/api/v1/webhook",
});

console.log("Contract updated successfully");
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/3-webhooks-essentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ values={[
- Add the following code to `webhook.js`:

```js
const { Util } = require("darchlabs");
const { server } = require("darchlabs");

Util.ListenServer(3000, "/api/v1/webhook", (wh) => {
server.ListenServer(3000, "/api/v1/webhook", (wh) => {
console.log(`Received webhook with ID: ${wh.id}`);
});
```
Expand All @@ -82,9 +82,9 @@ Util.ListenServer(3000, "/api/v1/webhook", (wh) => {
- Add the following code to `webhook.ts`:

```ts
import { Util, type Webhook } from "darchlabs";
import { server, type Webhook } from "darchlabs";

Util.ListenServer(3000, "/api/v1/webhook", (wh: Webhook) => {
server.ListenServer(3000, "/api/v1/webhook", (wh: Webhook) => {
console.log(`Received webhook with ID: ${wh.id}`);
});
```
Expand Down
22 changes: 11 additions & 11 deletions docs/tutorials/5-sc-triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ values={[
<TabItem value="js">

```js
const { Util } = require("darchlabs");
const { server } = require("darchlabs");

Util.ListenServer(3000, "/api/v1/webhook", (wh) => {
server.ListenServer(3000, "/api/v1/webhook", (wh) => {
console.log(`received webhook with ID: ${wh.id}`);
});
```
Expand All @@ -46,9 +46,9 @@ Util.ListenServer(3000, "/api/v1/webhook", (wh) => {
<TabItem value="ts">

```ts
import { Util, type Webhook } from "darchlabs";
import { server, type Webhook } from "darchlabs";

Util.ListenServer(3000, "/api/v1/webhook", (wh: Webhook) => {
server.ListenServer(3000, "/api/v1/webhook", (wh: Webhook) => {
console.log(`received webhook with ID: ${wh.id}`);
});
```
Expand All @@ -70,18 +70,18 @@ values={[
<TabItem value="js">

```js
const { Util } = require("darchlabs");
const { server } = require("darchlabs");
const dotenv = require("dotenv");

dotenv.config();

Util.ListenServer(3000, "/api/v1/webhook", async (wh) => {
server.ListenServer(3000, "/api/v1/webhook", async (wh) => {
console.log(`received webhook with ID: ${wh.id}`);

// do anything with the webhook ...

// trigger the method on the smart contract in response to the webhook
const tx = await Util.TriggerEVMMethod({
const tx = await server.TriggerEVMMethod({
network: "mumbai",
nodeUrl: process.env.NODE_URL!,
abi: [/* ABI contract json */],
Expand All @@ -98,18 +98,18 @@ Util.ListenServer(3000, "/api/v1/webhook", async (wh) => {
<TabItem value="ts">

```ts
import { Util, type Webhook } from "darchlabs";
import { server, type Webhook } from "darchlabs";
import dotenv from "dotenv";

dotenv.config();

Util.ListenServer(3000, "/api/v1/webhook", async (wh: Webhook) => {
server.ListenServer(3000, "/api/v1/webhook", async (wh: Webhook) => {
console.log(`received webhook with ID: ${wh.id}`);

// do anything with the webhook ...

// trigger the method on the smart contract in response to the webhook
const tx = await Util.TriggerEVMMethod({
const tx = await server.TriggerEVMMethod({
network: "mumbai",
nodeUrl: process.env.NODE_URL!,
abi: [
Expand All @@ -129,7 +129,7 @@ Util.ListenServer(3000, "/api/v1/webhook", async (wh: Webhook) => {

:::info

The `Util.TriggerEVMMethod` method is implement ed using the [ethers.js library](https://docs.ethers.io/v5/). You can view its implementation [here](https://github.com/darchlabs/client-nodejs/blob/main/src/util/evm-trigger-method.ts). The `increment` method is from our demo Solidity contract, which can be found [here](https://github.com/darchlabs/demo-integration-starter-kit/blob/main/demo-storage-contract/storage.sol).
The `server.TriggerEVMMethod` method is implement ed using the [ethers.js library](https://docs.ethers.io/v5/). You can view its implementation [here](https://github.com/darchlabs/client-nodejs/blob/main/src/server/evm-trigger-method.ts). The `increment` method is from our demo Solidity contract, which can be found [here](https://github.com/darchlabs/demo-integration-starter-kit/blob/main/demo-storage-contract/storage.sol).

:::

Expand Down