@neutral-trade/sdk 1.0.6 → 1.0.8

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
@@ -44,6 +44,8 @@ Low-level generated bindings are also available from the `./generated` subpath.
44
44
 
45
45
  - `src/registry/**`, `src/constants/**`, `src/types/**` — the vault registry. **PRs welcome** (new vault listings land here).
46
46
  - `src/generated/**`, `src/extensions/**`, `test/client/**` — **bot-owned**: replaced wholesale by automated client drops from the (private) program monorepo, verified by `client-drop.manifest` + CI. Don't edit by hand — changes there belong upstream.
47
+ - `packages/widget-sdk/**` - embeddable host SDK with Wallet Standard signing, strict transaction verification, vanilla mounting, and a React entry point.
48
+ - `examples/widget-vanilla/**`, `examples/widget-react/**` - devnet widget integrations using Wallet Standard discovery.
47
49
 
48
50
  ## License
49
51
 
package/dist/index.d.mts CHANGED
@@ -767,6 +767,10 @@ declare function fetchReferrerStatus(rpc: ExtensionsRpc, params: {
767
767
  * to verify active status and the net-deposit threshold.
768
768
  * Deterministic eligibility failures use stable error messages; deposits below
769
769
  * the vault minimum throw `BuilderDepositAmountTooLowError`.
770
+ *
771
+ * One transaction: bind the on-chain referrer for fee split, request the
772
+ * deposit, and emit the points attribution memo. Atomic — a partial link is
773
+ * not possible.
770
774
  */
771
775
  declare function buildAttributedDepositTx(rpc: ExtensionsRpc, params: BuildAttributedDepositTxParams): Promise<Array<Instruction>>;
772
776
  /**
package/dist/index.mjs CHANGED
@@ -1931,6 +1931,19 @@ async function buildRequestSwitchInstructions(rpc, params) {
1931
1931
  * oracle freshness, remains authoritative onchain because it can race a build.
1932
1932
  */
1933
1933
  const DEFAULT_PUBLIC_KEY = "11111111111111111111111111111111";
1934
+ const MEMO_PROGRAM_ADDRESS = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
1935
+ /**
1936
+ * Points attribution rides the same transaction as the on-chain referral
1937
+ * binding, so a builder wires one call and gets both. The memo carries the
1938
+ * referrer address because an instruction builder has no code to carry and no
1939
+ * business making an HTTP call to look one up.
1940
+ */
1941
+ function buildPointsAttributionMemoInstruction(referrer) {
1942
+ return {
1943
+ programAddress: MEMO_PROGRAM_ADDRESS,
1944
+ data: new TextEncoder().encode(`NT_REF=v1|op=register|ref=${referrer}`)
1945
+ };
1946
+ }
1934
1947
  /**
1935
1948
  * Converts the signed aggregate from one `ReferrerAccount` read into exact
1936
1949
  * basis-point progress between two product-supplied tier thresholds.
@@ -2126,6 +2139,10 @@ async function fetchReferrerStatus(rpc, params) {
2126
2139
  * to verify active status and the net-deposit threshold.
2127
2140
  * Deterministic eligibility failures use stable error messages; deposits below
2128
2141
  * the vault minimum throw `BuilderDepositAmountTooLowError`.
2142
+ *
2143
+ * One transaction: bind the on-chain referrer for fee split, request the
2144
+ * deposit, and emit the points attribution memo. Atomic — a partial link is
2145
+ * not possible.
2129
2146
  */
2130
2147
  async function buildAttributedDepositTx(rpc, params) {
2131
2148
  assertValidAmountRaw(params.amount);
@@ -2160,7 +2177,7 @@ async function buildAttributedDepositTx(rpc, params) {
2160
2177
  }, { programAddress: resolvedVault.programAddress });
2161
2178
  const instructions = [];
2162
2179
  if (depositContext.initializeInstruction) instructions.push(depositContext.initializeInstruction);
2163
- instructions.push(setUserReferrerInstruction, depositContext.requestInstruction);
2180
+ instructions.push(setUserReferrerInstruction, depositContext.requestInstruction, buildPointsAttributionMemoInstruction(referrer));
2164
2181
  return instructions;
2165
2182
  }
2166
2183
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neutral-trade/sdk",
3
3
  "type": "module",
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
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",
@@ -79,7 +79,7 @@
79
79
  "build": "tsdown",
80
80
  "dev": "tsdown --watch",
81
81
  "lint": "eslint",
82
- "release": "bumpp",
82
+ "release": "bumpp package.json packages/widget-sdk/package.json",
83
83
  "start": "tsx src/index.ts",
84
84
  "test": "vitest",
85
85
  "typecheck": "tsc",