@xpr-agents/sdk 0.2.0 → 0.2.2
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 +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,9 +19,10 @@ npm install @xpr-agents/sdk @proton/js @proton/web-sdk
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
import { JsonRpc } from '@proton/js';
|
|
22
|
-
import { AgentRegistry, FeedbackRegistry, ValidationRegistry, EscrowRegistry } from '@xpr-agents/sdk';
|
|
22
|
+
import { AgentRegistry, FeedbackRegistry, ValidationRegistry, EscrowRegistry, NETWORKS } from '@xpr-agents/sdk';
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// Use NETWORKS.TESTNET for testnet, NETWORKS.MAINNET for mainnet
|
|
25
|
+
const rpc = new JsonRpc(NETWORKS.TESTNET.rpc);
|
|
25
26
|
|
|
26
27
|
// Initialize registries
|
|
27
28
|
const agents = new AgentRegistry(rpc);
|
|
@@ -49,13 +50,14 @@ const clientJobs = await escrow.listJobsByClient('clientacc');
|
|
|
49
50
|
|
|
50
51
|
```typescript
|
|
51
52
|
import ProtonWebSDK from '@proton/web-sdk';
|
|
52
|
-
import { AgentRegistry, FeedbackRegistry } from '@xpr-agents/sdk';
|
|
53
|
+
import { AgentRegistry, FeedbackRegistry, NETWORKS } from '@xpr-agents/sdk';
|
|
53
54
|
|
|
54
|
-
// Connect wallet
|
|
55
|
+
// Connect wallet (use NETWORKS.MAINNET for production)
|
|
56
|
+
const net = NETWORKS.TESTNET;
|
|
55
57
|
const { link, session } = await ProtonWebSDK({
|
|
56
58
|
linkOptions: {
|
|
57
|
-
chainId:
|
|
58
|
-
endpoints: [
|
|
59
|
+
chainId: net.chainId,
|
|
60
|
+
endpoints: [net.rpc],
|
|
59
61
|
},
|
|
60
62
|
selectorOptions: { appName: 'My App' },
|
|
61
63
|
});
|
|
@@ -141,7 +143,7 @@ await feedback.submit({
|
|
|
141
143
|
| Network | Chain ID | Endpoints |
|
|
142
144
|
|---------|----------|-----------|
|
|
143
145
|
| Mainnet | `384da888...` | `https://proton.eosusa.io` |
|
|
144
|
-
| Testnet | `71ee83bc...` | `https://
|
|
146
|
+
| Testnet | `71ee83bc...` | `https://tn1.protonnz.com` |
|
|
145
147
|
|
|
146
148
|
## Types
|
|
147
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpr-agents/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "TypeScript SDK for XPR Network Trustless Agent Registry - register agents, submit feedback, validate outputs, and manage escrow jobs",
|
|
5
5
|
"author": "XPR Network",
|
|
6
6
|
"license": "MIT",
|