-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
getDelegates
, add example, set up CI
- Loading branch information
1 parent
424caa0
commit bef085c
Showing
10 changed files
with
628 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
- name: setup caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PNPM_CACHE_FOLDER }} | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm- | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.x | ||
|
||
- name: setup pnpm config | ||
run: pnpm config set store-dir $PNPM_CACHE_FOLDER | ||
|
||
- name: install dependencies | ||
run: pnpm install | ||
|
||
- name: lint code | ||
run: pnpm lint | ||
|
||
- name: check formatting | ||
run: pnpm format | ||
|
||
- name: build packages | ||
run: pnpm build | ||
- run: pnpm test:coverage | ||
- run: pnpm test:report | ||
|
||
# run coverage only on ubuntu | ||
- name: Coveralls | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: coverallsapp/github-action@master | ||
with: | ||
path-to-lcov: ./coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,4 +174,6 @@ dist | |
# Finder (MacOS) folder config | ||
.DS_Store | ||
|
||
site/.vitepress/cache | ||
site/.vitepress/cache | ||
|
||
lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ApiClient } from '../src/api.js' | ||
import { goerli } from 'viem/chains' | ||
import { EIP3770Address } from '../src/types.js' | ||
|
||
const safeAddress = process.env.SAFE_ADDRESS as EIP3770Address | ||
|
||
const apiClient = new ApiClient({ url: 'https://safe-transaction-goerli.safe.global', safeAddress, chainId: goerli.id }) | ||
|
||
const response = await apiClient.getDelegates({ limit:'100' }) | ||
|
||
console.log(`List of delegates for ${safeAddress}:\n`) | ||
|
||
for (const delegate of response.results) { | ||
console.log(`${delegate.label}: ${delegate.delegate}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.