├── .gitignore ├── LICENSE ├── README.md ├── adapter-registry ├── adapter-registry.abi └── adapter-registry.go ├── defisdk.go ├── defisdk_test.go ├── go.mod └── go.sum /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/go,git,macos,visualstudiocode 3 | # Edit at https://www.gitignore.io/?templates=go,git,macos,visualstudiocode 4 | 5 | ### Git ### 6 | # Created by git for backups. To disable backups in Git: 7 | # $ git config --global mergetool.keepBackup false 8 | *.orig 9 | 10 | # Created by git when using merge tools for conflicts 11 | *.BACKUP.* 12 | *.BASE.* 13 | *.LOCAL.* 14 | *.REMOTE.* 15 | *_BACKUP_*.txt 16 | *_BASE_*.txt 17 | *_LOCAL_*.txt 18 | *_REMOTE_*.txt 19 | 20 | ### Go ### 21 | # Binaries for programs and plugins 22 | *.exe 23 | *.exe~ 24 | *.dll 25 | *.so 26 | *.dylib 27 | 28 | # Test binary, built with `go test -c` 29 | *.test 30 | 31 | # Output of the go coverage tool, specifically when used with LiteIDE 32 | *.out 33 | 34 | # Dependency directories (remove the comment below to include it) 35 | # vendor/ 36 | 37 | ### Go Patch ### 38 | /vendor/ 39 | /Godeps/ 40 | 41 | ### macOS ### 42 | # General 43 | .DS_Store 44 | .AppleDouble 45 | .LSOverride 46 | 47 | # Icon must end with two \r 48 | Icon 49 | 50 | # Thumbnails 51 | ._* 52 | 53 | # Files that might appear in the root of a volume 54 | .DocumentRevisions-V100 55 | .fseventsd 56 | .Spotlight-V100 57 | .TemporaryItems 58 | .Trashes 59 | .VolumeIcon.icns 60 | .com.apple.timemachine.donotpresent 61 | 62 | # Directories potentially created on remote AFP share 63 | .AppleDB 64 | .AppleDesktop 65 | Network Trash Folder 66 | Temporary Items 67 | .apdisk 68 | 69 | ### VisualStudioCode ### 70 | .vscode/* 71 | !.vscode/settings.json 72 | !.vscode/tasks.json 73 | !.vscode/launch.json 74 | !.vscode/extensions.json 75 | 76 | ### VisualStudioCode Patch ### 77 | # Ignore all local history of files 78 | .history 79 | 80 | # End of https://www.gitignore.io/api/go,git,macos,visualstudiocode 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Zerion 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # defi-sdk-go 2 | This library is a simple Go wrapper for DeFi SDK. 3 | 4 | Visit [docs.zerion.io](docs.zerion.io) for full documentation. 5 | 6 | # Install 7 | ```bash 8 | $ go get github.com/zeriontech/defi-sdk-go 9 | ``` 10 | # Usage 11 | 12 | ## Initialize DeFiSDK 13 | DeFi SDK directly connects to the Ethereum blockchain. You are welcome to use an Ethereum node of your choice to start using DeFi SDK. 14 | If you don't have a node, in the example below you can use a node provided by Cloudflare and served through our domain. 15 | 16 | ```golang 17 | package main 18 | 19 | import defisdk "github.com/zeriontech/defi-sdk-go" 20 | 21 | func main() { 22 | ethereumNodeUrl := "https://eth-mainnet.zerion.io/" 23 | sdk := defisdk.New(ethereumNodeUrl) 24 | } 25 | ``` 26 | ## Examples 27 | ### Get supported protocols 28 | ```go 29 | sdk.GetSupportedProtocols() 30 | // [PieDAO Multi-Collateral Dai Bancor DeFi Money Market TokenSets 0x Staking Uniswap V1 Synthetix PoolTogether Dai Savings Rate Chai iearn.finance (v3) iearn.finance (v2) Idle dYdX Curve Compound Balancer Aave] 31 | ``` 32 | ### Get account balance locked in a protocol 33 | ```go 34 | userAddress := "0xa218a8346454c982912cf6d14c714663c2d510d8" 35 | protocol := "Aave" 36 | 37 | sdk.GetProtocolBalance(userAddress, protocol) 38 | // [{ 39 | // Metadata:{ 40 | // Name:Aave 41 | // Description:Decentralized lending & borrowing protocol 42 | // WebsiteURL:aave.com 43 | // IconURL:protocol-icons.s3.amazonaws.com/aave.png 44 | // Version:+0 45 | // } 46 | // AdapterBalances:[{ 47 | // Metadata:{ 48 | // AdapterAddress:[139 98 192 32 145 254 6 174 52 84 211 193 41 33 179 38 17 186 85 1] 49 | // AdapterType:Asset 50 | // } 51 | // Balances:[{ 52 | // Base:{ 53 | // Metadata:{ 54 | // Token:[252 30 105 15 97 239 217 97 41 75 62 28 227 49 63 189 138 164 248 93] 55 | // Name:Aave Interest bearing DAI 56 | // Symbol:aDAI 57 | // Decimals:18 58 | // } 59 | // Amount:+1008383439792242970 60 | // } 61 | // Underlying:[{ 62 | // Metadata:{ 63 | // Token:[107 23 84 116 232 144 148 196 77 169 139 149 78 237 234 196 149 39 29 15] 64 | // Name:Dai Stablecoin 65 | // Symbol:DAI 66 | // Decimals:18 67 | // } 68 | // Amount:+1008383439792242970 69 | // }] 70 | // }] 71 | // }] 72 | // }] 73 | ``` 74 | 75 | ### Get supported token types 76 | ```go 77 | sdk.GetTokenAdapterNames() 78 | // [PieDAO Pie Token SmartToken MToken SetToken Uniswap V1 pool token PoolTogether pool Chai token YToken IdleToken Curve pool token CToken Balancer pool token AToken ERC20] 79 | ``` 80 | 81 | ### Get derivative token underlying components 82 | ```go 83 | uniswapDaiPool := "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667" 84 | sdk.GetTokenComponents("Uniswap V1 pool token", uniswapDaiPool) 85 | 86 | // [{ 87 | // Metadata:{ 88 | // Token:[238 238 238 238 238 238 238 238 238 238 238 238 238 238 238 238 238 238 238 238] 89 | // Name:Ether 90 | // Symbol:ETH 91 | // Decimals:18 92 | // } 93 | // Amount:+1108093230485279057 94 | // } 95 | // { 96 | // Metadata:{ 97 | // Token:[107 23 84 116 232 144 148 196 77 169 139 149 78 237 234 196 149 39 29 15] 98 | // Name:Dai Stablecoin 99 | // Symbol:DAI 100 | // Decimals:18 101 | // } 102 | // Amount:+221366932637588225901 103 | // }] 104 | ``` 105 | -------------------------------------------------------------------------------- /adapter-registry/adapter-registry.abi: -------------------------------------------------------------------------------- 1 | [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"address[][]","name":"tokens","type":"address[][]"}],"name":"addProtocolAdapters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"protocolNames","type":"string[]"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"websiteURL","type":"string"},{"internalType":"string","name":"iconURL","type":"string"},{"internalType":"uint256","name":"version","type":"uint256"}],"internalType":"struct ProtocolMetadata[]","name":"metadata","type":"tuple[]"},{"internalType":"address[][]","name":"adapters","type":"address[][]"},{"internalType":"address[][][]","name":"tokens","type":"address[][][]"}],"name":"addProtocols","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"tokenAdapterNames","type":"string[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"name":"addTokenAdapters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"getAdapterBalance","outputs":[{"components":[{"components":[{"internalType":"address","name":"adapterAddress","type":"address"},{"internalType":"string","name":"adapterType","type":"string"}],"internalType":"struct AdapterMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance[]","name":"balances","type":"tuple[]"}],"internalType":"struct AdapterBalance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"name":"getAdapterBalances","outputs":[{"components":[{"components":[{"internalType":"address","name":"adapterAddress","type":"address"},{"internalType":"string","name":"adapterType","type":"string"}],"internalType":"struct AdapterMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance[]","name":"balances","type":"tuple[]"}],"internalType":"struct AdapterBalance[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getBalances","outputs":[{"components":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"websiteURL","type":"string"},{"internalType":"string","name":"iconURL","type":"string"},{"internalType":"uint256","name":"version","type":"uint256"}],"internalType":"struct ProtocolMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"adapterAddress","type":"address"},{"internalType":"string","name":"adapterType","type":"string"}],"internalType":"struct AdapterMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance[]","name":"balances","type":"tuple[]"}],"internalType":"struct AdapterBalance[]","name":"adapterBalances","type":"tuple[]"}],"internalType":"struct ProtocolBalance[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenType","type":"string"},{"internalType":"address","name":"token","type":"address"}],"name":"getFinalFullTokenBalance","outputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenType","type":"string"},{"internalType":"address","name":"token","type":"address"}],"name":"getFullTokenBalance","outputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"}],"name":"getProtocolAdapters","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string[]","name":"protocolNames","type":"string[]"}],"name":"getProtocolBalances","outputs":[{"components":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"websiteURL","type":"string"},{"internalType":"string","name":"iconURL","type":"string"},{"internalType":"uint256","name":"version","type":"uint256"}],"internalType":"struct ProtocolMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"adapterAddress","type":"address"},{"internalType":"string","name":"adapterType","type":"string"}],"internalType":"struct AdapterMetadata","name":"metadata","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance","name":"base","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct TokenMetadata","name":"metadata","type":"tuple"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenBalance[]","name":"underlying","type":"tuple[]"}],"internalType":"struct FullTokenBalance[]","name":"balances","type":"tuple[]"}],"internalType":"struct AdapterBalance[]","name":"adapterBalances","type":"tuple[]"}],"internalType":"struct ProtocolBalance[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"}],"name":"getProtocolMetadata","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"websiteURL","type":"string"},{"internalType":"string","name":"iconURL","type":"string"},{"internalType":"uint256","name":"version","type":"uint256"}],"internalType":"struct ProtocolMetadata","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolNames","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"adapter","type":"address"}],"name":"getSupportedTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenAdapterName","type":"string"}],"name":"getTokenAdapter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenAdapterNames","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"}],"name":"isValidProtocol","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenAdapterName","type":"string"}],"name":"isValidTokenAdapter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"},{"internalType":"uint256[]","name":"adapterIndices","type":"uint256[]"}],"name":"removeProtocolAdapters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"protocolNames","type":"string[]"}],"name":"removeProtocols","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"tokenAdapterNames","type":"string[]"}],"name":"removeTokenAdapters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"newAdapterAddress","type":"address"},{"internalType":"address[]","name":"newSupportedTokens","type":"address[]"}],"name":"updateProtocolAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"protocolName","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"websiteURL","type":"string"},{"internalType":"string","name":"iconURL","type":"string"}],"name":"updateProtocolMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenAdapterName","type":"string"},{"internalType":"address","name":"adapter","type":"address"}],"name":"updateTokenAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"}] -------------------------------------------------------------------------------- /adapter-registry/adapter-registry.go: -------------------------------------------------------------------------------- 1 | // Code generated - DO NOT EDIT. 2 | // This file is a generated binding and any manual changes will be lost. 3 | 4 | package adapterRegistry 5 | 6 | import ( 7 | "math/big" 8 | "strings" 9 | 10 | ethereum "github.com/ethereum/go-ethereum" 11 | "github.com/ethereum/go-ethereum/accounts/abi" 12 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 13 | "github.com/ethereum/go-ethereum/common" 14 | "github.com/ethereum/go-ethereum/core/types" 15 | "github.com/ethereum/go-ethereum/event" 16 | ) 17 | 18 | // Reference imports to suppress errors if they are not otherwise used. 19 | var ( 20 | _ = big.NewInt 21 | _ = strings.NewReader 22 | _ = ethereum.NotFound 23 | _ = bind.Bind 24 | _ = common.Big1 25 | _ = types.BloomLookup 26 | _ = event.NewSubscription 27 | ) 28 | 29 | // AdapterBalance is an auto generated low-level Go binding around an user-defined struct. 30 | type AdapterBalance struct { 31 | Metadata AdapterMetadata 32 | Balances []FullTokenBalance 33 | } 34 | 35 | // AdapterMetadata is an auto generated low-level Go binding around an user-defined struct. 36 | type AdapterMetadata struct { 37 | AdapterAddress common.Address 38 | AdapterType string 39 | } 40 | 41 | // FullTokenBalance is an auto generated low-level Go binding around an user-defined struct. 42 | type FullTokenBalance struct { 43 | Base TokenBalance 44 | Underlying []TokenBalance 45 | } 46 | 47 | // ProtocolBalance is an auto generated low-level Go binding around an user-defined struct. 48 | type ProtocolBalance struct { 49 | Metadata ProtocolMetadata 50 | AdapterBalances []AdapterBalance 51 | } 52 | 53 | // ProtocolMetadata is an auto generated low-level Go binding around an user-defined struct. 54 | type ProtocolMetadata struct { 55 | Name string 56 | Description string 57 | WebsiteURL string 58 | IconURL string 59 | Version *big.Int 60 | } 61 | 62 | // TokenBalance is an auto generated low-level Go binding around an user-defined struct. 63 | type TokenBalance struct { 64 | Metadata TokenMetadata 65 | Amount *big.Int 66 | } 67 | 68 | // TokenMetadata is an auto generated low-level Go binding around an user-defined struct. 69 | type TokenMetadata struct { 70 | Token common.Address 71 | Name string 72 | Symbol string 73 | Decimals uint8 74 | } 75 | 76 | // AdapterRegistryABI is the input ABI used to generate the binding from. 77 | const AdapterRegistryABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"},{\"internalType\":\"address[]\",\"name\":\"adapters\",\"type\":\"address[]\"},{\"internalType\":\"address[][]\",\"name\":\"tokens\",\"type\":\"address[][]\"}],\"name\":\"addProtocolAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"protocolNames\",\"type\":\"string[]\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"websiteURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"iconURL\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"internalType\":\"structProtocolMetadata[]\",\"name\":\"metadata\",\"type\":\"tuple[]\"},{\"internalType\":\"address[][]\",\"name\":\"adapters\",\"type\":\"address[][]\"},{\"internalType\":\"address[][][]\",\"name\":\"tokens\",\"type\":\"address[][][]\"}],\"name\":\"addProtocols\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"tokenAdapterNames\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"adapters\",\"type\":\"address[]\"}],\"name\":\"addTokenAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"adapter\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"getAdapterBalance\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"adapterAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"adapterType\",\"type\":\"string\"}],\"internalType\":\"structAdapterMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance[]\",\"name\":\"balances\",\"type\":\"tuple[]\"}],\"internalType\":\"structAdapterBalance\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"adapters\",\"type\":\"address[]\"}],\"name\":\"getAdapterBalances\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"adapterAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"adapterType\",\"type\":\"string\"}],\"internalType\":\"structAdapterMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance[]\",\"name\":\"balances\",\"type\":\"tuple[]\"}],\"internalType\":\"structAdapterBalance[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getBalances\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"websiteURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"iconURL\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"internalType\":\"structProtocolMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"adapterAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"adapterType\",\"type\":\"string\"}],\"internalType\":\"structAdapterMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance[]\",\"name\":\"balances\",\"type\":\"tuple[]\"}],\"internalType\":\"structAdapterBalance[]\",\"name\":\"adapterBalances\",\"type\":\"tuple[]\"}],\"internalType\":\"structProtocolBalance[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"tokenType\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFinalFullTokenBalance\",\"outputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"tokenType\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getFullTokenBalance\",\"outputs\":[{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"}],\"name\":\"getProtocolAdapters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"string[]\",\"name\":\"protocolNames\",\"type\":\"string[]\"}],\"name\":\"getProtocolBalances\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"websiteURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"iconURL\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"internalType\":\"structProtocolMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"adapterAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"adapterType\",\"type\":\"string\"}],\"internalType\":\"structAdapterMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance\",\"name\":\"base\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"}],\"internalType\":\"structTokenMetadata\",\"name\":\"metadata\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTokenBalance[]\",\"name\":\"underlying\",\"type\":\"tuple[]\"}],\"internalType\":\"structFullTokenBalance[]\",\"name\":\"balances\",\"type\":\"tuple[]\"}],\"internalType\":\"structAdapterBalance[]\",\"name\":\"adapterBalances\",\"type\":\"tuple[]\"}],\"internalType\":\"structProtocolBalance[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"}],\"name\":\"getProtocolMetadata\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"websiteURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"iconURL\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"internalType\":\"structProtocolMetadata\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProtocolNames\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"adapter\",\"type\":\"address\"}],\"name\":\"getSupportedTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"tokenAdapterName\",\"type\":\"string\"}],\"name\":\"getTokenAdapter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenAdapterNames\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"}],\"name\":\"isValidProtocol\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"tokenAdapterName\",\"type\":\"string\"}],\"name\":\"isValidTokenAdapter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"},{\"internalType\":\"uint256[]\",\"name\":\"adapterIndices\",\"type\":\"uint256[]\"}],\"name\":\"removeProtocolAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"protocolNames\",\"type\":\"string[]\"}],\"name\":\"removeProtocols\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"tokenAdapterNames\",\"type\":\"string[]\"}],\"name\":\"removeTokenAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"newAdapterAddress\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"newSupportedTokens\",\"type\":\"address[]\"}],\"name\":\"updateProtocolAdapter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"protocolName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"websiteURL\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"iconURL\",\"type\":\"string\"}],\"name\":\"updateProtocolMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"tokenAdapterName\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"adapter\",\"type\":\"address\"}],\"name\":\"updateTokenAdapter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" 78 | 79 | // AdapterRegistry is an auto generated Go binding around an Ethereum contract. 80 | type AdapterRegistry struct { 81 | AdapterRegistryCaller // Read-only binding to the contract 82 | AdapterRegistryTransactor // Write-only binding to the contract 83 | AdapterRegistryFilterer // Log filterer for contract events 84 | } 85 | 86 | // AdapterRegistryCaller is an auto generated read-only Go binding around an Ethereum contract. 87 | type AdapterRegistryCaller struct { 88 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 89 | } 90 | 91 | // AdapterRegistryTransactor is an auto generated write-only Go binding around an Ethereum contract. 92 | type AdapterRegistryTransactor struct { 93 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 94 | } 95 | 96 | // AdapterRegistryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 97 | type AdapterRegistryFilterer struct { 98 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 99 | } 100 | 101 | // AdapterRegistrySession is an auto generated Go binding around an Ethereum contract, 102 | // with pre-set call and transact options. 103 | type AdapterRegistrySession struct { 104 | Contract *AdapterRegistry // Generic contract binding to set the session for 105 | CallOpts bind.CallOpts // Call options to use throughout this session 106 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 107 | } 108 | 109 | // AdapterRegistryCallerSession is an auto generated read-only Go binding around an Ethereum contract, 110 | // with pre-set call options. 111 | type AdapterRegistryCallerSession struct { 112 | Contract *AdapterRegistryCaller // Generic contract caller binding to set the session for 113 | CallOpts bind.CallOpts // Call options to use throughout this session 114 | } 115 | 116 | // AdapterRegistryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 117 | // with pre-set transact options. 118 | type AdapterRegistryTransactorSession struct { 119 | Contract *AdapterRegistryTransactor // Generic contract transactor binding to set the session for 120 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 121 | } 122 | 123 | // AdapterRegistryRaw is an auto generated low-level Go binding around an Ethereum contract. 124 | type AdapterRegistryRaw struct { 125 | Contract *AdapterRegistry // Generic contract binding to access the raw methods on 126 | } 127 | 128 | // AdapterRegistryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 129 | type AdapterRegistryCallerRaw struct { 130 | Contract *AdapterRegistryCaller // Generic read-only contract binding to access the raw methods on 131 | } 132 | 133 | // AdapterRegistryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 134 | type AdapterRegistryTransactorRaw struct { 135 | Contract *AdapterRegistryTransactor // Generic write-only contract binding to access the raw methods on 136 | } 137 | 138 | // NewAdapterRegistry creates a new instance of AdapterRegistry, bound to a specific deployed contract. 139 | func NewAdapterRegistry(address common.Address, backend bind.ContractBackend) (*AdapterRegistry, error) { 140 | contract, err := bindAdapterRegistry(address, backend, backend, backend) 141 | if err != nil { 142 | return nil, err 143 | } 144 | return &AdapterRegistry{AdapterRegistryCaller: AdapterRegistryCaller{contract: contract}, AdapterRegistryTransactor: AdapterRegistryTransactor{contract: contract}, AdapterRegistryFilterer: AdapterRegistryFilterer{contract: contract}}, nil 145 | } 146 | 147 | // NewAdapterRegistryCaller creates a new read-only instance of AdapterRegistry, bound to a specific deployed contract. 148 | func NewAdapterRegistryCaller(address common.Address, caller bind.ContractCaller) (*AdapterRegistryCaller, error) { 149 | contract, err := bindAdapterRegistry(address, caller, nil, nil) 150 | if err != nil { 151 | return nil, err 152 | } 153 | return &AdapterRegistryCaller{contract: contract}, nil 154 | } 155 | 156 | // NewAdapterRegistryTransactor creates a new write-only instance of AdapterRegistry, bound to a specific deployed contract. 157 | func NewAdapterRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*AdapterRegistryTransactor, error) { 158 | contract, err := bindAdapterRegistry(address, nil, transactor, nil) 159 | if err != nil { 160 | return nil, err 161 | } 162 | return &AdapterRegistryTransactor{contract: contract}, nil 163 | } 164 | 165 | // NewAdapterRegistryFilterer creates a new log filterer instance of AdapterRegistry, bound to a specific deployed contract. 166 | func NewAdapterRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*AdapterRegistryFilterer, error) { 167 | contract, err := bindAdapterRegistry(address, nil, nil, filterer) 168 | if err != nil { 169 | return nil, err 170 | } 171 | return &AdapterRegistryFilterer{contract: contract}, nil 172 | } 173 | 174 | // bindAdapterRegistry binds a generic wrapper to an already deployed contract. 175 | func bindAdapterRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 176 | parsed, err := abi.JSON(strings.NewReader(AdapterRegistryABI)) 177 | if err != nil { 178 | return nil, err 179 | } 180 | return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 181 | } 182 | 183 | // Call invokes the (constant) contract method with params as input values and 184 | // sets the output to result. The result type might be a single field for simple 185 | // returns, a slice of interfaces for anonymous returns and a struct for named 186 | // returns. 187 | func (_AdapterRegistry *AdapterRegistryRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 188 | return _AdapterRegistry.Contract.AdapterRegistryCaller.contract.Call(opts, result, method, params...) 189 | } 190 | 191 | // Transfer initiates a plain transaction to move funds to the contract, calling 192 | // its default method if one is available. 193 | func (_AdapterRegistry *AdapterRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 194 | return _AdapterRegistry.Contract.AdapterRegistryTransactor.contract.Transfer(opts) 195 | } 196 | 197 | // Transact invokes the (paid) contract method with params as input values. 198 | func (_AdapterRegistry *AdapterRegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 199 | return _AdapterRegistry.Contract.AdapterRegistryTransactor.contract.Transact(opts, method, params...) 200 | } 201 | 202 | // Call invokes the (constant) contract method with params as input values and 203 | // sets the output to result. The result type might be a single field for simple 204 | // returns, a slice of interfaces for anonymous returns and a struct for named 205 | // returns. 206 | func (_AdapterRegistry *AdapterRegistryCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 207 | return _AdapterRegistry.Contract.contract.Call(opts, result, method, params...) 208 | } 209 | 210 | // Transfer initiates a plain transaction to move funds to the contract, calling 211 | // its default method if one is available. 212 | func (_AdapterRegistry *AdapterRegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 213 | return _AdapterRegistry.Contract.contract.Transfer(opts) 214 | } 215 | 216 | // Transact invokes the (paid) contract method with params as input values. 217 | func (_AdapterRegistry *AdapterRegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 218 | return _AdapterRegistry.Contract.contract.Transact(opts, method, params...) 219 | } 220 | 221 | // GetAdapterBalance is a free data retrieval call binding the contract method 0x4bf9649b. 222 | // 223 | // Solidity: function getAdapterBalance(address account, address adapter, address[] tokens) view returns(AdapterBalance) 224 | func (_AdapterRegistry *AdapterRegistryCaller) GetAdapterBalance(opts *bind.CallOpts, account common.Address, adapter common.Address, tokens []common.Address) (AdapterBalance, error) { 225 | var ( 226 | ret0 = new(AdapterBalance) 227 | ) 228 | out := ret0 229 | err := _AdapterRegistry.contract.Call(opts, out, "getAdapterBalance", account, adapter, tokens) 230 | return *ret0, err 231 | } 232 | 233 | // GetAdapterBalance is a free data retrieval call binding the contract method 0x4bf9649b. 234 | // 235 | // Solidity: function getAdapterBalance(address account, address adapter, address[] tokens) view returns(AdapterBalance) 236 | func (_AdapterRegistry *AdapterRegistrySession) GetAdapterBalance(account common.Address, adapter common.Address, tokens []common.Address) (AdapterBalance, error) { 237 | return _AdapterRegistry.Contract.GetAdapterBalance(&_AdapterRegistry.CallOpts, account, adapter, tokens) 238 | } 239 | 240 | // GetAdapterBalance is a free data retrieval call binding the contract method 0x4bf9649b. 241 | // 242 | // Solidity: function getAdapterBalance(address account, address adapter, address[] tokens) view returns(AdapterBalance) 243 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetAdapterBalance(account common.Address, adapter common.Address, tokens []common.Address) (AdapterBalance, error) { 244 | return _AdapterRegistry.Contract.GetAdapterBalance(&_AdapterRegistry.CallOpts, account, adapter, tokens) 245 | } 246 | 247 | // GetAdapterBalances is a free data retrieval call binding the contract method 0xa2aef46d. 248 | // 249 | // Solidity: function getAdapterBalances(address account, address[] adapters) view returns([]AdapterBalance) 250 | func (_AdapterRegistry *AdapterRegistryCaller) GetAdapterBalances(opts *bind.CallOpts, account common.Address, adapters []common.Address) ([]AdapterBalance, error) { 251 | var ( 252 | ret0 = new([]AdapterBalance) 253 | ) 254 | out := ret0 255 | err := _AdapterRegistry.contract.Call(opts, out, "getAdapterBalances", account, adapters) 256 | return *ret0, err 257 | } 258 | 259 | // GetAdapterBalances is a free data retrieval call binding the contract method 0xa2aef46d. 260 | // 261 | // Solidity: function getAdapterBalances(address account, address[] adapters) view returns([]AdapterBalance) 262 | func (_AdapterRegistry *AdapterRegistrySession) GetAdapterBalances(account common.Address, adapters []common.Address) ([]AdapterBalance, error) { 263 | return _AdapterRegistry.Contract.GetAdapterBalances(&_AdapterRegistry.CallOpts, account, adapters) 264 | } 265 | 266 | // GetAdapterBalances is a free data retrieval call binding the contract method 0xa2aef46d. 267 | // 268 | // Solidity: function getAdapterBalances(address account, address[] adapters) view returns([]AdapterBalance) 269 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetAdapterBalances(account common.Address, adapters []common.Address) ([]AdapterBalance, error) { 270 | return _AdapterRegistry.Contract.GetAdapterBalances(&_AdapterRegistry.CallOpts, account, adapters) 271 | } 272 | 273 | // GetBalances is a free data retrieval call binding the contract method 0xc84aae17. 274 | // 275 | // Solidity: function getBalances(address account) view returns([]ProtocolBalance) 276 | func (_AdapterRegistry *AdapterRegistryCaller) GetBalances(opts *bind.CallOpts, account common.Address) ([]ProtocolBalance, error) { 277 | var ( 278 | ret0 = new([]ProtocolBalance) 279 | ) 280 | out := ret0 281 | err := _AdapterRegistry.contract.Call(opts, out, "getBalances", account) 282 | return *ret0, err 283 | } 284 | 285 | // GetBalances is a free data retrieval call binding the contract method 0xc84aae17. 286 | // 287 | // Solidity: function getBalances(address account) view returns([]ProtocolBalance) 288 | func (_AdapterRegistry *AdapterRegistrySession) GetBalances(account common.Address) ([]ProtocolBalance, error) { 289 | return _AdapterRegistry.Contract.GetBalances(&_AdapterRegistry.CallOpts, account) 290 | } 291 | 292 | // GetBalances is a free data retrieval call binding the contract method 0xc84aae17. 293 | // 294 | // Solidity: function getBalances(address account) view returns([]ProtocolBalance) 295 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetBalances(account common.Address) ([]ProtocolBalance, error) { 296 | return _AdapterRegistry.Contract.GetBalances(&_AdapterRegistry.CallOpts, account) 297 | } 298 | 299 | // GetFinalFullTokenBalance is a free data retrieval call binding the contract method 0xa81d9a09. 300 | // 301 | // Solidity: function getFinalFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 302 | func (_AdapterRegistry *AdapterRegistryCaller) GetFinalFullTokenBalance(opts *bind.CallOpts, tokenType string, token common.Address) (FullTokenBalance, error) { 303 | var ( 304 | ret0 = new(FullTokenBalance) 305 | ) 306 | out := ret0 307 | err := _AdapterRegistry.contract.Call(opts, out, "getFinalFullTokenBalance", tokenType, token) 308 | return *ret0, err 309 | } 310 | 311 | // GetFinalFullTokenBalance is a free data retrieval call binding the contract method 0xa81d9a09. 312 | // 313 | // Solidity: function getFinalFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 314 | func (_AdapterRegistry *AdapterRegistrySession) GetFinalFullTokenBalance(tokenType string, token common.Address) (FullTokenBalance, error) { 315 | return _AdapterRegistry.Contract.GetFinalFullTokenBalance(&_AdapterRegistry.CallOpts, tokenType, token) 316 | } 317 | 318 | // GetFinalFullTokenBalance is a free data retrieval call binding the contract method 0xa81d9a09. 319 | // 320 | // Solidity: function getFinalFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 321 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetFinalFullTokenBalance(tokenType string, token common.Address) (FullTokenBalance, error) { 322 | return _AdapterRegistry.Contract.GetFinalFullTokenBalance(&_AdapterRegistry.CallOpts, tokenType, token) 323 | } 324 | 325 | // GetFullTokenBalance is a free data retrieval call binding the contract method 0x56098b38. 326 | // 327 | // Solidity: function getFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 328 | func (_AdapterRegistry *AdapterRegistryCaller) GetFullTokenBalance(opts *bind.CallOpts, tokenType string, token common.Address) (FullTokenBalance, error) { 329 | var ( 330 | ret0 = new(FullTokenBalance) 331 | ) 332 | out := ret0 333 | err := _AdapterRegistry.contract.Call(opts, out, "getFullTokenBalance", tokenType, token) 334 | return *ret0, err 335 | } 336 | 337 | // GetFullTokenBalance is a free data retrieval call binding the contract method 0x56098b38. 338 | // 339 | // Solidity: function getFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 340 | func (_AdapterRegistry *AdapterRegistrySession) GetFullTokenBalance(tokenType string, token common.Address) (FullTokenBalance, error) { 341 | return _AdapterRegistry.Contract.GetFullTokenBalance(&_AdapterRegistry.CallOpts, tokenType, token) 342 | } 343 | 344 | // GetFullTokenBalance is a free data retrieval call binding the contract method 0x56098b38. 345 | // 346 | // Solidity: function getFullTokenBalance(string tokenType, address token) view returns(FullTokenBalance) 347 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetFullTokenBalance(tokenType string, token common.Address) (FullTokenBalance, error) { 348 | return _AdapterRegistry.Contract.GetFullTokenBalance(&_AdapterRegistry.CallOpts, tokenType, token) 349 | } 350 | 351 | // GetProtocolAdapters is a free data retrieval call binding the contract method 0xeff70322. 352 | // 353 | // Solidity: function getProtocolAdapters(string protocolName) view returns(address[]) 354 | func (_AdapterRegistry *AdapterRegistryCaller) GetProtocolAdapters(opts *bind.CallOpts, protocolName string) ([]common.Address, error) { 355 | var ( 356 | ret0 = new([]common.Address) 357 | ) 358 | out := ret0 359 | err := _AdapterRegistry.contract.Call(opts, out, "getProtocolAdapters", protocolName) 360 | return *ret0, err 361 | } 362 | 363 | // GetProtocolAdapters is a free data retrieval call binding the contract method 0xeff70322. 364 | // 365 | // Solidity: function getProtocolAdapters(string protocolName) view returns(address[]) 366 | func (_AdapterRegistry *AdapterRegistrySession) GetProtocolAdapters(protocolName string) ([]common.Address, error) { 367 | return _AdapterRegistry.Contract.GetProtocolAdapters(&_AdapterRegistry.CallOpts, protocolName) 368 | } 369 | 370 | // GetProtocolAdapters is a free data retrieval call binding the contract method 0xeff70322. 371 | // 372 | // Solidity: function getProtocolAdapters(string protocolName) view returns(address[]) 373 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetProtocolAdapters(protocolName string) ([]common.Address, error) { 374 | return _AdapterRegistry.Contract.GetProtocolAdapters(&_AdapterRegistry.CallOpts, protocolName) 375 | } 376 | 377 | // GetProtocolBalances is a free data retrieval call binding the contract method 0x85c6a793. 378 | // 379 | // Solidity: function getProtocolBalances(address account, string[] protocolNames) view returns([]ProtocolBalance) 380 | func (_AdapterRegistry *AdapterRegistryCaller) GetProtocolBalances(opts *bind.CallOpts, account common.Address, protocolNames []string) ([]ProtocolBalance, error) { 381 | var ( 382 | ret0 = new([]ProtocolBalance) 383 | ) 384 | out := ret0 385 | err := _AdapterRegistry.contract.Call(opts, out, "getProtocolBalances", account, protocolNames) 386 | return *ret0, err 387 | } 388 | 389 | // GetProtocolBalances is a free data retrieval call binding the contract method 0x85c6a793. 390 | // 391 | // Solidity: function getProtocolBalances(address account, string[] protocolNames) view returns([]ProtocolBalance) 392 | func (_AdapterRegistry *AdapterRegistrySession) GetProtocolBalances(account common.Address, protocolNames []string) ([]ProtocolBalance, error) { 393 | return _AdapterRegistry.Contract.GetProtocolBalances(&_AdapterRegistry.CallOpts, account, protocolNames) 394 | } 395 | 396 | // GetProtocolBalances is a free data retrieval call binding the contract method 0x85c6a793. 397 | // 398 | // Solidity: function getProtocolBalances(address account, string[] protocolNames) view returns([]ProtocolBalance) 399 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetProtocolBalances(account common.Address, protocolNames []string) ([]ProtocolBalance, error) { 400 | return _AdapterRegistry.Contract.GetProtocolBalances(&_AdapterRegistry.CallOpts, account, protocolNames) 401 | } 402 | 403 | // GetProtocolMetadata is a free data retrieval call binding the contract method 0xd857da49. 404 | // 405 | // Solidity: function getProtocolMetadata(string protocolName) view returns(ProtocolMetadata) 406 | func (_AdapterRegistry *AdapterRegistryCaller) GetProtocolMetadata(opts *bind.CallOpts, protocolName string) (ProtocolMetadata, error) { 407 | var ( 408 | ret0 = new(ProtocolMetadata) 409 | ) 410 | out := ret0 411 | err := _AdapterRegistry.contract.Call(opts, out, "getProtocolMetadata", protocolName) 412 | return *ret0, err 413 | } 414 | 415 | // GetProtocolMetadata is a free data retrieval call binding the contract method 0xd857da49. 416 | // 417 | // Solidity: function getProtocolMetadata(string protocolName) view returns(ProtocolMetadata) 418 | func (_AdapterRegistry *AdapterRegistrySession) GetProtocolMetadata(protocolName string) (ProtocolMetadata, error) { 419 | return _AdapterRegistry.Contract.GetProtocolMetadata(&_AdapterRegistry.CallOpts, protocolName) 420 | } 421 | 422 | // GetProtocolMetadata is a free data retrieval call binding the contract method 0xd857da49. 423 | // 424 | // Solidity: function getProtocolMetadata(string protocolName) view returns(ProtocolMetadata) 425 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetProtocolMetadata(protocolName string) (ProtocolMetadata, error) { 426 | return _AdapterRegistry.Contract.GetProtocolMetadata(&_AdapterRegistry.CallOpts, protocolName) 427 | } 428 | 429 | // GetProtocolNames is a free data retrieval call binding the contract method 0x3b692f52. 430 | // 431 | // Solidity: function getProtocolNames() view returns(string[]) 432 | func (_AdapterRegistry *AdapterRegistryCaller) GetProtocolNames(opts *bind.CallOpts) ([]string, error) { 433 | var ( 434 | ret0 = new([]string) 435 | ) 436 | out := ret0 437 | err := _AdapterRegistry.contract.Call(opts, out, "getProtocolNames") 438 | return *ret0, err 439 | } 440 | 441 | // GetProtocolNames is a free data retrieval call binding the contract method 0x3b692f52. 442 | // 443 | // Solidity: function getProtocolNames() view returns(string[]) 444 | func (_AdapterRegistry *AdapterRegistrySession) GetProtocolNames() ([]string, error) { 445 | return _AdapterRegistry.Contract.GetProtocolNames(&_AdapterRegistry.CallOpts) 446 | } 447 | 448 | // GetProtocolNames is a free data retrieval call binding the contract method 0x3b692f52. 449 | // 450 | // Solidity: function getProtocolNames() view returns(string[]) 451 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetProtocolNames() ([]string, error) { 452 | return _AdapterRegistry.Contract.GetProtocolNames(&_AdapterRegistry.CallOpts) 453 | } 454 | 455 | // GetSupportedTokens is a free data retrieval call binding the contract method 0x07526acf. 456 | // 457 | // Solidity: function getSupportedTokens(address adapter) view returns(address[]) 458 | func (_AdapterRegistry *AdapterRegistryCaller) GetSupportedTokens(opts *bind.CallOpts, adapter common.Address) ([]common.Address, error) { 459 | var ( 460 | ret0 = new([]common.Address) 461 | ) 462 | out := ret0 463 | err := _AdapterRegistry.contract.Call(opts, out, "getSupportedTokens", adapter) 464 | return *ret0, err 465 | } 466 | 467 | // GetSupportedTokens is a free data retrieval call binding the contract method 0x07526acf. 468 | // 469 | // Solidity: function getSupportedTokens(address adapter) view returns(address[]) 470 | func (_AdapterRegistry *AdapterRegistrySession) GetSupportedTokens(adapter common.Address) ([]common.Address, error) { 471 | return _AdapterRegistry.Contract.GetSupportedTokens(&_AdapterRegistry.CallOpts, adapter) 472 | } 473 | 474 | // GetSupportedTokens is a free data retrieval call binding the contract method 0x07526acf. 475 | // 476 | // Solidity: function getSupportedTokens(address adapter) view returns(address[]) 477 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetSupportedTokens(adapter common.Address) ([]common.Address, error) { 478 | return _AdapterRegistry.Contract.GetSupportedTokens(&_AdapterRegistry.CallOpts, adapter) 479 | } 480 | 481 | // GetTokenAdapter is a free data retrieval call binding the contract method 0x54fa3382. 482 | // 483 | // Solidity: function getTokenAdapter(string tokenAdapterName) view returns(address) 484 | func (_AdapterRegistry *AdapterRegistryCaller) GetTokenAdapter(opts *bind.CallOpts, tokenAdapterName string) (common.Address, error) { 485 | var ( 486 | ret0 = new(common.Address) 487 | ) 488 | out := ret0 489 | err := _AdapterRegistry.contract.Call(opts, out, "getTokenAdapter", tokenAdapterName) 490 | return *ret0, err 491 | } 492 | 493 | // GetTokenAdapter is a free data retrieval call binding the contract method 0x54fa3382. 494 | // 495 | // Solidity: function getTokenAdapter(string tokenAdapterName) view returns(address) 496 | func (_AdapterRegistry *AdapterRegistrySession) GetTokenAdapter(tokenAdapterName string) (common.Address, error) { 497 | return _AdapterRegistry.Contract.GetTokenAdapter(&_AdapterRegistry.CallOpts, tokenAdapterName) 498 | } 499 | 500 | // GetTokenAdapter is a free data retrieval call binding the contract method 0x54fa3382. 501 | // 502 | // Solidity: function getTokenAdapter(string tokenAdapterName) view returns(address) 503 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetTokenAdapter(tokenAdapterName string) (common.Address, error) { 504 | return _AdapterRegistry.Contract.GetTokenAdapter(&_AdapterRegistry.CallOpts, tokenAdapterName) 505 | } 506 | 507 | // GetTokenAdapterNames is a free data retrieval call binding the contract method 0xc0680cd3. 508 | // 509 | // Solidity: function getTokenAdapterNames() view returns(string[]) 510 | func (_AdapterRegistry *AdapterRegistryCaller) GetTokenAdapterNames(opts *bind.CallOpts) ([]string, error) { 511 | var ( 512 | ret0 = new([]string) 513 | ) 514 | out := ret0 515 | err := _AdapterRegistry.contract.Call(opts, out, "getTokenAdapterNames") 516 | return *ret0, err 517 | } 518 | 519 | // GetTokenAdapterNames is a free data retrieval call binding the contract method 0xc0680cd3. 520 | // 521 | // Solidity: function getTokenAdapterNames() view returns(string[]) 522 | func (_AdapterRegistry *AdapterRegistrySession) GetTokenAdapterNames() ([]string, error) { 523 | return _AdapterRegistry.Contract.GetTokenAdapterNames(&_AdapterRegistry.CallOpts) 524 | } 525 | 526 | // GetTokenAdapterNames is a free data retrieval call binding the contract method 0xc0680cd3. 527 | // 528 | // Solidity: function getTokenAdapterNames() view returns(string[]) 529 | func (_AdapterRegistry *AdapterRegistryCallerSession) GetTokenAdapterNames() ([]string, error) { 530 | return _AdapterRegistry.Contract.GetTokenAdapterNames(&_AdapterRegistry.CallOpts) 531 | } 532 | 533 | // IsValidProtocol is a free data retrieval call binding the contract method 0xcb874d33. 534 | // 535 | // Solidity: function isValidProtocol(string protocolName) view returns(bool) 536 | func (_AdapterRegistry *AdapterRegistryCaller) IsValidProtocol(opts *bind.CallOpts, protocolName string) (bool, error) { 537 | var ( 538 | ret0 = new(bool) 539 | ) 540 | out := ret0 541 | err := _AdapterRegistry.contract.Call(opts, out, "isValidProtocol", protocolName) 542 | return *ret0, err 543 | } 544 | 545 | // IsValidProtocol is a free data retrieval call binding the contract method 0xcb874d33. 546 | // 547 | // Solidity: function isValidProtocol(string protocolName) view returns(bool) 548 | func (_AdapterRegistry *AdapterRegistrySession) IsValidProtocol(protocolName string) (bool, error) { 549 | return _AdapterRegistry.Contract.IsValidProtocol(&_AdapterRegistry.CallOpts, protocolName) 550 | } 551 | 552 | // IsValidProtocol is a free data retrieval call binding the contract method 0xcb874d33. 553 | // 554 | // Solidity: function isValidProtocol(string protocolName) view returns(bool) 555 | func (_AdapterRegistry *AdapterRegistryCallerSession) IsValidProtocol(protocolName string) (bool, error) { 556 | return _AdapterRegistry.Contract.IsValidProtocol(&_AdapterRegistry.CallOpts, protocolName) 557 | } 558 | 559 | // IsValidTokenAdapter is a free data retrieval call binding the contract method 0xe9dd5f25. 560 | // 561 | // Solidity: function isValidTokenAdapter(string tokenAdapterName) view returns(bool) 562 | func (_AdapterRegistry *AdapterRegistryCaller) IsValidTokenAdapter(opts *bind.CallOpts, tokenAdapterName string) (bool, error) { 563 | var ( 564 | ret0 = new(bool) 565 | ) 566 | out := ret0 567 | err := _AdapterRegistry.contract.Call(opts, out, "isValidTokenAdapter", tokenAdapterName) 568 | return *ret0, err 569 | } 570 | 571 | // IsValidTokenAdapter is a free data retrieval call binding the contract method 0xe9dd5f25. 572 | // 573 | // Solidity: function isValidTokenAdapter(string tokenAdapterName) view returns(bool) 574 | func (_AdapterRegistry *AdapterRegistrySession) IsValidTokenAdapter(tokenAdapterName string) (bool, error) { 575 | return _AdapterRegistry.Contract.IsValidTokenAdapter(&_AdapterRegistry.CallOpts, tokenAdapterName) 576 | } 577 | 578 | // IsValidTokenAdapter is a free data retrieval call binding the contract method 0xe9dd5f25. 579 | // 580 | // Solidity: function isValidTokenAdapter(string tokenAdapterName) view returns(bool) 581 | func (_AdapterRegistry *AdapterRegistryCallerSession) IsValidTokenAdapter(tokenAdapterName string) (bool, error) { 582 | return _AdapterRegistry.Contract.IsValidTokenAdapter(&_AdapterRegistry.CallOpts, tokenAdapterName) 583 | } 584 | 585 | // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 586 | // 587 | // Solidity: function owner() view returns(address) 588 | func (_AdapterRegistry *AdapterRegistryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { 589 | var ( 590 | ret0 = new(common.Address) 591 | ) 592 | out := ret0 593 | err := _AdapterRegistry.contract.Call(opts, out, "owner") 594 | return *ret0, err 595 | } 596 | 597 | // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 598 | // 599 | // Solidity: function owner() view returns(address) 600 | func (_AdapterRegistry *AdapterRegistrySession) Owner() (common.Address, error) { 601 | return _AdapterRegistry.Contract.Owner(&_AdapterRegistry.CallOpts) 602 | } 603 | 604 | // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 605 | // 606 | // Solidity: function owner() view returns(address) 607 | func (_AdapterRegistry *AdapterRegistryCallerSession) Owner() (common.Address, error) { 608 | return _AdapterRegistry.Contract.Owner(&_AdapterRegistry.CallOpts) 609 | } 610 | 611 | // AddProtocolAdapters is a paid mutator transaction binding the contract method 0xbefe43a3. 612 | // 613 | // Solidity: function addProtocolAdapters(string protocolName, address[] adapters, address[][] tokens) returns() 614 | func (_AdapterRegistry *AdapterRegistryTransactor) AddProtocolAdapters(opts *bind.TransactOpts, protocolName string, adapters []common.Address, tokens [][]common.Address) (*types.Transaction, error) { 615 | return _AdapterRegistry.contract.Transact(opts, "addProtocolAdapters", protocolName, adapters, tokens) 616 | } 617 | 618 | // AddProtocolAdapters is a paid mutator transaction binding the contract method 0xbefe43a3. 619 | // 620 | // Solidity: function addProtocolAdapters(string protocolName, address[] adapters, address[][] tokens) returns() 621 | func (_AdapterRegistry *AdapterRegistrySession) AddProtocolAdapters(protocolName string, adapters []common.Address, tokens [][]common.Address) (*types.Transaction, error) { 622 | return _AdapterRegistry.Contract.AddProtocolAdapters(&_AdapterRegistry.TransactOpts, protocolName, adapters, tokens) 623 | } 624 | 625 | // AddProtocolAdapters is a paid mutator transaction binding the contract method 0xbefe43a3. 626 | // 627 | // Solidity: function addProtocolAdapters(string protocolName, address[] adapters, address[][] tokens) returns() 628 | func (_AdapterRegistry *AdapterRegistryTransactorSession) AddProtocolAdapters(protocolName string, adapters []common.Address, tokens [][]common.Address) (*types.Transaction, error) { 629 | return _AdapterRegistry.Contract.AddProtocolAdapters(&_AdapterRegistry.TransactOpts, protocolName, adapters, tokens) 630 | } 631 | 632 | // AddProtocols is a paid mutator transaction binding the contract method 0x83c0a76e. 633 | // 634 | // Solidity: function addProtocols(string[] protocolNames, []ProtocolMetadata metadata, address[][] adapters, address[][][] tokens) returns() 635 | func (_AdapterRegistry *AdapterRegistryTransactor) AddProtocols(opts *bind.TransactOpts, protocolNames []string, metadata []ProtocolMetadata, adapters [][]common.Address, tokens [][][]common.Address) (*types.Transaction, error) { 636 | return _AdapterRegistry.contract.Transact(opts, "addProtocols", protocolNames, metadata, adapters, tokens) 637 | } 638 | 639 | // AddProtocols is a paid mutator transaction binding the contract method 0x83c0a76e. 640 | // 641 | // Solidity: function addProtocols(string[] protocolNames, []ProtocolMetadata metadata, address[][] adapters, address[][][] tokens) returns() 642 | func (_AdapterRegistry *AdapterRegistrySession) AddProtocols(protocolNames []string, metadata []ProtocolMetadata, adapters [][]common.Address, tokens [][][]common.Address) (*types.Transaction, error) { 643 | return _AdapterRegistry.Contract.AddProtocols(&_AdapterRegistry.TransactOpts, protocolNames, metadata, adapters, tokens) 644 | } 645 | 646 | // AddProtocols is a paid mutator transaction binding the contract method 0x83c0a76e. 647 | // 648 | // Solidity: function addProtocols(string[] protocolNames, []ProtocolMetadata metadata, address[][] adapters, address[][][] tokens) returns() 649 | func (_AdapterRegistry *AdapterRegistryTransactorSession) AddProtocols(protocolNames []string, metadata []ProtocolMetadata, adapters [][]common.Address, tokens [][][]common.Address) (*types.Transaction, error) { 650 | return _AdapterRegistry.Contract.AddProtocols(&_AdapterRegistry.TransactOpts, protocolNames, metadata, adapters, tokens) 651 | } 652 | 653 | // AddTokenAdapters is a paid mutator transaction binding the contract method 0x70be4eda. 654 | // 655 | // Solidity: function addTokenAdapters(string[] tokenAdapterNames, address[] adapters) returns() 656 | func (_AdapterRegistry *AdapterRegistryTransactor) AddTokenAdapters(opts *bind.TransactOpts, tokenAdapterNames []string, adapters []common.Address) (*types.Transaction, error) { 657 | return _AdapterRegistry.contract.Transact(opts, "addTokenAdapters", tokenAdapterNames, adapters) 658 | } 659 | 660 | // AddTokenAdapters is a paid mutator transaction binding the contract method 0x70be4eda. 661 | // 662 | // Solidity: function addTokenAdapters(string[] tokenAdapterNames, address[] adapters) returns() 663 | func (_AdapterRegistry *AdapterRegistrySession) AddTokenAdapters(tokenAdapterNames []string, adapters []common.Address) (*types.Transaction, error) { 664 | return _AdapterRegistry.Contract.AddTokenAdapters(&_AdapterRegistry.TransactOpts, tokenAdapterNames, adapters) 665 | } 666 | 667 | // AddTokenAdapters is a paid mutator transaction binding the contract method 0x70be4eda. 668 | // 669 | // Solidity: function addTokenAdapters(string[] tokenAdapterNames, address[] adapters) returns() 670 | func (_AdapterRegistry *AdapterRegistryTransactorSession) AddTokenAdapters(tokenAdapterNames []string, adapters []common.Address) (*types.Transaction, error) { 671 | return _AdapterRegistry.Contract.AddTokenAdapters(&_AdapterRegistry.TransactOpts, tokenAdapterNames, adapters) 672 | } 673 | 674 | // RemoveProtocolAdapters is a paid mutator transaction binding the contract method 0x00778353. 675 | // 676 | // Solidity: function removeProtocolAdapters(string protocolName, uint256[] adapterIndices) returns() 677 | func (_AdapterRegistry *AdapterRegistryTransactor) RemoveProtocolAdapters(opts *bind.TransactOpts, protocolName string, adapterIndices []*big.Int) (*types.Transaction, error) { 678 | return _AdapterRegistry.contract.Transact(opts, "removeProtocolAdapters", protocolName, adapterIndices) 679 | } 680 | 681 | // RemoveProtocolAdapters is a paid mutator transaction binding the contract method 0x00778353. 682 | // 683 | // Solidity: function removeProtocolAdapters(string protocolName, uint256[] adapterIndices) returns() 684 | func (_AdapterRegistry *AdapterRegistrySession) RemoveProtocolAdapters(protocolName string, adapterIndices []*big.Int) (*types.Transaction, error) { 685 | return _AdapterRegistry.Contract.RemoveProtocolAdapters(&_AdapterRegistry.TransactOpts, protocolName, adapterIndices) 686 | } 687 | 688 | // RemoveProtocolAdapters is a paid mutator transaction binding the contract method 0x00778353. 689 | // 690 | // Solidity: function removeProtocolAdapters(string protocolName, uint256[] adapterIndices) returns() 691 | func (_AdapterRegistry *AdapterRegistryTransactorSession) RemoveProtocolAdapters(protocolName string, adapterIndices []*big.Int) (*types.Transaction, error) { 692 | return _AdapterRegistry.Contract.RemoveProtocolAdapters(&_AdapterRegistry.TransactOpts, protocolName, adapterIndices) 693 | } 694 | 695 | // RemoveProtocols is a paid mutator transaction binding the contract method 0x657ea762. 696 | // 697 | // Solidity: function removeProtocols(string[] protocolNames) returns() 698 | func (_AdapterRegistry *AdapterRegistryTransactor) RemoveProtocols(opts *bind.TransactOpts, protocolNames []string) (*types.Transaction, error) { 699 | return _AdapterRegistry.contract.Transact(opts, "removeProtocols", protocolNames) 700 | } 701 | 702 | // RemoveProtocols is a paid mutator transaction binding the contract method 0x657ea762. 703 | // 704 | // Solidity: function removeProtocols(string[] protocolNames) returns() 705 | func (_AdapterRegistry *AdapterRegistrySession) RemoveProtocols(protocolNames []string) (*types.Transaction, error) { 706 | return _AdapterRegistry.Contract.RemoveProtocols(&_AdapterRegistry.TransactOpts, protocolNames) 707 | } 708 | 709 | // RemoveProtocols is a paid mutator transaction binding the contract method 0x657ea762. 710 | // 711 | // Solidity: function removeProtocols(string[] protocolNames) returns() 712 | func (_AdapterRegistry *AdapterRegistryTransactorSession) RemoveProtocols(protocolNames []string) (*types.Transaction, error) { 713 | return _AdapterRegistry.Contract.RemoveProtocols(&_AdapterRegistry.TransactOpts, protocolNames) 714 | } 715 | 716 | // RemoveTokenAdapters is a paid mutator transaction binding the contract method 0x9d392fa0. 717 | // 718 | // Solidity: function removeTokenAdapters(string[] tokenAdapterNames) returns() 719 | func (_AdapterRegistry *AdapterRegistryTransactor) RemoveTokenAdapters(opts *bind.TransactOpts, tokenAdapterNames []string) (*types.Transaction, error) { 720 | return _AdapterRegistry.contract.Transact(opts, "removeTokenAdapters", tokenAdapterNames) 721 | } 722 | 723 | // RemoveTokenAdapters is a paid mutator transaction binding the contract method 0x9d392fa0. 724 | // 725 | // Solidity: function removeTokenAdapters(string[] tokenAdapterNames) returns() 726 | func (_AdapterRegistry *AdapterRegistrySession) RemoveTokenAdapters(tokenAdapterNames []string) (*types.Transaction, error) { 727 | return _AdapterRegistry.Contract.RemoveTokenAdapters(&_AdapterRegistry.TransactOpts, tokenAdapterNames) 728 | } 729 | 730 | // RemoveTokenAdapters is a paid mutator transaction binding the contract method 0x9d392fa0. 731 | // 732 | // Solidity: function removeTokenAdapters(string[] tokenAdapterNames) returns() 733 | func (_AdapterRegistry *AdapterRegistryTransactorSession) RemoveTokenAdapters(tokenAdapterNames []string) (*types.Transaction, error) { 734 | return _AdapterRegistry.Contract.RemoveTokenAdapters(&_AdapterRegistry.TransactOpts, tokenAdapterNames) 735 | } 736 | 737 | // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 738 | // 739 | // Solidity: function transferOwnership(address _owner) returns() 740 | func (_AdapterRegistry *AdapterRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { 741 | return _AdapterRegistry.contract.Transact(opts, "transferOwnership", _owner) 742 | } 743 | 744 | // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 745 | // 746 | // Solidity: function transferOwnership(address _owner) returns() 747 | func (_AdapterRegistry *AdapterRegistrySession) TransferOwnership(_owner common.Address) (*types.Transaction, error) { 748 | return _AdapterRegistry.Contract.TransferOwnership(&_AdapterRegistry.TransactOpts, _owner) 749 | } 750 | 751 | // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 752 | // 753 | // Solidity: function transferOwnership(address _owner) returns() 754 | func (_AdapterRegistry *AdapterRegistryTransactorSession) TransferOwnership(_owner common.Address) (*types.Transaction, error) { 755 | return _AdapterRegistry.Contract.TransferOwnership(&_AdapterRegistry.TransactOpts, _owner) 756 | } 757 | 758 | // UpdateProtocolAdapter is a paid mutator transaction binding the contract method 0xdeebabcc. 759 | // 760 | // Solidity: function updateProtocolAdapter(string protocolName, uint256 index, address newAdapterAddress, address[] newSupportedTokens) returns() 761 | func (_AdapterRegistry *AdapterRegistryTransactor) UpdateProtocolAdapter(opts *bind.TransactOpts, protocolName string, index *big.Int, newAdapterAddress common.Address, newSupportedTokens []common.Address) (*types.Transaction, error) { 762 | return _AdapterRegistry.contract.Transact(opts, "updateProtocolAdapter", protocolName, index, newAdapterAddress, newSupportedTokens) 763 | } 764 | 765 | // UpdateProtocolAdapter is a paid mutator transaction binding the contract method 0xdeebabcc. 766 | // 767 | // Solidity: function updateProtocolAdapter(string protocolName, uint256 index, address newAdapterAddress, address[] newSupportedTokens) returns() 768 | func (_AdapterRegistry *AdapterRegistrySession) UpdateProtocolAdapter(protocolName string, index *big.Int, newAdapterAddress common.Address, newSupportedTokens []common.Address) (*types.Transaction, error) { 769 | return _AdapterRegistry.Contract.UpdateProtocolAdapter(&_AdapterRegistry.TransactOpts, protocolName, index, newAdapterAddress, newSupportedTokens) 770 | } 771 | 772 | // UpdateProtocolAdapter is a paid mutator transaction binding the contract method 0xdeebabcc. 773 | // 774 | // Solidity: function updateProtocolAdapter(string protocolName, uint256 index, address newAdapterAddress, address[] newSupportedTokens) returns() 775 | func (_AdapterRegistry *AdapterRegistryTransactorSession) UpdateProtocolAdapter(protocolName string, index *big.Int, newAdapterAddress common.Address, newSupportedTokens []common.Address) (*types.Transaction, error) { 776 | return _AdapterRegistry.Contract.UpdateProtocolAdapter(&_AdapterRegistry.TransactOpts, protocolName, index, newAdapterAddress, newSupportedTokens) 777 | } 778 | 779 | // UpdateProtocolMetadata is a paid mutator transaction binding the contract method 0xb2c687d0. 780 | // 781 | // Solidity: function updateProtocolMetadata(string protocolName, string name, string description, string websiteURL, string iconURL) returns() 782 | func (_AdapterRegistry *AdapterRegistryTransactor) UpdateProtocolMetadata(opts *bind.TransactOpts, protocolName string, name string, description string, websiteURL string, iconURL string) (*types.Transaction, error) { 783 | return _AdapterRegistry.contract.Transact(opts, "updateProtocolMetadata", protocolName, name, description, websiteURL, iconURL) 784 | } 785 | 786 | // UpdateProtocolMetadata is a paid mutator transaction binding the contract method 0xb2c687d0. 787 | // 788 | // Solidity: function updateProtocolMetadata(string protocolName, string name, string description, string websiteURL, string iconURL) returns() 789 | func (_AdapterRegistry *AdapterRegistrySession) UpdateProtocolMetadata(protocolName string, name string, description string, websiteURL string, iconURL string) (*types.Transaction, error) { 790 | return _AdapterRegistry.Contract.UpdateProtocolMetadata(&_AdapterRegistry.TransactOpts, protocolName, name, description, websiteURL, iconURL) 791 | } 792 | 793 | // UpdateProtocolMetadata is a paid mutator transaction binding the contract method 0xb2c687d0. 794 | // 795 | // Solidity: function updateProtocolMetadata(string protocolName, string name, string description, string websiteURL, string iconURL) returns() 796 | func (_AdapterRegistry *AdapterRegistryTransactorSession) UpdateProtocolMetadata(protocolName string, name string, description string, websiteURL string, iconURL string) (*types.Transaction, error) { 797 | return _AdapterRegistry.Contract.UpdateProtocolMetadata(&_AdapterRegistry.TransactOpts, protocolName, name, description, websiteURL, iconURL) 798 | } 799 | 800 | // UpdateTokenAdapter is a paid mutator transaction binding the contract method 0x2dc909f6. 801 | // 802 | // Solidity: function updateTokenAdapter(string tokenAdapterName, address adapter) returns() 803 | func (_AdapterRegistry *AdapterRegistryTransactor) UpdateTokenAdapter(opts *bind.TransactOpts, tokenAdapterName string, adapter common.Address) (*types.Transaction, error) { 804 | return _AdapterRegistry.contract.Transact(opts, "updateTokenAdapter", tokenAdapterName, adapter) 805 | } 806 | 807 | // UpdateTokenAdapter is a paid mutator transaction binding the contract method 0x2dc909f6. 808 | // 809 | // Solidity: function updateTokenAdapter(string tokenAdapterName, address adapter) returns() 810 | func (_AdapterRegistry *AdapterRegistrySession) UpdateTokenAdapter(tokenAdapterName string, adapter common.Address) (*types.Transaction, error) { 811 | return _AdapterRegistry.Contract.UpdateTokenAdapter(&_AdapterRegistry.TransactOpts, tokenAdapterName, adapter) 812 | } 813 | 814 | // UpdateTokenAdapter is a paid mutator transaction binding the contract method 0x2dc909f6. 815 | // 816 | // Solidity: function updateTokenAdapter(string tokenAdapterName, address adapter) returns() 817 | func (_AdapterRegistry *AdapterRegistryTransactorSession) UpdateTokenAdapter(tokenAdapterName string, adapter common.Address) (*types.Transaction, error) { 818 | return _AdapterRegistry.Contract.UpdateTokenAdapter(&_AdapterRegistry.TransactOpts, tokenAdapterName, adapter) 819 | } 820 | 821 | // AdapterRegistryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the AdapterRegistry contract. 822 | type AdapterRegistryOwnershipTransferredIterator struct { 823 | Event *AdapterRegistryOwnershipTransferred // Event containing the contract specifics and raw log 824 | 825 | contract *bind.BoundContract // Generic contract to use for unpacking event data 826 | event string // Event name to use for unpacking event data 827 | 828 | logs chan types.Log // Log channel receiving the found contract events 829 | sub ethereum.Subscription // Subscription for errors, completion and termination 830 | done bool // Whether the subscription completed delivering logs 831 | fail error // Occurred error to stop iteration 832 | } 833 | 834 | // Next advances the iterator to the subsequent event, returning whether there 835 | // are any more events found. In case of a retrieval or parsing error, false is 836 | // returned and Error() can be queried for the exact failure. 837 | func (it *AdapterRegistryOwnershipTransferredIterator) Next() bool { 838 | // If the iterator failed, stop iterating 839 | if it.fail != nil { 840 | return false 841 | } 842 | // If the iterator completed, deliver directly whatever's available 843 | if it.done { 844 | select { 845 | case log := <-it.logs: 846 | it.Event = new(AdapterRegistryOwnershipTransferred) 847 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 848 | it.fail = err 849 | return false 850 | } 851 | it.Event.Raw = log 852 | return true 853 | 854 | default: 855 | return false 856 | } 857 | } 858 | // Iterator still in progress, wait for either a data or an error event 859 | select { 860 | case log := <-it.logs: 861 | it.Event = new(AdapterRegistryOwnershipTransferred) 862 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 863 | it.fail = err 864 | return false 865 | } 866 | it.Event.Raw = log 867 | return true 868 | 869 | case err := <-it.sub.Err(): 870 | it.done = true 871 | it.fail = err 872 | return it.Next() 873 | } 874 | } 875 | 876 | // Error returns any retrieval or parsing error occurred during filtering. 877 | func (it *AdapterRegistryOwnershipTransferredIterator) Error() error { 878 | return it.fail 879 | } 880 | 881 | // Close terminates the iteration process, releasing any pending underlying 882 | // resources. 883 | func (it *AdapterRegistryOwnershipTransferredIterator) Close() error { 884 | it.sub.Unsubscribe() 885 | return nil 886 | } 887 | 888 | // AdapterRegistryOwnershipTransferred represents a OwnershipTransferred event raised by the AdapterRegistry contract. 889 | type AdapterRegistryOwnershipTransferred struct { 890 | PreviousOwner common.Address 891 | NewOwner common.Address 892 | Raw types.Log // Blockchain specific contextual infos 893 | } 894 | 895 | // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 896 | // 897 | // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 898 | func (_AdapterRegistry *AdapterRegistryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*AdapterRegistryOwnershipTransferredIterator, error) { 899 | 900 | var previousOwnerRule []interface{} 901 | for _, previousOwnerItem := range previousOwner { 902 | previousOwnerRule = append(previousOwnerRule, previousOwnerItem) 903 | } 904 | var newOwnerRule []interface{} 905 | for _, newOwnerItem := range newOwner { 906 | newOwnerRule = append(newOwnerRule, newOwnerItem) 907 | } 908 | 909 | logs, sub, err := _AdapterRegistry.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) 910 | if err != nil { 911 | return nil, err 912 | } 913 | return &AdapterRegistryOwnershipTransferredIterator{contract: _AdapterRegistry.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil 914 | } 915 | 916 | // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 917 | // 918 | // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 919 | func (_AdapterRegistry *AdapterRegistryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *AdapterRegistryOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { 920 | 921 | var previousOwnerRule []interface{} 922 | for _, previousOwnerItem := range previousOwner { 923 | previousOwnerRule = append(previousOwnerRule, previousOwnerItem) 924 | } 925 | var newOwnerRule []interface{} 926 | for _, newOwnerItem := range newOwner { 927 | newOwnerRule = append(newOwnerRule, newOwnerItem) 928 | } 929 | 930 | logs, sub, err := _AdapterRegistry.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) 931 | if err != nil { 932 | return nil, err 933 | } 934 | return event.NewSubscription(func(quit <-chan struct{}) error { 935 | defer sub.Unsubscribe() 936 | for { 937 | select { 938 | case log := <-logs: 939 | // New log arrived, parse the event and forward to the user 940 | event := new(AdapterRegistryOwnershipTransferred) 941 | if err := _AdapterRegistry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { 942 | return err 943 | } 944 | event.Raw = log 945 | 946 | select { 947 | case sink <- event: 948 | case err := <-sub.Err(): 949 | return err 950 | case <-quit: 951 | return nil 952 | } 953 | case err := <-sub.Err(): 954 | return err 955 | case <-quit: 956 | return nil 957 | } 958 | } 959 | }), nil 960 | } 961 | 962 | // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 963 | // 964 | // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 965 | func (_AdapterRegistry *AdapterRegistryFilterer) ParseOwnershipTransferred(log types.Log) (*AdapterRegistryOwnershipTransferred, error) { 966 | event := new(AdapterRegistryOwnershipTransferred) 967 | if err := _AdapterRegistry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { 968 | return nil, err 969 | } 970 | return event, nil 971 | } 972 | -------------------------------------------------------------------------------- /defisdk.go: -------------------------------------------------------------------------------- 1 | package defisdk 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 7 | "github.com/ethereum/go-ethereum/common" 8 | "github.com/ethereum/go-ethereum/ethclient" 9 | 10 | registry "github.com/zeriontech/defi-sdk-go/adapter-registry" 11 | ) 12 | 13 | type DefiSDK struct { 14 | registryAddress common.Address 15 | client *ethclient.Client 16 | registry *registry.AdapterRegistry 17 | } 18 | 19 | const registryAddressString string = "0x06fe76b2f432fdfecaef1a7d4f6c3d41b5861672" 20 | 21 | func New(nodeURL string) DefiSDK { 22 | client, err := ethclient.Dial(nodeURL) 23 | if err != nil { 24 | log.Fatal(err) 25 | } 26 | registryAddress := common.HexToAddress(registryAddressString) 27 | instance, err := registry.NewAdapterRegistry(registryAddress, client) 28 | if err != nil { 29 | log.Fatal(err) 30 | } 31 | sdk := DefiSDK{registryAddress, client, instance} 32 | return sdk 33 | } 34 | 35 | func (sdk DefiSDK) GetSupportedProtocols() []string { 36 | supportedProtocols, err := sdk.registry.GetProtocolNames(&bind.CallOpts{}) 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | return supportedProtocols 41 | } 42 | 43 | func (sdk DefiSDK) GetTokenAdapterNames() []string { 44 | tokenAdapters, err := sdk.registry.GetTokenAdapterNames(&bind.CallOpts{}) 45 | if err != nil { 46 | log.Fatal(err) 47 | } 48 | return tokenAdapters 49 | } 50 | 51 | func (sdk DefiSDK) GetBalances(userAddress string) []registry.ProtocolBalance { 52 | address := common.HexToAddress(userAddress) 53 | 54 | protocolBalances, err := sdk.registry.GetBalances(&bind.CallOpts{}, address) 55 | if err != nil { 56 | log.Fatal(err) 57 | } 58 | return protocolBalances 59 | } 60 | 61 | func (sdk DefiSDK) GetProtocolBalance(userAddress string, protocolName string) registry.ProtocolBalance { 62 | address := common.HexToAddress(userAddress) 63 | protocolNames := []string{protocolName} 64 | 65 | protocolBalances, err := sdk.registry.GetProtocolBalances(&bind.CallOpts{}, address, protocolNames) 66 | if err != nil { 67 | log.Fatal(err) 68 | } 69 | return protocolBalances[0] 70 | } 71 | 72 | func (sdk DefiSDK) GetTokenComponents(tokenType string, tokenAddress string) []registry.TokenBalance { 73 | tokenBalance, err := sdk.registry.GetFullTokenBalance(&bind.CallOpts{}, tokenType, common.HexToAddress(tokenAddress)) 74 | if err != nil { 75 | log.Fatal(err) 76 | } 77 | return tokenBalance.Underlying 78 | } 79 | -------------------------------------------------------------------------------- /defisdk_test.go: -------------------------------------------------------------------------------- 1 | package defisdk 2 | 3 | import "testing" 4 | 5 | func TestMainFunctions(t *testing.T) { 6 | 7 | sdk := New("https://eth-mainnet.zerion.io/") 8 | sdk.GetTokenAdapterNames() 9 | 10 | user := "0xa218a8346454c982912cf6d14c714663c2d510d8" 11 | sdk.GetBalances(user) 12 | 13 | protocol := "Aave" 14 | sdk.GetProtocolBalance(user, protocol) 15 | 16 | uniswapDaiPool := "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667" 17 | sdk.GetTokenComponents("Uniswap V1 pool token", uniswapDaiPool) 18 | } 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/zeriontech/defi-sdk-go 2 | 3 | go 1.14 4 | 5 | require github.com/ethereum/go-ethereum v1.9.14 6 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= 2 | github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= 3 | github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= 4 | github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= 5 | github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= 6 | github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= 7 | github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= 8 | github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= 9 | github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 10 | github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 11 | github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= 12 | github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= 13 | github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= 14 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 15 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 16 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= 17 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 18 | github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= 19 | github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= 20 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 21 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 22 | github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= 23 | github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= 24 | github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= 25 | github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 26 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 27 | github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6 h1:Eey/GGQ/E5Xp1P2Lyx1qj007hLZfbi0+CoVeJruGCtI= 28 | github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= 29 | github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= 30 | github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= 31 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 32 | github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= 33 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 34 | github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= 35 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 36 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 37 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 38 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 39 | github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= 40 | github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= 41 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 42 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 43 | github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= 44 | github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= 45 | github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= 46 | github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c h1:JHHhtb9XWJrGNMcrVP6vyzO4dusgi/HnceHTgxSejUM= 47 | github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 48 | github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa h1:XKAhUk/dtp+CV0VO6mhG2V7jA9vbcGcnYF/Ay9NjZrY= 49 | github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= 50 | github.com/ethereum/go-ethereum v1.9.14 h1:/rGoPYujLeajAHyDs8aZKYcLrurLdUJP9AzHk73QNr0= 51 | github.com/ethereum/go-ethereum v1.9.14/go.mod h1:oP8FC5+TbICUyftkTWs+8JryntjIJLJvWvApK3z2AYw= 52 | github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 53 | github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= 54 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 55 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= 56 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= 57 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 58 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 59 | github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= 60 | github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= 61 | github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= 62 | github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= 63 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 64 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 65 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 66 | github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c h1:zqAKixg3cTcIasAMJV+EcfVbWwLpOZ7LeoWJvcuD/5Q= 67 | github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 68 | github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= 69 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 70 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 71 | github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989 h1:giknQ4mEuDFmmHSrGcbargOuLHQGtywqo4mheITex54= 72 | github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 73 | github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= 74 | github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= 75 | github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 76 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 77 | github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= 78 | github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= 79 | github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= 80 | github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= 81 | github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= 82 | github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= 83 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 84 | github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 85 | github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= 86 | github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= 87 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 88 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 89 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 90 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 91 | github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 92 | github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 93 | github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= 94 | github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= 95 | github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 96 | github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 97 | github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= 98 | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 99 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 100 | github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= 101 | github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= 102 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 103 | github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 104 | github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= 105 | github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 106 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 107 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 108 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 109 | github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 110 | github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= 111 | github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= 112 | github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= 113 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 114 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 115 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 116 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 117 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 118 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 119 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 120 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 121 | github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150 h1:ZeU+auZj1iNzN8iVhff6M38Mfu73FQiJve/GEXYJBjE= 122 | github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 123 | github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= 124 | github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= 125 | github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= 126 | github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= 127 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 128 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 129 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 130 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= 131 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= 132 | github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= 133 | github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= 134 | github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= 135 | github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= 136 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 137 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 138 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 139 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 140 | github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= 141 | github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= 142 | github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= 143 | github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= 144 | github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 145 | github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= 146 | github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= 147 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 148 | golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 h1:QmwruyY+bKbDDL0BaglrbZABEali68eoMFhTZpCjYVA= 149 | golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 150 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 151 | golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 152 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 153 | golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U= 154 | golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 155 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 156 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 157 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 158 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 159 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 160 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 161 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= 162 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 163 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 164 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 165 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 166 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 167 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 168 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 169 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 170 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 171 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 172 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= 173 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 174 | gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= 175 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 176 | gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= 177 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 178 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 179 | gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 180 | --------------------------------------------------------------------------------