@relay-protocol/settlement-abis 2.0.2 → 2.0.4

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 CHANGED
@@ -1,31 +1,81 @@
1
- # Contract ABIs for Relay Protocol
1
+ # Relay Settlement Contract ABIs
2
2
 
3
- This package contains the ABIs for the Relay Protocol settlement contracts, exported
4
- from the Foundry build output.
3
+ Contract ABIs for the Relay Settlement Protocol, published as plain JSON ABI arrays.
5
4
 
6
- ## How to use
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @relay-protocol/settlement-abis
9
+ # or
10
+ yarn add @relay-protocol/settlement-abis
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Every export is a plain ABI array, so it can be passed directly to viem, ethers, or any
16
+ other library that accepts a JSON ABI.
17
+
18
+ ### Reading contract state
19
+
20
+ ```typescript
21
+ import { RelayHub } from "@relay-protocol/settlement-abis"
22
+ import { createPublicClient, http } from "viem"
23
+
24
+ const client = createPublicClient({ transport: http("https://...") })
25
+
26
+ const balance = await client.readContract({
27
+ address: hubAddress,
28
+ abi: RelayHub,
29
+ functionName: "balanceOf",
30
+ args: [account, tokenId],
31
+ })
32
+ ```
33
+
34
+ ### Decoding events
7
35
 
8
36
  ```typescript
9
- import { RelayHub, RelayAllocator } from "@relay-protocol/settlement-abis"
37
+ import { RelayHub } from "@relay-protocol/settlement-abis"
10
38
 
11
- const logs = await client.getContractEvents({
39
+ const transfers = await client.getContractEvents({
12
40
  address: hubAddress,
13
41
  abi: RelayHub,
14
42
  eventName: "Transfer",
15
43
  })
16
44
  ```
17
45
 
18
- Each export is a plain ABI array, so it works with viem, ethers, and anything else
19
- that accepts a JSON ABI.
46
+ ### Decoding historical transactions
20
47
 
21
- ## Regenerating the ABIs
48
+ The `RelayOracle` export merges the ABIs of every historical version of the oracle, so a
49
+ single ABI can decode both current and legacy transactions.
22
50
 
23
- The contents of `src/abis/` and `src/index.ts` are generated - do not edit them by hand.
24
- After modifying contract source code, regenerate and commit the result:
51
+ ```typescript
52
+ import { RelayOracle, RelayOracleV2 } from "@relay-protocol/settlement-abis"
25
53
 
26
- ```sh
27
- yarn workspace @relay-settlement/smart-contracts build:abis
54
+ // RelayOracle covers all deployed versions, RelayOracleV2 only the current one
55
+ const executions = await client.getContractEvents({
56
+ address: oracleAddress,
57
+ abi: RelayOracle,
58
+ eventName: "Executed",
59
+ })
28
60
  ```
29
61
 
30
- `src/versions/` is hand-curated - it merges historical contract ABIs so the consumer can
31
- decode legacy transactions, and the generator never writes there.
62
+ ## Included ABIs
63
+
64
+ | Area | Exports |
65
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
66
+ | Core | `RelayHub`, `RelayAllocator`, `RelayExecutor`, `Config`, `ERC20View`, `WithdrawGasPayer` |
67
+ | Oracles | `RelayOracleV2`, `RelayOracle`, `RelayOracleMultisig`, `RelayOracleIdempotencyStore`, `RelayPriceOracle` |
68
+ | Price adapters | `ChainlinkDataStreamsAdapter`, `StorkFastAdapter`, `IPriceFeedAdapter` |
69
+ | Depository | `RelayDepository`, `RelayGatewayDepository`, `ICircleGatewayWallet`, `ICircleGatewayMinter` |
70
+ | Payload builders | `EthereumVmPayloadBuilder`, `BitcoinVmPayloadBuilder`, `SolanaVmPayloadBuilder`, `TonVmPayloadBuilder`, `TronVmPayloadBuilder`, `XrpVmPayloadBuilder`, `HyperliquidVmPayloadBuilder`, `LighterVmPayloadBuilder`, `GatewayVmPayloadBuilder` |
71
+ | Deposit addresses | `RelayDepositAddressManager`, `DepositAddressFactory`, `BitcoinDepositAddress`, `SignedPricingOracle`, `BasicPricingOracle` |
72
+ | Call resolvers | `BasicCallResolver`, `PoolExactOutputResolver`, `PoolSponsorshipResolver` |
73
+ | Routers | `MulticallRouter`, `IMulticallRouter` |
74
+
75
+ Interfaces (`IHub`, `ICallResolver`, `IPricingOracle`, ...) and shared libraries are also
76
+ exported. See the [TypeScript definitions](./dist/index.d.ts) for the complete list.
77
+
78
+ ## Related packages
79
+
80
+ - [`@relay-protocol/settlement-sdk`](https://www.npmjs.com/package/@relay-protocol/settlement-sdk) — encoding and decoding messages for the protocol
81
+ - [`@relay-protocol/settlement-networks`](https://www.npmjs.com/package/@relay-protocol/settlement-networks) — network and contract address configuration