mirror of
https://github.com/status-im/status-go.git
synced 2025-01-12 07:35:02 +00:00
fix(BC)_:Add account and chainID to the permissionGranted
event
This commit is contained in:
parent
9a45ae09ca
commit
3f96b8430b
@ -62,7 +62,7 @@ func (c *RequestAccountsCommand) Execute(ctx context.Context, request RPCRequest
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
signal.SendConnectorDAppPermissionGranted(connectorDApp)
|
signal.SendConnectorDAppPermissionGranted(connectorDApp, account, []uint64{chainID})
|
||||||
}
|
}
|
||||||
|
|
||||||
return FormatAccountAddressToResponse(dApp.SharedAccount), nil
|
return FormatAccountAddressToResponse(dApp.SharedAccount), nil
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package signal
|
package signal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/status-im/status-go/eth-node/types"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventConnectorSendRequestAccounts = "connector.sendRequestAccounts"
|
EventConnectorSendRequestAccounts = "connector.sendRequestAccounts"
|
||||||
EventConnectorSendTransaction = "connector.sendTransaction"
|
EventConnectorSendTransaction = "connector.sendTransaction"
|
||||||
@ -29,6 +33,12 @@ type ConnectorSendTransactionSignal struct {
|
|||||||
TxArgs string `json:"txArgs"`
|
TxArgs string `json:"txArgs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConnectorSendDappPermissionGrantedSignal struct {
|
||||||
|
ConnectorDApp
|
||||||
|
Chains []uint64 `json:"chains"`
|
||||||
|
SharedAccount types.Address `json:"sharedAccount"`
|
||||||
|
}
|
||||||
|
|
||||||
type ConnectorPersonalSignSignal struct {
|
type ConnectorPersonalSignSignal struct {
|
||||||
ConnectorDApp
|
ConnectorDApp
|
||||||
RequestID string `json:"requestId"`
|
RequestID string `json:"requestId"`
|
||||||
@ -66,8 +76,12 @@ func SendConnectorPersonalSign(dApp ConnectorDApp, requestID, challenge, address
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendConnectorDAppPermissionGranted(dApp ConnectorDApp) {
|
func SendConnectorDAppPermissionGranted(dApp ConnectorDApp, account types.Address, chains []uint64) {
|
||||||
send(EventConnectorDAppPermissionGranted, dApp)
|
send(EventConnectorDAppPermissionGranted, ConnectorSendDappPermissionGrantedSignal{
|
||||||
|
ConnectorDApp: dApp,
|
||||||
|
Chains: chains,
|
||||||
|
SharedAccount: account,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendConnectorDAppPermissionRevoked(dApp ConnectorDApp) {
|
func SendConnectorDAppPermissionRevoked(dApp ConnectorDApp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user