@agent-fuel/sdk 0.3.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to `@agent-fuel/sdk` are documented here. Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [0.3.2] — 2026-05-31
6
+
7
+ ### Changed
8
+
9
+ - `pay()` now bundles `compute_score` as a third instruction in the same atomic transaction. Without this, every paying agent's `agent_profile.score` stayed at its initial value until someone manually invoked `compute_score` — and nothing in the codebase did. The backend mirrors `agents.score` from `ScoreComputed` events only, so the displayed score was effectively stuck at 0 for the entire lifetime of any agent using the SDK's high-level helper. Adding the instruction inside the same tx means the score reflects the freshly-incremented counters with no extra round-trip and no race window where the spend lands but the score-update tx is lost.
10
+
5
11
  ## [0.3.1] — 2026-05-31
6
12
 
7
13
  ### Changed
package/dist/cli.cjs CHANGED
@@ -3834,9 +3834,16 @@ async function pay(args) {
3834
3834
  receiptUsed: receipt,
3835
3835
  systemProgram: web3_js.SystemProgram.programId
3836
3836
  });
3837
- const spendIx = await spendBuilder.instruction();
3838
- const recordIx = await recordBuilder.instruction();
3839
- const tx = new web3_js.Transaction().add(createAtaIx, spendIx, recordIx);
3837
+ const computeBuilder = rep.methods.computeScore().accounts({
3838
+ caller: agent.publicKey,
3839
+ agentProfile
3840
+ });
3841
+ const [spendIx, recordIx, computeIx] = await Promise.all([
3842
+ spendBuilder.instruction(),
3843
+ recordBuilder.instruction(),
3844
+ computeBuilder.instruction()
3845
+ ]);
3846
+ const tx = new web3_js.Transaction().add(createAtaIx, spendIx, recordIx, computeIx);
3840
3847
  try {
3841
3848
  const signature = await web3_js.sendAndConfirmTransaction(
3842
3849
  connection,
@@ -4163,7 +4170,7 @@ async function safeText(res) {
4163
4170
  }
4164
4171
 
4165
4172
  // src/cli.ts
4166
- var VERSION = "0.3.1";
4173
+ var VERSION = "0.3.2";
4167
4174
  var RPC_DEFAULTS = {
4168
4175
  "mainnet-beta": "https://api.mainnet-beta.solana.com",
4169
4176
  devnet: "https://api.devnet.solana.com",