Skip to content

Commit a71ae80

Browse files
chore: minor copy updates (#662)
* chore: minor copy updates * chore: update ultra api key copy * chore: remove anchor dep * chore: add exactout supported amm to schema * chore: add better description for wrapAndUnwrapSol * chore: update portal plans image
1 parent 8b5f388 commit a71ae80

22 files changed

+65
-78
lines changed

docs/1-environment-setup.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ In the documentation, we are using the Solana `web3.js` library to set up connec
1818
**JavaScript Libraries**
1919

2020
- `@solana/web3.js`
21-
- `@coral-xyz/anchor`
2221
- `@solana/spl-token`
2322
- `@jup-ag/referral-sdk`
24-
- `bs58`
25-
- `cross-fetch`
2623

2724
## Useful Scripts
2825

@@ -48,11 +45,10 @@ To set up a development wallet via `.env` file, you can use the following script
4845
```jsx
4946
// index.js
5047
import { Keypair } from '@solana/web3.js';
51-
import { Wallet } from '@coral-xyz/anchor';
5248
import dotenv from 'dotenv';
5349
require('dotenv').config();
5450

55-
const wallet = new Wallet(Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY || '')));
51+
const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY || '')));
5652
```
5753

5854
```
@@ -64,9 +60,8 @@ To set up a development wallet via a wallet generated via [Solana CLI](https://s
6460

6561
```jsx
6662
import { Keypair } from '@solana/web3.js';
67-
import { Wallet } from '@coral-xyz/anchor';
6863
import fs from 'fs';
6964

70-
const privateKeyArray = JSON.parse(fs.readFileSync('../.config/solana/id.json', 'utf8').trim());
71-
const wallet = new Wallet(Keypair.fromSecretKey(new Uint8Array(privateKeyArray)));
65+
const privateKeyArray = JSON.parse(fs.readFileSync('/Path/to/.config/solana/id.json', 'utf8').trim());
66+
const wallet = Keypair.fromSecretKey(new Uint8Array(privateKeyArray));
7267
```

docs/100-swap-api/2-build-swap-transaction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ await fetch('https://lite-api.jup.ag/swap/v1/swap', {
6868
},
6969
body: JSON.stringify({
7070
quoteResponse,
71-
userPublicKey: wallet.publicKey.toString(),
71+
userPublicKey: wallet.publicKey,
7272

7373
// ADDITIONAL PARAMETERS TO OPTIMIZE FOR TRANSACTION LANDING
7474
// See next guide to optimize for transaction landing
@@ -152,7 +152,7 @@ const instructions = await (
152152
},
153153
body: JSON.stringify({
154154
quoteResponse,
155-
userPublicKey: wallet.publicKey.toString(),
155+
userPublicKey: wallet.publicKey,
156156
})
157157
})
158158
).json();

docs/100-swap-api/3-send-swap-transaction.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const transactionBase64 = swapResponse.swapTransaction
4848
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
4949
console.log(transaction);
5050

51-
transaction.sign([wallet.payer]);
51+
transaction.sign([wallet]);
5252

5353
const transactionBinary = transaction.serialize();
5454
console.log(transactionBinary);
@@ -141,7 +141,7 @@ const swapResponse = await (
141141
},
142142
body: JSON.stringify({
143143
quoteResponse,
144-
userPublicKey: wallet.publicKey.toBase58(),
144+
userPublicKey: wallet.publicKey,
145145
prioritizationFeeLamports: {
146146
priorityLevelWithMaxLamports: {
147147
maxLamports: 10000000,
@@ -171,7 +171,7 @@ const swapTransaction = await (
171171
},
172172
body: JSON.stringify({
173173
quoteResponse,
174-
userPublicKey: wallet.publicKey.toBase58(),
174+
userPublicKey: wallet.publicKey,
175175
dynamicComputeUnitLimit: true
176176
})
177177
})
@@ -209,7 +209,7 @@ const swapTransaction = await (
209209
},
210210
body: JSON.stringify({
211211
quoteResponse,
212-
userPublicKey: wallet.publicKey.toBase58(),
212+
userPublicKey: wallet.publicKey,
213213
dynamicSlippage: true,
214214
})
215215
})
@@ -261,7 +261,7 @@ const swapTransaction = await (
261261
},
262262
body: JSON.stringify({
263263
quoteResponse,
264-
userPublicKey: wallet.publicKey.toBase58(),
264+
userPublicKey: wallet.publicKey,
265265
prioritizationFeeLamports: {
266266
jitoTipLamports: 1000000 // note that this is FIXED LAMPORTS not a max cap
267267
}

docs/100-swap-api/4-add-fees-to-swap.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ const swapResponse = await (
150150
})
151151
})
152152
).json();
153-
154-
console.log(swapResponse);
155153
```
156154

157155
</details>
@@ -172,8 +170,6 @@ const quoteResponse = await (
172170
'https://lite-api.jup.ag/swap/v1/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000&slippageBps=50&restrictIntermediateTokens=true&platformFeeBps=20'
173171
)
174172
).json();
175-
176-
console.log(JSON.stringify(quoteResponse, null, 2));
177173
```
178174

179175
### 3. Set your feeAccount in Swap
@@ -189,7 +185,7 @@ const swapResponse = await (
189185
},
190186
body: JSON.stringify({
191187
quoteResponse,
192-
userPublicKey: wallet.publicKey.toBase58(), // Pass in actual referred user in production
188+
userPublicKey: wallet.publicKey, // Pass in actual referred user in production
193189
feeAccount: feeAccount,
194190
})
195191
})

docs/100-swap-api/5-payments-through-swap.md

+17-23
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Jupiter Swap API can be utilized such that you, a merchant can allow your cu
1313

1414
## Use Case
1515

16-
Let’s set the stage. You are selling a **jupcake!!!** to your customer and merchant might only accept in 1 USDC, but Alice only has 1 SOL for various reasons. Well, you’re at the right place! By using the Swap API, merchant can let customer pay in SOL while merchant still receive USDC in order to complete the payment for a jupcake.
16+
Let’s set the stage. You are selling a **jupcake!!!** to your customer and merchant might only accept in 1 USDC, but your customer only has 1 SOL. Well, you’re at the right place! By using the Swap API, merchant can let customer pay in SOL while merchant still receive USDC in order to complete the payment for a jupcake.
1717

1818
- Customer has 1,000,000 SOL.
1919
- Merchant sells 1 jupcake for 1 USDC.
@@ -33,31 +33,30 @@ npm i @solana/spl-token
3333
```jsx
3434
import { PublicKey, Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
3535
import { getAssociatedTokenAddress, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
36-
import { Wallet } from '@coral-xyz/anchor';
37-
import fetch from 'cross-fetch';
3836
```
3937

40-
Before we start getting a quote and swap transaction, for example sake, we will need to prepare your and Alice's accounts. In production scenario, you will need to dynamically pass this in and allow users to sign in their device interfaces.
38+
Before we start getting a quote and swap transaction, for example sake, we will need to prepare both merchant and customer accounts. In production scenario, you will need to dynamically pass this in and allow users to sign in their device interfaces.
4139

40+
:::note
4241
Do note that you will need to have already set up:
43-
- A wallet in your machine to simulate yourself as the customer as the customer is the signer of the transaction (similar to how we set up in [Environment Setup](/docs/environment-setup)).
42+
- **A wallet in your machine to simulate yourself as the customer as the customer is the signer of the transaction** (similar to how we set up in [Environment Setup](/docs/environment-setup)).
4443
- `trackingAccount` is an additional Solana Account you can pass in to track only Jupiter transactions easily.
44+
:::
4545

4646
#### Set Up Accounts
4747

4848
```jsx
49-
const customerAccount = new Wallet(...);
50-
51-
console.log("customerAccount:", customerAccount.publicKey.toBase58());
49+
const privateKeyArray = JSON.parse(fs.readFileSync('/Path/to/.config/solana/id.json', 'utf8').trim());
50+
const customerWallet = Keypair.fromSecretKey(new Uint8Array(privateKeyArray));
5251

5352
const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'); // Your preferred token payment
54-
53+
const customerAccount = customerWallet.publicKey;
5554
const merchantAccount = new PublicKey('ReplaceWithMerchantPubkey');
56-
// const trackingAccount = new PublicKey('ReplaceWithPubkey');
55+
// const trackingAccount = new PublicKey('ReplaceWithPubkey'); // If required
5756

58-
console.log("USDC_MINT:", USDC_MINT.toBase58());
59-
console.log("merchantAccount:", merchantAccount.toBase58());
60-
// console.log("trackingAccount:", trackingAccount.toBase58());
57+
console.log("USDC_MINT:", USDC_MINT.publicKey);
58+
console.log("merchantAccount:", merchantAccount.publicKey);
59+
// console.log("trackingAccount:", trackingAccount.publicKey);
6160
```
6261

6362
#### Set Up `destinationTokenAccount`
@@ -74,7 +73,7 @@ const merchantUSDCTokenAccount = await getAssociatedTokenAddress(
7473
ASSOCIATED_TOKEN_PROGRAM_ID
7574
);
7675

77-
console.log("merchantUSDCTokenAccount:", merchantUSDCTokenAccount.toBase58());
76+
console.log("merchantUSDCTokenAccount:", merchantUSDCTokenAccount.publicKey);
7877
```
7978

8079
### 2. Set `swapMode` to `ExactOut` in Quote
@@ -128,14 +127,12 @@ const swapResponse = await (
128127
},
129128
body: JSON.stringify({
130129
quoteResponse,
131-
userPublicKey: customerAccount.publicKey.toBase58(),
132-
destinationTokenAccount: merchantUSDCTokenAccount.toBase58(),
133-
// trackingAccount: trackingAccount.toBase58(),
130+
userPublicKey: customerAccount.publicKey,
131+
destinationTokenAccount: merchantUSDCTokenAccount.publicKey,
132+
// trackingAccount: trackingAccount.publicKey,
134133
})
135134
})
136135
).json();
137-
138-
console.log(swapResponse);
139136
```
140137

141138
### 4. Prepare Transaction
@@ -145,11 +142,8 @@ We have walked through the steps here and explained some of the code, you can re
145142
```jsx
146143
const transactionBase64 = swapResponse.swapTransaction
147144
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
148-
149145
transaction.feePayer = customerAccount.publicKey;
150-
151-
transaction.sign([customerAccount.payer]);
152-
146+
transaction.sign([customerWallet]);
153147
const transactionBinary = transaction.serialize();
154148
```
155149

docs/101-ultra-api/1-get-order.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ title: "Get Order"
1212
:::note
1313
Base URL: `https://lite-api.jup.ag/ultra/v1/order`
1414

15-
For higher rate limits, [refer to the API Key Setup doc](/docs/api-setup).
15+
For higher rate limits, please reach out to us in [Discord](https://discord.gg/jup).
16+
17+
Portal API keys currently do not apply for Ultra API.
1618
:::
1719

1820
:::tip API Reference

docs/101-ultra-api/2-execute-order.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ title: "Execute Order"
1212
:::note
1313
Base URL: `https://lite-api.jup.ag/ultra/v1/execute`
1414

15-
For higher rate limits, [refer to the API Key Setup doc](/docs/api-setup).
15+
For higher rate limits, please reach out to us in [Discord](https://discord.gg/jup).
16+
17+
Portal API keys currently do not apply for Ultra API.
1618
:::
1719

1820
:::tip API Reference
@@ -33,7 +35,7 @@ const transactionBase64 = orderResponse.transaction
3335
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
3436

3537
// Sign the transaction
36-
transaction.sign([wallet.payer]);
38+
transaction.sign([wallet]);
3739

3840
// Serialize the transaction to base64 format
3941
const signedTransaction = Buffer.from(transaction.serialize()).toString('base64');

docs/101-ultra-api/3-get-balances.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ title: "Get Balances"
1212
:::note
1313
Base URL: `https://lite-api.jup.ag/ultra/v1/balances`
1414

15-
For higher rate limits, [refer to the API Key Setup doc](/docs/api-setup).
15+
For higher rate limits, please reach out to us in [Discord](https://discord.gg/jup).
16+
17+
Portal API keys currently do not apply for Ultra API.
1618
:::
1719

1820
:::tip API Reference

docs/101-ultra-api/4-get-shield.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ title: "Get Shield"
1212
:::note
1313
Base URL: `https://lite-api.jup.ag/ultra/v1/shield`
1414

15-
For higher rate limits, [refer to the API Key Setup doc](/docs/api-setup).
15+
For higher rate limits, please reach out to us in [Discord](https://discord.gg/jup).
16+
17+
Portal API keys currently do not apply for Ultra API.
1618
:::
1719

1820
:::tip API Reference

docs/101-ultra-api/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The Jupiter Ultra API is the *only* API you ever need to experience or build the
1919
| **Blazing fast** | 95% of all swaps are executed under 2 seconds via our proprietary transaction sending engine. |
2020
| **MEV-protected** | The lowest incidence of MEV attacks across all existing applications, by far. |
2121
| **Real-Time Slippage Estimator** | Intelligently derives the best possible slippage to use at the time of execution, balancing between trade success and price protection. |
22+
| **Gasless Support** | Enables gasless transactions for users with certain tokens and trade sizes, you can identify this via the secondary signer in the transaction. |
2223
| **One-stop shop** | Retrieve the user's balances, get a quote, execute the trade, and get the results of the trade, all within Ultra API without touching a single RPC or any other external API. |
2324
| **World class support** | We handle the complexities of RPC connections, transaction landing, slippage protection and more. |
2425

docs/102-trigger-api/2-execute-order.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const transactionBase64 = orderResponse.tx
3333
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
3434

3535
// Sign the transaction
36-
transaction.sign([wallet.payer]);
36+
transaction.sign([wallet]);
3737

3838
// Serialize the transaction to base64 format
3939
const signedTransaction = Buffer.from(transaction.serialize()).toString('base64');
@@ -90,7 +90,7 @@ If you want to handle the transaction, you can sign and send the transaction to
9090
const transactionBase64 = createOrderResponse.transaction
9191
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
9292

93-
transaction.sign([wallet.payer]);
93+
transaction.sign([wallet]);
9494

9595
const transactionBinary = transaction.serialize();
9696

docs/103-recurring-api/1-create-order.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const createOrderResponse = await (
5454
'Content-Type': 'application/json',
5555
},
5656
body: JSON.stringify({
57-
user: wallet.publicKey.toBase58(),
57+
user: wallet.publicKey,
5858
inputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
5959
outputMint: "So11111111111111111111111111111111111111112",
6060
params: {
@@ -94,7 +94,7 @@ const createOrderResponse = await (
9494
'Content-Type': 'application/json',
9595
},
9696
body: JSON.stringify({
97-
user: wallet.publicKey.toBase58(),
97+
user: wallet.publicKey,
9898
inputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
9999
outputMint: "So11111111111111111111111111111111111111112",
100100
params: {

docs/103-recurring-api/2-execute-order.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const transactionBase64 = createOrderResponse.transaction
3333
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
3434

3535
// Sign the transaction
36-
transaction.sign([wallet.payer]);
36+
transaction.sign([wallet]);
3737

3838
// Serialize the transaction to base64 format
3939
const signedTransaction = Buffer.from(transaction.serialize()).toString('base64');
@@ -98,7 +98,7 @@ If you want to handle the transaction, you can sign and send the transaction to
9898
const transactionBase64 = createOrderResponse.transaction
9999
const transaction = VersionedTransaction.deserialize(Buffer.from(transactionBase64, 'base64'));
100100

101-
transaction.sign([wallet.payer]);
101+
transaction.sign([wallet]);
102102

103103
const transactionBinary = transaction.serialize();
104104

docs/103-recurring-api/3-cancel-order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const cancelOrderResponse = await (
4242
},
4343
body: JSON.stringify({
4444
order: "4DWzP4TdTsuwvYMaMWrRqzya4UTFKFoVjfUWNWh8zhzd",
45-
user: wallet.publicKey.toBase58(),
45+
user: wallet.publicKey,
4646
recurringType: "time",
4747
}),
4848
})

docs/103-recurring-api/4-deposit-price-order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const priceDepositResponse = await (
4242
},
4343
body: JSON.stringify({
4444
order: "EpTsCUnKComCd8FDNZn3kVrQBQo2uEn5rRzYk9ocqFPH",
45-
user: wallet.publicKey.toBase58(),
45+
user: wallet.publicKey,
4646
amount: 1000000
4747
}),
4848
})

docs/103-recurring-api/5-withdraw-price-order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const priceWithdrawResponse = await (
4646
},
4747
body: JSON.stringify({
4848
order: "EpTsCUnKComCd8FDNZn3kVrQBQo2uEn5rRzYk9ocqFPH",
49-
user: wallet.publicKey.toBase58(),
49+
user: wallet.publicKey,
5050
inputOrOutput: "In", // either "In" or "Out" mint, note that price-based orders auto withdraws the output tokens to the user's wallet every time the order is executed
5151
amount: 1000000
5252
}),

docs/600-routing/dex-integration.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,7 @@ As Solana grows and more DEXes are built, we have to be more cautious in the DEX
2525
- **Traction**: We look at the traction of the DEX to ensure it has market demand and is well-used.
2626
- **Team and backers**: This is a good indicator of the quality of the DEX if they are backed by or built by reputable or verifiable entities.
2727

28-
## Integration Guidelines
29-
30-
### Markets API
31-
- This API should track all markets/pools that is listed or delisted, this will allow us to automatically track new markets as you add them to your DEX.
32-
33-
### Rust SDK
34-
- [Your SDK should implement the following interface](#).
35-
- We are soon migrating to a Rust SDK and so are asking all integrated DEXes to create a Rust SDK version or give access to the code for us to include.
36-
37-
## AMM Interface
28+
### AMM Interface
3829

3930
To facilitate integration of your DEX into the Jupiter Core Engine:
4031
- Provide a DEX SDK that works with the [Jupiter AMM Interface](https://docs.rs/crate/jupiter-amm-interface).

0 commit comments

Comments
 (0)