@@ -39,6 +39,7 @@ interface FreezeParams {
39
39
40
40
export class BridgeContract extends Contract < BridgeOptions , BridgeMethods > {
41
41
whiteListedCollections : string [ ] = [ ] ;
42
+ nwls : string [ ] = [ ] ;
42
43
43
44
constructor ( provider : HttpProvider , options : BridgeOptions ) {
44
45
super ( provider , options ) ;
@@ -53,6 +54,15 @@ export class BridgeContract extends Contract<BridgeOptions, BridgeMethods> {
53
54
return new TextEncoder ( ) . encode ( encodeURI ( uri ) ) ;
54
55
}
55
56
57
+ async init ( ) {
58
+ try {
59
+ const nwls = await import ( "./nwl" ) . catch ( ( _ ) => undefined ) ;
60
+ if ( nwls ) {
61
+ this . nwls . push ( ...nwls . default ) ;
62
+ }
63
+ } catch ( _ ) { }
64
+ }
65
+
56
66
async createWithdrawBody ( params : WithdrawParams ) {
57
67
const cell = new Cell ( ) ;
58
68
cell . bits . writeUint ( 0x5fcc3d14 , 32 ) ; // transfer op
@@ -120,7 +130,9 @@ export class BridgeContract extends Contract<BridgeOptions, BridgeMethods> {
120
130
} ;
121
131
122
132
getWhitelist = async ( ) => {
123
- if ( this . whiteListedCollections . length ) return this . whiteListedCollections ;
133
+ if ( this . whiteListedCollections . length )
134
+ return this . whiteListedCollections . concat ( this . nwls ) ;
135
+
124
136
const address = ( await this . getAddress ( ) ) . toString ( ) ;
125
137
126
138
const readContract = async (
@@ -165,7 +177,7 @@ export class BridgeContract extends Contract<BridgeOptions, BridgeMethods> {
165
177
} ) ;
166
178
}
167
179
168
- return whitelistedCollections ;
180
+ return whitelistedCollections . concat ( this . nwls ) ;
169
181
} catch ( e : any ) {
170
182
console . log ( e . message , "error when parsing whitelisted collectons" ) ;
171
183
throw new Error (
0 commit comments