@neutral-trade/sdk 2.2.3 → 2.3.0

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
@@ -47,6 +47,8 @@ Low-level generated bindings are also available from the `./generated` subpath.
47
47
  - `packages/widget-sdk/**` - embeddable host SDK with Wallet Standard signing, strict transaction verification, vanilla mounting, and a React entry point.
48
48
  - `examples/widget-vanilla/**`, `examples/widget-react/**` - devnet widget integrations using Wallet Standard discovery.
49
49
 
50
+ Changes to `main` require a pull request with successful lint, tests on all three CI operating systems, and the bot-owned client paths guard. This requirement also applies to repository admins.
51
+
50
52
  ## License
51
53
 
52
54
  [MIT](./LICENSE.md)
package/dist/index.d.mts CHANGED
@@ -830,7 +830,8 @@ declare function fetchReferrerStatus(rpc: ExtensionsRpc, params: {
830
830
  }): Promise<ReferrerStatus>;
831
831
  /**
832
832
  * Builds the only valid first-deposit ordering: initialize (when needed),
833
- * bind the referrer, then request the deposit. Fee settlement uses the
833
+ * bind the referrer, request the deposit, then append the points attribution
834
+ * memo with the referrer's wallet address. Fee settlement uses the
834
835
  * referrer's live effective rates, including later tier-schedule and override
835
836
  * changes that raise, lower, or zero either component.
836
837
  *
package/dist/index.mjs CHANGED
@@ -348,7 +348,7 @@ var vaults_default = [
348
348
  "vaultAddress": "Aea2VZfX6hw758cxx2WaGm7kqmdVjhbYsLfde5chVG1W",
349
349
  "depositToken": "USDC",
350
350
  "pointsMultiplier": 1,
351
- "pointsEnabled": false
351
+ "pointsEnabled": true
352
352
  },
353
353
  {
354
354
  "vaultId": 87,
@@ -2161,6 +2161,13 @@ async function buildRequestSwitchInstructions(rpc, params) {
2161
2161
  * oracle freshness, remains authoritative onchain because it can race a build.
2162
2162
  */
2163
2163
  const DEFAULT_PUBLIC_KEY = "11111111111111111111111111111111";
2164
+ const MEMO_PROGRAM_ADDRESS = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
2165
+ function buildPointsAttributionMemoInstruction(referrer) {
2166
+ return {
2167
+ programAddress: MEMO_PROGRAM_ADDRESS,
2168
+ data: new TextEncoder().encode(`NT_REF=v1|op=register|ref=${referrer}`)
2169
+ };
2170
+ }
2164
2171
  /**
2165
2172
  * Converts the signed aggregate from one `ReferrerAccount` read into exact
2166
2173
  * basis-point progress between two product-supplied tier thresholds.
@@ -2346,7 +2353,8 @@ async function fetchReferrerStatus(rpc, params) {
2346
2353
  }
2347
2354
  /**
2348
2355
  * Builds the only valid first-deposit ordering: initialize (when needed),
2349
- * bind the referrer, then request the deposit. Fee settlement uses the
2356
+ * bind the referrer, request the deposit, then append the points attribution
2357
+ * memo with the referrer's wallet address. Fee settlement uses the
2350
2358
  * referrer's live effective rates, including later tier-schedule and override
2351
2359
  * changes that raise, lower, or zero either component.
2352
2360
  *
@@ -2390,7 +2398,7 @@ async function buildAttributedDepositTx(rpc, params) {
2390
2398
  }, { programAddress: resolvedVault.programAddress });
2391
2399
  const instructions = [];
2392
2400
  if (depositContext.initializeInstruction) instructions.push(depositContext.initializeInstruction);
2393
- instructions.push(setUserReferrerInstruction, depositContext.requestInstruction);
2401
+ instructions.push(setUserReferrerInstruction, depositContext.requestInstruction, buildPointsAttributionMemoInstruction(referrer));
2394
2402
  return instructions;
2395
2403
  }
2396
2404
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neutral-trade/sdk",
3
3
  "type": "module",
4
- "version": "2.2.3",
4
+ "version": "2.3.0",
5
5
  "description": "Neutral Trade vault registry and Codama-generated ntbundle client for @solana/kit",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/neutral-trade/sdk#readme",