@@ -3,6 +3,7 @@ package wallet
3
3
import (
4
4
"errors"
5
5
"fmt"
6
+ "github.com/OpenBazaar/multiwallet/filecoin"
6
7
"net"
7
8
"net/url"
8
9
"os"
@@ -89,6 +90,7 @@ func NewMultiWallet(cfg *WalletConfig) (multiwallet.MultiWallet, error) {
89
90
enableAPIWallet [wallet .Litecoin ] = cfg .ConfigFile .LTC
90
91
}
91
92
enableAPIWallet [wallet .Ethereum ] = cfg .ConfigFile .ETH
93
+ enableAPIWallet [wallet .Filecoin ] = cfg .ConfigFile .FIL
92
94
93
95
var newMultiwallet = make (multiwallet.MultiWallet )
94
96
for coin , coinConfig := range enableAPIWallet {
@@ -178,6 +180,18 @@ func createAPIWallet(coin wallet.CoinType, coinConfigOverrides *schema.CoinConfi
178
180
return InvalidCoinType , nil , err
179
181
}
180
182
return actualCoin , w , nil
183
+ case wallet .Filecoin :
184
+ if testnet {
185
+ actualCoin = wallet .TestnetFilecoin
186
+ } else {
187
+ actualCoin = wallet .Filecoin
188
+ }
189
+ //actualCoin = wallet.Filecoin
190
+ w , err := filecoin .NewFilecoinWallet (* coinConfig , cfg .Mnemonic , cfg .Params , cfg .Proxy , cache .NewMockCacher (), cfg .DisableExchangeRates )
191
+ if err != nil {
192
+ return InvalidCoinType , nil , err
193
+ }
194
+ return actualCoin , w , nil
181
195
}
182
196
return InvalidCoinType , nil , fmt .Errorf ("unable to create wallet for unknown coin %s" , coin .String ())
183
197
}
@@ -297,6 +311,8 @@ func prepareAPICoinConfig(coin wallet.CoinType, override *schema.CoinConfig, wal
297
311
defaultConfig = defaultConfigSet .LTC
298
312
case wallet .Zcash :
299
313
defaultConfig = defaultConfigSet .ZEC
314
+ case wallet .Filecoin :
315
+ defaultConfig = defaultConfigSet .FIL
300
316
case wallet .Ethereum :
301
317
defaultConfig = defaultConfigSet .ETH
302
318
defaultCoinOptions = schema .EthereumDefaultOptions ()
0 commit comments