@audren-xyz/sdk 1.3.1 → 1.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/README.md +24 -1
- package/dist/aggregators.d.ts +284 -0
- package/dist/aggregators.js +1245 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/swap.js +11 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/swap.js
CHANGED
|
@@ -52,7 +52,13 @@ export async function fetchAggregatorPrivateSwapRoute(aggregatorBaseUrl, quotePa
|
|
|
52
52
|
...(quoteParams.onlyDirectRoutes ? { onlyDirectRoutes: 'true' } : {}),
|
|
53
53
|
...(excluded.length > 0 ? { excludeDexes: excluded.join(',') } : {}),
|
|
54
54
|
});
|
|
55
|
-
const quoteRes = await fetch(`${base}/quote?${qs.toString()}`, {
|
|
55
|
+
const quoteRes = await fetch(`${base}/quote?${qs.toString()}`, {
|
|
56
|
+
signal: makeSignal(),
|
|
57
|
+
redirect: 'manual',
|
|
58
|
+
});
|
|
59
|
+
if (quoteRes.status >= 300 && quoteRes.status < 400) {
|
|
60
|
+
throw new Error(`Aggregator /quote returned unexpected HTTP ${quoteRes.status} redirect`);
|
|
61
|
+
}
|
|
56
62
|
if (!quoteRes.ok) {
|
|
57
63
|
throw new Error(`Aggregator /quote failed: HTTP ${quoteRes.status}`);
|
|
58
64
|
}
|
|
@@ -61,6 +67,7 @@ export async function fetchAggregatorPrivateSwapRoute(aggregatorBaseUrl, quotePa
|
|
|
61
67
|
method: 'POST',
|
|
62
68
|
headers: { 'content-type': 'application/json' },
|
|
63
69
|
signal: makeSignal(),
|
|
70
|
+
redirect: 'manual',
|
|
64
71
|
body: JSON.stringify({
|
|
65
72
|
quoteResponse: quote,
|
|
66
73
|
userPublicKey: escrowAddress,
|
|
@@ -70,6 +77,9 @@ export async function fetchAggregatorPrivateSwapRoute(aggregatorBaseUrl, quotePa
|
|
|
70
77
|
skipUserAccountsRpcCalls: true,
|
|
71
78
|
}),
|
|
72
79
|
});
|
|
80
|
+
if (swapRes.status >= 300 && swapRes.status < 400) {
|
|
81
|
+
throw new Error(`Aggregator /swap-instructions returned unexpected HTTP ${swapRes.status} redirect`);
|
|
82
|
+
}
|
|
73
83
|
if (!swapRes.ok) {
|
|
74
84
|
throw new Error(`Aggregator /swap-instructions failed: HTTP ${swapRes.status}`);
|
|
75
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audren-xyz/sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "TypeScript SDK for Audren — zero-indexer BN254 Groth16 global MASP core (PDAs, Poseidon, layouts, CompactWalletStore, gateway/relayer client, tx v1) plus WASM Groth16 prover (@audren-xyz/sdk/prover) and IDLs (@audren-xyz/sdk/idl)",
|