@relay-protocol/settlement-abis 2.0.1 → 2.0.3

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 ADDED
@@ -0,0 +1,81 @@
1
+ # Relay Settlement Contract ABIs
2
+
3
+ Contract ABIs for the Relay Settlement Protocol, published as plain JSON ABI arrays.
4
+
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
35
+
36
+ ```typescript
37
+ import { RelayHub } from "@relay-protocol/settlement-abis"
38
+
39
+ const transfers = await client.getContractEvents({
40
+ address: hubAddress,
41
+ abi: RelayHub,
42
+ eventName: "Transfer",
43
+ })
44
+ ```
45
+
46
+ ### Decoding historical transactions
47
+
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.
50
+
51
+ ```typescript
52
+ import { RelayOracle, RelayOracleV2 } from "@relay-protocol/settlement-abis"
53
+
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
+ })
60
+ ```
61
+
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