// Create a subscribe command to watch multiple addresses.
Create a subscribe command to watch multiple addresses.
// Create a subscribe command to watch multiple addresses .
func createAddressCommandDeprecated(baseMsg map[string]interface{}, whitelist map[common.Address]bool, to_or_from bool) map[string]interface{} {
	if len(whitelist) == 0 {
		return nil
	}
	addresses := make([]string, 0)
	for address := range whitelist {
		addresses = append(addresses, address.Hex())
	}
	keyStr := ""
	if to_or_from {
		keyStr = "to"
	} else {
		keyStr = "from"
	}
	toFilter := map[string]interface{}{
		"status": "pending",
		keyStr:   addresses,
	}
	baseMsg["categoryCode"] = "configs"
	baseMsg["eventCode"] = "put"
	baseMsg["config"] = map[string]interface{}{
		"scope":        "global",
		"filters":      []map[string]interface{}{toFilter},
		"watchAddress": true,
	}
	return baseMsg
}
func createAddressCommandDeprecated ( baseMsg map [ string ] interface { } , whitelist map [ common . Address ] bool , to_or_from bool ) map [ string ] interface { } { if len ( whitelist ) == 0 { return nil } addresses := make ( [ ] string , 0 ) for address := range whitelist { addresses = append ( addresses , address . Hex ( ) ) } keyStr := " " if to_or_from { keyStr = " " } else { keyStr = " " } toFilter := map [ string ] interface { } { " " : " " , keyStr : addresses , } baseMsg [ " " ] = " " baseMsg [ " " ] = " " baseMsg [ " " ] = map [ string ] interface { } { " " : " " , " " : [ ] map [ string ] interface { } { toFilter } , " " : true , } return baseMsg }
Create a subscribe command to watch multiple addresses.
Create a subscribe command to watch multiple addresses .
// see https://docs.blocknative.com/websocket#configurations