aftermath-ts-sdk 2.1.0 → 2.2.0-dev.b73637d

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
@@ -29,16 +29,19 @@ const dca = afSdk.Dca();
29
29
  For complex transaction construction, use AftermathApi for direct control:
30
30
 
31
31
  ```typescript
32
+ import { SuiGrpcClient } from "@mysten/sui/grpc";
33
+ import { SuiJsonRpcClient } from "@mysten/sui/jsonRpc";
34
+
32
35
  const afSdk = await Aftermath.create({ network: "MAINNET" });
33
36
  const addresses = await afSdk.getAddresses();
34
37
 
38
+ const fullnodeUrl = "https://fullnode.mainnet.sui.io";
39
+
35
40
  const afApi = new AftermathApi(
36
- new SuiClient({
37
- transport: new SuiHTTPTransport({
38
- url: "https://fullnode.mainnet.sui.io",
39
- }),
40
- }),
41
- addresses // Configuration addresses
41
+ new SuiGrpcClient({ network: "mainnet", baseUrl: fullnodeUrl }),
42
+ addresses, // Configuration addresses
43
+ // Still required by the few helpers that have no gRPC equivalent — see below
44
+ new SuiJsonRpcClient({ network: "mainnet", url: fullnodeUrl })
42
45
  );
43
46
 
44
47
  // Access protocol APIs
@@ -47,6 +50,29 @@ const stakingApi = afApi.Staking();
47
50
  const farmsApi = afApi.Farms();
48
51
  ```
49
52
 
53
+ `Aftermath.create`'s `fullnodeUrl` option takes a **gRPC base URL** (it is passed
54
+ to `SuiGrpcClient` as `baseUrl`, and to `SuiJsonRpcClient` as `url`). Sui
55
+ fullnodes serve both protocols from the same host, so a single URL is enough.
56
+
57
+ ### Remaining JSON-RPC surface
58
+
59
+ Sui JSON-RPC is deprecated and scheduled for removal from fullnodes in
60
+ mid-October 2026. Every fullnode call this SDK makes goes over gRPC **except**
61
+ the following, which cannot be expressed with `SuiGrpcClient` without changing
62
+ what they return:
63
+
64
+ | Helper | Why |
65
+ | --- | --- |
66
+ | `Events().fetchCastEventsWithCursor` | `suix_queryEvents` has no `SuiGrpcClient` equivalent; `ledgerService.ListEvents` has a different filter model and BCS-only payloads |
67
+ | `Transactions().fetchTransactionsWithCursor` | `suix_queryTransactionBlocks` has no gRPC equivalent at all |
68
+ | `Objects().fetchObject` / `fetchObjectGeneral` / `fetchObjectBatch` / `fetchOwnedObjects` | gRPC returns Move object contents as BCS bytes or as a differently-shaped `json` view, so the parsed `content.fields` these helpers' casters consume cannot be reproduced |
69
+ | `DynamicFields().fetchDynamicFieldObject` | same; gRPC returns the field value as BCS bytes |
70
+ | `Sui().fetchSystemState` (deprecated) | gRPC has no `SuiSystemStateSummary` equivalent |
71
+
72
+ Prefer the Aftermath API (`Aftermath.create(...)`'s high-level providers) for
73
+ events, transaction history and system state — those already avoid the fullnode
74
+ entirely.
75
+
50
76
  ## Available Protocols
51
77
 
52
78
  ### Pools (AMM)