@piprail/sdk 1.3.0 → 1.3.1

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
@@ -4,6 +4,19 @@ All notable changes to `@piprail/sdk` are documented here. The format
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
5
5
  versions follow [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [1.3.1] — 2026-06-04
8
+
9
+ Aptos pay-path fix surfaced by the live mainnet test — no API change, fully compatible with 1.3.0.
10
+
11
+ ### Fixed
12
+ - **Aptos: cap `maxGasAmount` (50k) on the Fungible-Asset transfer.** Aptos validates
13
+ `max_gas_amount × gas_unit_price` against the sender's balance *before* execution, so the SDK
14
+ default (200k units) made a tiny transfer demand ~0.5 APT held just to be admitted — a wallet
15
+ with a modest APT balance was rejected with `INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE` even
16
+ though the transfer itself uses a fraction of that. A `primary_fungible_store::transfer` (even
17
+ one that creates the recipient's primary store) stays well under 50k gas units, so the cap keeps
18
+ ample gas headroom while the upfront fee requirement stays small. Live-validated on Aptos mainnet.
19
+
7
20
  ## [1.3.0] — 2026-06-04
8
21
 
9
22
  A new chain **family** — **Aptos** — the **9th driver family** and the only Move L1 with BOTH
@@ -37,6 +37,7 @@ var APTOS_MAINNET = {
37
37
  };
38
38
 
39
39
  // src/drivers/aptos/pay.ts
40
+ var MAX_GAS_AMOUNT = 5e4;
40
41
  async function payAptos(params) {
41
42
  const { client, signer, sender, accept } = params;
42
43
  const metadata = accept.asset === "native" ? APT_FA_METADATA : accept.asset;
@@ -48,7 +49,8 @@ async function payAptos(params) {
48
49
  typeArguments: ["0x1::fungible_asset::Metadata"],
49
50
  // u64 amount goes as a base-unit string; the FA metadata object + recipient are addresses.
50
51
  functionArguments: [metadata, accept.payTo, accept.amount]
51
- }
52
+ },
53
+ options: { maxGasAmount: MAX_GAS_AMOUNT }
52
54
  });
53
55
  const res = await client.signSubmit({ signer, transaction });
54
56
  return res.hash;
@@ -227,7 +229,8 @@ function makeAptosNetwork(preset, rpcUrl) {
227
229
  build: (input) => aptos.transaction.build.simple({
228
230
  sender: input.sender,
229
231
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
230
- data: input.data
232
+ data: input.data,
233
+ ...input.options ? { options: input.options } : {}
231
234
  }),
232
235
  signSubmit: (input) => aptos.signAndSubmitTransaction({
233
236
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -37,6 +37,7 @@ var APTOS_MAINNET = {
37
37
  };
38
38
 
39
39
  // src/drivers/aptos/pay.ts
40
+ var MAX_GAS_AMOUNT = 5e4;
40
41
  async function payAptos(params) {
41
42
  const { client, signer, sender, accept } = params;
42
43
  const metadata = accept.asset === "native" ? APT_FA_METADATA : accept.asset;
@@ -48,7 +49,8 @@ async function payAptos(params) {
48
49
  typeArguments: ["0x1::fungible_asset::Metadata"],
49
50
  // u64 amount goes as a base-unit string; the FA metadata object + recipient are addresses.
50
51
  functionArguments: [metadata, accept.payTo, accept.amount]
51
- }
52
+ },
53
+ options: { maxGasAmount: MAX_GAS_AMOUNT }
52
54
  });
53
55
  const res = await client.signSubmit({ signer, transaction });
54
56
  return res.hash;
@@ -227,7 +229,8 @@ function makeAptosNetwork(preset, rpcUrl) {
227
229
  build: (input) => aptos.transaction.build.simple({
228
230
  sender: input.sender,
229
231
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
230
- data: input.data
232
+ data: input.data,
233
+ ...input.options ? { options: input.options } : {}
231
234
  }),
232
235
  signSubmit: (input) => aptos.signAndSubmitTransaction({
233
236
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
package/dist/index.cjs CHANGED
@@ -822,7 +822,7 @@ var loaders = {
822
822
  aptos: async () => {
823
823
  let mod;
824
824
  try {
825
- mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./aptos-T3MNKUPB.cjs")));
825
+ mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./aptos-MKZ5MAGL.cjs")));
826
826
  } catch (cause) {
827
827
  throw new (0, _chunkYJPWIK5Lcjs.MissingDriverError)(
828
828
  `Aptos selected, but its package isn't installed. Run: npm install @aptos-labs/ts-sdk`,
package/dist/index.js CHANGED
@@ -822,7 +822,7 @@ var loaders = {
822
822
  aptos: async () => {
823
823
  let mod;
824
824
  try {
825
- mod = await import("./aptos-MQY7KOOJ.js");
825
+ mod = await import("./aptos-DTAONNMM.js");
826
826
  } catch (cause) {
827
827
  throw new MissingDriverError(
828
828
  `Aptos selected, but its package isn't installed. Run: npm install @aptos-labs/ts-sdk`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piprail/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Accept x402 crypto payments across 27 chains — every major EVM chain plus Solana, TON, Tron, NEAR, Sui, Aptos, Stellar & XRPL — in a couple of lines. No backend, no database, no fee; payments settle straight to your wallet.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",