@sage-protocol/sdk 0.0.3 → 0.0.5
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 +8 -8
- package/dist/index.cjs +2205 -23
- package/dist/index.mjs +2205 -23
- package/package.json +1 -1
- package/types/index.d.ts +138 -0
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Design Principles
|
|
|
17
17
|
Quick Start
|
|
18
18
|
-----------
|
|
19
19
|
```bash
|
|
20
|
-
npm i --workspace sage-protocol
|
|
20
|
+
npm i --workspace @sage-protocol/sdk
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
import sdk from 'sage-protocol
|
|
24
|
+
import sdk from '@sage-protocol/sdk';
|
|
25
25
|
|
|
26
26
|
const provider = sdk.getProvider({ rpcUrl: 'https://base-sepolia.publicnode.com' });
|
|
27
27
|
|
|
@@ -39,7 +39,7 @@ const info = await sdk.governance.getGovernorInfo({ provider, governor: subdaos[
|
|
|
39
39
|
**CommonJS usage**
|
|
40
40
|
|
|
41
41
|
```js
|
|
42
|
-
const sdk = require('sage-protocol
|
|
42
|
+
const sdk = require('@sage-protocol/sdk');
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Module Overview
|
|
@@ -82,7 +82,7 @@ API Notes and Examples
|
|
|
82
82
|
|
|
83
83
|
Salted Proposal Descriptions
|
|
84
84
|
```js
|
|
85
|
-
import sdk from 'sage-protocol
|
|
85
|
+
import sdk from '@sage-protocol/sdk';
|
|
86
86
|
// buildProposeTx() auto‑salts descriptions unless you pass a bytes32 description hash
|
|
87
87
|
const tx = sdk.governance.buildProposeTx({
|
|
88
88
|
governor: '0xGov',
|
|
@@ -95,7 +95,7 @@ const tx = sdk.governance.buildProposeTx({
|
|
|
95
95
|
|
|
96
96
|
Private Transaction Submission
|
|
97
97
|
```js
|
|
98
|
-
import sdk from 'sage-protocol
|
|
98
|
+
import sdk from '@sage-protocol/sdk';
|
|
99
99
|
// Submit signed private transaction via builder/relay RPC (eth_sendPrivateTransaction)
|
|
100
100
|
const { hash } = await sdk.utils.privateTx.sendTransaction({
|
|
101
101
|
signer, // ethers v6 signer
|
|
@@ -106,7 +106,7 @@ const { hash } = await sdk.utils.privateTx.sendTransaction({
|
|
|
106
106
|
|
|
107
107
|
Subgraph‑First Prompt Reads (with tag filters)
|
|
108
108
|
```js
|
|
109
|
-
import sdk from 'sage-protocol
|
|
109
|
+
import sdk from '@sage-protocol/sdk';
|
|
110
110
|
|
|
111
111
|
// Bulk listing by registry (subgraph)
|
|
112
112
|
const items = await sdk.subgraph.listRegistryPrompts({
|
|
@@ -212,8 +212,8 @@ await sdk.subdao.ensureSxxxBurnAllowance({ signer, sxxx: SXXX, spender: FACTORY,
|
|
|
212
212
|
Normalize proposals/timelines across OZ governors with a compact adapter, inspired by Boardroom’s pattern.
|
|
213
213
|
|
|
214
214
|
```js
|
|
215
|
-
import sdk from 'sage-protocol
|
|
216
|
-
import { getProvider } from 'sage-protocol
|
|
215
|
+
import sdk from '@sage-protocol/sdk';
|
|
216
|
+
import { getProvider } from '@sage-protocol/sdk';
|
|
217
217
|
|
|
218
218
|
const provider = getProvider({ rpcUrl: process.env.RPC_URL });
|
|
219
219
|
const tr = sdk.adapters.transports.createTransports({ provider, signer: null, subgraph: process.env.SAGE_SUBGRAPH_URL });
|