@@ -25,122 +25,6 @@ import { COLORS } from '../styles/themes';
25
25
import { TOKEN_DOWNLOAD_STATUS } from '../sagas/tokens' ;
26
26
import { NanoContractsList } from '../components/NanoContract/NanoContractsList' ;
27
27
import { getNanoContractFeatureToggle } from '../utils' ;
28
- import { Address } from '@hathor/wallet-lib' ;
29
-
30
- const MOCK_DEPOSIT = ( wallet ) => ( {
31
- type : 'WC_SESSION_REQUEST' ,
32
- payload : {
33
- id : 3 ,
34
- topic : '6514868878fe1dadd648a495692d5ab9d458c7d45876f2c63e1e7274640a53d4' ,
35
- jsonrpc : '2.0' ,
36
- params : {
37
- request : {
38
- method : 'htr_sendNanoContractTx' ,
39
- params : {
40
- push_tx : true ,
41
- network : 'testnet' ,
42
- method : 'bet' ,
43
- blueprint_id : '3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595' ,
44
- nc_id : '00002a71944472852754ed2f53dbd366b90b090bb319715e82f7fe0e786f0553' ,
45
- actions : [ {
46
- type : 'deposit' ,
47
- token : '00' ,
48
- amount : 1
49
- } ] ,
50
- args : [
51
- ( new Address ( 'WdXfZ6zKa1mQpBAhGQVj9pCuWDqCrG5ZR6' , {
52
- network : wallet . getNetwork ( )
53
- } ) ) . decode ( ) . toString ( 'hex' ) ,
54
- 'true'
55
- ] ,
56
- } ,
57
- } ,
58
- } ,
59
- } ,
60
- } ) ;
61
-
62
- const MOCK_INITIALIZE = ( wallet ) => ( {
63
- type : 'WC_SESSION_REQUEST' ,
64
- payload : {
65
- id : 3 ,
66
- topic : '6514868878fe1dadd648a495692d5ab9d458c7d45876f2c63e1e7274640a53d4' ,
67
- jsonrpc : '2.0' ,
68
- params : {
69
- request : {
70
- method : 'htr_sendNanoContractTx' ,
71
- params : {
72
- push_tx : true ,
73
- network : 'testnet' ,
74
- method : 'initialize' ,
75
- blueprint_id : '3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595' ,
76
- args : [
77
- '76a914969647cffd30891b1444944ff228f3bd7582fa4588ac' ,
78
- '00' ,
79
- 1720281665 ,
80
- ] ,
81
- } ,
82
- } ,
83
- } ,
84
- } ,
85
- } ) ;
86
-
87
- const MOCK_WITHDRAWL = ( wallet ) => ( {
88
- type : 'WC_SESSION_REQUEST' ,
89
- payload : {
90
- id : 3 ,
91
- topic : '6514868878fe1dadd648a495692d5ab9d458c7d45876f2c63e1e7274640a53d4' ,
92
- jsonrpc : '2.0' ,
93
- params : {
94
- request : {
95
- method : 'htr_sendNanoContractTx' ,
96
- params : {
97
- push_tx : true ,
98
- network : 'testnet' ,
99
- method : 'withdrawl' ,
100
- blueprint_id : '3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595' ,
101
- nc_id : '00002a71944472852754ed2f53dbd366b90b090bb319715e82f7fe0e786f0553' ,
102
- actions : [ {
103
- type : 'withdrawal' ,
104
- token : '00' ,
105
- amount : 1
106
- } ] ,
107
- } ,
108
- } ,
109
- } ,
110
- } ,
111
- } ) ;
112
-
113
- const MOCK_SET_RESULT = ( wallet ) => ( {
114
- type : 'WC_SESSION_REQUEST' ,
115
- payload : {
116
- id : 3 ,
117
- topic : '6514868878fe1dadd648a495692d5ab9d458c7d45876f2c63e1e7274640a53d4' ,
118
- jsonrpc : '2.0' ,
119
- params : {
120
- request : {
121
- method : 'htr_sendNanoContractTx' ,
122
- params : {
123
- push_tx : true ,
124
- network : 'testnet' ,
125
- method : 'set_result' ,
126
- blueprint_id : '3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595' ,
127
- nc_id : '00002a71944472852754ed2f53dbd366b90b090bb319715e82f7fe0e786f0553' ,
128
- actions : [ {
129
- type : 'deposit' ,
130
- token : '00' ,
131
- amount : 1
132
- } ] ,
133
- args : [
134
- ( new Address ( 'WdXfZ6zKa1mQpBAhGQVj9pCuWDqCrG5ZR6' , {
135
- network : wallet . getNetwork ( )
136
- } ) ) . decode ( ) . toString ( 'hex' ) ,
137
- 'true'
138
- ] ,
139
- } ,
140
- } ,
141
- } ,
142
- } ,
143
- } ) ;
144
28
145
29
/**
146
30
* State filter to retrieve token-related data from root state.
@@ -233,32 +117,8 @@ export const Dashboard = () => {
233
117
navigation . navigate ( 'MainScreen' ) ;
234
118
}
235
119
236
- const onInitializeNanoTx = ( ) => {
237
- dispatch ( MOCK_INITIALIZE ( wallet ) ) ;
238
- console . log ( 'initialize call on nano contract' ) ;
239
- } ;
240
-
241
- const onSendNanoTx = ( ) => {
242
- dispatch ( MOCK_DEPOSIT ( wallet ) ) ;
243
- console . log ( 'deposit call on nano contract' ) ;
244
- } ;
245
-
246
- const onWithdrawalNanoTx = ( ) => {
247
- dispatch ( MOCK_WITHDRAWL ( wallet ) ) ;
248
- console . log ( 'withdrawal call on nano contract' ) ;
249
- } ;
250
-
251
- const onSetResultNanoTx = ( ) => {
252
- dispatch ( MOCK_SET_RESULT ( wallet ) ) ;
253
- console . log ( 'set_result call on nano contract' ) ;
254
- } ;
255
-
256
120
return (
257
121
< Wrapper >
258
- < Button title = 'Deposit Nano Tx' onPress = { onSendNanoTx } />
259
- < Button title = 'Initialize Nano Tx' onPress = { onInitializeNanoTx } />
260
- < Button title = 'Withdrawal Nano Tx' onPress = { onWithdrawalNanoTx } />
261
- < Button title = 'Set Result Nano Tx' onPress = { onSetResultNanoTx } />
262
122
< ShowPushNotificationTxDetails navigation = { navigation } />
263
123
< AskForPushNotification navigation = { navigation } />
264
124
< AskForPushNotificationRefresh />
0 commit comments