@@ -163,6 +163,7 @@ type tokenData struct {
163
163
}
164
164
165
165
type createPool struct {
166
+ Namespace string `json:"namespace"`
166
167
Type core.TokenType `json:"type"`
167
168
RequestID string `json:"requestId"`
168
169
Signer string `json:"signer"`
@@ -173,12 +174,14 @@ type createPool struct {
173
174
}
174
175
175
176
type activatePool struct {
177
+ Namespace string `json:"namespace"`
176
178
PoolData string `json:"poolData"`
177
179
PoolLocator string `json:"poolLocator"`
178
180
Config fftypes.JSONObject `json:"config"`
179
181
}
180
182
181
183
type deactivatePool struct {
184
+ Namespace string `json:"namespace"`
182
185
PoolData string `json:"poolData"`
183
186
PoolLocator string `json:"poolLocator"`
184
187
Config fftypes.JSONObject `json:"config"`
@@ -195,6 +198,7 @@ type checkInterface struct {
195
198
}
196
199
197
200
type mintTokens struct {
201
+ Namespace string `json:"namespace"`
198
202
PoolLocator string `json:"poolLocator"`
199
203
TokenIndex string `json:"tokenIndex,omitempty"`
200
204
To string `json:"to"`
@@ -208,6 +212,7 @@ type mintTokens struct {
208
212
}
209
213
210
214
type burnTokens struct {
215
+ Namespace string `json:"namespace"`
211
216
PoolLocator string `json:"poolLocator"`
212
217
TokenIndex string `json:"tokenIndex,omitempty"`
213
218
From string `json:"from"`
@@ -221,6 +226,7 @@ type burnTokens struct {
221
226
222
227
type transferTokens struct {
223
228
PoolLocator string `json:"poolLocator"`
229
+ Namespace string `json:"namespace"`
224
230
TokenIndex string `json:"tokenIndex,omitempty"`
225
231
From string `json:"from"`
226
232
To string `json:"to"`
@@ -233,6 +239,7 @@ type transferTokens struct {
233
239
}
234
240
235
241
type tokenApproval struct {
242
+ Namespace string `json:"namespace"`
236
243
Signer string `json:"signer"`
237
244
Operator string `json:"operator"`
238
245
Approved bool `json:"approved"`
@@ -318,6 +325,16 @@ func (ft *FFTokens) StartNamespace(ctx context.Context, namespace string) (err e
318
325
if err != nil {
319
326
return err
320
327
}
328
+ startCmd := core.WSStart {
329
+ WSActionBase : core.WSActionBase {
330
+ Type : core .WSClientActionStart ,
331
+ },
332
+ Namespace : namespace ,
333
+ }
334
+ b , _ := json .Marshal (startCmd )
335
+ if err := ft .wsconn [namespace ].Send (ctx , b ); err != nil {
336
+ return err
337
+ }
321
338
322
339
go ft .eventLoop (namespace )
323
340
@@ -716,6 +733,7 @@ func (ft *FFTokens) CreateTokenPool(ctx context.Context, nsOpID string, pool *co
716
733
var errRes tokenError
717
734
res , err := ft .client .R ().SetContext (ctx ).
718
735
SetBody (& createPool {
736
+ Namespace : pool .Namespace ,
719
737
Type : pool .Type ,
720
738
RequestID : nsOpID ,
721
739
Signer : pool .Key ,
@@ -746,6 +764,7 @@ func (ft *FFTokens) ActivateTokenPool(ctx context.Context, pool *core.TokenPool)
746
764
var errRes tokenError
747
765
res , err := ft .client .R ().SetContext (ctx ).
748
766
SetBody (& activatePool {
767
+ Namespace : pool .Namespace ,
749
768
PoolData : packPoolData (pool .Namespace , pool .ID ),
750
769
PoolLocator : pool .Locator ,
751
770
Config : pool .Config ,
@@ -778,6 +797,7 @@ func (ft *FFTokens) DeactivateTokenPool(ctx context.Context, pool *core.TokenPoo
778
797
var errRes tokenError
779
798
res , err := ft .client .R ().SetContext (ctx ).
780
799
SetBody (& deactivatePool {
800
+ Namespace : pool .Namespace ,
781
801
PoolData : pool .PluginData ,
782
802
PoolLocator : pool .Locator ,
783
803
Config : pool .Config ,
@@ -855,6 +875,7 @@ func (ft *FFTokens) MintTokens(ctx context.Context, nsOpID string, poolLocator s
855
875
var errRes tokenError
856
876
res , err := ft .client .R ().SetContext (ctx ).
857
877
SetBody (& mintTokens {
878
+ Namespace : mint .Namespace ,
858
879
PoolLocator : poolLocator ,
859
880
TokenIndex : mint .TokenIndex ,
860
881
To : mint .To ,
@@ -890,6 +911,7 @@ func (ft *FFTokens) BurnTokens(ctx context.Context, nsOpID string, poolLocator s
890
911
var errRes tokenError
891
912
res , err := ft .client .R ().SetContext (ctx ).
892
913
SetBody (& burnTokens {
914
+ Namespace : burn .Namespace ,
893
915
PoolLocator : poolLocator ,
894
916
TokenIndex : burn .TokenIndex ,
895
917
From : burn .From ,
@@ -924,6 +946,7 @@ func (ft *FFTokens) TransferTokens(ctx context.Context, nsOpID string, poolLocat
924
946
var errRes tokenError
925
947
res , err := ft .client .R ().SetContext (ctx ).
926
948
SetBody (& transferTokens {
949
+ Namespace : transfer .Namespace ,
927
950
PoolLocator : poolLocator ,
928
951
TokenIndex : transfer .TokenIndex ,
929
952
From : transfer .From ,
@@ -959,6 +982,7 @@ func (ft *FFTokens) TokensApproval(ctx context.Context, nsOpID string, poolLocat
959
982
var errRes tokenError
960
983
res , err := ft .client .R ().SetContext (ctx ).
961
984
SetBody (& tokenApproval {
985
+ Namespace : approval .Namespace ,
962
986
PoolLocator : poolLocator ,
963
987
Signer : approval .Key ,
964
988
Operator : approval .Operator ,
0 commit comments