@provex/abis 1.6.2 → 1.7.0-rc.20260522201545.020a3eb
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/LICENSE +21 -0
- package/README.md +57 -0
- package/package.json +4 -2
- package/skills/abis-integration/SKILL.md +118 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Provex
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @provex/abis
|
|
2
|
+
|
|
3
|
+
Solidity contract ABIs for the Provex protocol. Exported as typed viem-compatible `as const` arrays so calldata encoding and event decoding stay type-safe end-to-end.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @provex/abis viem
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `viem ^2.0.0`.
|
|
12
|
+
|
|
13
|
+
## Versions
|
|
14
|
+
|
|
15
|
+
The protocol has two on-chain versions. Both are exported as named subpath imports so a single application can interact with either.
|
|
16
|
+
|
|
17
|
+
| Subpath | What it exports | When to use |
|
|
18
|
+
|---------|-----------------|-------------|
|
|
19
|
+
| `@provex/abis/v3` | `Escrow`, `Orchestrator`, `UnifiedPaymentVerifier`, `PaymentVerifierRegistry`, `NullifierRegistry` | Current protocol. Off-chain zkTLS attestations via Reclaim. Use for all new integrations. |
|
|
20
|
+
| `@provex/abis/v2` | `Escrow`, `Verifiers` (per-provider verifier ABIs) | Legacy protocol. On-chain proof verification. Read-only access for historical deposits. |
|
|
21
|
+
| `@provex/abis` | Re-exports both as `{ v2, v3 }` namespaces | Convenience entry when consuming both. |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { createPublicClient, http } from 'viem'
|
|
27
|
+
import { pulsechain } from 'viem/chains'
|
|
28
|
+
import { Escrow, Orchestrator } from '@provex/abis/v3'
|
|
29
|
+
|
|
30
|
+
const client = createPublicClient({ chain: pulsechain, transport: http() })
|
|
31
|
+
|
|
32
|
+
// Read a deposit
|
|
33
|
+
const deposit = await client.readContract({
|
|
34
|
+
address: '0x...', // V3 Escrow address — see @provex/utils/contracts
|
|
35
|
+
abi: Escrow,
|
|
36
|
+
functionName: 'getDeposit',
|
|
37
|
+
args: [1n],
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Decode an event
|
|
41
|
+
const logs = await client.getContractEvents({
|
|
42
|
+
address: '0x...',
|
|
43
|
+
abi: Orchestrator,
|
|
44
|
+
eventName: 'IntentSignaled',
|
|
45
|
+
fromBlock: 'earliest',
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Contract addresses per chain live in `@provex/utils/contracts` — keep ABIs and addresses in sync by version.
|
|
50
|
+
|
|
51
|
+
## Integration
|
|
52
|
+
|
|
53
|
+
For the full SDK and React hooks built on these ABIs, see [@provex/react](https://www.npmjs.com/package/@provex/react). For typed indexer queries, see [@provex/indexer-client](https://www.npmjs.com/package/@provex/indexer-client).
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provex/abis",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-rc.20260522201545.020a3eb",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"publishConfig": {
|
|
13
|
-
"access": "
|
|
13
|
+
"access": "public"
|
|
14
14
|
},
|
|
15
|
+
"license": "MIT",
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
30
31
|
"dist",
|
|
32
|
+
"skills",
|
|
31
33
|
"README.md"
|
|
32
34
|
],
|
|
33
35
|
"scripts": {
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: abis-integration
|
|
3
|
+
description: Use when integrating the Provex protocol via `@provex/abis` — when reading deposits, intents, or events from Provex's Escrow/Orchestrator/UnifiedPaymentVerifier contracts, when encoding calldata for `signalIntent` / `createDeposit` / `fulfillIntent`, when decoding `IntentSignaled` / `DepositCreated` / `IntentFulfilled` event logs via viem, or when wiring a custom subgraph/indexer that needs the ABIs. Covers the v2-vs-v3 split, the `as const` typing requirement for viem inference, and the contract-address sourcing pattern.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `@provex/abis` Integration
|
|
7
|
+
|
|
8
|
+
Typed Solidity ABIs for the Provex protocol, exported as `as const` arrays so viem can infer types end-to-end.
|
|
9
|
+
|
|
10
|
+
## What you get
|
|
11
|
+
|
|
12
|
+
| Subpath | Exports | When to use |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `@provex/abis/v3` | `Escrow`, `Orchestrator`, `UnifiedPaymentVerifier`, `PaymentVerifierRegistry`, `NullifierRegistry` | **Current protocol.** Off-chain zkTLS attestations via Reclaim. Use for all new integrations. |
|
|
15
|
+
| `@provex/abis/v2` | `Escrow`, `Verifiers` | Legacy. On-chain proof verification. Read-only for historical deposits. |
|
|
16
|
+
| `@provex/abis` | `{ v2, v3 }` namespaced re-export | Convenience if you read from both eras. |
|
|
17
|
+
|
|
18
|
+
The `viem` peer dependency is required (`^2.0.0`). The ABIs are pure data — no runtime — but the type inference depends on viem's `Abi` type.
|
|
19
|
+
|
|
20
|
+
## Canonical reads
|
|
21
|
+
|
|
22
|
+
Pair the ABI with an address from `@provex/utils/contracts` — never hardcode. The contracts package keeps the address ↔ chain mapping in sync with the deployed protocol version.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createPublicClient, http } from 'viem'
|
|
26
|
+
import { pulsechain } from 'viem/chains'
|
|
27
|
+
import { Escrow, Orchestrator } from '@provex/abis/v3'
|
|
28
|
+
import { contracts } from '@provex/utils/contracts'
|
|
29
|
+
|
|
30
|
+
const client = createPublicClient({ chain: pulsechain, transport: http() })
|
|
31
|
+
|
|
32
|
+
// Read a deposit by local ID
|
|
33
|
+
const deposit = await client.readContract({
|
|
34
|
+
address: contracts.escrow[369],
|
|
35
|
+
abi: Escrow,
|
|
36
|
+
functionName: 'getDeposit',
|
|
37
|
+
args: [1n],
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Read intent by hash
|
|
41
|
+
const intent = await client.readContract({
|
|
42
|
+
address: contracts.orchestrator[369],
|
|
43
|
+
abi: Orchestrator,
|
|
44
|
+
functionName: 'getIntent',
|
|
45
|
+
args: ['0xabc...' as `0x${string}`],
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Gotcha: `getIntent` returns an empty struct for both fulfilled AND pruned intents
|
|
50
|
+
|
|
51
|
+
V3's `Orchestrator.getIntent(hash)` returns the zero-struct for two unrelated terminal states. Use the indexer (or event presence) to distinguish — RPC is the freshness signal, indexer is the type signal. During indexer lag, prefer `fulfilled` over `cancelled` to avoid false-cancel UI flicker.
|
|
52
|
+
|
|
53
|
+
## Canonical writes
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { createWalletClient, http } from 'viem'
|
|
57
|
+
import { pulsechain } from 'viem/chains'
|
|
58
|
+
import { Orchestrator } from '@provex/abis/v3'
|
|
59
|
+
import { contracts } from '@provex/utils/contracts'
|
|
60
|
+
|
|
61
|
+
const wallet = createWalletClient({ chain: pulsechain, transport: http() })
|
|
62
|
+
|
|
63
|
+
const hash = await wallet.writeContract({
|
|
64
|
+
address: contracts.orchestrator[369],
|
|
65
|
+
abi: Orchestrator,
|
|
66
|
+
functionName: 'signalIntent',
|
|
67
|
+
args: [/* IntentParams struct */],
|
|
68
|
+
account: '0x...',
|
|
69
|
+
})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If you don't need a wallet client, use `encodeFunctionData` from viem and hand the calldata to any signer (Safe SDK, Privy, EIP-7702 relayer, etc.):
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { encodeFunctionData } from 'viem'
|
|
76
|
+
import { Orchestrator } from '@provex/abis/v3'
|
|
77
|
+
|
|
78
|
+
const data = encodeFunctionData({
|
|
79
|
+
abi: Orchestrator,
|
|
80
|
+
functionName: 'signalIntent',
|
|
81
|
+
args: [/* IntentParams */],
|
|
82
|
+
})
|
|
83
|
+
// → submit { to: contracts.orchestrator[369], data, value: 0n } via your signer
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Decoding events
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { decodeEventLog } from 'viem'
|
|
90
|
+
import { Orchestrator } from '@provex/abis/v3'
|
|
91
|
+
|
|
92
|
+
for (const log of receipt.logs) {
|
|
93
|
+
try {
|
|
94
|
+
const event = decodeEventLog({ abi: Orchestrator, data: log.data, topics: log.topics })
|
|
95
|
+
if (event.eventName === 'IntentSignaled') {
|
|
96
|
+
const { intentHash, owner, depositId, amount } = event.args
|
|
97
|
+
// ...
|
|
98
|
+
}
|
|
99
|
+
} catch {} // log isn't from this contract
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Chain support
|
|
104
|
+
|
|
105
|
+
| Chain | ID | Status |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| PulseChain | `369` | primary — production protocol |
|
|
108
|
+
| Base | `8453` | peer-trade only (not full Provex escrow) |
|
|
109
|
+
|
|
110
|
+
Identity attestations live on Ethereum mainnet (`1`) via EAS, not on Provex's chains.
|
|
111
|
+
|
|
112
|
+
## When NOT to import from this package
|
|
113
|
+
|
|
114
|
+
- **You want contract addresses** → use `@provex/utils/contracts` (it cross-references the ABI version).
|
|
115
|
+
- **You want SDK ergonomics** (deposit lookups by token+method, reputation tier math, signalIntent with prepared calldata) → use `@provex/react`'s `createProveXClient()` or hooks.
|
|
116
|
+
- **You want typed indexer queries** → use `@provex/indexer-client`.
|
|
117
|
+
|
|
118
|
+
This package is for low-level ABI access. Most consumers should go through `@provex/react` and only reach for `@provex/abis` when bypassing the SDK (smart accounts, batched calls, custom subgraphs).
|