Skip to content

Commit 2895c34

Browse files
authored
Update swap input parameters
Swap doesn't take 'rpc' & 'payer/wallet' info as input parameter anymore. I get's the globally set 'rpc' endpoint from 'setRpc()' and 'payer/wallet' from 'setPayerFromByte()'.
1 parent cb68301 commit 2895c34

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/whirlpool/docs/03-SDKs/05-Trade.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,16 @@ This guide explains how to use the SDK to perform a token swap in an Orca Whirlp
146146

147147
await setWhirlpoolsConfig('solanaDevnet');
148148
await setRpc('https://api.devnet.solana.com');
149-
const signer = await setPayerFromBytes(new Uint8Array(secret));
149+
await setPayerFromBytes(new Uint8Array(secret));
150+
150151
const whirlpoolAddress = address("3KBZiL2g8C7tiJ32hTv5v3KM7aK9htpqTw4cTXz1HvPt");
151152
const mintAddress = address("BRjpCHtyQLNCo8gqRUr8jtdAj5AjPYQaoqbvcZiHok1k");
152153
const inputAmount = 1_000_000n;
153154

154155
const { instructions, quote, callback: sendTx } = await swap(
155-
devnetRpc,
156156
{ inputAmount, mint: mintAddress },
157157
whirlpoolAddress,
158-
100,
159-
signer
158+
100
160159
);
161160

162161
// Use the callback to submit the transaction

0 commit comments

Comments
 (0)