1
+ import { GatewayApiClient } from '@radixdlt/babylon-gateway-api-sdk'
1
2
import './style.css'
2
3
import {
3
4
RadixDappToolkit ,
@@ -28,6 +29,8 @@ content.innerHTML = `
28
29
<pre id="walletResponse"></pre>
29
30
<pre id="requests"></pre>
30
31
<pre id="state"></pre>
32
+ <pre id="gatewayConfig"></pre>
33
+ <pre id="gatewayStatus"></pre>
31
34
<pre id="device"></pre>
32
35
<pre id="logs"></pre>
33
36
`
@@ -39,6 +42,8 @@ const walletResponse = document.getElementById('walletResponse')!
39
42
const device = document . getElementById ( 'device' ) !
40
43
const logs = document . getElementById ( 'logs' ) !
41
44
const state = document . getElementById ( 'state' ) !
45
+ const gatewayConfig = document . getElementById ( 'gatewayConfig' ) !
46
+ const gatewayStatus = document . getElementById ( 'gatewayStatus' ) !
42
47
43
48
const logger = Logger ( )
44
49
@@ -56,7 +61,7 @@ const requestItemClient = RequestItemClient({
56
61
} )
57
62
58
63
const dAppToolkit = RadixDappToolkit ( {
59
- dAppDefinitionAddress,
64
+ applicationDappDefinitionAddress : dAppDefinitionAddress ,
60
65
networkId,
61
66
enableMobile : true ,
62
67
providers : {
@@ -69,6 +74,10 @@ const dAppToolkit = RadixDappToolkit({
69
74
logger,
70
75
} )
71
76
77
+ const gatewayApi = GatewayApiClient . initialize (
78
+ dAppToolkit . gatewayApi . clientConfig ,
79
+ )
80
+
72
81
dAppToolkit . walletApi . provideChallengeGenerator ( async ( ) =>
73
82
[ ...window . crypto . getRandomValues ( new Uint8Array ( 32 ) ) ]
74
83
. map ( ( x ) => x . toString ( 16 ) . padStart ( 2 , '0' ) )
@@ -77,6 +86,10 @@ dAppToolkit.walletApi.provideChallengeGenerator(async () =>
77
86
78
87
dAppToolkit . walletApi . setRequestData ( DataRequestBuilder . persona ( ) . withProof ( ) )
79
88
89
+ gatewayConfig . innerHTML = `
90
+ [Gateway]
91
+ ${ JSON . stringify ( dAppToolkit . gatewayApi . clientConfig , null , 2 ) } `
92
+
80
93
resetButton . onclick = ( ) => {
81
94
sessionStore . clear ( )
82
95
requestsStore . clear ( )
@@ -96,9 +109,13 @@ setInterval(() => {
96
109
sessionStore . getItemList ( ) . map ( ( value : any ) => {
97
110
sessions . innerHTML = JSON . stringify ( { sessions : value } , null , 2 )
98
111
} )
99
- // storageClient.getPartition('identities')
112
+ gatewayApi . status
113
+ . getCurrent ( )
114
+ . then (
115
+ ( status ) => ( gatewayStatus . innerHTML = JSON . stringify ( status , null , 2 ) ) ,
116
+ ) // storageClient.getPartition('identities')
100
117
// .getState((state) => {
101
- // keyPairs.innerHTML = JSON.stringify(state, null, 2)
118
+ // keyPairs.innerHTML = JSON.stringify(state, null, 2)
102
119
// debugger
103
120
// })
104
121
// .map((items) => {
0 commit comments