@varla/sdk 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @varla/sdk
|
|
2
|
+
|
|
3
|
+
Published SDK package for Varla.
|
|
4
|
+
|
|
5
|
+
This package is the single source of truth for:
|
|
6
|
+
- contract **ABIs**
|
|
7
|
+
- per-chain deployed **addresses**
|
|
8
|
+
- shared **types** used by Varla offchain services and apps
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# bun
|
|
14
|
+
bun add @varla/sdk
|
|
15
|
+
|
|
16
|
+
# npm
|
|
17
|
+
npm i @varla/sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Addresses
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import * as addresses from "@varla/sdk/addresses";
|
|
26
|
+
|
|
27
|
+
// e.g.
|
|
28
|
+
// addresses.polygon.core
|
|
29
|
+
// addresses.bsc.pool
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### ABIs
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import * as abi from "@varla/sdk/abi";
|
|
36
|
+
|
|
37
|
+
// e.g.
|
|
38
|
+
// abi.VARLACORE_ABI
|
|
39
|
+
// abi.POLYMARKETCTFADAPTER_ABI
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Types
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import type { AddressBook } from "@varla/sdk";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## How it’s built
|
|
49
|
+
|
|
50
|
+
On publish, this repo regenerates artifacts from the tracked `deployments/*` and Hardhat `artifacts/*`.
|
|
51
|
+
|
|
52
|
+
The published output is `dist/` and is exported via package `exports`.
|
|
53
|
+
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varla/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
9
10
|
],
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
},
|
|
32
33
|
"scripts": {
|
|
33
34
|
"clean": "rm -rf dist",
|
|
34
|
-
"gen": "cd ../.. && bun scripts/export-addressbook.ts auto --out packages/
|
|
35
|
+
"gen": "cd ../.. && bun scripts/export-addressbook.ts auto --out packages/sdk/src/addresses && bun scripts/export-abi.ts --out packages/sdk/src/abi",
|
|
35
36
|
"build": "tsc -p tsconfig.json",
|
|
36
37
|
"prepack": "bun run clean && bun run gen && bun run build"
|
|
37
38
|
},
|