Skip to content

Commit 9cd7c6c

Browse files
committed
Add headers and text input for headers
1 parent df48ea9 commit 9cd7c6c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

demo/pages/sdk/actions/swap.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const SwapActionPage: NextPage = () => {
2323

2424
const { primaryWallet: primaryWallet } = useDynamicContext()
2525
const [jsonPayload, setJsonPayload] = useState<any>()
26+
const [headersPayload, setHeadersPayload] = useState<any>()
2627
const [error, setError] = useState<string | undefined>()
2728
const [logs, setLogs] = useState<{ message: string[]; level: LogLevel }[]>([])
2829
const [quote, setQuote] = useState<Execute | undefined>()
@@ -167,6 +168,12 @@ const SwapActionPage: NextPage = () => {
167168
value={jsonPayload}
168169
onChange={(e) => setJsonPayload(e.target.value)}
169170
/>
171+
<div>Paste in headers JSON parameters below (optional):</div>
172+
<textarea
173+
style={{ minHeight: 200, minWidth: 500 }}
174+
value={headersPayload}
175+
onChange={(e) => setHeadersPayload(e.target.value)}
176+
/>
170177
<button
171178
style={{
172179
marginTop: 50,
@@ -300,7 +307,8 @@ const SwapActionPage: NextPage = () => {
300307
tradeType,
301308
options
302309
},
303-
true
310+
true,
311+
headersPayload ? JSON.parse(headersPayload) : undefined
304312
)
305313

306314
setQuote(quote)

0 commit comments

Comments
 (0)