-
Notifications
You must be signed in to change notification settings - Fork 22
/
apiprov.go
29 lines (23 loc) · 910 Bytes
/
apiprov.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package filclient
import (
"context"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/wallet"
)
type paychApiProvider struct {
api.Gateway
wallet *wallet.LocalWallet
mp *MsgPusher
}
func (a *paychApiProvider) MpoolPushMessage(ctx context.Context, msg *types.Message, maxFee *api.MessageSendSpec) (*types.SignedMessage, error) {
return a.mp.MpoolPushMessage(ctx, msg, maxFee)
}
func (a *paychApiProvider) WalletHas(ctx context.Context, addr address.Address) (bool, error) {
return a.wallet.WalletHas(ctx, addr)
}
func (a *paychApiProvider) WalletSign(ctx context.Context, addr address.Address, data []byte) (*crypto.Signature, error) {
return a.wallet.WalletSign(ctx, addr, data, api.MsgMeta{Type: api.MTUnknown})
}