File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -153,3 +153,24 @@ export const TonJiggle: Story = {
153
153
} ,
154
154
} ,
155
155
} ;
156
+
157
+ export const WithAppId : Story = {
158
+ args : {
159
+ theme : {
160
+ border : "#004A6533" ,
161
+ primary : "#177594" ,
162
+ background : "#181F34" ,
163
+ input_card : "#27272A" ,
164
+ input_token : "#1D2939" ,
165
+ light_shade : "#193349" ,
166
+ slippage_box : "#D1D1E0" ,
167
+ text_black : "#FFFFFF" ,
168
+ text_white : "#FFFFFF" ,
169
+ text_fade : "#6B7280" ,
170
+ skeleton_shine : "#585959" ,
171
+ } ,
172
+ options : {
173
+ app_id : "tonjiggle" ,
174
+ } ,
175
+ } ,
176
+ } ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ export type SwapOptions = {
5
5
default_pay_token ?: string ;
6
6
default_receive_token ?: string ;
7
7
pin_tokens ?: string [ ] ;
8
+ app_id ?: string ;
8
9
} ;
9
10
10
11
type SwapOptionsStates = {
@@ -13,7 +14,7 @@ type SwapOptionsStates = {
13
14
} ;
14
15
15
16
type SwapOptionsActions = {
16
- setOptions : ( colors : SwapOptions ) => void ;
17
+ setOptions : ( options : SwapOptions ) => void ;
17
18
} ;
18
19
19
20
export const useOptionsStore = create < SwapOptionsActions & SwapOptionsStates > (
Original file line number Diff line number Diff line change @@ -8,14 +8,16 @@ import {
8
8
} from "@tonconnect/ui-react" ;
9
9
import { useSwapStore } from "../store/swap.store" ;
10
10
import catchError from "./catchErrors" ;
11
+ import { useOptionsStore } from "../store/options.store" ;
11
12
12
13
export default async function swap (
13
14
tonconnect : TonConnectUI ,
14
15
bestRoute : BestRoute
15
16
) {
16
17
const client = new MyTonSwapClient ( ) ;
18
+ const app_id = useOptionsStore . getState ( ) . options . app_id ;
17
19
const rawMessageResult = await catchError ( ( ) =>
18
- client . swap . createSwap ( tonconnect . account ! . address , bestRoute )
20
+ client . swap . createSwap ( tonconnect . account ! . address , bestRoute , app_id )
19
21
) ;
20
22
if ( rawMessageResult . error ) return console . log ( "make this alert!" ) ;
21
23
const rawMessage = rawMessageResult . data ;
You can’t perform that action at this time.
0 commit comments