Skip to content

Commit 3730912

Browse files
committed
simple seda - polymarket mid price feed
0 parents  commit 3730912

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3446
-0
lines changed

.cursor/rules/oracle-programs.mdc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
Review all documentation listed below to build, test, and deploy an Oracle Program to the SEDA Network. Please install any dependencies that are needed to work with this Oracle Program from the SEDA starter kit.
7+
8+
Overview of Building an Oracle Program: https://docs.seda.xyz/home/for-developers/building-an-oracle-program
9+
10+
Getting Started: Price Feed: https://docs.seda.xyz/home/for-developers/building-an-oracle-program/price-feed-example/getting-started-price-feed
11+
12+
Testing Your Oracle Program: https://docs.seda.xyz/home/for-developers/building-an-oracle-program/price-feed-example/testing-your-oracle-program
13+
14+
Deploying Your Oracle Program: https://docs.seda.xyz/home/for-developers/building-an-oracle-program/price-feed-example/deploying-your-oracle-program
15+
16+
Fetching Open Data: https://docs.seda.xyz/home/for-developers/building-an-oracle-program/price-feed-example/fetching-open-data
17+
18+
Advanced: API-key Gated Data: https://docs.seda.xyz/home/for-developers/building-an-oracle-program/price-feed-example/advanced-api-key-gated-data
19+
20+
SEDA SDK: https://github.com/sedaprotocol/seda-sdk

.cursorignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/.env*

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM oven/bun:latest
2+
3+
# Install system dependencies
4+
RUN apt-get update \
5+
&& apt-get -y install --no-install-recommends \
6+
nano \
7+
unzip \
8+
vim-tiny \
9+
clang \
10+
libsecp256k1-dev \
11+
protobuf-compiler \
12+
build-essential \
13+
&& apt-get auto-remove -y \
14+
&& apt-get clean -y \
15+
&& chsh -s $(which bash) bun \
16+
&& echo 'export PS1="\e[01;32m\u\e[m:\e[01;34m\w\e[m\$ "' >> /home/bun/.bashrc
17+
18+
USER bun
19+
WORKDIR /home/bun

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "seda-starter-kit",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "1.1.20"
7+
}
8+
},
9+
"features": {
10+
"ghcr.io/devcontainers/features/common-utils:2": {
11+
"installZsh": true,
12+
"configureZshAsDefaultShell": true,
13+
"installOhMyZsh": true
14+
},
15+
"ghcr.io/devcontainers/features/git:1": {},
16+
"ghcr.io/devcontainers/features/node:1": {},
17+
"ghcr.io/devcontainers/features/rust:1": {
18+
"version": "latest",
19+
"profile": "default",
20+
"targets": "wasm32-wasip1,wasm32-unknown-unknown",
21+
"toolchain": "nightly",
22+
"components": "rustfmt"
23+
}
24+
},
25+
"customizations": {
26+
"vscode": {
27+
"settings": {},
28+
"extensions": [
29+
"EditorConfig.EditorConfig",
30+
"dbaeumer.vscode-eslint",
31+
"esbenp.prettier-vscode",
32+
"dtsvet.vscode-wasm",
33+
"NomicFoundation.hardhat-solidity"
34+
]
35+
}
36+
},
37+
"postCreateCommand": "bun install"
38+
}

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# RPC for the SEDA network you want to interact with
2+
SEDA_RPC_ENDPOINT=https://rpc.testnet.seda.xyz
3+
4+
# (optional) Explorer for the SEDA network you want to interact with
5+
SEDA_EXPLORER_URL=https://testnet.explorer.seda.xyz
6+
7+
# For Mainnet, uncomment the lines below
8+
# SEDA_RPC_ENDPOINT=https://rpc.seda.xyz
9+
# SEDA_EXPLORER_URL=https://explorer.seda.xyz
10+
11+
# Your SEDA chain mnemonic, fill this in to upload binaries or interact with data requests directly
12+
SEDA_MNEMONIC=
13+
14+
# Used for posting data request on the seda chain and configuring the consumer contract
15+
# You can get this by running `bunx seda-sdk wasm upload PATH_TO_BUILD`
16+
ORACLE_PROGRAM_ID=

.github/workflows/evm-hardhat.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: EVM Hardhat
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'integrations/evm-hardhat/**'
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- 'integrations/evm-hardhat/**'
12+
# Allow manual trigger from GitHub UI
13+
workflow_dispatch:
14+
15+
jobs:
16+
build-and-test:
17+
name: Build and Test
18+
runs-on: ubuntu-latest
19+
20+
defaults:
21+
run:
22+
working-directory: integrations/evm-hardhat
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Bun
29+
uses: oven-sh/setup-bun@v1
30+
with:
31+
bun-version: latest
32+
33+
- name: Install dependencies
34+
run: bun install
35+
36+
- name: Run checks
37+
run: bun run check
38+
39+
- name: Compile contracts
40+
run: bun run compile
41+
42+
- name: Run tests
43+
run: bun run test
44+
45+
- name: Show results
46+
run: echo "All EVM Hardhatintegration checks passed!"
47+

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Oracle Program
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
# Allow manual trigger from GitHub UI
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-test:
13+
name: Build and Test
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Rust
21+
uses: dtolnay/rust-toolchain@stable
22+
with:
23+
targets: wasm32-wasip1
24+
components: clippy, rustfmt
25+
26+
- name: Setup Bun
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: latest
30+
31+
- name: Install wasm-opt
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y binaryen
35+
36+
- name: Install wasm-strip
37+
run: |
38+
curl -sSL https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz | tar -xz
39+
sudo cp wabt-1.0.31/bin/wasm-strip /usr/local/bin/
40+
sudo chmod +x /usr/local/bin/wasm-strip
41+
42+
- name: Check formatting
43+
run: cargo fmt --all -- --check
44+
45+
- name: Run Clippy
46+
run: cargo clippy --all-features --locked -- -D warnings
47+
48+
- name: Install dependencies
49+
run: bun install
50+
51+
- name: Build
52+
run: bun run build
53+
54+
- name: Run tests
55+
run: bun run test
56+
57+
- name: Show results
58+
run: echo "All Oracle Program checks passed!"

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Environment variables
2+
.env*
3+
!.env.example
4+
5+
# Dependency directories
6+
node_modules
7+
8+
# Build files
9+
build
10+
11+
# TypeChain files
12+
/typechain
13+
/typechain-types
14+
15+
# OS files
16+
.DS_Store
17+
18+
# Added by cargo
19+
/target

0 commit comments

Comments
 (0)