├── .gitignore ├── LICENSE ├── README.md ├── api ├── address │ ├── address_security.go │ └── address_security_test.go ├── approval │ ├── approval_security.go │ ├── approval_security_test.go │ ├── approval_security_v2.go │ └── approval_security_v2_test.go ├── chain │ ├── chain.go │ └── chain_test.go ├── dapp │ ├── dapp_security.go │ └── dapp_security_test.go ├── decode │ ├── signature_data_decode.go │ └── signature_data_decode_test.go ├── nft │ ├── nft_security.go │ └── nft_security_test.go ├── phishingsite │ ├── phishing_site_detection.go │ └── phishing_site_detection_test.go ├── rugpull │ ├── rug_pull_detection.go │ └── rug_pull_detection_test.go └── token │ ├── token_security.go │ └── token_security_test.go ├── auth ├── auth.go └── auth_test.go ├── go.mod ├── go.sum └── pkg ├── errorcode └── errorcode.go └── gen ├── client ├── approve_controller_v_1 │ ├── address_contract_using_g_e_t1_parameters.go │ ├── address_contract_using_g_e_t1_responses.go │ ├── approval_contract_using_g_e_t_parameters.go │ ├── approval_contract_using_g_e_t_responses.go │ └── approve_controllerv1_client.go ├── approve_controller_v_2 │ ├── address_n_f_t1155_approve_list_using_g_e_t1_parameters.go │ ├── address_n_f_t1155_approve_list_using_g_e_t1_responses.go │ ├── address_n_f_t721_approve_list_using_g_e_t1_parameters.go │ ├── address_n_f_t721_approve_list_using_g_e_t1_responses.go │ ├── address_token_approve_list_using_g_e_t1_parameters.go │ ├── address_token_approve_list_using_g_e_t1_responses.go │ └── approve_controllerv2_client.go ├── contract_abi_controller │ ├── contract_abi_controller_client.go │ ├── get_abi_data_info_using_p_o_s_t_parameters.go │ └── get_abi_data_info_using_p_o_s_t_responses.go ├── dapp_controller │ ├── dapp_controller_client.go │ ├── get_dapp_info_using_g_e_t_parameters.go │ └── get_dapp_info_using_g_e_t_responses.go ├── defi_controller │ ├── defi_controller_client.go │ ├── get_defi_info_using_g_e_t_parameters.go │ └── get_defi_info_using_g_e_t_responses.go ├── goplus_client.go ├── nft_controller │ ├── get_nft_info_using_g_e_t1_parameters.go │ ├── get_nft_info_using_g_e_t1_responses.go │ └── nft_controller_client.go ├── token_controller │ ├── get_access_token_using_p_o_s_t_parameters.go │ ├── get_access_token_using_p_o_s_t_responses.go │ └── token_controller_client.go ├── token_controller_v_1 │ ├── get_chains_list_using_g_e_t_parameters.go │ ├── get_chains_list_using_g_e_t_responses.go │ ├── token_controllerv1_client.go │ ├── token_security_using_g_e_t1_parameters.go │ └── token_security_using_g_e_t1_responses.go └── website_controller │ ├── phishing_site_using_g_e_t_parameters.go │ ├── phishing_site_using_g_e_t_responses.go │ └── website_controller_client.go └── models ├── abi_address_info.go ├── abi_param_info.go ├── approve_address_info.go ├── approve_erc1155_result.go ├── approve_n_f_t1155_list_response.go ├── approve_n_f_t_list_response.go ├── approve_result.go ├── approve_token_out_list_response.go ├── approve_token_result.go ├── audit_info.go ├── contract_approve_response.go ├── contracts.go ├── contracts_security.go ├── dapp_contract_security_response.go ├── get_access_token_request.go ├── get_access_token_response.go ├── get_defi_info_response.go ├── json_object.go ├── map_string_string.go ├── parse_abi_data_request.go ├── parse_abi_data_response.go ├── response_wrapper_address_contract.go ├── response_wrapper_contract_approve_response.go ├── response_wrapper_dapp_contract_security_response.go ├── response_wrapper_get_access_token_response.go ├── response_wrapper_get_nft_info.go ├── response_wrapper_json_object.go ├── response_wrapper_list_approve_n_f_t1155_list_response.go ├── response_wrapper_list_approve_n_f_t_list_response.go ├── response_wrapper_list_approve_token_out_list_response.go ├── response_wrapper_list_get_chains_list.go ├── response_wrapper_list_json_object.go ├── response_wrapper_map_string_string.go ├── response_wrapper_parse_abi_data_response.go ├── response_wrapper_phishing_site.go ├── response_wrapper_ta_token_security_response.go ├── response_wrapper_token_security.go ├── response_wrapperobject.go └── ta_token_security_response.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoPlus Security SDK for Go 2 | 3 | The official [GoPlus Security](https://gopluslabs.io/) Go SDK. 4 | 5 | ### Installation 6 | 7 | ``` 8 | go get github.com/GoPlusSecurity/goplus-sdk-go 9 | ``` 10 | 11 | ## Documentation 12 | 13 | Please see the [SDK guide](https://docs.gopluslabs.io/docs/goplus-sdk) and [API reference](https://docs.gopluslabs.io/reference/api-overview) for the most up-to-date documentation and examples. 14 | 15 | -------------------------------------------------------------------------------- /api/address/address_security.go: -------------------------------------------------------------------------------- 1 | package address 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/approve_controller_v_1" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int64 15 | AccessToken string 16 | } 17 | 18 | type AddressSecurity struct { 19 | Config *Config 20 | } 21 | 22 | func NewAddressSecurity(config *Config) *AddressSecurity { 23 | return &AddressSecurity{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type Result = approve_controller_v_1.AddressContractUsingGET1OK 29 | 30 | func (s *AddressSecurity) Run(chainId, address string) (*Result, error) { 31 | params := approve_controller_v_1.NewAddressContractUsingGET1Params() 32 | params.SetAddress(address) 33 | if chainId != "" { 34 | params.SetChainID(pointer.String(chainId)) 35 | } 36 | if s.Config != nil { 37 | if s.Config.AccessToken != "" { 38 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 39 | } 40 | if s.Config.Timeout != 0 { 41 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 42 | } 43 | } 44 | 45 | return client.Default.ApproveControllerv1.AddressContractUsingGET1(params) 46 | } 47 | -------------------------------------------------------------------------------- /api/address/address_security_test.go: -------------------------------------------------------------------------------- 1 | package address 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestAddressSecurity_Run(t *testing.T) { 10 | addressSecurity := NewAddressSecurity(nil) 11 | data, err := addressSecurity.Run("", "0xc8b759860149542a98a3eb57c14aadf59d6d89b9") 12 | if err != nil { 13 | t.Errorf(err.Error()) 14 | } 15 | 16 | if data.Payload.Code != errorcode.SUCCESS { 17 | t.Errorf(data.Payload.Message) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/approval/approval_security.go: -------------------------------------------------------------------------------- 1 | package approval 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/approve_controller_v_1" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type ApprovalSecurity struct { 19 | Config *Config 20 | } 21 | 22 | func NewApprovalSecurity(config *Config) *ApprovalSecurity { 23 | return &ApprovalSecurity{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type Result = approve_controller_v_1.ApprovalContractUsingGETOK 29 | 30 | func (a *ApprovalSecurity) Run(chainId, address string) (*Result, error) { 31 | params := approve_controller_v_1.NewApprovalContractUsingGETParams() 32 | params.SetChainID(chainId) 33 | params.SetContractAddresses(address) 34 | if a.Config != nil { 35 | if a.Config.AccessToken != "" { 36 | params.SetAuthorization(pointer.String(a.Config.AccessToken)) 37 | } 38 | if a.Config.Timeout != 0 { 39 | params.SetTimeout(time.Duration(a.Config.Timeout) * time.Second) 40 | } 41 | } 42 | 43 | return client.Default.ApproveControllerv1.ApprovalContractUsingGET(params) 44 | } 45 | -------------------------------------------------------------------------------- /api/approval/approval_security_test.go: -------------------------------------------------------------------------------- 1 | package approval 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestApprovalSecurity_Run(t *testing.T) { 10 | approvalSecurityV1 := NewApprovalSecurity(nil) 11 | data, err := approvalSecurityV1.Run("1", "0x4639cd8cd52ec1cf2e496a606ce28d8afb1c792f") 12 | 13 | if err != nil { 14 | t.Errorf(err.Error()) 15 | } 16 | 17 | if data.Payload.Code != errorcode.SUCCESS && data.Payload.Code != errorcode.DATA_PENDING_SYNC { 18 | t.Errorf(data.Payload.Message) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/approval/approval_security_v2.go: -------------------------------------------------------------------------------- 1 | package approval 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/approve_controller_v_2" 10 | ) 11 | 12 | type ConfigV2 struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type ApprovalSecurityV2 struct { 19 | Config *ConfigV2 20 | } 21 | 22 | func NewApprovalSecurityV2(config *ConfigV2) *ApprovalSecurityV2 { 23 | return &ApprovalSecurityV2{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type TokenResult = approve_controller_v_2.AddressTokenApproveListUsingGET1OK 29 | 30 | func (a *ApprovalSecurityV2) Token(chainId, address string) (*TokenResult, error) { 31 | params := approve_controller_v_2.NewAddressTokenApproveListUsingGET1Params() 32 | params.SetChainID(chainId) 33 | params.SetAddresses(address) 34 | if a.Config != nil { 35 | if a.Config.AccessToken != "" { 36 | params.SetAuthorization(pointer.String(a.Config.AccessToken)) 37 | } 38 | if a.Config.Timeout != 0 { 39 | params.SetTimeout(time.Duration(a.Config.Timeout) * time.Second) 40 | } 41 | } 42 | 43 | return client.Default.ApproveControllerv2.AddressTokenApproveListUsingGET1(params) 44 | } 45 | 46 | type ERC721NFTResult = approve_controller_v_2.AddressNFT721ApproveListUsingGET1OK 47 | 48 | func (a *ApprovalSecurityV2) ERC721NFT(chainId, address string) (*ERC721NFTResult, error) { 49 | params := approve_controller_v_2.NewAddressNFT721ApproveListUsingGET1Params() 50 | params.SetChainID(chainId) 51 | params.SetAddresses(address) 52 | if a.Config != nil { 53 | if a.Config.AccessToken != "" { 54 | params.SetAuthorization(pointer.String(a.Config.AccessToken)) 55 | } 56 | if a.Config.Timeout != 0 { 57 | params.SetTimeout(time.Duration(a.Config.Timeout) * time.Second) 58 | } 59 | } 60 | 61 | return client.Default.ApproveControllerv2.AddressNFT721ApproveListUsingGET1(params) 62 | } 63 | 64 | type ERC1155NFTResult = approve_controller_v_2.AddressNFT1155ApproveListUsingGET1OK 65 | 66 | func (a *ApprovalSecurityV2) ERC1155NFT(chainId, address string) (*ERC1155NFTResult, error) { 67 | params := approve_controller_v_2.NewAddressNFT1155ApproveListUsingGET1Params() 68 | params.SetChainID(chainId) 69 | params.SetAddresses(address) 70 | if a.Config != nil { 71 | if a.Config.AccessToken != "" { 72 | params.SetAuthorization(pointer.String(a.Config.AccessToken)) 73 | } 74 | if a.Config.Timeout != 0 { 75 | params.SetTimeout(time.Duration(a.Config.Timeout) * time.Second) 76 | } 77 | } 78 | 79 | return client.Default.ApproveControllerv2.AddressNFT1155ApproveListUsingGET1(params) 80 | } 81 | -------------------------------------------------------------------------------- /api/approval/approval_security_v2_test.go: -------------------------------------------------------------------------------- 1 | package approval 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestApprovalSecurityV2_Token(t *testing.T) { 10 | approvalSecurityV2 := NewApprovalSecurityV2(nil) 11 | data, err := approvalSecurityV2.Token("56", "0xd018e2b543a2669410537f96293590138cacedf3") 12 | 13 | if err != nil { 14 | t.Errorf(err.Error()) 15 | } 16 | 17 | if data.Payload.Code != errorcode.SUCCESS { 18 | t.Errorf(data.Payload.Message) 19 | } 20 | 21 | t.Log(data.Payload.Result[0].TokenAddress) 22 | } 23 | 24 | func TestApprovalSecurityV2_ERC721NFT(t *testing.T) { 25 | approvalSecurityV2 := NewApprovalSecurityV2(nil) 26 | data, err := approvalSecurityV2.ERC721NFT("1", "0xd95dbdab08a9fed2d71ac9c3028aac40905d8cf3") 27 | 28 | if err != nil { 29 | t.Errorf(err.Error()) 30 | } 31 | 32 | if data.Payload.Code != errorcode.SUCCESS { 33 | t.Errorf(data.Payload.Message) 34 | } 35 | t.Log(data.Payload.Result[0].NftAddress) 36 | } 37 | 38 | func TestApprovalSecurityV2_ERC1155NFT(t *testing.T) { 39 | approvalSecurityV2 := NewApprovalSecurityV2(nil) 40 | data, err := approvalSecurityV2.ERC1155NFT("56", "0xb0dccbb9c4a65a94a41a0165aaea79c8b2fc54ce") 41 | 42 | if err != nil { 43 | t.Errorf(err.Error()) 44 | } 45 | 46 | if data.Payload.Code != errorcode.SUCCESS { 47 | t.Errorf(data.Payload.Message) 48 | } 49 | t.Log(data.Payload.Result[0].NftAddress) 50 | } 51 | -------------------------------------------------------------------------------- /api/chain/chain.go: -------------------------------------------------------------------------------- 1 | package chain 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/token_controller_v_1" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type Chain struct { 19 | Config *Config 20 | } 21 | 22 | func NewChain(config *Config) *Chain { 23 | return &Chain{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type Result = token_controller_v_1.GetChainsListUsingGETOK 29 | 30 | func (s *Chain) Run(name string) (*Result, error) { 31 | params := token_controller_v_1.NewGetChainsListUsingGETParams() 32 | if name != "" { 33 | params.SetName(pointer.String(name)) 34 | } 35 | if s.Config != nil { 36 | if s.Config.AccessToken != "" { 37 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 38 | } 39 | if s.Config.Timeout != 0 { 40 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 41 | } 42 | } 43 | 44 | return client.Default.TokenControllerv1.GetChainsListUsingGET(params) 45 | } 46 | -------------------------------------------------------------------------------- /api/chain/chain_test.go: -------------------------------------------------------------------------------- 1 | package chain 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestChain_Run(t *testing.T) { 10 | chain := NewChain(nil) 11 | data, err := chain.Run("") 12 | 13 | if err != nil { 14 | t.Errorf(err.Error()) 15 | } 16 | 17 | if data.Payload.Code != errorcode.SUCCESS { 18 | t.Errorf(data.Payload.Message) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/dapp/dapp_security.go: -------------------------------------------------------------------------------- 1 | package dapp 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/dapp_controller" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type DAppSecurity struct { 19 | Config *Config 20 | } 21 | 22 | func NewDAppSecurity(config *Config) *DAppSecurity { 23 | return &DAppSecurity{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type Result = dapp_controller.GetDappInfoUsingGETOK 29 | 30 | func (s *DAppSecurity) Run(url string) (*Result, error) { 31 | params := dapp_controller.NewGetDappInfoUsingGETParams() 32 | params.SetURL(pointer.String(url)) 33 | if s.Config != nil { 34 | if s.Config.AccessToken != "" { 35 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 36 | } 37 | if s.Config.Timeout != 0 { 38 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 39 | } 40 | } 41 | 42 | return client.Default.DappController.GetDappInfoUsingGET(params) 43 | } 44 | -------------------------------------------------------------------------------- /api/dapp/dapp_security_test.go: -------------------------------------------------------------------------------- 1 | package dapp 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestDAppSecurity_Run(t *testing.T) { 10 | dAppSecurity := NewDAppSecurity(nil) 11 | 12 | url := "https://for.tube" 13 | data, err := dAppSecurity.Run(url) 14 | 15 | if err != nil { 16 | t.Errorf(err.Error()) 17 | } 18 | 19 | if data.Payload.Code != errorcode.SUCCESS { 20 | t.Errorf(data.Payload.Message) 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /api/decode/signature_data_decode.go: -------------------------------------------------------------------------------- 1 | package decode 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/contract_abi_controller" 10 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 11 | ) 12 | 13 | type Config struct { 14 | // timeout seconds 15 | Timeout int 16 | AccessToken string 17 | } 18 | 19 | type Result = contract_abi_controller.GetAbiDataInfoUsingPOSTOK 20 | 21 | type SignatureDataDecode struct { 22 | Config *Config 23 | } 24 | 25 | func NewSignatureDataDecode(config *Config) *SignatureDataDecode { 26 | return &SignatureDataDecode{ 27 | Config: config, 28 | } 29 | } 30 | 31 | func (s *SignatureDataDecode) Run(chainId, contractAddress, data string) (*Result, error) { 32 | params := contract_abi_controller.NewGetAbiDataInfoUsingPOSTParams() 33 | params.SetAbiDataRequest(&models.ParseAbiDataRequest{ 34 | ChainID: pointer.String(chainId), 35 | ContractAddress: contractAddress, 36 | Data: pointer.String(data), 37 | }) 38 | if s.Config != nil { 39 | if s.Config.AccessToken != "" { 40 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 41 | } 42 | if s.Config.Timeout != 0 { 43 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 44 | } 45 | } 46 | 47 | response, _, err := client.Default.ContractAbiController.GetAbiDataInfoUsingPOST(params) 48 | return response, err 49 | } 50 | -------------------------------------------------------------------------------- /api/decode/signature_data_decode_test.go: -------------------------------------------------------------------------------- 1 | package decode 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestSignatureDataDecode_Run(t *testing.T) { 10 | signatureDataDecode := NewSignatureDataDecode(nil) 11 | 12 | chainId := "1" 13 | contractAddress := "0x4cc8aa0c6ffbe18534584da9b592aa438733ee66" 14 | inputData := "0xa0712d680000000000000000000000000000000000000000000000000000000062fee481" 15 | data, err := signatureDataDecode.Run(chainId, contractAddress, inputData) 16 | 17 | if err != nil { 18 | t.Errorf(err.Error()) 19 | } 20 | 21 | if data.Payload.Code != errorcode.SUCCESS { 22 | t.Errorf(data.Payload.Message) 23 | } 24 | t.Log(data.Payload.Result.ContractName) 25 | } 26 | -------------------------------------------------------------------------------- /api/nft/nft_security.go: -------------------------------------------------------------------------------- 1 | package nft 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 7 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/nft_controller" 8 | "k8s.io/utils/pointer" 9 | ) 10 | 11 | type Config struct { 12 | // timeout seconds 13 | Timeout int 14 | AccessToken string 15 | } 16 | 17 | type NFTSecurity struct { 18 | Config *Config 19 | } 20 | 21 | func NewNFTSecurity(config *Config) *NFTSecurity { 22 | return &NFTSecurity{ 23 | Config: config, 24 | } 25 | } 26 | 27 | type Result = nft_controller.GetNftInfoUsingGET1OK 28 | 29 | func (s *NFTSecurity) Run(chainId, address string) (*Result, error) { 30 | params := nft_controller.NewGetNftInfoUsingGET1Params() 31 | params.SetChainID(chainId) 32 | params.SetContractAddresses(address) 33 | if s.Config != nil { 34 | if s.Config.AccessToken != "" { 35 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 36 | } 37 | if s.Config.Timeout != 0 { 38 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 39 | } 40 | } 41 | 42 | return client.Default.NftController.GetNftInfoUsingGET1(params) 43 | } 44 | -------------------------------------------------------------------------------- /api/nft/nft_security_test.go: -------------------------------------------------------------------------------- 1 | package nft 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestNFTSecurity_Run(t *testing.T) { 10 | nftSecurity := NewNFTSecurity(nil) 11 | 12 | chainId := "1" 13 | contractAddress := "0x82f5ef9ddc3d231962ba57a9c2ebb307dc8d26c2" 14 | data, err := nftSecurity.Run(chainId, contractAddress) 15 | 16 | if err != nil { 17 | t.Errorf(err.Error()) 18 | } 19 | 20 | if data.Payload.Code != errorcode.SUCCESS && data.Payload.Code != errorcode.DATA_PENDING_SYNC { 21 | t.Errorf(data.Payload.Message) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /api/phishingsite/phishing_site_detection.go: -------------------------------------------------------------------------------- 1 | package phishingsite 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/website_controller" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type PhishingSiteDetection struct { 19 | Config *Config 20 | } 21 | 22 | func NewPhishingSiteDetection(config *Config) *PhishingSiteDetection { 23 | return &PhishingSiteDetection{ 24 | Config: config, 25 | } 26 | } 27 | 28 | type Result = website_controller.PhishingSiteUsingGETOK 29 | 30 | func (s *PhishingSiteDetection) Run(url string) (*Result, error) { 31 | params := website_controller.NewPhishingSiteUsingGETParams() 32 | params.SetURL(url) 33 | if s.Config != nil { 34 | if s.Config.AccessToken != "" { 35 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 36 | } 37 | if s.Config.Timeout != 0 { 38 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 39 | } 40 | } 41 | 42 | return client.Default.WebsiteController.PhishingSiteUsingGET(params) 43 | } 44 | -------------------------------------------------------------------------------- /api/phishingsite/phishing_site_detection_test.go: -------------------------------------------------------------------------------- 1 | package phishingsite 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestPhishingSiteDetection_Run(t *testing.T) { 10 | phishingSiteSecurity := NewPhishingSiteDetection(nil) 11 | 12 | url := "https://xn--cm-68s.cc/" 13 | data, err := phishingSiteSecurity.Run(url) 14 | 15 | if err != nil { 16 | t.Errorf(err.Error()) 17 | } 18 | 19 | if data.Payload.Code != errorcode.SUCCESS { 20 | t.Errorf(data.Payload.Message) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/rugpull/rug_pull_detection.go: -------------------------------------------------------------------------------- 1 | package rugpull 2 | 3 | import ( 4 | "time" 5 | 6 | "k8s.io/utils/pointer" 7 | 8 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/defi_controller" 10 | ) 11 | 12 | type Config struct { 13 | // timeout seconds 14 | Timeout int 15 | AccessToken string 16 | } 17 | 18 | type RugPullDetection struct { 19 | Config *Config 20 | } 21 | 22 | type Result = defi_controller.GetDefiInfoUsingGETOK 23 | 24 | func NewRugPullDetection(config *Config) *RugPullDetection { 25 | return &RugPullDetection{ 26 | Config: config, 27 | } 28 | } 29 | 30 | func (s *RugPullDetection) Run(chainId, address string) (*Result, error) { 31 | params := defi_controller.NewGetDefiInfoUsingGETParams() 32 | params.SetChainID(chainId) 33 | params.SetContractAddresses(address) 34 | if s.Config != nil { 35 | if s.Config.AccessToken != "" { 36 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 37 | } 38 | if s.Config.Timeout != 0 { 39 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 40 | } 41 | } 42 | 43 | return client.Default.DefiController.GetDefiInfoUsingGET(params) 44 | } 45 | -------------------------------------------------------------------------------- /api/rugpull/rug_pull_detection_test.go: -------------------------------------------------------------------------------- 1 | package rugpull 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestPhishingSiteDetection_Run(t *testing.T) { 10 | rugPull := NewRugPullDetection(nil) 11 | data, err := rugPull.Run("1", "0x6B175474E89094C44Da98b954EedeAC495271d0F") 12 | 13 | if err != nil { 14 | t.Errorf(err.Error()) 15 | } 16 | 17 | if data.Payload.Code != errorcode.SUCCESS { 18 | t.Errorf(data.Payload.Message) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/token/token_security.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import ( 4 | "strings" 5 | "time" 6 | 7 | "k8s.io/utils/pointer" 8 | 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 10 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/token_controller_v_1" 11 | ) 12 | 13 | type Config struct { 14 | // timeout seconds 15 | Timeout int 16 | AccessToken string 17 | } 18 | 19 | type TokenSecurity struct { 20 | Config *Config 21 | } 22 | 23 | func NewTokenSecurity(config *Config) *TokenSecurity { 24 | return &TokenSecurity{ 25 | Config: config, 26 | } 27 | } 28 | 29 | type Result = token_controller_v_1.TokenSecurityUsingGET1OK 30 | 31 | func (s *TokenSecurity) Run(chainId string, addresses []string) (*Result, error) { 32 | contractAddresses := strings.Join(addresses, ",") 33 | 34 | params := token_controller_v_1.NewTokenSecurityUsingGET1Params() 35 | params.SetChainID(chainId) 36 | params.SetContractAddresses(contractAddresses) 37 | if s.Config != nil { 38 | if s.Config.AccessToken != "" { 39 | params.SetAuthorization(pointer.String(s.Config.AccessToken)) 40 | } 41 | if s.Config.Timeout != 0 { 42 | params.SetTimeout(time.Duration(s.Config.Timeout) * time.Second) 43 | } 44 | } 45 | 46 | return client.Default.TokenControllerv1.TokenSecurityUsingGET1(params) 47 | } 48 | -------------------------------------------------------------------------------- /api/token/token_security_test.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/errorcode" 7 | ) 8 | 9 | func TestTokenSecurity_Run(t *testing.T) { 10 | tokenSecurity := NewTokenSecurity(nil) 11 | data, err := tokenSecurity.Run("1", []string{"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}) 12 | 13 | if err != nil { 14 | t.Errorf(err.Error()) 15 | } 16 | 17 | if data.Payload.Code != errorcode.SUCCESS { 18 | t.Errorf(data.Payload.Message) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | "crypto/sha1" 5 | "fmt" 6 | "strconv" 7 | "time" 8 | 9 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client" 10 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/token_controller" 11 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 12 | 13 | "k8s.io/utils/pointer" 14 | ) 15 | 16 | type Config struct { 17 | Timeout int 18 | } 19 | 20 | type Result = token_controller.GetAccessTokenUsingPOSTOK 21 | 22 | type App struct { 23 | Key string 24 | Secret string 25 | Config *Config 26 | } 27 | 28 | func NewApp(key, secret string, config *Config) *App { 29 | return &App{ 30 | Key: key, 31 | Secret: secret, 32 | Config: config, 33 | } 34 | } 35 | 36 | func (a *App) GetAccessToken() (*Result, error) { 37 | now := time.Now().Unix() 38 | nowStr := strconv.FormatInt(now, 10) 39 | s := sign(a.Key, a.Secret, nowStr) 40 | params := token_controller.NewGetAccessTokenUsingPOSTParams() 41 | params.SetRequest(&models.GetAccessTokenRequest{ 42 | AppKey: pointer.String(a.Key), 43 | Sign: pointer.String(s), 44 | Time: pointer.Int64(now), 45 | }) 46 | if a.Config != nil && a.Config.Timeout != 0 { 47 | params.SetTimeout(time.Duration(a.Config.Timeout)) 48 | } 49 | 50 | response, _, err := client.Default.TokenController.GetAccessTokenUsingPOST(params) 51 | return response, err 52 | } 53 | 54 | func sign(key, secret, time string) string { 55 | h := sha1.New() 56 | s := key + time + secret 57 | h.Write([]byte(s)) 58 | return fmt.Sprintf("%x", h.Sum(nil)) 59 | } 60 | -------------------------------------------------------------------------------- /auth/auth_test.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import "testing" 4 | 5 | func TestApp_GetAccessToken(t *testing.T) { 6 | key := "" 7 | secret := "" 8 | app := NewApp(key, secret, nil) 9 | _, err := app.GetAccessToken() 10 | 11 | if err != nil { 12 | t.Errorf(err.Error()) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/GoPlusSecurity/goplus-sdk-go 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/go-openapi/errors v0.20.3 7 | github.com/go-openapi/runtime v0.26.0 8 | github.com/go-openapi/strfmt v0.21.7 9 | github.com/go-openapi/swag v0.22.3 10 | github.com/go-openapi/validate v0.22.1 11 | ) 12 | 13 | require ( 14 | github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect 15 | github.com/go-logr/logr v1.2.3 // indirect 16 | github.com/go-logr/stdr v1.2.2 // indirect 17 | github.com/go-openapi/analysis v0.21.4 // indirect 18 | github.com/go-openapi/jsonpointer v0.19.5 // indirect 19 | github.com/go-openapi/jsonreference v0.20.0 // indirect 20 | github.com/go-openapi/loads v0.21.2 // indirect 21 | github.com/go-openapi/spec v0.20.8 // indirect 22 | github.com/josharian/intern v1.0.0 // indirect 23 | github.com/mailru/easyjson v0.7.7 // indirect 24 | github.com/mitchellh/mapstructure v1.5.0 // indirect 25 | github.com/oklog/ulid v1.3.1 // indirect 26 | github.com/opentracing/opentracing-go v1.2.0 // indirect 27 | go.mongodb.org/mongo-driver v1.11.3 // indirect 28 | go.opentelemetry.io/otel v1.14.0 // indirect 29 | go.opentelemetry.io/otel/trace v1.14.0 // indirect 30 | gopkg.in/yaml.v2 v2.4.0 // indirect 31 | gopkg.in/yaml.v3 v3.0.1 // indirect 32 | k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect 33 | ) 34 | -------------------------------------------------------------------------------- /pkg/errorcode/errorcode.go: -------------------------------------------------------------------------------- 1 | package errorcode 2 | 3 | const ( 4 | SUCCESS = 1 5 | DATA_PENDING_SYNC = 2 6 | ADDRESS_FORMAT_ERROR = 2004 7 | CHAIN_NOT_SUPPORTED = 2018 8 | NON_CONTRACT_ADDRESS = 2020 9 | CONTRACT_INFO_NOT_FOUND = 2021 10 | DAPP_NOT_FOUND = 2026 11 | ABI_NOT_FOUND = 2027 12 | ABI_FUNCTION_UNSUPPOERT = 2028 13 | APP_KEY_NOT_EXIST = 4010 14 | SIGNATURE_EXPIRATION = 4011 15 | SIGNATURE_VERIFICATION_FAILURE = 4012 16 | FREQUENCY_OVER_LIMIT = 4029 17 | INVALID_TOKEN = 4022 18 | TOKEN_NOT_FOUND = 4023 19 | SERVER_ERROR = 5000 20 | PARAM_ERROR = 5006 21 | ) 22 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_1/address_contract_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // AddressContractUsingGET1Reader is a Reader for the AddressContractUsingGET1 structure. 19 | type AddressContractUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *AddressContractUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewAddressContractUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewAddressContractUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewAddressContractUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewAddressContractUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewAddressContractUsingGET1OK creates a AddressContractUsingGET1OK with default headers values 57 | func NewAddressContractUsingGET1OK() *AddressContractUsingGET1OK { 58 | return &AddressContractUsingGET1OK{} 59 | } 60 | 61 | /* 62 | AddressContractUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type AddressContractUsingGET1OK struct { 67 | Payload *models.ResponseWrapperAddressContract 68 | } 69 | 70 | func (o *AddressContractUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/address_security/{address}][%d] addressContractUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *AddressContractUsingGET1OK) GetPayload() *models.ResponseWrapperAddressContract { 75 | return o.Payload 76 | } 77 | 78 | func (o *AddressContractUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperAddressContract) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewAddressContractUsingGET1Unauthorized creates a AddressContractUsingGET1Unauthorized with default headers values 91 | func NewAddressContractUsingGET1Unauthorized() *AddressContractUsingGET1Unauthorized { 92 | return &AddressContractUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | AddressContractUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type AddressContractUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *AddressContractUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/address_security/{address}][%d] addressContractUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *AddressContractUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewAddressContractUsingGET1Forbidden creates a AddressContractUsingGET1Forbidden with default headers values 113 | func NewAddressContractUsingGET1Forbidden() *AddressContractUsingGET1Forbidden { 114 | return &AddressContractUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | AddressContractUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type AddressContractUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *AddressContractUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/address_security/{address}][%d] addressContractUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *AddressContractUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewAddressContractUsingGET1NotFound creates a AddressContractUsingGET1NotFound with default headers values 135 | func NewAddressContractUsingGET1NotFound() *AddressContractUsingGET1NotFound { 136 | return &AddressContractUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | AddressContractUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type AddressContractUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *AddressContractUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/address_security/{address}][%d] addressContractUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *AddressContractUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_1/approval_contract_using_g_e_t_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // ApprovalContractUsingGETReader is a Reader for the ApprovalContractUsingGET structure. 19 | type ApprovalContractUsingGETReader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *ApprovalContractUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewApprovalContractUsingGETOK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewApprovalContractUsingGETUnauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewApprovalContractUsingGETForbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewApprovalContractUsingGETNotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewApprovalContractUsingGETOK creates a ApprovalContractUsingGETOK with default headers values 57 | func NewApprovalContractUsingGETOK() *ApprovalContractUsingGETOK { 58 | return &ApprovalContractUsingGETOK{} 59 | } 60 | 61 | /* 62 | ApprovalContractUsingGETOK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type ApprovalContractUsingGETOK struct { 67 | Payload *models.ResponseWrapperContractApproveResponse 68 | } 69 | 70 | func (o *ApprovalContractUsingGETOK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/approval_security/{chain_id}][%d] approvalContractUsingGETOK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *ApprovalContractUsingGETOK) GetPayload() *models.ResponseWrapperContractApproveResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *ApprovalContractUsingGETOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperContractApproveResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewApprovalContractUsingGETUnauthorized creates a ApprovalContractUsingGETUnauthorized with default headers values 91 | func NewApprovalContractUsingGETUnauthorized() *ApprovalContractUsingGETUnauthorized { 92 | return &ApprovalContractUsingGETUnauthorized{} 93 | } 94 | 95 | /* 96 | ApprovalContractUsingGETUnauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type ApprovalContractUsingGETUnauthorized struct { 101 | } 102 | 103 | func (o *ApprovalContractUsingGETUnauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/approval_security/{chain_id}][%d] approvalContractUsingGETUnauthorized ", 401) 105 | } 106 | 107 | func (o *ApprovalContractUsingGETUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewApprovalContractUsingGETForbidden creates a ApprovalContractUsingGETForbidden with default headers values 113 | func NewApprovalContractUsingGETForbidden() *ApprovalContractUsingGETForbidden { 114 | return &ApprovalContractUsingGETForbidden{} 115 | } 116 | 117 | /* 118 | ApprovalContractUsingGETForbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type ApprovalContractUsingGETForbidden struct { 123 | } 124 | 125 | func (o *ApprovalContractUsingGETForbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/approval_security/{chain_id}][%d] approvalContractUsingGETForbidden ", 403) 127 | } 128 | 129 | func (o *ApprovalContractUsingGETForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewApprovalContractUsingGETNotFound creates a ApprovalContractUsingGETNotFound with default headers values 135 | func NewApprovalContractUsingGETNotFound() *ApprovalContractUsingGETNotFound { 136 | return &ApprovalContractUsingGETNotFound{} 137 | } 138 | 139 | /* 140 | ApprovalContractUsingGETNotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type ApprovalContractUsingGETNotFound struct { 145 | } 146 | 147 | func (o *ApprovalContractUsingGETNotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/approval_security/{chain_id}][%d] approvalContractUsingGETNotFound ", 404) 149 | } 150 | 151 | func (o *ApprovalContractUsingGETNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_1/approve_controllerv1_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new approve controller v 1 API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for approve controller v 1 API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | AddressContractUsingGET1(params *AddressContractUsingGET1Params) (*AddressContractUsingGET1OK, error) 31 | 32 | ApprovalContractUsingGET(params *ApprovalContractUsingGETParams) (*ApprovalContractUsingGETOK, error) 33 | 34 | SetTransport(transport runtime.ClientTransport) 35 | } 36 | 37 | /* 38 | AddressContractUsingGET1 checks if the address is malicious 39 | */ 40 | func (a *Client) AddressContractUsingGET1(params *AddressContractUsingGET1Params) (*AddressContractUsingGET1OK, error) { 41 | // TODO: Validate the params before sending 42 | if params == nil { 43 | params = NewAddressContractUsingGET1Params() 44 | } 45 | 46 | result, err := a.transport.Submit(&runtime.ClientOperation{ 47 | ID: "addressContractUsingGET_1", 48 | Method: "GET", 49 | PathPattern: "/api/v1/address_security/{address}", 50 | ProducesMediaTypes: []string{"*/*"}, 51 | ConsumesMediaTypes: []string{"application/json"}, 52 | Schemes: []string{"https"}, 53 | Params: params, 54 | Reader: &AddressContractUsingGET1Reader{formats: a.formats}, 55 | Context: params.Context, 56 | Client: params.HTTPClient, 57 | }) 58 | if err != nil { 59 | return nil, err 60 | } 61 | success, ok := result.(*AddressContractUsingGET1OK) 62 | if ok { 63 | return success, nil 64 | } 65 | // unexpected success response 66 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 67 | msg := fmt.Sprintf("unexpected success response for addressContractUsingGET_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) 68 | panic(msg) 69 | } 70 | 71 | /* 72 | ApprovalContractUsingGET checks if the approval is secure 73 | */ 74 | func (a *Client) ApprovalContractUsingGET(params *ApprovalContractUsingGETParams) (*ApprovalContractUsingGETOK, error) { 75 | // TODO: Validate the params before sending 76 | if params == nil { 77 | params = NewApprovalContractUsingGETParams() 78 | } 79 | 80 | result, err := a.transport.Submit(&runtime.ClientOperation{ 81 | ID: "approvalContractUsingGET", 82 | Method: "GET", 83 | PathPattern: "/api/v1/approval_security/{chain_id}", 84 | ProducesMediaTypes: []string{"*/*"}, 85 | ConsumesMediaTypes: []string{"application/json"}, 86 | Schemes: []string{"https"}, 87 | Params: params, 88 | Reader: &ApprovalContractUsingGETReader{formats: a.formats}, 89 | Context: params.Context, 90 | Client: params.HTTPClient, 91 | }) 92 | if err != nil { 93 | return nil, err 94 | } 95 | success, ok := result.(*ApprovalContractUsingGETOK) 96 | if ok { 97 | return success, nil 98 | } 99 | // unexpected success response 100 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 101 | msg := fmt.Sprintf("unexpected success response for approvalContractUsingGET: API contract not enforced by server. Client expected to get an error, but got: %T", result) 102 | panic(msg) 103 | } 104 | 105 | // SetTransport changes the transport on the client 106 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 107 | a.transport = transport 108 | } 109 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_2/address_n_f_t1155_approve_list_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_2 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // AddressNFT1155ApproveListUsingGET1Reader is a Reader for the AddressNFT1155ApproveListUsingGET1 structure. 19 | type AddressNFT1155ApproveListUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *AddressNFT1155ApproveListUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewAddressNFT1155ApproveListUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewAddressNFT1155ApproveListUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewAddressNFT1155ApproveListUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewAddressNFT1155ApproveListUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewAddressNFT1155ApproveListUsingGET1OK creates a AddressNFT1155ApproveListUsingGET1OK with default headers values 57 | func NewAddressNFT1155ApproveListUsingGET1OK() *AddressNFT1155ApproveListUsingGET1OK { 58 | return &AddressNFT1155ApproveListUsingGET1OK{} 59 | } 60 | 61 | /* 62 | AddressNFT1155ApproveListUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type AddressNFT1155ApproveListUsingGET1OK struct { 67 | Payload *models.ResponseWrapperListApproveNFT1155ListResponse 68 | } 69 | 70 | func (o *AddressNFT1155ApproveListUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v2/nft1155_approval_security/{chainId}][%d] addressNFT1155ApproveListUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *AddressNFT1155ApproveListUsingGET1OK) GetPayload() *models.ResponseWrapperListApproveNFT1155ListResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *AddressNFT1155ApproveListUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperListApproveNFT1155ListResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewAddressNFT1155ApproveListUsingGET1Unauthorized creates a AddressNFT1155ApproveListUsingGET1Unauthorized with default headers values 91 | func NewAddressNFT1155ApproveListUsingGET1Unauthorized() *AddressNFT1155ApproveListUsingGET1Unauthorized { 92 | return &AddressNFT1155ApproveListUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | AddressNFT1155ApproveListUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type AddressNFT1155ApproveListUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *AddressNFT1155ApproveListUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v2/nft1155_approval_security/{chainId}][%d] addressNFT1155ApproveListUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *AddressNFT1155ApproveListUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewAddressNFT1155ApproveListUsingGET1Forbidden creates a AddressNFT1155ApproveListUsingGET1Forbidden with default headers values 113 | func NewAddressNFT1155ApproveListUsingGET1Forbidden() *AddressNFT1155ApproveListUsingGET1Forbidden { 114 | return &AddressNFT1155ApproveListUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | AddressNFT1155ApproveListUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type AddressNFT1155ApproveListUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *AddressNFT1155ApproveListUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v2/nft1155_approval_security/{chainId}][%d] addressNFT1155ApproveListUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *AddressNFT1155ApproveListUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewAddressNFT1155ApproveListUsingGET1NotFound creates a AddressNFT1155ApproveListUsingGET1NotFound with default headers values 135 | func NewAddressNFT1155ApproveListUsingGET1NotFound() *AddressNFT1155ApproveListUsingGET1NotFound { 136 | return &AddressNFT1155ApproveListUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | AddressNFT1155ApproveListUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type AddressNFT1155ApproveListUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *AddressNFT1155ApproveListUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v2/nft1155_approval_security/{chainId}][%d] addressNFT1155ApproveListUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *AddressNFT1155ApproveListUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_2/address_n_f_t721_approve_list_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_2 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // AddressNFT721ApproveListUsingGET1Reader is a Reader for the AddressNFT721ApproveListUsingGET1 structure. 19 | type AddressNFT721ApproveListUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *AddressNFT721ApproveListUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewAddressNFT721ApproveListUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewAddressNFT721ApproveListUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewAddressNFT721ApproveListUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewAddressNFT721ApproveListUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewAddressNFT721ApproveListUsingGET1OK creates a AddressNFT721ApproveListUsingGET1OK with default headers values 57 | func NewAddressNFT721ApproveListUsingGET1OK() *AddressNFT721ApproveListUsingGET1OK { 58 | return &AddressNFT721ApproveListUsingGET1OK{} 59 | } 60 | 61 | /* 62 | AddressNFT721ApproveListUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type AddressNFT721ApproveListUsingGET1OK struct { 67 | Payload *models.ResponseWrapperListApproveNFTListResponse 68 | } 69 | 70 | func (o *AddressNFT721ApproveListUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v2/nft721_approval_security/{chainId}][%d] addressNFT721ApproveListUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *AddressNFT721ApproveListUsingGET1OK) GetPayload() *models.ResponseWrapperListApproveNFTListResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *AddressNFT721ApproveListUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperListApproveNFTListResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewAddressNFT721ApproveListUsingGET1Unauthorized creates a AddressNFT721ApproveListUsingGET1Unauthorized with default headers values 91 | func NewAddressNFT721ApproveListUsingGET1Unauthorized() *AddressNFT721ApproveListUsingGET1Unauthorized { 92 | return &AddressNFT721ApproveListUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | AddressNFT721ApproveListUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type AddressNFT721ApproveListUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *AddressNFT721ApproveListUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v2/nft721_approval_security/{chainId}][%d] addressNFT721ApproveListUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *AddressNFT721ApproveListUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewAddressNFT721ApproveListUsingGET1Forbidden creates a AddressNFT721ApproveListUsingGET1Forbidden with default headers values 113 | func NewAddressNFT721ApproveListUsingGET1Forbidden() *AddressNFT721ApproveListUsingGET1Forbidden { 114 | return &AddressNFT721ApproveListUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | AddressNFT721ApproveListUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type AddressNFT721ApproveListUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *AddressNFT721ApproveListUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v2/nft721_approval_security/{chainId}][%d] addressNFT721ApproveListUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *AddressNFT721ApproveListUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewAddressNFT721ApproveListUsingGET1NotFound creates a AddressNFT721ApproveListUsingGET1NotFound with default headers values 135 | func NewAddressNFT721ApproveListUsingGET1NotFound() *AddressNFT721ApproveListUsingGET1NotFound { 136 | return &AddressNFT721ApproveListUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | AddressNFT721ApproveListUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type AddressNFT721ApproveListUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *AddressNFT721ApproveListUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v2/nft721_approval_security/{chainId}][%d] addressNFT721ApproveListUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *AddressNFT721ApproveListUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/approve_controller_v_2/address_token_approve_list_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package approve_controller_v_2 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // AddressTokenApproveListUsingGET1Reader is a Reader for the AddressTokenApproveListUsingGET1 structure. 19 | type AddressTokenApproveListUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *AddressTokenApproveListUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewAddressTokenApproveListUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewAddressTokenApproveListUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewAddressTokenApproveListUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewAddressTokenApproveListUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewAddressTokenApproveListUsingGET1OK creates a AddressTokenApproveListUsingGET1OK with default headers values 57 | func NewAddressTokenApproveListUsingGET1OK() *AddressTokenApproveListUsingGET1OK { 58 | return &AddressTokenApproveListUsingGET1OK{} 59 | } 60 | 61 | /* 62 | AddressTokenApproveListUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type AddressTokenApproveListUsingGET1OK struct { 67 | Payload *models.ResponseWrapperListApproveTokenOutListResponse 68 | } 69 | 70 | func (o *AddressTokenApproveListUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v2/token_approval_security/{chainId}][%d] addressTokenApproveListUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *AddressTokenApproveListUsingGET1OK) GetPayload() *models.ResponseWrapperListApproveTokenOutListResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *AddressTokenApproveListUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperListApproveTokenOutListResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewAddressTokenApproveListUsingGET1Unauthorized creates a AddressTokenApproveListUsingGET1Unauthorized with default headers values 91 | func NewAddressTokenApproveListUsingGET1Unauthorized() *AddressTokenApproveListUsingGET1Unauthorized { 92 | return &AddressTokenApproveListUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | AddressTokenApproveListUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type AddressTokenApproveListUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *AddressTokenApproveListUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v2/token_approval_security/{chainId}][%d] addressTokenApproveListUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *AddressTokenApproveListUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewAddressTokenApproveListUsingGET1Forbidden creates a AddressTokenApproveListUsingGET1Forbidden with default headers values 113 | func NewAddressTokenApproveListUsingGET1Forbidden() *AddressTokenApproveListUsingGET1Forbidden { 114 | return &AddressTokenApproveListUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | AddressTokenApproveListUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type AddressTokenApproveListUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *AddressTokenApproveListUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v2/token_approval_security/{chainId}][%d] addressTokenApproveListUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *AddressTokenApproveListUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewAddressTokenApproveListUsingGET1NotFound creates a AddressTokenApproveListUsingGET1NotFound with default headers values 135 | func NewAddressTokenApproveListUsingGET1NotFound() *AddressTokenApproveListUsingGET1NotFound { 136 | return &AddressTokenApproveListUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | AddressTokenApproveListUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type AddressTokenApproveListUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *AddressTokenApproveListUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v2/token_approval_security/{chainId}][%d] addressTokenApproveListUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *AddressTokenApproveListUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/contract_abi_controller/contract_abi_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package contract_abi_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new contract abi controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for contract abi controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetAbiDataInfoUsingPOST(params *GetAbiDataInfoUsingPOSTParams) (*GetAbiDataInfoUsingPOSTOK, *GetAbiDataInfoUsingPOSTCreated, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | GetAbiDataInfoUsingPOST gets abi decode info 37 | */ 38 | func (a *Client) GetAbiDataInfoUsingPOST(params *GetAbiDataInfoUsingPOSTParams) (*GetAbiDataInfoUsingPOSTOK, *GetAbiDataInfoUsingPOSTCreated, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewGetAbiDataInfoUsingPOSTParams() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "getAbiDataInfoUsingPOST", 46 | Method: "POST", 47 | PathPattern: "/api/v1/abi/input_decode", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &GetAbiDataInfoUsingPOSTReader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, nil, err 58 | } 59 | switch value := result.(type) { 60 | case *GetAbiDataInfoUsingPOSTOK: 61 | return value, nil, nil 62 | case *GetAbiDataInfoUsingPOSTCreated: 63 | return nil, value, nil 64 | } 65 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 66 | msg := fmt.Sprintf("unexpected success response for contract_abi_controller: API contract not enforced by server. Client expected to get an error, but got: %T", result) 67 | panic(msg) 68 | } 69 | 70 | // SetTransport changes the transport on the client 71 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 72 | a.transport = transport 73 | } 74 | -------------------------------------------------------------------------------- /pkg/gen/client/contract_abi_controller/get_abi_data_info_using_p_o_s_t_parameters.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package contract_abi_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "context" 10 | "net/http" 11 | "time" 12 | 13 | "github.com/go-openapi/errors" 14 | "github.com/go-openapi/runtime" 15 | cr "github.com/go-openapi/runtime/client" 16 | "github.com/go-openapi/strfmt" 17 | 18 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 19 | ) 20 | 21 | // NewGetAbiDataInfoUsingPOSTParams creates a new GetAbiDataInfoUsingPOSTParams object 22 | // with the default values initialized. 23 | func NewGetAbiDataInfoUsingPOSTParams() *GetAbiDataInfoUsingPOSTParams { 24 | var () 25 | return &GetAbiDataInfoUsingPOSTParams{ 26 | 27 | timeout: cr.DefaultTimeout, 28 | } 29 | } 30 | 31 | // NewGetAbiDataInfoUsingPOSTParamsWithTimeout creates a new GetAbiDataInfoUsingPOSTParams object 32 | // with the default values initialized, and the ability to set a timeout on a request 33 | func NewGetAbiDataInfoUsingPOSTParamsWithTimeout(timeout time.Duration) *GetAbiDataInfoUsingPOSTParams { 34 | var () 35 | return &GetAbiDataInfoUsingPOSTParams{ 36 | 37 | timeout: timeout, 38 | } 39 | } 40 | 41 | // NewGetAbiDataInfoUsingPOSTParamsWithContext creates a new GetAbiDataInfoUsingPOSTParams object 42 | // with the default values initialized, and the ability to set a context for a request 43 | func NewGetAbiDataInfoUsingPOSTParamsWithContext(ctx context.Context) *GetAbiDataInfoUsingPOSTParams { 44 | var () 45 | return &GetAbiDataInfoUsingPOSTParams{ 46 | 47 | Context: ctx, 48 | } 49 | } 50 | 51 | // NewGetAbiDataInfoUsingPOSTParamsWithHTTPClient creates a new GetAbiDataInfoUsingPOSTParams object 52 | // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 | func NewGetAbiDataInfoUsingPOSTParamsWithHTTPClient(client *http.Client) *GetAbiDataInfoUsingPOSTParams { 54 | var () 55 | return &GetAbiDataInfoUsingPOSTParams{ 56 | HTTPClient: client, 57 | } 58 | } 59 | 60 | /* 61 | GetAbiDataInfoUsingPOSTParams contains all the parameters to send to the API endpoint 62 | for the get abi data info using p o s t operation typically these are written to a http.Request 63 | */ 64 | type GetAbiDataInfoUsingPOSTParams struct { 65 | 66 | /*Authorization 67 | Authorization (test: Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) 68 | 69 | */ 70 | Authorization *string 71 | /*AbiDataRequest 72 | abiDataRequest 73 | 74 | */ 75 | AbiDataRequest *models.ParseAbiDataRequest 76 | 77 | timeout time.Duration 78 | Context context.Context 79 | HTTPClient *http.Client 80 | } 81 | 82 | // WithTimeout adds the timeout to the get abi data info using p o s t params 83 | func (o *GetAbiDataInfoUsingPOSTParams) WithTimeout(timeout time.Duration) *GetAbiDataInfoUsingPOSTParams { 84 | o.SetTimeout(timeout) 85 | return o 86 | } 87 | 88 | // SetTimeout adds the timeout to the get abi data info using p o s t params 89 | func (o *GetAbiDataInfoUsingPOSTParams) SetTimeout(timeout time.Duration) { 90 | o.timeout = timeout 91 | } 92 | 93 | // WithContext adds the context to the get abi data info using p o s t params 94 | func (o *GetAbiDataInfoUsingPOSTParams) WithContext(ctx context.Context) *GetAbiDataInfoUsingPOSTParams { 95 | o.SetContext(ctx) 96 | return o 97 | } 98 | 99 | // SetContext adds the context to the get abi data info using p o s t params 100 | func (o *GetAbiDataInfoUsingPOSTParams) SetContext(ctx context.Context) { 101 | o.Context = ctx 102 | } 103 | 104 | // WithHTTPClient adds the HTTPClient to the get abi data info using p o s t params 105 | func (o *GetAbiDataInfoUsingPOSTParams) WithHTTPClient(client *http.Client) *GetAbiDataInfoUsingPOSTParams { 106 | o.SetHTTPClient(client) 107 | return o 108 | } 109 | 110 | // SetHTTPClient adds the HTTPClient to the get abi data info using p o s t params 111 | func (o *GetAbiDataInfoUsingPOSTParams) SetHTTPClient(client *http.Client) { 112 | o.HTTPClient = client 113 | } 114 | 115 | // WithAuthorization adds the authorization to the get abi data info using p o s t params 116 | func (o *GetAbiDataInfoUsingPOSTParams) WithAuthorization(authorization *string) *GetAbiDataInfoUsingPOSTParams { 117 | o.SetAuthorization(authorization) 118 | return o 119 | } 120 | 121 | // SetAuthorization adds the authorization to the get abi data info using p o s t params 122 | func (o *GetAbiDataInfoUsingPOSTParams) SetAuthorization(authorization *string) { 123 | o.Authorization = authorization 124 | } 125 | 126 | // WithAbiDataRequest adds the abiDataRequest to the get abi data info using p o s t params 127 | func (o *GetAbiDataInfoUsingPOSTParams) WithAbiDataRequest(abiDataRequest *models.ParseAbiDataRequest) *GetAbiDataInfoUsingPOSTParams { 128 | o.SetAbiDataRequest(abiDataRequest) 129 | return o 130 | } 131 | 132 | // SetAbiDataRequest adds the abiDataRequest to the get abi data info using p o s t params 133 | func (o *GetAbiDataInfoUsingPOSTParams) SetAbiDataRequest(abiDataRequest *models.ParseAbiDataRequest) { 134 | o.AbiDataRequest = abiDataRequest 135 | } 136 | 137 | // WriteToRequest writes these params to a swagger request 138 | func (o *GetAbiDataInfoUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 139 | 140 | if err := r.SetTimeout(o.timeout); err != nil { 141 | return err 142 | } 143 | var res []error 144 | 145 | if o.Authorization != nil { 146 | 147 | // header param Authorization 148 | if err := r.SetHeaderParam("Authorization", *o.Authorization); err != nil { 149 | return err 150 | } 151 | 152 | } 153 | 154 | if o.AbiDataRequest != nil { 155 | if err := r.SetBodyParam(o.AbiDataRequest); err != nil { 156 | return err 157 | } 158 | } 159 | 160 | if len(res) > 0 { 161 | return errors.CompositeValidationError(res...) 162 | } 163 | return nil 164 | } 165 | -------------------------------------------------------------------------------- /pkg/gen/client/dapp_controller/dapp_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package dapp_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new dapp controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for dapp controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetDappInfoUsingGET(params *GetDappInfoUsingGETParams) (*GetDappInfoUsingGETOK, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | GetDappInfoUsingGET checks risk of dapp through URL 37 | */ 38 | func (a *Client) GetDappInfoUsingGET(params *GetDappInfoUsingGETParams) (*GetDappInfoUsingGETOK, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewGetDappInfoUsingGETParams() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "getDappInfoUsingGET", 46 | Method: "GET", 47 | PathPattern: "/api/v1/dapp_security", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &GetDappInfoUsingGETReader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, err 58 | } 59 | success, ok := result.(*GetDappInfoUsingGETOK) 60 | if ok { 61 | return success, nil 62 | } 63 | // unexpected success response 64 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 65 | msg := fmt.Sprintf("unexpected success response for getDappInfoUsingGET: API contract not enforced by server. Client expected to get an error, but got: %T", result) 66 | panic(msg) 67 | } 68 | 69 | // SetTransport changes the transport on the client 70 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 71 | a.transport = transport 72 | } 73 | -------------------------------------------------------------------------------- /pkg/gen/client/dapp_controller/get_dapp_info_using_g_e_t_parameters.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package dapp_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "context" 10 | "net/http" 11 | "time" 12 | 13 | "github.com/go-openapi/errors" 14 | "github.com/go-openapi/runtime" 15 | cr "github.com/go-openapi/runtime/client" 16 | "github.com/go-openapi/strfmt" 17 | ) 18 | 19 | // NewGetDappInfoUsingGETParams creates a new GetDappInfoUsingGETParams object 20 | // with the default values initialized. 21 | func NewGetDappInfoUsingGETParams() *GetDappInfoUsingGETParams { 22 | var () 23 | return &GetDappInfoUsingGETParams{ 24 | 25 | timeout: cr.DefaultTimeout, 26 | } 27 | } 28 | 29 | // NewGetDappInfoUsingGETParamsWithTimeout creates a new GetDappInfoUsingGETParams object 30 | // with the default values initialized, and the ability to set a timeout on a request 31 | func NewGetDappInfoUsingGETParamsWithTimeout(timeout time.Duration) *GetDappInfoUsingGETParams { 32 | var () 33 | return &GetDappInfoUsingGETParams{ 34 | 35 | timeout: timeout, 36 | } 37 | } 38 | 39 | // NewGetDappInfoUsingGETParamsWithContext creates a new GetDappInfoUsingGETParams object 40 | // with the default values initialized, and the ability to set a context for a request 41 | func NewGetDappInfoUsingGETParamsWithContext(ctx context.Context) *GetDappInfoUsingGETParams { 42 | var () 43 | return &GetDappInfoUsingGETParams{ 44 | 45 | Context: ctx, 46 | } 47 | } 48 | 49 | // NewGetDappInfoUsingGETParamsWithHTTPClient creates a new GetDappInfoUsingGETParams object 50 | // with the default values initialized, and the ability to set a custom HTTPClient for a request 51 | func NewGetDappInfoUsingGETParamsWithHTTPClient(client *http.Client) *GetDappInfoUsingGETParams { 52 | var () 53 | return &GetDappInfoUsingGETParams{ 54 | HTTPClient: client, 55 | } 56 | } 57 | 58 | /* 59 | GetDappInfoUsingGETParams contains all the parameters to send to the API endpoint 60 | for the get dapp info using g e t operation typically these are written to a http.Request 61 | */ 62 | type GetDappInfoUsingGETParams struct { 63 | 64 | /*Authorization 65 | Authorization (test: Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) 66 | 67 | */ 68 | Authorization *string 69 | /*URL 70 | Url or domain 71 | 72 | */ 73 | URL *string 74 | 75 | timeout time.Duration 76 | Context context.Context 77 | HTTPClient *http.Client 78 | } 79 | 80 | // WithTimeout adds the timeout to the get dapp info using g e t params 81 | func (o *GetDappInfoUsingGETParams) WithTimeout(timeout time.Duration) *GetDappInfoUsingGETParams { 82 | o.SetTimeout(timeout) 83 | return o 84 | } 85 | 86 | // SetTimeout adds the timeout to the get dapp info using g e t params 87 | func (o *GetDappInfoUsingGETParams) SetTimeout(timeout time.Duration) { 88 | o.timeout = timeout 89 | } 90 | 91 | // WithContext adds the context to the get dapp info using g e t params 92 | func (o *GetDappInfoUsingGETParams) WithContext(ctx context.Context) *GetDappInfoUsingGETParams { 93 | o.SetContext(ctx) 94 | return o 95 | } 96 | 97 | // SetContext adds the context to the get dapp info using g e t params 98 | func (o *GetDappInfoUsingGETParams) SetContext(ctx context.Context) { 99 | o.Context = ctx 100 | } 101 | 102 | // WithHTTPClient adds the HTTPClient to the get dapp info using g e t params 103 | func (o *GetDappInfoUsingGETParams) WithHTTPClient(client *http.Client) *GetDappInfoUsingGETParams { 104 | o.SetHTTPClient(client) 105 | return o 106 | } 107 | 108 | // SetHTTPClient adds the HTTPClient to the get dapp info using g e t params 109 | func (o *GetDappInfoUsingGETParams) SetHTTPClient(client *http.Client) { 110 | o.HTTPClient = client 111 | } 112 | 113 | // WithAuthorization adds the authorization to the get dapp info using g e t params 114 | func (o *GetDappInfoUsingGETParams) WithAuthorization(authorization *string) *GetDappInfoUsingGETParams { 115 | o.SetAuthorization(authorization) 116 | return o 117 | } 118 | 119 | // SetAuthorization adds the authorization to the get dapp info using g e t params 120 | func (o *GetDappInfoUsingGETParams) SetAuthorization(authorization *string) { 121 | o.Authorization = authorization 122 | } 123 | 124 | // WithURL adds the url to the get dapp info using g e t params 125 | func (o *GetDappInfoUsingGETParams) WithURL(url *string) *GetDappInfoUsingGETParams { 126 | o.SetURL(url) 127 | return o 128 | } 129 | 130 | // SetURL adds the url to the get dapp info using g e t params 131 | func (o *GetDappInfoUsingGETParams) SetURL(url *string) { 132 | o.URL = url 133 | } 134 | 135 | // WriteToRequest writes these params to a swagger request 136 | func (o *GetDappInfoUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 137 | 138 | if err := r.SetTimeout(o.timeout); err != nil { 139 | return err 140 | } 141 | var res []error 142 | 143 | if o.Authorization != nil { 144 | 145 | // header param Authorization 146 | if err := r.SetHeaderParam("Authorization", *o.Authorization); err != nil { 147 | return err 148 | } 149 | 150 | } 151 | 152 | if o.URL != nil { 153 | 154 | // query param url 155 | var qrURL string 156 | if o.URL != nil { 157 | qrURL = *o.URL 158 | } 159 | qURL := qrURL 160 | if qURL != "" { 161 | if err := r.SetQueryParam("url", qURL); err != nil { 162 | return err 163 | } 164 | } 165 | 166 | } 167 | 168 | if len(res) > 0 { 169 | return errors.CompositeValidationError(res...) 170 | } 171 | return nil 172 | } 173 | -------------------------------------------------------------------------------- /pkg/gen/client/dapp_controller/get_dapp_info_using_g_e_t_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package dapp_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // GetDappInfoUsingGETReader is a Reader for the GetDappInfoUsingGET structure. 19 | type GetDappInfoUsingGETReader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *GetDappInfoUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewGetDappInfoUsingGETOK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewGetDappInfoUsingGETUnauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewGetDappInfoUsingGETForbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewGetDappInfoUsingGETNotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewGetDappInfoUsingGETOK creates a GetDappInfoUsingGETOK with default headers values 57 | func NewGetDappInfoUsingGETOK() *GetDappInfoUsingGETOK { 58 | return &GetDappInfoUsingGETOK{} 59 | } 60 | 61 | /* 62 | GetDappInfoUsingGETOK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type GetDappInfoUsingGETOK struct { 67 | Payload *models.ResponseWrapperDappContractSecurityResponse 68 | } 69 | 70 | func (o *GetDappInfoUsingGETOK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/dapp_security][%d] getDappInfoUsingGETOK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *GetDappInfoUsingGETOK) GetPayload() *models.ResponseWrapperDappContractSecurityResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *GetDappInfoUsingGETOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperDappContractSecurityResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewGetDappInfoUsingGETUnauthorized creates a GetDappInfoUsingGETUnauthorized with default headers values 91 | func NewGetDappInfoUsingGETUnauthorized() *GetDappInfoUsingGETUnauthorized { 92 | return &GetDappInfoUsingGETUnauthorized{} 93 | } 94 | 95 | /* 96 | GetDappInfoUsingGETUnauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type GetDappInfoUsingGETUnauthorized struct { 101 | } 102 | 103 | func (o *GetDappInfoUsingGETUnauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/dapp_security][%d] getDappInfoUsingGETUnauthorized ", 401) 105 | } 106 | 107 | func (o *GetDappInfoUsingGETUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewGetDappInfoUsingGETForbidden creates a GetDappInfoUsingGETForbidden with default headers values 113 | func NewGetDappInfoUsingGETForbidden() *GetDappInfoUsingGETForbidden { 114 | return &GetDappInfoUsingGETForbidden{} 115 | } 116 | 117 | /* 118 | GetDappInfoUsingGETForbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type GetDappInfoUsingGETForbidden struct { 123 | } 124 | 125 | func (o *GetDappInfoUsingGETForbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/dapp_security][%d] getDappInfoUsingGETForbidden ", 403) 127 | } 128 | 129 | func (o *GetDappInfoUsingGETForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewGetDappInfoUsingGETNotFound creates a GetDappInfoUsingGETNotFound with default headers values 135 | func NewGetDappInfoUsingGETNotFound() *GetDappInfoUsingGETNotFound { 136 | return &GetDappInfoUsingGETNotFound{} 137 | } 138 | 139 | /* 140 | GetDappInfoUsingGETNotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type GetDappInfoUsingGETNotFound struct { 145 | } 146 | 147 | func (o *GetDappInfoUsingGETNotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/dapp_security][%d] getDappInfoUsingGETNotFound ", 404) 149 | } 150 | 151 | func (o *GetDappInfoUsingGETNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/defi_controller/defi_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package defi_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new defi controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for defi controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetDefiInfoUsingGET(params *GetDefiInfoUsingGETParams) (*GetDefiInfoUsingGETOK, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | GetDefiInfoUsingGET rugs pull detection API beta 37 | */ 38 | func (a *Client) GetDefiInfoUsingGET(params *GetDefiInfoUsingGETParams) (*GetDefiInfoUsingGETOK, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewGetDefiInfoUsingGETParams() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "getDefiInfoUsingGET", 46 | Method: "GET", 47 | PathPattern: "/api/v1/rugpull_detecting/{chain_id}", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &GetDefiInfoUsingGETReader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, err 58 | } 59 | success, ok := result.(*GetDefiInfoUsingGETOK) 60 | if ok { 61 | return success, nil 62 | } 63 | // unexpected success response 64 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 65 | msg := fmt.Sprintf("unexpected success response for getDefiInfoUsingGET: API contract not enforced by server. Client expected to get an error, but got: %T", result) 66 | panic(msg) 67 | } 68 | 69 | // SetTransport changes the transport on the client 70 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 71 | a.transport = transport 72 | } 73 | -------------------------------------------------------------------------------- /pkg/gen/client/defi_controller/get_defi_info_using_g_e_t_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package defi_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // GetDefiInfoUsingGETReader is a Reader for the GetDefiInfoUsingGET structure. 19 | type GetDefiInfoUsingGETReader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *GetDefiInfoUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewGetDefiInfoUsingGETOK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewGetDefiInfoUsingGETUnauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewGetDefiInfoUsingGETForbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewGetDefiInfoUsingGETNotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewGetDefiInfoUsingGETOK creates a GetDefiInfoUsingGETOK with default headers values 57 | func NewGetDefiInfoUsingGETOK() *GetDefiInfoUsingGETOK { 58 | return &GetDefiInfoUsingGETOK{} 59 | } 60 | 61 | /* 62 | GetDefiInfoUsingGETOK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type GetDefiInfoUsingGETOK struct { 67 | Payload *models.GetDefiInfoResponse 68 | } 69 | 70 | func (o *GetDefiInfoUsingGETOK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/rugpull_detecting/{chain_id}][%d] getDefiInfoUsingGETOK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *GetDefiInfoUsingGETOK) GetPayload() *models.GetDefiInfoResponse { 75 | return o.Payload 76 | } 77 | 78 | func (o *GetDefiInfoUsingGETOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.GetDefiInfoResponse) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewGetDefiInfoUsingGETUnauthorized creates a GetDefiInfoUsingGETUnauthorized with default headers values 91 | func NewGetDefiInfoUsingGETUnauthorized() *GetDefiInfoUsingGETUnauthorized { 92 | return &GetDefiInfoUsingGETUnauthorized{} 93 | } 94 | 95 | /* 96 | GetDefiInfoUsingGETUnauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type GetDefiInfoUsingGETUnauthorized struct { 101 | } 102 | 103 | func (o *GetDefiInfoUsingGETUnauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/rugpull_detecting/{chain_id}][%d] getDefiInfoUsingGETUnauthorized ", 401) 105 | } 106 | 107 | func (o *GetDefiInfoUsingGETUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewGetDefiInfoUsingGETForbidden creates a GetDefiInfoUsingGETForbidden with default headers values 113 | func NewGetDefiInfoUsingGETForbidden() *GetDefiInfoUsingGETForbidden { 114 | return &GetDefiInfoUsingGETForbidden{} 115 | } 116 | 117 | /* 118 | GetDefiInfoUsingGETForbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type GetDefiInfoUsingGETForbidden struct { 123 | } 124 | 125 | func (o *GetDefiInfoUsingGETForbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/rugpull_detecting/{chain_id}][%d] getDefiInfoUsingGETForbidden ", 403) 127 | } 128 | 129 | func (o *GetDefiInfoUsingGETForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewGetDefiInfoUsingGETNotFound creates a GetDefiInfoUsingGETNotFound with default headers values 135 | func NewGetDefiInfoUsingGETNotFound() *GetDefiInfoUsingGETNotFound { 136 | return &GetDefiInfoUsingGETNotFound{} 137 | } 138 | 139 | /* 140 | GetDefiInfoUsingGETNotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type GetDefiInfoUsingGETNotFound struct { 145 | } 146 | 147 | func (o *GetDefiInfoUsingGETNotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/rugpull_detecting/{chain_id}][%d] getDefiInfoUsingGETNotFound ", 404) 149 | } 150 | 151 | func (o *GetDefiInfoUsingGETNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/goplus_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package client 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/runtime" 10 | httptransport "github.com/go-openapi/runtime/client" 11 | "github.com/go-openapi/strfmt" 12 | 13 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/approve_controller_v_1" 14 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/approve_controller_v_2" 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/contract_abi_controller" 16 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/dapp_controller" 17 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/defi_controller" 18 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/nft_controller" 19 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/token_controller" 20 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/token_controller_v_1" 21 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/client/website_controller" 22 | ) 23 | 24 | // Default goplus HTTP client. 25 | var Default = NewHTTPClient(nil) 26 | 27 | const ( 28 | // DefaultHost is the default Host 29 | // found in Meta (info) section of spec file 30 | DefaultHost string = "api.gopluslabs.io" 31 | // DefaultBasePath is the default BasePath 32 | // found in Meta (info) section of spec file 33 | DefaultBasePath string = "/" 34 | ) 35 | 36 | // DefaultSchemes are the default schemes found in Meta (info) section of spec file 37 | var DefaultSchemes = []string{"https"} 38 | 39 | // NewHTTPClient creates a new goplus HTTP client. 40 | func NewHTTPClient(formats strfmt.Registry) *Goplus { 41 | return NewHTTPClientWithConfig(formats, nil) 42 | } 43 | 44 | // NewHTTPClientWithConfig creates a new goplus HTTP client, 45 | // using a customizable transport config. 46 | func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Goplus { 47 | // ensure nullable parameters have default 48 | if cfg == nil { 49 | cfg = DefaultTransportConfig() 50 | } 51 | 52 | // create transport and client 53 | transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) 54 | return New(transport, formats) 55 | } 56 | 57 | // New creates a new goplus client 58 | func New(transport runtime.ClientTransport, formats strfmt.Registry) *Goplus { 59 | // ensure nullable parameters have default 60 | if formats == nil { 61 | formats = strfmt.Default 62 | } 63 | 64 | cli := new(Goplus) 65 | cli.Transport = transport 66 | cli.ApproveControllerv1 = approve_controller_v_1.New(transport, formats) 67 | cli.ApproveControllerv2 = approve_controller_v_2.New(transport, formats) 68 | cli.ContractAbiController = contract_abi_controller.New(transport, formats) 69 | cli.DappController = dapp_controller.New(transport, formats) 70 | cli.DefiController = defi_controller.New(transport, formats) 71 | cli.NftController = nft_controller.New(transport, formats) 72 | cli.TokenController = token_controller.New(transport, formats) 73 | cli.TokenControllerv1 = token_controller_v_1.New(transport, formats) 74 | cli.WebsiteController = website_controller.New(transport, formats) 75 | return cli 76 | } 77 | 78 | // DefaultTransportConfig creates a TransportConfig with the 79 | // default settings taken from the meta section of the spec file. 80 | func DefaultTransportConfig() *TransportConfig { 81 | return &TransportConfig{ 82 | Host: DefaultHost, 83 | BasePath: DefaultBasePath, 84 | Schemes: DefaultSchemes, 85 | } 86 | } 87 | 88 | // TransportConfig contains the transport related info, 89 | // found in the meta section of the spec file. 90 | type TransportConfig struct { 91 | Host string 92 | BasePath string 93 | Schemes []string 94 | } 95 | 96 | // WithHost overrides the default host, 97 | // provided by the meta section of the spec file. 98 | func (cfg *TransportConfig) WithHost(host string) *TransportConfig { 99 | cfg.Host = host 100 | return cfg 101 | } 102 | 103 | // WithBasePath overrides the default basePath, 104 | // provided by the meta section of the spec file. 105 | func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { 106 | cfg.BasePath = basePath 107 | return cfg 108 | } 109 | 110 | // WithSchemes overrides the default schemes, 111 | // provided by the meta section of the spec file. 112 | func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { 113 | cfg.Schemes = schemes 114 | return cfg 115 | } 116 | 117 | // Goplus is a client for goplus 118 | type Goplus struct { 119 | ApproveControllerv1 approve_controller_v_1.ClientService 120 | 121 | ApproveControllerv2 approve_controller_v_2.ClientService 122 | 123 | ContractAbiController contract_abi_controller.ClientService 124 | 125 | DappController dapp_controller.ClientService 126 | 127 | DefiController defi_controller.ClientService 128 | 129 | NftController nft_controller.ClientService 130 | 131 | TokenController token_controller.ClientService 132 | 133 | TokenControllerv1 token_controller_v_1.ClientService 134 | 135 | WebsiteController website_controller.ClientService 136 | 137 | Transport runtime.ClientTransport 138 | } 139 | 140 | // SetTransport changes the transport on the client and all its subresources 141 | func (c *Goplus) SetTransport(transport runtime.ClientTransport) { 142 | c.Transport = transport 143 | c.ApproveControllerv1.SetTransport(transport) 144 | c.ApproveControllerv2.SetTransport(transport) 145 | c.ContractAbiController.SetTransport(transport) 146 | c.DappController.SetTransport(transport) 147 | c.DefiController.SetTransport(transport) 148 | c.NftController.SetTransport(transport) 149 | c.TokenController.SetTransport(transport) 150 | c.TokenControllerv1.SetTransport(transport) 151 | c.WebsiteController.SetTransport(transport) 152 | } 153 | -------------------------------------------------------------------------------- /pkg/gen/client/nft_controller/get_nft_info_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package nft_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // GetNftInfoUsingGET1Reader is a Reader for the GetNftInfoUsingGET1 structure. 19 | type GetNftInfoUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *GetNftInfoUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewGetNftInfoUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewGetNftInfoUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewGetNftInfoUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewGetNftInfoUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewGetNftInfoUsingGET1OK creates a GetNftInfoUsingGET1OK with default headers values 57 | func NewGetNftInfoUsingGET1OK() *GetNftInfoUsingGET1OK { 58 | return &GetNftInfoUsingGET1OK{} 59 | } 60 | 61 | /* 62 | GetNftInfoUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type GetNftInfoUsingGET1OK struct { 67 | Payload *models.ResponseWrapperGetNftInfo 68 | } 69 | 70 | func (o *GetNftInfoUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/nft_security/{chain_id}][%d] getNftInfoUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *GetNftInfoUsingGET1OK) GetPayload() *models.ResponseWrapperGetNftInfo { 75 | return o.Payload 76 | } 77 | 78 | func (o *GetNftInfoUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperGetNftInfo) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewGetNftInfoUsingGET1Unauthorized creates a GetNftInfoUsingGET1Unauthorized with default headers values 91 | func NewGetNftInfoUsingGET1Unauthorized() *GetNftInfoUsingGET1Unauthorized { 92 | return &GetNftInfoUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | GetNftInfoUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type GetNftInfoUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *GetNftInfoUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/nft_security/{chain_id}][%d] getNftInfoUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *GetNftInfoUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewGetNftInfoUsingGET1Forbidden creates a GetNftInfoUsingGET1Forbidden with default headers values 113 | func NewGetNftInfoUsingGET1Forbidden() *GetNftInfoUsingGET1Forbidden { 114 | return &GetNftInfoUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | GetNftInfoUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type GetNftInfoUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *GetNftInfoUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/nft_security/{chain_id}][%d] getNftInfoUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *GetNftInfoUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewGetNftInfoUsingGET1NotFound creates a GetNftInfoUsingGET1NotFound with default headers values 135 | func NewGetNftInfoUsingGET1NotFound() *GetNftInfoUsingGET1NotFound { 136 | return &GetNftInfoUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | GetNftInfoUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type GetNftInfoUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *GetNftInfoUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/nft_security/{chain_id}][%d] getNftInfoUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *GetNftInfoUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/nft_controller/nft_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package nft_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new nft controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for nft controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetNftInfoUsingGET1(params *GetNftInfoUsingGET1Params) (*GetNftInfoUsingGET1OK, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | GetNftInfoUsingGET1 gets n f t s security and risk data 37 | */ 38 | func (a *Client) GetNftInfoUsingGET1(params *GetNftInfoUsingGET1Params) (*GetNftInfoUsingGET1OK, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewGetNftInfoUsingGET1Params() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "getNftInfoUsingGET_1", 46 | Method: "GET", 47 | PathPattern: "/api/v1/nft_security/{chain_id}", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &GetNftInfoUsingGET1Reader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, err 58 | } 59 | success, ok := result.(*GetNftInfoUsingGET1OK) 60 | if ok { 61 | return success, nil 62 | } 63 | // unexpected success response 64 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 65 | msg := fmt.Sprintf("unexpected success response for getNftInfoUsingGET_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) 66 | panic(msg) 67 | } 68 | 69 | // SetTransport changes the transport on the client 70 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 71 | a.transport = transport 72 | } 73 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller/get_access_token_using_p_o_s_t_parameters.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "context" 10 | "net/http" 11 | "time" 12 | 13 | "github.com/go-openapi/errors" 14 | "github.com/go-openapi/runtime" 15 | cr "github.com/go-openapi/runtime/client" 16 | "github.com/go-openapi/strfmt" 17 | 18 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 19 | ) 20 | 21 | // NewGetAccessTokenUsingPOSTParams creates a new GetAccessTokenUsingPOSTParams object 22 | // with the default values initialized. 23 | func NewGetAccessTokenUsingPOSTParams() *GetAccessTokenUsingPOSTParams { 24 | var () 25 | return &GetAccessTokenUsingPOSTParams{ 26 | 27 | timeout: cr.DefaultTimeout, 28 | } 29 | } 30 | 31 | // NewGetAccessTokenUsingPOSTParamsWithTimeout creates a new GetAccessTokenUsingPOSTParams object 32 | // with the default values initialized, and the ability to set a timeout on a request 33 | func NewGetAccessTokenUsingPOSTParamsWithTimeout(timeout time.Duration) *GetAccessTokenUsingPOSTParams { 34 | var () 35 | return &GetAccessTokenUsingPOSTParams{ 36 | 37 | timeout: timeout, 38 | } 39 | } 40 | 41 | // NewGetAccessTokenUsingPOSTParamsWithContext creates a new GetAccessTokenUsingPOSTParams object 42 | // with the default values initialized, and the ability to set a context for a request 43 | func NewGetAccessTokenUsingPOSTParamsWithContext(ctx context.Context) *GetAccessTokenUsingPOSTParams { 44 | var () 45 | return &GetAccessTokenUsingPOSTParams{ 46 | 47 | Context: ctx, 48 | } 49 | } 50 | 51 | // NewGetAccessTokenUsingPOSTParamsWithHTTPClient creates a new GetAccessTokenUsingPOSTParams object 52 | // with the default values initialized, and the ability to set a custom HTTPClient for a request 53 | func NewGetAccessTokenUsingPOSTParamsWithHTTPClient(client *http.Client) *GetAccessTokenUsingPOSTParams { 54 | var () 55 | return &GetAccessTokenUsingPOSTParams{ 56 | HTTPClient: client, 57 | } 58 | } 59 | 60 | /* 61 | GetAccessTokenUsingPOSTParams contains all the parameters to send to the API endpoint 62 | for the get access token using p o s t operation typically these are written to a http.Request 63 | */ 64 | type GetAccessTokenUsingPOSTParams struct { 65 | 66 | /*Request 67 | request 68 | 69 | */ 70 | Request *models.GetAccessTokenRequest 71 | 72 | timeout time.Duration 73 | Context context.Context 74 | HTTPClient *http.Client 75 | } 76 | 77 | // WithTimeout adds the timeout to the get access token using p o s t params 78 | func (o *GetAccessTokenUsingPOSTParams) WithTimeout(timeout time.Duration) *GetAccessTokenUsingPOSTParams { 79 | o.SetTimeout(timeout) 80 | return o 81 | } 82 | 83 | // SetTimeout adds the timeout to the get access token using p o s t params 84 | func (o *GetAccessTokenUsingPOSTParams) SetTimeout(timeout time.Duration) { 85 | o.timeout = timeout 86 | } 87 | 88 | // WithContext adds the context to the get access token using p o s t params 89 | func (o *GetAccessTokenUsingPOSTParams) WithContext(ctx context.Context) *GetAccessTokenUsingPOSTParams { 90 | o.SetContext(ctx) 91 | return o 92 | } 93 | 94 | // SetContext adds the context to the get access token using p o s t params 95 | func (o *GetAccessTokenUsingPOSTParams) SetContext(ctx context.Context) { 96 | o.Context = ctx 97 | } 98 | 99 | // WithHTTPClient adds the HTTPClient to the get access token using p o s t params 100 | func (o *GetAccessTokenUsingPOSTParams) WithHTTPClient(client *http.Client) *GetAccessTokenUsingPOSTParams { 101 | o.SetHTTPClient(client) 102 | return o 103 | } 104 | 105 | // SetHTTPClient adds the HTTPClient to the get access token using p o s t params 106 | func (o *GetAccessTokenUsingPOSTParams) SetHTTPClient(client *http.Client) { 107 | o.HTTPClient = client 108 | } 109 | 110 | // WithRequest adds the request to the get access token using p o s t params 111 | func (o *GetAccessTokenUsingPOSTParams) WithRequest(request *models.GetAccessTokenRequest) *GetAccessTokenUsingPOSTParams { 112 | o.SetRequest(request) 113 | return o 114 | } 115 | 116 | // SetRequest adds the request to the get access token using p o s t params 117 | func (o *GetAccessTokenUsingPOSTParams) SetRequest(request *models.GetAccessTokenRequest) { 118 | o.Request = request 119 | } 120 | 121 | // WriteToRequest writes these params to a swagger request 122 | func (o *GetAccessTokenUsingPOSTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 123 | 124 | if err := r.SetTimeout(o.timeout); err != nil { 125 | return err 126 | } 127 | var res []error 128 | 129 | if o.Request != nil { 130 | if err := r.SetBodyParam(o.Request); err != nil { 131 | return err 132 | } 133 | } 134 | 135 | if len(res) > 0 { 136 | return errors.CompositeValidationError(res...) 137 | } 138 | return nil 139 | } 140 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller/token_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new token controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for token controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetAccessTokenUsingPOST(params *GetAccessTokenUsingPOSTParams) (*GetAccessTokenUsingPOSTOK, *GetAccessTokenUsingPOSTCreated, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | GetAccessTokenUsingPOST gets token 37 | */ 38 | func (a *Client) GetAccessTokenUsingPOST(params *GetAccessTokenUsingPOSTParams) (*GetAccessTokenUsingPOSTOK, *GetAccessTokenUsingPOSTCreated, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewGetAccessTokenUsingPOSTParams() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "getAccessTokenUsingPOST", 46 | Method: "POST", 47 | PathPattern: "/api/v1/token", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &GetAccessTokenUsingPOSTReader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, nil, err 58 | } 59 | switch value := result.(type) { 60 | case *GetAccessTokenUsingPOSTOK: 61 | return value, nil, nil 62 | case *GetAccessTokenUsingPOSTCreated: 63 | return nil, value, nil 64 | } 65 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 66 | msg := fmt.Sprintf("unexpected success response for token_controller: API contract not enforced by server. Client expected to get an error, but got: %T", result) 67 | panic(msg) 68 | } 69 | 70 | // SetTransport changes the transport on the client 71 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 72 | a.transport = transport 73 | } 74 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller_v_1/get_chains_list_using_g_e_t_parameters.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "context" 10 | "net/http" 11 | "time" 12 | 13 | "github.com/go-openapi/errors" 14 | "github.com/go-openapi/runtime" 15 | cr "github.com/go-openapi/runtime/client" 16 | "github.com/go-openapi/strfmt" 17 | ) 18 | 19 | // NewGetChainsListUsingGETParams creates a new GetChainsListUsingGETParams object 20 | // with the default values initialized. 21 | func NewGetChainsListUsingGETParams() *GetChainsListUsingGETParams { 22 | var () 23 | return &GetChainsListUsingGETParams{ 24 | 25 | timeout: cr.DefaultTimeout, 26 | } 27 | } 28 | 29 | // NewGetChainsListUsingGETParamsWithTimeout creates a new GetChainsListUsingGETParams object 30 | // with the default values initialized, and the ability to set a timeout on a request 31 | func NewGetChainsListUsingGETParamsWithTimeout(timeout time.Duration) *GetChainsListUsingGETParams { 32 | var () 33 | return &GetChainsListUsingGETParams{ 34 | 35 | timeout: timeout, 36 | } 37 | } 38 | 39 | // NewGetChainsListUsingGETParamsWithContext creates a new GetChainsListUsingGETParams object 40 | // with the default values initialized, and the ability to set a context for a request 41 | func NewGetChainsListUsingGETParamsWithContext(ctx context.Context) *GetChainsListUsingGETParams { 42 | var () 43 | return &GetChainsListUsingGETParams{ 44 | 45 | Context: ctx, 46 | } 47 | } 48 | 49 | // NewGetChainsListUsingGETParamsWithHTTPClient creates a new GetChainsListUsingGETParams object 50 | // with the default values initialized, and the ability to set a custom HTTPClient for a request 51 | func NewGetChainsListUsingGETParamsWithHTTPClient(client *http.Client) *GetChainsListUsingGETParams { 52 | var () 53 | return &GetChainsListUsingGETParams{ 54 | HTTPClient: client, 55 | } 56 | } 57 | 58 | /* 59 | GetChainsListUsingGETParams contains all the parameters to send to the API endpoint 60 | for the get chains list using g e t operation typically these are written to a http.Request 61 | */ 62 | type GetChainsListUsingGETParams struct { 63 | 64 | /*Authorization 65 | Authorization (test: Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) 66 | 67 | */ 68 | Authorization *string 69 | /*Name 70 | API name. 71 | 72 | */ 73 | Name *string 74 | 75 | timeout time.Duration 76 | Context context.Context 77 | HTTPClient *http.Client 78 | } 79 | 80 | // WithTimeout adds the timeout to the get chains list using g e t params 81 | func (o *GetChainsListUsingGETParams) WithTimeout(timeout time.Duration) *GetChainsListUsingGETParams { 82 | o.SetTimeout(timeout) 83 | return o 84 | } 85 | 86 | // SetTimeout adds the timeout to the get chains list using g e t params 87 | func (o *GetChainsListUsingGETParams) SetTimeout(timeout time.Duration) { 88 | o.timeout = timeout 89 | } 90 | 91 | // WithContext adds the context to the get chains list using g e t params 92 | func (o *GetChainsListUsingGETParams) WithContext(ctx context.Context) *GetChainsListUsingGETParams { 93 | o.SetContext(ctx) 94 | return o 95 | } 96 | 97 | // SetContext adds the context to the get chains list using g e t params 98 | func (o *GetChainsListUsingGETParams) SetContext(ctx context.Context) { 99 | o.Context = ctx 100 | } 101 | 102 | // WithHTTPClient adds the HTTPClient to the get chains list using g e t params 103 | func (o *GetChainsListUsingGETParams) WithHTTPClient(client *http.Client) *GetChainsListUsingGETParams { 104 | o.SetHTTPClient(client) 105 | return o 106 | } 107 | 108 | // SetHTTPClient adds the HTTPClient to the get chains list using g e t params 109 | func (o *GetChainsListUsingGETParams) SetHTTPClient(client *http.Client) { 110 | o.HTTPClient = client 111 | } 112 | 113 | // WithAuthorization adds the authorization to the get chains list using g e t params 114 | func (o *GetChainsListUsingGETParams) WithAuthorization(authorization *string) *GetChainsListUsingGETParams { 115 | o.SetAuthorization(authorization) 116 | return o 117 | } 118 | 119 | // SetAuthorization adds the authorization to the get chains list using g e t params 120 | func (o *GetChainsListUsingGETParams) SetAuthorization(authorization *string) { 121 | o.Authorization = authorization 122 | } 123 | 124 | // WithName adds the name to the get chains list using g e t params 125 | func (o *GetChainsListUsingGETParams) WithName(name *string) *GetChainsListUsingGETParams { 126 | o.SetName(name) 127 | return o 128 | } 129 | 130 | // SetName adds the name to the get chains list using g e t params 131 | func (o *GetChainsListUsingGETParams) SetName(name *string) { 132 | o.Name = name 133 | } 134 | 135 | // WriteToRequest writes these params to a swagger request 136 | func (o *GetChainsListUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 137 | 138 | if err := r.SetTimeout(o.timeout); err != nil { 139 | return err 140 | } 141 | var res []error 142 | 143 | if o.Authorization != nil { 144 | 145 | // header param Authorization 146 | if err := r.SetHeaderParam("Authorization", *o.Authorization); err != nil { 147 | return err 148 | } 149 | 150 | } 151 | 152 | if o.Name != nil { 153 | 154 | // query param name 155 | var qrName string 156 | if o.Name != nil { 157 | qrName = *o.Name 158 | } 159 | qName := qrName 160 | if qName != "" { 161 | if err := r.SetQueryParam("name", qName); err != nil { 162 | return err 163 | } 164 | } 165 | 166 | } 167 | 168 | if len(res) > 0 { 169 | return errors.CompositeValidationError(res...) 170 | } 171 | return nil 172 | } 173 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller_v_1/get_chains_list_using_g_e_t_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // GetChainsListUsingGETReader is a Reader for the GetChainsListUsingGET structure. 19 | type GetChainsListUsingGETReader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *GetChainsListUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewGetChainsListUsingGETOK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewGetChainsListUsingGETUnauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewGetChainsListUsingGETForbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewGetChainsListUsingGETNotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewGetChainsListUsingGETOK creates a GetChainsListUsingGETOK with default headers values 57 | func NewGetChainsListUsingGETOK() *GetChainsListUsingGETOK { 58 | return &GetChainsListUsingGETOK{} 59 | } 60 | 61 | /* 62 | GetChainsListUsingGETOK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type GetChainsListUsingGETOK struct { 67 | Payload *models.ResponseWrapperListGetChainsList 68 | } 69 | 70 | func (o *GetChainsListUsingGETOK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/supported_chains][%d] getChainsListUsingGETOK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *GetChainsListUsingGETOK) GetPayload() *models.ResponseWrapperListGetChainsList { 75 | return o.Payload 76 | } 77 | 78 | func (o *GetChainsListUsingGETOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperListGetChainsList) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewGetChainsListUsingGETUnauthorized creates a GetChainsListUsingGETUnauthorized with default headers values 91 | func NewGetChainsListUsingGETUnauthorized() *GetChainsListUsingGETUnauthorized { 92 | return &GetChainsListUsingGETUnauthorized{} 93 | } 94 | 95 | /* 96 | GetChainsListUsingGETUnauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type GetChainsListUsingGETUnauthorized struct { 101 | } 102 | 103 | func (o *GetChainsListUsingGETUnauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/supported_chains][%d] getChainsListUsingGETUnauthorized ", 401) 105 | } 106 | 107 | func (o *GetChainsListUsingGETUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewGetChainsListUsingGETForbidden creates a GetChainsListUsingGETForbidden with default headers values 113 | func NewGetChainsListUsingGETForbidden() *GetChainsListUsingGETForbidden { 114 | return &GetChainsListUsingGETForbidden{} 115 | } 116 | 117 | /* 118 | GetChainsListUsingGETForbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type GetChainsListUsingGETForbidden struct { 123 | } 124 | 125 | func (o *GetChainsListUsingGETForbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/supported_chains][%d] getChainsListUsingGETForbidden ", 403) 127 | } 128 | 129 | func (o *GetChainsListUsingGETForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewGetChainsListUsingGETNotFound creates a GetChainsListUsingGETNotFound with default headers values 135 | func NewGetChainsListUsingGETNotFound() *GetChainsListUsingGETNotFound { 136 | return &GetChainsListUsingGETNotFound{} 137 | } 138 | 139 | /* 140 | GetChainsListUsingGETNotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type GetChainsListUsingGETNotFound struct { 145 | } 146 | 147 | func (o *GetChainsListUsingGETNotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/supported_chains][%d] getChainsListUsingGETNotFound ", 404) 149 | } 150 | 151 | func (o *GetChainsListUsingGETNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller_v_1/token_controllerv1_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new token controller v 1 API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for token controller v 1 API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | GetChainsListUsingGET(params *GetChainsListUsingGETParams) (*GetChainsListUsingGETOK, error) 31 | 32 | TokenSecurityUsingGET1(params *TokenSecurityUsingGET1Params) (*TokenSecurityUsingGET1OK, error) 33 | 34 | SetTransport(transport runtime.ClientTransport) 35 | } 36 | 37 | /* 38 | GetChainsListUsingGET gets the list of chains supported by different functions 39 | */ 40 | func (a *Client) GetChainsListUsingGET(params *GetChainsListUsingGETParams) (*GetChainsListUsingGETOK, error) { 41 | // TODO: Validate the params before sending 42 | if params == nil { 43 | params = NewGetChainsListUsingGETParams() 44 | } 45 | 46 | result, err := a.transport.Submit(&runtime.ClientOperation{ 47 | ID: "getChainsListUsingGET", 48 | Method: "GET", 49 | PathPattern: "/api/v1/supported_chains", 50 | ProducesMediaTypes: []string{"*/*"}, 51 | ConsumesMediaTypes: []string{"application/json"}, 52 | Schemes: []string{"https"}, 53 | Params: params, 54 | Reader: &GetChainsListUsingGETReader{formats: a.formats}, 55 | Context: params.Context, 56 | Client: params.HTTPClient, 57 | }) 58 | if err != nil { 59 | return nil, err 60 | } 61 | success, ok := result.(*GetChainsListUsingGETOK) 62 | if ok { 63 | return success, nil 64 | } 65 | // unexpected success response 66 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 67 | msg := fmt.Sprintf("unexpected success response for getChainsListUsingGET: API contract not enforced by server. Client expected to get an error, but got: %T", result) 68 | panic(msg) 69 | } 70 | 71 | /* 72 | TokenSecurityUsingGET1 gets token s security and risk data 73 | */ 74 | func (a *Client) TokenSecurityUsingGET1(params *TokenSecurityUsingGET1Params) (*TokenSecurityUsingGET1OK, error) { 75 | // TODO: Validate the params before sending 76 | if params == nil { 77 | params = NewTokenSecurityUsingGET1Params() 78 | } 79 | 80 | result, err := a.transport.Submit(&runtime.ClientOperation{ 81 | ID: "tokenSecurityUsingGET_1", 82 | Method: "GET", 83 | PathPattern: "/api/v1/token_security/{chain_id}", 84 | ProducesMediaTypes: []string{"*/*"}, 85 | ConsumesMediaTypes: []string{"application/json"}, 86 | Schemes: []string{"https"}, 87 | Params: params, 88 | Reader: &TokenSecurityUsingGET1Reader{formats: a.formats}, 89 | Context: params.Context, 90 | Client: params.HTTPClient, 91 | }) 92 | if err != nil { 93 | return nil, err 94 | } 95 | success, ok := result.(*TokenSecurityUsingGET1OK) 96 | if ok { 97 | return success, nil 98 | } 99 | // unexpected success response 100 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 101 | msg := fmt.Sprintf("unexpected success response for tokenSecurityUsingGET_1: API contract not enforced by server. Client expected to get an error, but got: %T", result) 102 | panic(msg) 103 | } 104 | 105 | // SetTransport changes the transport on the client 106 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 107 | a.transport = transport 108 | } 109 | -------------------------------------------------------------------------------- /pkg/gen/client/token_controller_v_1/token_security_using_g_e_t1_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package token_controller_v_1 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // TokenSecurityUsingGET1Reader is a Reader for the TokenSecurityUsingGET1 structure. 19 | type TokenSecurityUsingGET1Reader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *TokenSecurityUsingGET1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewTokenSecurityUsingGET1OK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewTokenSecurityUsingGET1Unauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewTokenSecurityUsingGET1Forbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewTokenSecurityUsingGET1NotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewTokenSecurityUsingGET1OK creates a TokenSecurityUsingGET1OK with default headers values 57 | func NewTokenSecurityUsingGET1OK() *TokenSecurityUsingGET1OK { 58 | return &TokenSecurityUsingGET1OK{} 59 | } 60 | 61 | /* 62 | TokenSecurityUsingGET1OK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type TokenSecurityUsingGET1OK struct { 67 | Payload *models.ResponseWrapperTokenSecurity 68 | } 69 | 70 | func (o *TokenSecurityUsingGET1OK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/token_security/{chain_id}][%d] tokenSecurityUsingGET1OK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *TokenSecurityUsingGET1OK) GetPayload() *models.ResponseWrapperTokenSecurity { 75 | return o.Payload 76 | } 77 | 78 | func (o *TokenSecurityUsingGET1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperTokenSecurity) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewTokenSecurityUsingGET1Unauthorized creates a TokenSecurityUsingGET1Unauthorized with default headers values 91 | func NewTokenSecurityUsingGET1Unauthorized() *TokenSecurityUsingGET1Unauthorized { 92 | return &TokenSecurityUsingGET1Unauthorized{} 93 | } 94 | 95 | /* 96 | TokenSecurityUsingGET1Unauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type TokenSecurityUsingGET1Unauthorized struct { 101 | } 102 | 103 | func (o *TokenSecurityUsingGET1Unauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/token_security/{chain_id}][%d] tokenSecurityUsingGET1Unauthorized ", 401) 105 | } 106 | 107 | func (o *TokenSecurityUsingGET1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewTokenSecurityUsingGET1Forbidden creates a TokenSecurityUsingGET1Forbidden with default headers values 113 | func NewTokenSecurityUsingGET1Forbidden() *TokenSecurityUsingGET1Forbidden { 114 | return &TokenSecurityUsingGET1Forbidden{} 115 | } 116 | 117 | /* 118 | TokenSecurityUsingGET1Forbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type TokenSecurityUsingGET1Forbidden struct { 123 | } 124 | 125 | func (o *TokenSecurityUsingGET1Forbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/token_security/{chain_id}][%d] tokenSecurityUsingGET1Forbidden ", 403) 127 | } 128 | 129 | func (o *TokenSecurityUsingGET1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewTokenSecurityUsingGET1NotFound creates a TokenSecurityUsingGET1NotFound with default headers values 135 | func NewTokenSecurityUsingGET1NotFound() *TokenSecurityUsingGET1NotFound { 136 | return &TokenSecurityUsingGET1NotFound{} 137 | } 138 | 139 | /* 140 | TokenSecurityUsingGET1NotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type TokenSecurityUsingGET1NotFound struct { 145 | } 146 | 147 | func (o *TokenSecurityUsingGET1NotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/token_security/{chain_id}][%d] tokenSecurityUsingGET1NotFound ", 404) 149 | } 150 | 151 | func (o *TokenSecurityUsingGET1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/website_controller/phishing_site_using_g_e_t_parameters.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package website_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "context" 10 | "net/http" 11 | "time" 12 | 13 | "github.com/go-openapi/errors" 14 | "github.com/go-openapi/runtime" 15 | cr "github.com/go-openapi/runtime/client" 16 | "github.com/go-openapi/strfmt" 17 | ) 18 | 19 | // NewPhishingSiteUsingGETParams creates a new PhishingSiteUsingGETParams object 20 | // with the default values initialized. 21 | func NewPhishingSiteUsingGETParams() *PhishingSiteUsingGETParams { 22 | var () 23 | return &PhishingSiteUsingGETParams{ 24 | 25 | timeout: cr.DefaultTimeout, 26 | } 27 | } 28 | 29 | // NewPhishingSiteUsingGETParamsWithTimeout creates a new PhishingSiteUsingGETParams object 30 | // with the default values initialized, and the ability to set a timeout on a request 31 | func NewPhishingSiteUsingGETParamsWithTimeout(timeout time.Duration) *PhishingSiteUsingGETParams { 32 | var () 33 | return &PhishingSiteUsingGETParams{ 34 | 35 | timeout: timeout, 36 | } 37 | } 38 | 39 | // NewPhishingSiteUsingGETParamsWithContext creates a new PhishingSiteUsingGETParams object 40 | // with the default values initialized, and the ability to set a context for a request 41 | func NewPhishingSiteUsingGETParamsWithContext(ctx context.Context) *PhishingSiteUsingGETParams { 42 | var () 43 | return &PhishingSiteUsingGETParams{ 44 | 45 | Context: ctx, 46 | } 47 | } 48 | 49 | // NewPhishingSiteUsingGETParamsWithHTTPClient creates a new PhishingSiteUsingGETParams object 50 | // with the default values initialized, and the ability to set a custom HTTPClient for a request 51 | func NewPhishingSiteUsingGETParamsWithHTTPClient(client *http.Client) *PhishingSiteUsingGETParams { 52 | var () 53 | return &PhishingSiteUsingGETParams{ 54 | HTTPClient: client, 55 | } 56 | } 57 | 58 | /* 59 | PhishingSiteUsingGETParams contains all the parameters to send to the API endpoint 60 | for the phishing site using g e t operation typically these are written to a http.Request 61 | */ 62 | type PhishingSiteUsingGETParams struct { 63 | 64 | /*Authorization 65 | Authorization (test: Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) 66 | 67 | */ 68 | Authorization *string 69 | /*URL 70 | Url 71 | 72 | */ 73 | URL string 74 | 75 | timeout time.Duration 76 | Context context.Context 77 | HTTPClient *http.Client 78 | } 79 | 80 | // WithTimeout adds the timeout to the phishing site using g e t params 81 | func (o *PhishingSiteUsingGETParams) WithTimeout(timeout time.Duration) *PhishingSiteUsingGETParams { 82 | o.SetTimeout(timeout) 83 | return o 84 | } 85 | 86 | // SetTimeout adds the timeout to the phishing site using g e t params 87 | func (o *PhishingSiteUsingGETParams) SetTimeout(timeout time.Duration) { 88 | o.timeout = timeout 89 | } 90 | 91 | // WithContext adds the context to the phishing site using g e t params 92 | func (o *PhishingSiteUsingGETParams) WithContext(ctx context.Context) *PhishingSiteUsingGETParams { 93 | o.SetContext(ctx) 94 | return o 95 | } 96 | 97 | // SetContext adds the context to the phishing site using g e t params 98 | func (o *PhishingSiteUsingGETParams) SetContext(ctx context.Context) { 99 | o.Context = ctx 100 | } 101 | 102 | // WithHTTPClient adds the HTTPClient to the phishing site using g e t params 103 | func (o *PhishingSiteUsingGETParams) WithHTTPClient(client *http.Client) *PhishingSiteUsingGETParams { 104 | o.SetHTTPClient(client) 105 | return o 106 | } 107 | 108 | // SetHTTPClient adds the HTTPClient to the phishing site using g e t params 109 | func (o *PhishingSiteUsingGETParams) SetHTTPClient(client *http.Client) { 110 | o.HTTPClient = client 111 | } 112 | 113 | // WithAuthorization adds the authorization to the phishing site using g e t params 114 | func (o *PhishingSiteUsingGETParams) WithAuthorization(authorization *string) *PhishingSiteUsingGETParams { 115 | o.SetAuthorization(authorization) 116 | return o 117 | } 118 | 119 | // SetAuthorization adds the authorization to the phishing site using g e t params 120 | func (o *PhishingSiteUsingGETParams) SetAuthorization(authorization *string) { 121 | o.Authorization = authorization 122 | } 123 | 124 | // WithURL adds the url to the phishing site using g e t params 125 | func (o *PhishingSiteUsingGETParams) WithURL(url string) *PhishingSiteUsingGETParams { 126 | o.SetURL(url) 127 | return o 128 | } 129 | 130 | // SetURL adds the url to the phishing site using g e t params 131 | func (o *PhishingSiteUsingGETParams) SetURL(url string) { 132 | o.URL = url 133 | } 134 | 135 | // WriteToRequest writes these params to a swagger request 136 | func (o *PhishingSiteUsingGETParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 137 | 138 | if err := r.SetTimeout(o.timeout); err != nil { 139 | return err 140 | } 141 | var res []error 142 | 143 | if o.Authorization != nil { 144 | 145 | // header param Authorization 146 | if err := r.SetHeaderParam("Authorization", *o.Authorization); err != nil { 147 | return err 148 | } 149 | 150 | } 151 | 152 | // query param url 153 | qrURL := o.URL 154 | qURL := qrURL 155 | if qURL != "" { 156 | if err := r.SetQueryParam("url", qURL); err != nil { 157 | return err 158 | } 159 | } 160 | 161 | if len(res) > 0 { 162 | return errors.CompositeValidationError(res...) 163 | } 164 | return nil 165 | } 166 | -------------------------------------------------------------------------------- /pkg/gen/client/website_controller/phishing_site_using_g_e_t_responses.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package website_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | "io" 11 | 12 | "github.com/go-openapi/runtime" 13 | "github.com/go-openapi/strfmt" 14 | 15 | "github.com/GoPlusSecurity/goplus-sdk-go/pkg/gen/models" 16 | ) 17 | 18 | // PhishingSiteUsingGETReader is a Reader for the PhishingSiteUsingGET structure. 19 | type PhishingSiteUsingGETReader struct { 20 | formats strfmt.Registry 21 | } 22 | 23 | // ReadResponse reads a server response into the received o. 24 | func (o *PhishingSiteUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 | switch response.Code() { 26 | case 200: 27 | result := NewPhishingSiteUsingGETOK() 28 | if err := result.readResponse(response, consumer, o.formats); err != nil { 29 | return nil, err 30 | } 31 | return result, nil 32 | case 401: 33 | result := NewPhishingSiteUsingGETUnauthorized() 34 | if err := result.readResponse(response, consumer, o.formats); err != nil { 35 | return nil, err 36 | } 37 | return nil, result 38 | case 403: 39 | result := NewPhishingSiteUsingGETForbidden() 40 | if err := result.readResponse(response, consumer, o.formats); err != nil { 41 | return nil, err 42 | } 43 | return nil, result 44 | case 404: 45 | result := NewPhishingSiteUsingGETNotFound() 46 | if err := result.readResponse(response, consumer, o.formats); err != nil { 47 | return nil, err 48 | } 49 | return nil, result 50 | 51 | default: 52 | return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 53 | } 54 | } 55 | 56 | // NewPhishingSiteUsingGETOK creates a PhishingSiteUsingGETOK with default headers values 57 | func NewPhishingSiteUsingGETOK() *PhishingSiteUsingGETOK { 58 | return &PhishingSiteUsingGETOK{} 59 | } 60 | 61 | /* 62 | PhishingSiteUsingGETOK handles this case with default header values. 63 | 64 | OK 65 | */ 66 | type PhishingSiteUsingGETOK struct { 67 | Payload *models.ResponseWrapperPhishingSite 68 | } 69 | 70 | func (o *PhishingSiteUsingGETOK) Error() string { 71 | return fmt.Sprintf("[GET /api/v1/phishing_site][%d] phishingSiteUsingGETOK %+v", 200, o.Payload) 72 | } 73 | 74 | func (o *PhishingSiteUsingGETOK) GetPayload() *models.ResponseWrapperPhishingSite { 75 | return o.Payload 76 | } 77 | 78 | func (o *PhishingSiteUsingGETOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 79 | 80 | o.Payload = new(models.ResponseWrapperPhishingSite) 81 | 82 | // response payload 83 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 84 | return err 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // NewPhishingSiteUsingGETUnauthorized creates a PhishingSiteUsingGETUnauthorized with default headers values 91 | func NewPhishingSiteUsingGETUnauthorized() *PhishingSiteUsingGETUnauthorized { 92 | return &PhishingSiteUsingGETUnauthorized{} 93 | } 94 | 95 | /* 96 | PhishingSiteUsingGETUnauthorized handles this case with default header values. 97 | 98 | Unauthorized 99 | */ 100 | type PhishingSiteUsingGETUnauthorized struct { 101 | } 102 | 103 | func (o *PhishingSiteUsingGETUnauthorized) Error() string { 104 | return fmt.Sprintf("[GET /api/v1/phishing_site][%d] phishingSiteUsingGETUnauthorized ", 401) 105 | } 106 | 107 | func (o *PhishingSiteUsingGETUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 108 | 109 | return nil 110 | } 111 | 112 | // NewPhishingSiteUsingGETForbidden creates a PhishingSiteUsingGETForbidden with default headers values 113 | func NewPhishingSiteUsingGETForbidden() *PhishingSiteUsingGETForbidden { 114 | return &PhishingSiteUsingGETForbidden{} 115 | } 116 | 117 | /* 118 | PhishingSiteUsingGETForbidden handles this case with default header values. 119 | 120 | Forbidden 121 | */ 122 | type PhishingSiteUsingGETForbidden struct { 123 | } 124 | 125 | func (o *PhishingSiteUsingGETForbidden) Error() string { 126 | return fmt.Sprintf("[GET /api/v1/phishing_site][%d] phishingSiteUsingGETForbidden ", 403) 127 | } 128 | 129 | func (o *PhishingSiteUsingGETForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 130 | 131 | return nil 132 | } 133 | 134 | // NewPhishingSiteUsingGETNotFound creates a PhishingSiteUsingGETNotFound with default headers values 135 | func NewPhishingSiteUsingGETNotFound() *PhishingSiteUsingGETNotFound { 136 | return &PhishingSiteUsingGETNotFound{} 137 | } 138 | 139 | /* 140 | PhishingSiteUsingGETNotFound handles this case with default header values. 141 | 142 | Not Found 143 | */ 144 | type PhishingSiteUsingGETNotFound struct { 145 | } 146 | 147 | func (o *PhishingSiteUsingGETNotFound) Error() string { 148 | return fmt.Sprintf("[GET /api/v1/phishing_site][%d] phishingSiteUsingGETNotFound ", 404) 149 | } 150 | 151 | func (o *PhishingSiteUsingGETNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 152 | 153 | return nil 154 | } 155 | -------------------------------------------------------------------------------- /pkg/gen/client/website_controller/website_controller_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package website_controller 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/go-openapi/runtime" 12 | "github.com/go-openapi/strfmt" 13 | ) 14 | 15 | // New creates a new website controller API client. 16 | func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 17 | return &Client{transport: transport, formats: formats} 18 | } 19 | 20 | /* 21 | Client for website controller API 22 | */ 23 | type Client struct { 24 | transport runtime.ClientTransport 25 | formats strfmt.Registry 26 | } 27 | 28 | // ClientService is the interface for Client methods 29 | type ClientService interface { 30 | PhishingSiteUsingGET(params *PhishingSiteUsingGETParams) (*PhishingSiteUsingGETOK, error) 31 | 32 | SetTransport(transport runtime.ClientTransport) 33 | } 34 | 35 | /* 36 | PhishingSiteUsingGET checks if the the url is a phishing site 37 | */ 38 | func (a *Client) PhishingSiteUsingGET(params *PhishingSiteUsingGETParams) (*PhishingSiteUsingGETOK, error) { 39 | // TODO: Validate the params before sending 40 | if params == nil { 41 | params = NewPhishingSiteUsingGETParams() 42 | } 43 | 44 | result, err := a.transport.Submit(&runtime.ClientOperation{ 45 | ID: "phishingSiteUsingGET", 46 | Method: "GET", 47 | PathPattern: "/api/v1/phishing_site", 48 | ProducesMediaTypes: []string{"*/*"}, 49 | ConsumesMediaTypes: []string{"application/json"}, 50 | Schemes: []string{"https"}, 51 | Params: params, 52 | Reader: &PhishingSiteUsingGETReader{formats: a.formats}, 53 | Context: params.Context, 54 | Client: params.HTTPClient, 55 | }) 56 | if err != nil { 57 | return nil, err 58 | } 59 | success, ok := result.(*PhishingSiteUsingGETOK) 60 | if ok { 61 | return success, nil 62 | } 63 | // unexpected success response 64 | // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 65 | msg := fmt.Sprintf("unexpected success response for phishingSiteUsingGET: API contract not enforced by server. Client expected to get an error, but got: %T", result) 66 | panic(msg) 67 | } 68 | 69 | // SetTransport changes the transport on the client 70 | func (a *Client) SetTransport(transport runtime.ClientTransport) { 71 | a.transport = transport 72 | } 73 | -------------------------------------------------------------------------------- /pkg/gen/models/abi_address_info.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // AbiAddressInfo AbiAddressInfo 14 | // 15 | // swagger:model AbiAddressInfo 16 | type AbiAddressInfo struct { 17 | 18 | // It describes the contract name if the address is a contract. 19 | ContractName string `json:"contract_name,omitempty"` 20 | 21 | // It describes whether the address is a contract. "1" means true; "0" means false. 22 | IsContract int32 `json:"is_contract,omitempty"` 23 | 24 | // It describes whether the address is a suspected malicious contract."1" means true; 25 | // "0" means that we have not found malicious behavior of this address. 26 | MaliciousAddress int32 `json:"malicious_address,omitempty"` 27 | 28 | // It describes the token name if the address is an ERC20 contract. 29 | Name string `json:"name,omitempty"` 30 | 31 | // It describes the standard type of the contract.Example:"erc20". 32 | Standard string `json:"standard,omitempty"` 33 | 34 | // It describes the token symbol if the address is an ERC20 contract. 35 | Symbol string `json:"symbol,omitempty"` 36 | } 37 | 38 | // Validate validates this abi address info 39 | func (m *AbiAddressInfo) Validate(formats strfmt.Registry) error { 40 | return nil 41 | } 42 | 43 | // MarshalBinary interface implementation 44 | func (m *AbiAddressInfo) MarshalBinary() ([]byte, error) { 45 | if m == nil { 46 | return nil, nil 47 | } 48 | return swag.WriteJSON(m) 49 | } 50 | 51 | // UnmarshalBinary interface implementation 52 | func (m *AbiAddressInfo) UnmarshalBinary(b []byte) error { 53 | var res AbiAddressInfo 54 | if err := swag.ReadJSON(b, &res); err != nil { 55 | return err 56 | } 57 | *m = res 58 | return nil 59 | } 60 | -------------------------------------------------------------------------------- /pkg/gen/models/abi_param_info.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // AbiParamInfo AbiParamInfo 15 | // 16 | // swagger:model AbiParamInfo 17 | type AbiParamInfo struct { 18 | 19 | // It describes the info about the address as a parameter. 20 | AddressInfo *AbiAddressInfo `json:"address_info,omitempty"` 21 | 22 | // It describes the input data in ABI. 23 | Input interface{} `json:"input,omitempty"` 24 | 25 | // It describes the parameter name in ABI, for example 26 | // "_from", "_to", "_value". 27 | Name string `json:"name,omitempty"` 28 | 29 | // It describes the parameter type in ABI, for example "address", "uint256", "bool". 30 | Type string `json:"type,omitempty"` 31 | } 32 | 33 | // Validate validates this abi param info 34 | func (m *AbiParamInfo) Validate(formats strfmt.Registry) error { 35 | var res []error 36 | 37 | if err := m.validateAddressInfo(formats); err != nil { 38 | res = append(res, err) 39 | } 40 | 41 | if len(res) > 0 { 42 | return errors.CompositeValidationError(res...) 43 | } 44 | return nil 45 | } 46 | 47 | func (m *AbiParamInfo) validateAddressInfo(formats strfmt.Registry) error { 48 | 49 | if swag.IsZero(m.AddressInfo) { // not required 50 | return nil 51 | } 52 | 53 | if m.AddressInfo != nil { 54 | if err := m.AddressInfo.Validate(formats); err != nil { 55 | if ve, ok := err.(*errors.Validation); ok { 56 | return ve.ValidateName("address_info") 57 | } 58 | return err 59 | } 60 | } 61 | 62 | return nil 63 | } 64 | 65 | // MarshalBinary interface implementation 66 | func (m *AbiParamInfo) MarshalBinary() ([]byte, error) { 67 | if m == nil { 68 | return nil, nil 69 | } 70 | return swag.WriteJSON(m) 71 | } 72 | 73 | // UnmarshalBinary interface implementation 74 | func (m *AbiParamInfo) UnmarshalBinary(b []byte) error { 75 | var res AbiParamInfo 76 | if err := swag.ReadJSON(b, &res); err != nil { 77 | return err 78 | } 79 | *m = res 80 | return nil 81 | } 82 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_address_info.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // ApproveAddressInfo ApproveAddressInfo 14 | // 15 | // swagger:model ApproveAddressInfo 16 | type ApproveAddressInfo struct { 17 | 18 | // Spender name 19 | ContractName string `json:"contract_name,omitempty"` 20 | 21 | // Spender's deployer 22 | CreatorAddress string `json:"creator_address,omitempty"` 23 | 24 | // Spender's deployed time 25 | DeployedTime int64 `json:"deployed_time,omitempty"` 26 | 27 | // Whether the spender has a history of malicious behavior or contains high risk. 28 | DoubtList int32 `json:"doubt_list,omitempty"` 29 | 30 | // Whether the spender is a contract. 31 | IsContract int32 `json:"is_contract,omitempty"` 32 | 33 | // Whether the spender is verified on blockchain explorer. 34 | IsOpenSource int32 `json:"is_open_source,omitempty"` 35 | 36 | // Specific malicious behaviors or risks of this spender. 37 | MaliciousBehavior []string `json:"malicious_behavior"` 38 | 39 | // Spender tag 40 | Tag string `json:"tag,omitempty"` 41 | 42 | // Whether the spender is on the whitelist, and can be trusted 43 | TrustList int32 `json:"trust_list,omitempty"` 44 | } 45 | 46 | // Validate validates this approve address info 47 | func (m *ApproveAddressInfo) Validate(formats strfmt.Registry) error { 48 | return nil 49 | } 50 | 51 | // MarshalBinary interface implementation 52 | func (m *ApproveAddressInfo) MarshalBinary() ([]byte, error) { 53 | if m == nil { 54 | return nil, nil 55 | } 56 | return swag.WriteJSON(m) 57 | } 58 | 59 | // UnmarshalBinary interface implementation 60 | func (m *ApproveAddressInfo) UnmarshalBinary(b []byte) error { 61 | var res ApproveAddressInfo 62 | if err := swag.ReadJSON(b, &res); err != nil { 63 | return err 64 | } 65 | *m = res 66 | return nil 67 | } 68 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_erc1155_result.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ApproveErc1155Result ApproveErc1155Result 15 | // 16 | // swagger:model ApproveErc1155Result 17 | type ApproveErc1155Result struct { 18 | 19 | // address_info 20 | AddressInfo *ApproveAddressInfo `json:"address_info,omitempty"` 21 | 22 | // Spender Address 23 | ApprovedContract string `json:"approved_contract,omitempty"` 24 | 25 | // Latest approval time 26 | ApprovedTime int64 `json:"approved_time,omitempty"` 27 | 28 | // Latest approval hash 29 | Hash string `json:"hash,omitempty"` 30 | 31 | // Initial approval hash 32 | InitialApprovalHash string `json:"initial_approval_hash,omitempty"` 33 | 34 | // Initial approval time 35 | InitialApprovalTime int64 `json:"initial_approval_time,omitempty"` 36 | } 37 | 38 | // Validate validates this approve erc1155 result 39 | func (m *ApproveErc1155Result) Validate(formats strfmt.Registry) error { 40 | var res []error 41 | 42 | if err := m.validateAddressInfo(formats); err != nil { 43 | res = append(res, err) 44 | } 45 | 46 | if len(res) > 0 { 47 | return errors.CompositeValidationError(res...) 48 | } 49 | return nil 50 | } 51 | 52 | func (m *ApproveErc1155Result) validateAddressInfo(formats strfmt.Registry) error { 53 | 54 | if swag.IsZero(m.AddressInfo) { // not required 55 | return nil 56 | } 57 | 58 | if m.AddressInfo != nil { 59 | if err := m.AddressInfo.Validate(formats); err != nil { 60 | if ve, ok := err.(*errors.Validation); ok { 61 | return ve.ValidateName("address_info") 62 | } 63 | return err 64 | } 65 | } 66 | 67 | return nil 68 | } 69 | 70 | // MarshalBinary interface implementation 71 | func (m *ApproveErc1155Result) MarshalBinary() ([]byte, error) { 72 | if m == nil { 73 | return nil, nil 74 | } 75 | return swag.WriteJSON(m) 76 | } 77 | 78 | // UnmarshalBinary interface implementation 79 | func (m *ApproveErc1155Result) UnmarshalBinary(b []byte) error { 80 | var res ApproveErc1155Result 81 | if err := swag.ReadJSON(b, &res); err != nil { 82 | return err 83 | } 84 | *m = res 85 | return nil 86 | } 87 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_n_f_t1155_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ApproveNFT1155ListResponse ApproveNFT1155ListResponse 17 | // 18 | // swagger:model ApproveNFT1155ListResponse 19 | type ApproveNFT1155ListResponse struct { 20 | 21 | // approved list 22 | ApprovedList []*ApproveErc1155Result `json:"approved_list"` 23 | 24 | // ChainID 25 | ChainID string `json:"chain_id,omitempty"` 26 | 27 | // Whether the contract is verified on blockchain explorer. 28 | IsOpenSource int32 `json:"is_open_source,omitempty"` 29 | 30 | // Whether NFT is certified on a reputable trading platform. 31 | IsVerified int32 `json:"is_verified,omitempty"` 32 | 33 | // Whether the NFT is malicious or contains high risk. 34 | MaliciousAddress int32 `json:"malicious_address,omitempty"` 35 | 36 | // Specific malicious behaviors or risks of this NFT. 37 | MaliciousBehavior []string `json:"malicious_behavior"` 38 | 39 | // NFT address 40 | NftAddress string `json:"nft_address,omitempty"` 41 | 42 | // NFT name 43 | NftName string `json:"nft_name,omitempty"` 44 | 45 | // NFT symbol 46 | NftSymbol string `json:"nft_symbol,omitempty"` 47 | } 48 | 49 | // Validate validates this approve n f t1155 list response 50 | func (m *ApproveNFT1155ListResponse) Validate(formats strfmt.Registry) error { 51 | var res []error 52 | 53 | if err := m.validateApprovedList(formats); err != nil { 54 | res = append(res, err) 55 | } 56 | 57 | if len(res) > 0 { 58 | return errors.CompositeValidationError(res...) 59 | } 60 | return nil 61 | } 62 | 63 | func (m *ApproveNFT1155ListResponse) validateApprovedList(formats strfmt.Registry) error { 64 | 65 | if swag.IsZero(m.ApprovedList) { // not required 66 | return nil 67 | } 68 | 69 | for i := 0; i < len(m.ApprovedList); i++ { 70 | if swag.IsZero(m.ApprovedList[i]) { // not required 71 | continue 72 | } 73 | 74 | if m.ApprovedList[i] != nil { 75 | if err := m.ApprovedList[i].Validate(formats); err != nil { 76 | if ve, ok := err.(*errors.Validation); ok { 77 | return ve.ValidateName("approved_list" + "." + strconv.Itoa(i)) 78 | } 79 | return err 80 | } 81 | } 82 | 83 | } 84 | 85 | return nil 86 | } 87 | 88 | // MarshalBinary interface implementation 89 | func (m *ApproveNFT1155ListResponse) MarshalBinary() ([]byte, error) { 90 | if m == nil { 91 | return nil, nil 92 | } 93 | return swag.WriteJSON(m) 94 | } 95 | 96 | // UnmarshalBinary interface implementation 97 | func (m *ApproveNFT1155ListResponse) UnmarshalBinary(b []byte) error { 98 | var res ApproveNFT1155ListResponse 99 | if err := swag.ReadJSON(b, &res); err != nil { 100 | return err 101 | } 102 | *m = res 103 | return nil 104 | } 105 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_n_f_t_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ApproveNFTListResponse ApproveNFTListResponse 17 | // 18 | // swagger:model ApproveNFTListResponse 19 | type ApproveNFTListResponse struct { 20 | 21 | // approved list 22 | ApprovedList []*ApproveResult `json:"approved_list"` 23 | 24 | // ChainID 25 | ChainID string `json:"chain_id,omitempty"` 26 | 27 | // Whether the contract is verified on blockchain explorer. 28 | IsOpenSource int32 `json:"is_open_source,omitempty"` 29 | 30 | // Whether NFT is certified on a reputable trading platform. 31 | IsVerified int32 `json:"is_verified,omitempty"` 32 | 33 | // Whether the NFT is malicious or contains high risk. 34 | MaliciousAddress int32 `json:"malicious_address,omitempty"` 35 | 36 | // Specific malicious behaviors or risks of this NFT. 37 | MaliciousBehavior []string `json:"malicious_behavior"` 38 | 39 | // nft address 40 | NftAddress string `json:"nft_address,omitempty"` 41 | 42 | // NFT name 43 | NftName string `json:"nft_name,omitempty"` 44 | 45 | // NFT symbol 46 | NftSymbol string `json:"nft_symbol,omitempty"` 47 | } 48 | 49 | // Validate validates this approve n f t list response 50 | func (m *ApproveNFTListResponse) Validate(formats strfmt.Registry) error { 51 | var res []error 52 | 53 | if err := m.validateApprovedList(formats); err != nil { 54 | res = append(res, err) 55 | } 56 | 57 | if len(res) > 0 { 58 | return errors.CompositeValidationError(res...) 59 | } 60 | return nil 61 | } 62 | 63 | func (m *ApproveNFTListResponse) validateApprovedList(formats strfmt.Registry) error { 64 | 65 | if swag.IsZero(m.ApprovedList) { // not required 66 | return nil 67 | } 68 | 69 | for i := 0; i < len(m.ApprovedList); i++ { 70 | if swag.IsZero(m.ApprovedList[i]) { // not required 71 | continue 72 | } 73 | 74 | if m.ApprovedList[i] != nil { 75 | if err := m.ApprovedList[i].Validate(formats); err != nil { 76 | if ve, ok := err.(*errors.Validation); ok { 77 | return ve.ValidateName("approved_list" + "." + strconv.Itoa(i)) 78 | } 79 | return err 80 | } 81 | } 82 | 83 | } 84 | 85 | return nil 86 | } 87 | 88 | // MarshalBinary interface implementation 89 | func (m *ApproveNFTListResponse) MarshalBinary() ([]byte, error) { 90 | if m == nil { 91 | return nil, nil 92 | } 93 | return swag.WriteJSON(m) 94 | } 95 | 96 | // UnmarshalBinary interface implementation 97 | func (m *ApproveNFTListResponse) UnmarshalBinary(b []byte) error { 98 | var res ApproveNFTListResponse 99 | if err := swag.ReadJSON(b, &res); err != nil { 100 | return err 101 | } 102 | *m = res 103 | return nil 104 | } 105 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_result.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ApproveResult ApproveResult 15 | // 16 | // swagger:model ApproveResult 17 | type ApproveResult struct { 18 | 19 | // address_info 20 | AddressInfo *ApproveAddressInfo `json:"address_info,omitempty"` 21 | 22 | // Spender Address 23 | ApprovedContract string `json:"approved_contract,omitempty"` 24 | 25 | // Approval type: "1" means "approved for all"; "0" means "approved for single NFT" 26 | ApprovedForAll int32 `json:"approved_for_all,omitempty"` 27 | 28 | // Latest approval time 29 | ApprovedTime int64 `json:"approved_time,omitempty"` 30 | 31 | // NFT token_id 32 | ApprovedTokenID string `json:"approved_token_id,omitempty"` 33 | 34 | // Latest approval hash 35 | Hash string `json:"hash,omitempty"` 36 | 37 | // Initial approval hash 38 | InitialApprovalHash string `json:"initial_approval_hash,omitempty"` 39 | 40 | // Initial approval time 41 | InitialApprovalTime int64 `json:"initial_approval_time,omitempty"` 42 | } 43 | 44 | // Validate validates this approve result 45 | func (m *ApproveResult) Validate(formats strfmt.Registry) error { 46 | var res []error 47 | 48 | if err := m.validateAddressInfo(formats); err != nil { 49 | res = append(res, err) 50 | } 51 | 52 | if len(res) > 0 { 53 | return errors.CompositeValidationError(res...) 54 | } 55 | return nil 56 | } 57 | 58 | func (m *ApproveResult) validateAddressInfo(formats strfmt.Registry) error { 59 | 60 | if swag.IsZero(m.AddressInfo) { // not required 61 | return nil 62 | } 63 | 64 | if m.AddressInfo != nil { 65 | if err := m.AddressInfo.Validate(formats); err != nil { 66 | if ve, ok := err.(*errors.Validation); ok { 67 | return ve.ValidateName("address_info") 68 | } 69 | return err 70 | } 71 | } 72 | 73 | return nil 74 | } 75 | 76 | // MarshalBinary interface implementation 77 | func (m *ApproveResult) MarshalBinary() ([]byte, error) { 78 | if m == nil { 79 | return nil, nil 80 | } 81 | return swag.WriteJSON(m) 82 | } 83 | 84 | // UnmarshalBinary interface implementation 85 | func (m *ApproveResult) UnmarshalBinary(b []byte) error { 86 | var res ApproveResult 87 | if err := swag.ReadJSON(b, &res); err != nil { 88 | return err 89 | } 90 | *m = res 91 | return nil 92 | } 93 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_token_out_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ApproveTokenOutListResponse ApproveTokenOutListResponse 17 | // 18 | // swagger:model ApproveTokenOutListResponse 19 | type ApproveTokenOutListResponse struct { 20 | 21 | // approved list 22 | ApprovedList []*ApproveTokenResult `json:"approved_list"` 23 | 24 | // balance 25 | Balance string `json:"balance,omitempty"` 26 | 27 | // ChainID 28 | ChainID string `json:"chain_id,omitempty"` 29 | 30 | // decimals 31 | Decimals int64 `json:"decimals,omitempty"` 32 | 33 | // Whether the contract is verified on blockchain explorer. 34 | IsOpenSource int32 `json:"is_open_source,omitempty"` 35 | 36 | // Whether the token is malicious or contains high risk. 37 | MaliciousAddress int32 `json:"malicious_address,omitempty"` 38 | 39 | // Specific malicious behaviors or risks of this token. 40 | MaliciousBehavior []string `json:"malicious_behavior"` 41 | 42 | // Token address 43 | TokenAddress string `json:"token_address,omitempty"` 44 | 45 | // Token name 46 | TokenName string `json:"token_name,omitempty"` 47 | 48 | // Token symbol 49 | TokenSymbol string `json:"token_symbol,omitempty"` 50 | } 51 | 52 | // Validate validates this approve token out list response 53 | func (m *ApproveTokenOutListResponse) Validate(formats strfmt.Registry) error { 54 | var res []error 55 | 56 | if err := m.validateApprovedList(formats); err != nil { 57 | res = append(res, err) 58 | } 59 | 60 | if len(res) > 0 { 61 | return errors.CompositeValidationError(res...) 62 | } 63 | return nil 64 | } 65 | 66 | func (m *ApproveTokenOutListResponse) validateApprovedList(formats strfmt.Registry) error { 67 | 68 | if swag.IsZero(m.ApprovedList) { // not required 69 | return nil 70 | } 71 | 72 | for i := 0; i < len(m.ApprovedList); i++ { 73 | if swag.IsZero(m.ApprovedList[i]) { // not required 74 | continue 75 | } 76 | 77 | if m.ApprovedList[i] != nil { 78 | if err := m.ApprovedList[i].Validate(formats); err != nil { 79 | if ve, ok := err.(*errors.Validation); ok { 80 | return ve.ValidateName("approved_list" + "." + strconv.Itoa(i)) 81 | } 82 | return err 83 | } 84 | } 85 | 86 | } 87 | 88 | return nil 89 | } 90 | 91 | // MarshalBinary interface implementation 92 | func (m *ApproveTokenOutListResponse) MarshalBinary() ([]byte, error) { 93 | if m == nil { 94 | return nil, nil 95 | } 96 | return swag.WriteJSON(m) 97 | } 98 | 99 | // UnmarshalBinary interface implementation 100 | func (m *ApproveTokenOutListResponse) UnmarshalBinary(b []byte) error { 101 | var res ApproveTokenOutListResponse 102 | if err := swag.ReadJSON(b, &res); err != nil { 103 | return err 104 | } 105 | *m = res 106 | return nil 107 | } 108 | -------------------------------------------------------------------------------- /pkg/gen/models/approve_token_result.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ApproveTokenResult ApproveTokenResult 15 | // 16 | // swagger:model ApproveTokenResult 17 | type ApproveTokenResult struct { 18 | 19 | // address_info 20 | AddressInfo *ApproveAddressInfo `json:"address_info,omitempty"` 21 | 22 | // Allowance of the spender 23 | ApprovedAmount string `json:"approved_amount,omitempty"` 24 | 25 | // Spender Address 26 | ApprovedContract string `json:"approved_contract,omitempty"` 27 | 28 | // Latest approval time 29 | ApprovedTime int64 `json:"approved_time,omitempty"` 30 | 31 | // Latest approval hash 32 | Hash string `json:"hash,omitempty"` 33 | 34 | // Initial approval hash 35 | InitialApprovalHash string `json:"initial_approval_hash,omitempty"` 36 | 37 | // Initial approval time 38 | InitialApprovalTime int64 `json:"initial_approval_time,omitempty"` 39 | } 40 | 41 | // Validate validates this approve token result 42 | func (m *ApproveTokenResult) Validate(formats strfmt.Registry) error { 43 | var res []error 44 | 45 | if err := m.validateAddressInfo(formats); err != nil { 46 | res = append(res, err) 47 | } 48 | 49 | if len(res) > 0 { 50 | return errors.CompositeValidationError(res...) 51 | } 52 | return nil 53 | } 54 | 55 | func (m *ApproveTokenResult) validateAddressInfo(formats strfmt.Registry) error { 56 | 57 | if swag.IsZero(m.AddressInfo) { // not required 58 | return nil 59 | } 60 | 61 | if m.AddressInfo != nil { 62 | if err := m.AddressInfo.Validate(formats); err != nil { 63 | if ve, ok := err.(*errors.Validation); ok { 64 | return ve.ValidateName("address_info") 65 | } 66 | return err 67 | } 68 | } 69 | 70 | return nil 71 | } 72 | 73 | // MarshalBinary interface implementation 74 | func (m *ApproveTokenResult) MarshalBinary() ([]byte, error) { 75 | if m == nil { 76 | return nil, nil 77 | } 78 | return swag.WriteJSON(m) 79 | } 80 | 81 | // UnmarshalBinary interface implementation 82 | func (m *ApproveTokenResult) UnmarshalBinary(b []byte) error { 83 | var res ApproveTokenResult 84 | if err := swag.ReadJSON(b, &res); err != nil { 85 | return err 86 | } 87 | *m = res 88 | return nil 89 | } 90 | -------------------------------------------------------------------------------- /pkg/gen/models/audit_info.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // AuditInfo AuditInfo 14 | // 15 | // swagger:model AuditInfo 16 | type AuditInfo struct { 17 | 18 | // It describes the firm that audited the dApp. 19 | AuditFirm string `json:"audit_firm,omitempty"` 20 | 21 | // It describes the website link of the audit report. 22 | AuditLink string `json:"audit_link,omitempty"` 23 | 24 | // It describes the time shown in the latest audit report. 25 | AuditTime string `json:"audit_time,omitempty"` 26 | } 27 | 28 | // Validate validates this audit info 29 | func (m *AuditInfo) Validate(formats strfmt.Registry) error { 30 | return nil 31 | } 32 | 33 | // MarshalBinary interface implementation 34 | func (m *AuditInfo) MarshalBinary() ([]byte, error) { 35 | if m == nil { 36 | return nil, nil 37 | } 38 | return swag.WriteJSON(m) 39 | } 40 | 41 | // UnmarshalBinary interface implementation 42 | func (m *AuditInfo) UnmarshalBinary(b []byte) error { 43 | var res AuditInfo 44 | if err := swag.ReadJSON(b, &res); err != nil { 45 | return err 46 | } 47 | *m = res 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /pkg/gen/models/contract_approve_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // ContractApproveResponse ContractApproveResponse 14 | // 15 | // swagger:model ContractApproveResponse 16 | type ContractApproveResponse struct { 17 | 18 | // It describes the approved contract name. 19 | ContractName string `json:"contract_name,omitempty"` 20 | 21 | // It describes the creator address of the contract.(Notice:When the address is not a contract ("is_contract"=0), it will return "null".) 22 | CreatorAddress string `json:"creator_address,omitempty"` 23 | 24 | // It describes the deployed time of the contract. 25 | // The value is presented as a timestamp. 26 | // Example: "deployed_time": 1626578345(Notice:When the address is not a contract ("is_contract"=0), it will return "null".) 27 | DeployedTime int64 `json:"deployed_time,omitempty"` 28 | 29 | // It describes whether the address is a suspected malicious contract. 30 | // "1" means true; 31 | // "0" means that we have not found malicious behavior of this address.(Notice:Return "0" does not mean it is safe. Maybe we just haven't found its malicious behavior.) 32 | DoubtList int32 `json:"doubt_list,omitempty"` 33 | 34 | // It describes whether the address is a contract. 35 | // "1" means true; 36 | // "0" means false. 37 | IsContract int32 `json:"is_contract,omitempty"` 38 | 39 | // It describes whether this contract is open source. 40 | // "1" means true; 41 | // "0" means false.(Notice:When the address is not a contract ("is_contract"=0), it will return "null".) 42 | IsOpenSource int32 `json:"is_open_source,omitempty"` 43 | 44 | // Whether the spender is a proxy contract. 45 | IsProxy int32 `json:"is_proxy,omitempty"` 46 | 47 | // It describes specific malicious behaviors. 48 | // "honeypot_related_address" means that the address is related to honeypot tokens or has created scam tokens. 49 | // "phishing_activities" means that this address has implemented phishing activities. 50 | // "blackmail_activities" means that this address has implemented blackmail activities. 51 | // "stealing_attack" means that this address has implemented stealing attacks. 52 | // "fake_kyc" means that this address is involved in fake KYC. 53 | // "malicious_mining_activities" means that this address is involved in malicious mining activities. 54 | // "darkweb_transactions" means that this address is involved in darkweb transactions. 55 | // "cybercrime" means that this address is involved in cybercrime. 56 | // "money_laundering" means that this address is involved in money laundering. 57 | // "financial_crime" means that this address is involved in financial crime. 58 | // "blacklist_doubt" means that the address is suspected of malicious behavior and is therefore blacklisted.(Notice:Returning an empty array means that no malicious behavior was found at that address.) 59 | MaliciousBehavior []string `json:"malicious_behavior"` 60 | 61 | // It describes which dapp uses the contract. 62 | // Example:"tag": "Compound" 63 | Tag string `json:"tag,omitempty"` 64 | 65 | // It describes whether the address is a famous and trustworthy one. 66 | // "1" means true; 67 | // "0" means that we have not included this address in the trusted list;(Notice:Return "0" does not mean the address is not trustworthy. Maybe we just haven't included it yet.) 68 | TrustList int32 `json:"trust_list,omitempty"` 69 | } 70 | 71 | // Validate validates this contract approve response 72 | func (m *ContractApproveResponse) Validate(formats strfmt.Registry) error { 73 | return nil 74 | } 75 | 76 | // MarshalBinary interface implementation 77 | func (m *ContractApproveResponse) MarshalBinary() ([]byte, error) { 78 | if m == nil { 79 | return nil, nil 80 | } 81 | return swag.WriteJSON(m) 82 | } 83 | 84 | // UnmarshalBinary interface implementation 85 | func (m *ContractApproveResponse) UnmarshalBinary(b []byte) error { 86 | var res ContractApproveResponse 87 | if err := swag.ReadJSON(b, &res); err != nil { 88 | return err 89 | } 90 | *m = res 91 | return nil 92 | } 93 | -------------------------------------------------------------------------------- /pkg/gen/models/contracts.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // Contracts Contracts 14 | // 15 | // swagger:model Contracts 16 | type Contracts struct { 17 | 18 | // It describes the dAap's contract address. 19 | ContractAddress string `json:"contract_address,omitempty"` 20 | 21 | // It describes the creator address of the contract. 22 | CreatorAddress string `json:"creator_address,omitempty"` 23 | 24 | // It describes the deployed time of the contract.The value is presented as a timestamp. 25 | // Example: "deployed_time": 1626578345 26 | DeploymentTime int64 `json:"deployment_time,omitempty"` 27 | 28 | // It describes whether this contract is open source. 29 | // "1" means true; 30 | // "0" means false. 31 | IsOpenSource int32 `json:"is_open_source,omitempty"` 32 | 33 | // It describes specific malicious behaviors of the contract. 34 | MaliciousBehavior []interface{} `json:"malicious_behavior"` 35 | 36 | // It describes whether the address is a suspected malicious contract. 37 | // "1" means true; 38 | // "0" means that we have not found malicious behavior of this contract.(Notice:"malicious_contract" return "0" does not mean the address is completely safe. Maybe we just haven't found its malicious behavior.) 39 | MaliciousContract int32 `json:"malicious_contract,omitempty"` 40 | 41 | // It describes whether the creator is a suspected malicious address. 42 | // "1" means true; 43 | // "0" means that we have not found malicious behavior of this address.(Notice:"malicious_creator" return "0" does not mean the address is completely safe. Maybe we just haven't found its malicious behavior.) 44 | MaliciousCreator int32 `json:"malicious_creator,omitempty"` 45 | 46 | // It describes specific malicious behaviors of the contract creator. 47 | MaliciousCreatorBehavior []interface{} `json:"malicious_creator_behavior"` 48 | } 49 | 50 | // Validate validates this contracts 51 | func (m *Contracts) Validate(formats strfmt.Registry) error { 52 | return nil 53 | } 54 | 55 | // MarshalBinary interface implementation 56 | func (m *Contracts) MarshalBinary() ([]byte, error) { 57 | if m == nil { 58 | return nil, nil 59 | } 60 | return swag.WriteJSON(m) 61 | } 62 | 63 | // UnmarshalBinary interface implementation 64 | func (m *Contracts) UnmarshalBinary(b []byte) error { 65 | var res Contracts 66 | if err := swag.ReadJSON(b, &res); err != nil { 67 | return err 68 | } 69 | *m = res 70 | return nil 71 | } 72 | -------------------------------------------------------------------------------- /pkg/gen/models/contracts_security.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ContractsSecurity ContractsSecurity 17 | // 18 | // swagger:model ContractsSecurity 19 | type ContractsSecurity struct { 20 | 21 | // It describes the chains that contracts are deployed on;"1" means Ethereum; 22 | // "25" means Cronos; 23 | // "56" means BSC; 24 | // "128" means HECO; 25 | // "137" means Polygon; 26 | // "250" means Fantom; 27 | // "42161" means Arbitrum; 28 | // "43114" means Avalanche. 29 | ChainID string `json:"chain_id,omitempty"` 30 | 31 | // contract info 32 | Contracts []*Contracts `json:"contracts"` 33 | } 34 | 35 | // Validate validates this contracts security 36 | func (m *ContractsSecurity) Validate(formats strfmt.Registry) error { 37 | var res []error 38 | 39 | if err := m.validateContracts(formats); err != nil { 40 | res = append(res, err) 41 | } 42 | 43 | if len(res) > 0 { 44 | return errors.CompositeValidationError(res...) 45 | } 46 | return nil 47 | } 48 | 49 | func (m *ContractsSecurity) validateContracts(formats strfmt.Registry) error { 50 | 51 | if swag.IsZero(m.Contracts) { // not required 52 | return nil 53 | } 54 | 55 | for i := 0; i < len(m.Contracts); i++ { 56 | if swag.IsZero(m.Contracts[i]) { // not required 57 | continue 58 | } 59 | 60 | if m.Contracts[i] != nil { 61 | if err := m.Contracts[i].Validate(formats); err != nil { 62 | if ve, ok := err.(*errors.Validation); ok { 63 | return ve.ValidateName("contracts" + "." + strconv.Itoa(i)) 64 | } 65 | return err 66 | } 67 | } 68 | 69 | } 70 | 71 | return nil 72 | } 73 | 74 | // MarshalBinary interface implementation 75 | func (m *ContractsSecurity) MarshalBinary() ([]byte, error) { 76 | if m == nil { 77 | return nil, nil 78 | } 79 | return swag.WriteJSON(m) 80 | } 81 | 82 | // UnmarshalBinary interface implementation 83 | func (m *ContractsSecurity) UnmarshalBinary(b []byte) error { 84 | var res ContractsSecurity 85 | if err := swag.ReadJSON(b, &res); err != nil { 86 | return err 87 | } 88 | *m = res 89 | return nil 90 | } 91 | -------------------------------------------------------------------------------- /pkg/gen/models/dapp_contract_security_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // DappContractSecurityResponse DappContractSecurityResponse 17 | // 18 | // swagger:model DappContractSecurityResponse 19 | type DappContractSecurityResponse struct { 20 | 21 | // audit info(Notice:When the dApp was not audited, ("is_audit"=0), it will return "null".If there are multiple audit reports, the information of the latest audit report is displayed.) 22 | AuditInfo []*AuditInfo `json:"audit_info"` 23 | 24 | // contracts security 25 | ContractsSecurity []*ContractsSecurity `json:"contracts_security"` 26 | 27 | // It describes whether the dApp was audited by a reputable audit firm. 28 | // "1" means true; 29 | // "0" means that we have not found audit information for this dApp .(Notice:Return "0" does not mean the dApp was not audited. Maybe we just haven't found audit information for this dApp yet.) 30 | IsAudit int32 `json:"is_audit,omitempty"` 31 | 32 | // It describes the dApp project name. 33 | ProjectName string `json:"project_name,omitempty"` 34 | 35 | // It describes whether the dapp is a famous and trustworthy one. "1" means true; 36 | // "0" means that this dapp is not yet in our trusted list.(Notice:(1) Only "trust_list": "1" means it is a famous and trustworthy dapp. 37 | // (2) "0" return doesn't mean it is risky.) 38 | TrustList int32 `json:"trust_list,omitempty"` 39 | 40 | // It describes the dApp's website link. 41 | URL string `json:"url,omitempty"` 42 | } 43 | 44 | // Validate validates this dapp contract security response 45 | func (m *DappContractSecurityResponse) Validate(formats strfmt.Registry) error { 46 | var res []error 47 | 48 | if err := m.validateAuditInfo(formats); err != nil { 49 | res = append(res, err) 50 | } 51 | 52 | if err := m.validateContractsSecurity(formats); err != nil { 53 | res = append(res, err) 54 | } 55 | 56 | if len(res) > 0 { 57 | return errors.CompositeValidationError(res...) 58 | } 59 | return nil 60 | } 61 | 62 | func (m *DappContractSecurityResponse) validateAuditInfo(formats strfmt.Registry) error { 63 | 64 | if swag.IsZero(m.AuditInfo) { // not required 65 | return nil 66 | } 67 | 68 | for i := 0; i < len(m.AuditInfo); i++ { 69 | if swag.IsZero(m.AuditInfo[i]) { // not required 70 | continue 71 | } 72 | 73 | if m.AuditInfo[i] != nil { 74 | if err := m.AuditInfo[i].Validate(formats); err != nil { 75 | if ve, ok := err.(*errors.Validation); ok { 76 | return ve.ValidateName("audit_info" + "." + strconv.Itoa(i)) 77 | } 78 | return err 79 | } 80 | } 81 | 82 | } 83 | 84 | return nil 85 | } 86 | 87 | func (m *DappContractSecurityResponse) validateContractsSecurity(formats strfmt.Registry) error { 88 | 89 | if swag.IsZero(m.ContractsSecurity) { // not required 90 | return nil 91 | } 92 | 93 | for i := 0; i < len(m.ContractsSecurity); i++ { 94 | if swag.IsZero(m.ContractsSecurity[i]) { // not required 95 | continue 96 | } 97 | 98 | if m.ContractsSecurity[i] != nil { 99 | if err := m.ContractsSecurity[i].Validate(formats); err != nil { 100 | if ve, ok := err.(*errors.Validation); ok { 101 | return ve.ValidateName("contracts_security" + "." + strconv.Itoa(i)) 102 | } 103 | return err 104 | } 105 | } 106 | 107 | } 108 | 109 | return nil 110 | } 111 | 112 | // MarshalBinary interface implementation 113 | func (m *DappContractSecurityResponse) MarshalBinary() ([]byte, error) { 114 | if m == nil { 115 | return nil, nil 116 | } 117 | return swag.WriteJSON(m) 118 | } 119 | 120 | // UnmarshalBinary interface implementation 121 | func (m *DappContractSecurityResponse) UnmarshalBinary(b []byte) error { 122 | var res DappContractSecurityResponse 123 | if err := swag.ReadJSON(b, &res); err != nil { 124 | return err 125 | } 126 | *m = res 127 | return nil 128 | } 129 | -------------------------------------------------------------------------------- /pkg/gen/models/get_access_token_request.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | "github.com/go-openapi/validate" 13 | ) 14 | 15 | // GetAccessTokenRequest GetAccessTokenRequest 16 | // 17 | // swagger:model GetAccessTokenRequest 18 | type GetAccessTokenRequest struct { 19 | 20 | // app_key 21 | // Required: true 22 | AppKey *string `json:"app_key"` 23 | 24 | // Sign Method 25 | // Concatenate app_key, time, app_secret in turn, and do sha1() . 26 | // Example 27 | // app_key = mBOMg20QW11BbtyH4Zh0 28 | // time = 1647847498 29 | // app_secret = V6aRfxlPJwN3ViJSIFSCdxPvneajuJsh 30 | // sign = sha1(mBOMg20QW11BbtyH4Zh01647847498V6aRfxlPJwN3ViJSIFSCdxPvneajuJsh) 31 | // = 7293d385b9225b3c3f232b76ba97255d0e21063e 32 | // Required: true 33 | Sign *string `json:"sign"` 34 | 35 | // Quest timestamp (Second), should be within +-1000s around current timestamp 36 | // Required: true 37 | Time *int64 `json:"time"` 38 | } 39 | 40 | // Validate validates this get access token request 41 | func (m *GetAccessTokenRequest) Validate(formats strfmt.Registry) error { 42 | var res []error 43 | 44 | if err := m.validateAppKey(formats); err != nil { 45 | res = append(res, err) 46 | } 47 | 48 | if err := m.validateSign(formats); err != nil { 49 | res = append(res, err) 50 | } 51 | 52 | if err := m.validateTime(formats); err != nil { 53 | res = append(res, err) 54 | } 55 | 56 | if len(res) > 0 { 57 | return errors.CompositeValidationError(res...) 58 | } 59 | return nil 60 | } 61 | 62 | func (m *GetAccessTokenRequest) validateAppKey(formats strfmt.Registry) error { 63 | 64 | if err := validate.Required("app_key", "body", m.AppKey); err != nil { 65 | return err 66 | } 67 | 68 | return nil 69 | } 70 | 71 | func (m *GetAccessTokenRequest) validateSign(formats strfmt.Registry) error { 72 | 73 | if err := validate.Required("sign", "body", m.Sign); err != nil { 74 | return err 75 | } 76 | 77 | return nil 78 | } 79 | 80 | func (m *GetAccessTokenRequest) validateTime(formats strfmt.Registry) error { 81 | 82 | if err := validate.Required("time", "body", m.Time); err != nil { 83 | return err 84 | } 85 | 86 | return nil 87 | } 88 | 89 | // MarshalBinary interface implementation 90 | func (m *GetAccessTokenRequest) MarshalBinary() ([]byte, error) { 91 | if m == nil { 92 | return nil, nil 93 | } 94 | return swag.WriteJSON(m) 95 | } 96 | 97 | // UnmarshalBinary interface implementation 98 | func (m *GetAccessTokenRequest) UnmarshalBinary(b []byte) error { 99 | var res GetAccessTokenRequest 100 | if err := swag.ReadJSON(b, &res); err != nil { 101 | return err 102 | } 103 | *m = res 104 | return nil 105 | } 106 | -------------------------------------------------------------------------------- /pkg/gen/models/get_access_token_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // GetAccessTokenResponse GetAccessTokenResponse 14 | // 15 | // swagger:model GetAccessTokenResponse 16 | type GetAccessTokenResponse struct { 17 | 18 | // access_token 19 | AccessToken string `json:"access_token,omitempty"` 20 | 21 | // expires_in 22 | ExpiresIn int64 `json:"expires_in,omitempty"` 23 | } 24 | 25 | // Validate validates this get access token response 26 | func (m *GetAccessTokenResponse) Validate(formats strfmt.Registry) error { 27 | return nil 28 | } 29 | 30 | // MarshalBinary interface implementation 31 | func (m *GetAccessTokenResponse) MarshalBinary() ([]byte, error) { 32 | if m == nil { 33 | return nil, nil 34 | } 35 | return swag.WriteJSON(m) 36 | } 37 | 38 | // UnmarshalBinary interface implementation 39 | func (m *GetAccessTokenResponse) UnmarshalBinary(b []byte) error { 40 | var res GetAccessTokenResponse 41 | if err := swag.ReadJSON(b, &res); err != nil { 42 | return err 43 | } 44 | *m = res 45 | return nil 46 | } 47 | -------------------------------------------------------------------------------- /pkg/gen/models/json_object.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | ) 11 | 12 | // JSONObject JSONObject 13 | // 14 | // swagger:model JSONObject 15 | type JSONObject map[string]interface{} 16 | 17 | // Validate validates this JSON object 18 | func (m JSONObject) Validate(formats strfmt.Registry) error { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /pkg/gen/models/map_string_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | ) 11 | 12 | // MapStringString MapStringString 13 | // 14 | // swagger:model MapStringString 15 | type MapStringString map[string]string 16 | 17 | // Validate validates this map string string 18 | func (m MapStringString) Validate(formats strfmt.Registry) error { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /pkg/gen/models/parse_abi_data_request.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "encoding/json" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | "github.com/go-openapi/validate" 15 | ) 16 | 17 | // ParseAbiDataRequest ParseAbiDataRequest 18 | // 19 | // swagger:model ParseAbiDataRequest 20 | type ParseAbiDataRequest struct { 21 | 22 | // Chain id, (ETH: 1, Cronos:25, BSC: 56, Heco: 128, Polygon: 137, Fantom:250, KCC: 321, Arbitrum: 42161, Avalanche: 43114) 23 | // Required: true 24 | ChainID *string `json:"chain_id"` 25 | 26 | // Carrying the signer and contract address will help to decode more information. 27 | ContractAddress string `json:"contract_address,omitempty"` 28 | 29 | // Transaction input 30 | // Required: true 31 | Data *string `json:"data"` 32 | 33 | // input info 34 | Input map[string]interface{} `json:"input,omitempty"` 35 | 36 | // Carrying the signer and contract address will help to decode more information. 37 | Signer string `json:"signer,omitempty"` 38 | 39 | // Transaction type 40 | // Enum: [common eth_signTypedData_v4 personal_sign eth_sign] 41 | TranscationType string `json:"transcation_type,omitempty"` 42 | } 43 | 44 | // Validate validates this parse abi data request 45 | func (m *ParseAbiDataRequest) Validate(formats strfmt.Registry) error { 46 | var res []error 47 | 48 | if err := m.validateChainID(formats); err != nil { 49 | res = append(res, err) 50 | } 51 | 52 | if err := m.validateData(formats); err != nil { 53 | res = append(res, err) 54 | } 55 | 56 | if err := m.validateTranscationType(formats); err != nil { 57 | res = append(res, err) 58 | } 59 | 60 | if len(res) > 0 { 61 | return errors.CompositeValidationError(res...) 62 | } 63 | return nil 64 | } 65 | 66 | func (m *ParseAbiDataRequest) validateChainID(formats strfmt.Registry) error { 67 | 68 | if err := validate.Required("chain_id", "body", m.ChainID); err != nil { 69 | return err 70 | } 71 | 72 | return nil 73 | } 74 | 75 | func (m *ParseAbiDataRequest) validateData(formats strfmt.Registry) error { 76 | 77 | if err := validate.Required("data", "body", m.Data); err != nil { 78 | return err 79 | } 80 | 81 | return nil 82 | } 83 | 84 | var parseAbiDataRequestTypeTranscationTypePropEnum []interface{} 85 | 86 | func init() { 87 | var res []string 88 | if err := json.Unmarshal([]byte(`["common","eth_signTypedData_v4","personal_sign","eth_sign"]`), &res); err != nil { 89 | panic(err) 90 | } 91 | for _, v := range res { 92 | parseAbiDataRequestTypeTranscationTypePropEnum = append(parseAbiDataRequestTypeTranscationTypePropEnum, v) 93 | } 94 | } 95 | 96 | const ( 97 | 98 | // ParseAbiDataRequestTranscationTypeCommon captures enum value "common" 99 | ParseAbiDataRequestTranscationTypeCommon string = "common" 100 | 101 | // ParseAbiDataRequestTranscationTypeEthSignTypedDataV4 captures enum value "eth_signTypedData_v4" 102 | ParseAbiDataRequestTranscationTypeEthSignTypedDataV4 string = "eth_signTypedData_v4" 103 | 104 | // ParseAbiDataRequestTranscationTypePersonalSign captures enum value "personal_sign" 105 | ParseAbiDataRequestTranscationTypePersonalSign string = "personal_sign" 106 | 107 | // ParseAbiDataRequestTranscationTypeEthSign captures enum value "eth_sign" 108 | ParseAbiDataRequestTranscationTypeEthSign string = "eth_sign" 109 | ) 110 | 111 | // prop value enum 112 | func (m *ParseAbiDataRequest) validateTranscationTypeEnum(path, location string, value string) error { 113 | if err := validate.EnumCase(path, location, value, parseAbiDataRequestTypeTranscationTypePropEnum, true); err != nil { 114 | return err 115 | } 116 | return nil 117 | } 118 | 119 | func (m *ParseAbiDataRequest) validateTranscationType(formats strfmt.Registry) error { 120 | 121 | if swag.IsZero(m.TranscationType) { // not required 122 | return nil 123 | } 124 | 125 | // value enum 126 | if err := m.validateTranscationTypeEnum("transcation_type", "body", m.TranscationType); err != nil { 127 | return err 128 | } 129 | 130 | return nil 131 | } 132 | 133 | // MarshalBinary interface implementation 134 | func (m *ParseAbiDataRequest) MarshalBinary() ([]byte, error) { 135 | if m == nil { 136 | return nil, nil 137 | } 138 | return swag.WriteJSON(m) 139 | } 140 | 141 | // UnmarshalBinary interface implementation 142 | func (m *ParseAbiDataRequest) UnmarshalBinary(b []byte) error { 143 | var res ParseAbiDataRequest 144 | if err := swag.ReadJSON(b, &res); err != nil { 145 | return err 146 | } 147 | *m = res 148 | return nil 149 | } 150 | -------------------------------------------------------------------------------- /pkg/gen/models/parse_abi_data_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ParseAbiDataResponse ParseAbiDataResponse 17 | // 18 | // swagger:model ParseAbiDataResponse 19 | type ParseAbiDataResponse struct { 20 | 21 | // Description of the contract. 22 | ContractDescription string `json:"contract_description,omitempty"` 23 | 24 | // The name of the contract that the user is interacting with. 25 | ContractName string `json:"contract_name,omitempty"` 26 | 27 | // It tells if contract that the user is interacting with is malicious contract. 28 | MaliciousContract int32 `json:"malicious_contract,omitempty"` 29 | 30 | // It describes the method name in ABI, for example "transfer". 31 | Method string `json:"method,omitempty"` 32 | 33 | // It describes the parameter info 34 | Params []*AbiParamInfo `json:"params"` 35 | 36 | // It explains why the transaction that users are signing contains risk.(Notice:Even non-malicious, commonly used, well-known contracts can be highly risky if not used properly.) 37 | Risk string `json:"risk,omitempty"` 38 | 39 | // It tells if the transaction that users are signing contains risk.(Notice:Even non-malicious, commonly used, well-known contracts can be highly risky if not used properly.) 40 | RiskySignature int32 `json:"risky_signature,omitempty"` 41 | 42 | // It explain the function of the method 43 | SignatureDetail string `json:"signature_detail,omitempty"` 44 | } 45 | 46 | // Validate validates this parse abi data response 47 | func (m *ParseAbiDataResponse) Validate(formats strfmt.Registry) error { 48 | var res []error 49 | 50 | if err := m.validateParams(formats); err != nil { 51 | res = append(res, err) 52 | } 53 | 54 | if len(res) > 0 { 55 | return errors.CompositeValidationError(res...) 56 | } 57 | return nil 58 | } 59 | 60 | func (m *ParseAbiDataResponse) validateParams(formats strfmt.Registry) error { 61 | 62 | if swag.IsZero(m.Params) { // not required 63 | return nil 64 | } 65 | 66 | for i := 0; i < len(m.Params); i++ { 67 | if swag.IsZero(m.Params[i]) { // not required 68 | continue 69 | } 70 | 71 | if m.Params[i] != nil { 72 | if err := m.Params[i].Validate(formats); err != nil { 73 | if ve, ok := err.(*errors.Validation); ok { 74 | return ve.ValidateName("params" + "." + strconv.Itoa(i)) 75 | } 76 | return err 77 | } 78 | } 79 | 80 | } 81 | 82 | return nil 83 | } 84 | 85 | // MarshalBinary interface implementation 86 | func (m *ParseAbiDataResponse) MarshalBinary() ([]byte, error) { 87 | if m == nil { 88 | return nil, nil 89 | } 90 | return swag.WriteJSON(m) 91 | } 92 | 93 | // UnmarshalBinary interface implementation 94 | func (m *ParseAbiDataResponse) UnmarshalBinary(b []byte) error { 95 | var res ParseAbiDataResponse 96 | if err := swag.ReadJSON(b, &res); err != nil { 97 | return err 98 | } 99 | *m = res 100 | return nil 101 | } 102 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_contract_approve_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ResponseWrapperContractApproveResponse ResponseWrapperContractApproveResponse 15 | // 16 | // swagger:model ResponseWrapperContractApproveResponse 17 | type ResponseWrapperContractApproveResponse struct { 18 | 19 | // Code 1: Success 20 | Code int32 `json:"code,omitempty"` 21 | 22 | // Response message 23 | Message string `json:"message,omitempty"` 24 | 25 | // Response result 26 | Result *ContractApproveResponse `json:"result,omitempty"` 27 | } 28 | 29 | // Validate validates this response wrapper contract approve response 30 | func (m *ResponseWrapperContractApproveResponse) Validate(formats strfmt.Registry) error { 31 | var res []error 32 | 33 | if err := m.validateResult(formats); err != nil { 34 | res = append(res, err) 35 | } 36 | 37 | if len(res) > 0 { 38 | return errors.CompositeValidationError(res...) 39 | } 40 | return nil 41 | } 42 | 43 | func (m *ResponseWrapperContractApproveResponse) validateResult(formats strfmt.Registry) error { 44 | 45 | if swag.IsZero(m.Result) { // not required 46 | return nil 47 | } 48 | 49 | if m.Result != nil { 50 | if err := m.Result.Validate(formats); err != nil { 51 | if ve, ok := err.(*errors.Validation); ok { 52 | return ve.ValidateName("result") 53 | } 54 | return err 55 | } 56 | } 57 | 58 | return nil 59 | } 60 | 61 | // MarshalBinary interface implementation 62 | func (m *ResponseWrapperContractApproveResponse) MarshalBinary() ([]byte, error) { 63 | if m == nil { 64 | return nil, nil 65 | } 66 | return swag.WriteJSON(m) 67 | } 68 | 69 | // UnmarshalBinary interface implementation 70 | func (m *ResponseWrapperContractApproveResponse) UnmarshalBinary(b []byte) error { 71 | var res ResponseWrapperContractApproveResponse 72 | if err := swag.ReadJSON(b, &res); err != nil { 73 | return err 74 | } 75 | *m = res 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_dapp_contract_security_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ResponseWrapperDappContractSecurityResponse ResponseWrapperDappContractSecurityResponse 15 | // 16 | // swagger:model ResponseWrapperDappContractSecurityResponse 17 | type ResponseWrapperDappContractSecurityResponse struct { 18 | 19 | // Code 1: Success 20 | Code int32 `json:"code,omitempty"` 21 | 22 | // Response message 23 | Message string `json:"message,omitempty"` 24 | 25 | // Response result 26 | Result *DappContractSecurityResponse `json:"result,omitempty"` 27 | } 28 | 29 | // Validate validates this response wrapper dapp contract security response 30 | func (m *ResponseWrapperDappContractSecurityResponse) Validate(formats strfmt.Registry) error { 31 | var res []error 32 | 33 | if err := m.validateResult(formats); err != nil { 34 | res = append(res, err) 35 | } 36 | 37 | if len(res) > 0 { 38 | return errors.CompositeValidationError(res...) 39 | } 40 | return nil 41 | } 42 | 43 | func (m *ResponseWrapperDappContractSecurityResponse) validateResult(formats strfmt.Registry) error { 44 | 45 | if swag.IsZero(m.Result) { // not required 46 | return nil 47 | } 48 | 49 | if m.Result != nil { 50 | if err := m.Result.Validate(formats); err != nil { 51 | if ve, ok := err.(*errors.Validation); ok { 52 | return ve.ValidateName("result") 53 | } 54 | return err 55 | } 56 | } 57 | 58 | return nil 59 | } 60 | 61 | // MarshalBinary interface implementation 62 | func (m *ResponseWrapperDappContractSecurityResponse) MarshalBinary() ([]byte, error) { 63 | if m == nil { 64 | return nil, nil 65 | } 66 | return swag.WriteJSON(m) 67 | } 68 | 69 | // UnmarshalBinary interface implementation 70 | func (m *ResponseWrapperDappContractSecurityResponse) UnmarshalBinary(b []byte) error { 71 | var res ResponseWrapperDappContractSecurityResponse 72 | if err := swag.ReadJSON(b, &res); err != nil { 73 | return err 74 | } 75 | *m = res 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_get_access_token_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ResponseWrapperGetAccessTokenResponse ResponseWrapperGetAccessTokenResponse 15 | // 16 | // swagger:model ResponseWrapperGetAccessTokenResponse 17 | type ResponseWrapperGetAccessTokenResponse struct { 18 | 19 | // Code 1: Success 20 | Code int32 `json:"code,omitempty"` 21 | 22 | // Response message 23 | Message string `json:"message,omitempty"` 24 | 25 | // Response result 26 | Result *GetAccessTokenResponse `json:"result,omitempty"` 27 | } 28 | 29 | // Validate validates this response wrapper get access token response 30 | func (m *ResponseWrapperGetAccessTokenResponse) Validate(formats strfmt.Registry) error { 31 | var res []error 32 | 33 | if err := m.validateResult(formats); err != nil { 34 | res = append(res, err) 35 | } 36 | 37 | if len(res) > 0 { 38 | return errors.CompositeValidationError(res...) 39 | } 40 | return nil 41 | } 42 | 43 | func (m *ResponseWrapperGetAccessTokenResponse) validateResult(formats strfmt.Registry) error { 44 | 45 | if swag.IsZero(m.Result) { // not required 46 | return nil 47 | } 48 | 49 | if m.Result != nil { 50 | if err := m.Result.Validate(formats); err != nil { 51 | if ve, ok := err.(*errors.Validation); ok { 52 | return ve.ValidateName("result") 53 | } 54 | return err 55 | } 56 | } 57 | 58 | return nil 59 | } 60 | 61 | // MarshalBinary interface implementation 62 | func (m *ResponseWrapperGetAccessTokenResponse) MarshalBinary() ([]byte, error) { 63 | if m == nil { 64 | return nil, nil 65 | } 66 | return swag.WriteJSON(m) 67 | } 68 | 69 | // UnmarshalBinary interface implementation 70 | func (m *ResponseWrapperGetAccessTokenResponse) UnmarshalBinary(b []byte) error { 71 | var res ResponseWrapperGetAccessTokenResponse 72 | if err := swag.ReadJSON(b, &res); err != nil { 73 | return err 74 | } 75 | *m = res 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_json_object.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // ResponseWrapperJSONObject ResponseWrapperJSONObject 14 | // 15 | // swagger:model ResponseWrapperJSONObject 16 | type ResponseWrapperJSONObject struct { 17 | 18 | // Code 1: Success 19 | Code int32 `json:"code,omitempty"` 20 | 21 | // Response message 22 | Message string `json:"message,omitempty"` 23 | 24 | // Response result 25 | Result map[string]interface{} `json:"result,omitempty"` 26 | } 27 | 28 | // Validate validates this response wrapper JSON object 29 | func (m *ResponseWrapperJSONObject) Validate(formats strfmt.Registry) error { 30 | return nil 31 | } 32 | 33 | // MarshalBinary interface implementation 34 | func (m *ResponseWrapperJSONObject) MarshalBinary() ([]byte, error) { 35 | if m == nil { 36 | return nil, nil 37 | } 38 | return swag.WriteJSON(m) 39 | } 40 | 41 | // UnmarshalBinary interface implementation 42 | func (m *ResponseWrapperJSONObject) UnmarshalBinary(b []byte) error { 43 | var res ResponseWrapperJSONObject 44 | if err := swag.ReadJSON(b, &res); err != nil { 45 | return err 46 | } 47 | *m = res 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_list_approve_n_f_t1155_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ResponseWrapperListApproveNFT1155ListResponse ResponseWrapperListApproveNFT1155ListResponse 17 | // 18 | // swagger:model ResponseWrapperListApproveNFT1155ListResponse 19 | type ResponseWrapperListApproveNFT1155ListResponse struct { 20 | 21 | // Code 1: Success 22 | Code int32 `json:"code,omitempty"` 23 | 24 | // Response message 25 | Message string `json:"message,omitempty"` 26 | 27 | // Response result 28 | Result []*ApproveNFT1155ListResponse `json:"result"` 29 | } 30 | 31 | // Validate validates this response wrapper list approve n f t1155 list response 32 | func (m *ResponseWrapperListApproveNFT1155ListResponse) Validate(formats strfmt.Registry) error { 33 | var res []error 34 | 35 | if err := m.validateResult(formats); err != nil { 36 | res = append(res, err) 37 | } 38 | 39 | if len(res) > 0 { 40 | return errors.CompositeValidationError(res...) 41 | } 42 | return nil 43 | } 44 | 45 | func (m *ResponseWrapperListApproveNFT1155ListResponse) validateResult(formats strfmt.Registry) error { 46 | 47 | if swag.IsZero(m.Result) { // not required 48 | return nil 49 | } 50 | 51 | for i := 0; i < len(m.Result); i++ { 52 | if swag.IsZero(m.Result[i]) { // not required 53 | continue 54 | } 55 | 56 | if m.Result[i] != nil { 57 | if err := m.Result[i].Validate(formats); err != nil { 58 | if ve, ok := err.(*errors.Validation); ok { 59 | return ve.ValidateName("result" + "." + strconv.Itoa(i)) 60 | } 61 | return err 62 | } 63 | } 64 | 65 | } 66 | 67 | return nil 68 | } 69 | 70 | // MarshalBinary interface implementation 71 | func (m *ResponseWrapperListApproveNFT1155ListResponse) MarshalBinary() ([]byte, error) { 72 | if m == nil { 73 | return nil, nil 74 | } 75 | return swag.WriteJSON(m) 76 | } 77 | 78 | // UnmarshalBinary interface implementation 79 | func (m *ResponseWrapperListApproveNFT1155ListResponse) UnmarshalBinary(b []byte) error { 80 | var res ResponseWrapperListApproveNFT1155ListResponse 81 | if err := swag.ReadJSON(b, &res); err != nil { 82 | return err 83 | } 84 | *m = res 85 | return nil 86 | } 87 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_list_approve_n_f_t_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ResponseWrapperListApproveNFTListResponse ResponseWrapperListApproveNFTListResponse 17 | // 18 | // swagger:model ResponseWrapperListApproveNFTListResponse 19 | type ResponseWrapperListApproveNFTListResponse struct { 20 | 21 | // Code 1: Success 22 | Code int32 `json:"code,omitempty"` 23 | 24 | // Response message 25 | Message string `json:"message,omitempty"` 26 | 27 | // Response result 28 | Result []*ApproveNFTListResponse `json:"result"` 29 | } 30 | 31 | // Validate validates this response wrapper list approve n f t list response 32 | func (m *ResponseWrapperListApproveNFTListResponse) Validate(formats strfmt.Registry) error { 33 | var res []error 34 | 35 | if err := m.validateResult(formats); err != nil { 36 | res = append(res, err) 37 | } 38 | 39 | if len(res) > 0 { 40 | return errors.CompositeValidationError(res...) 41 | } 42 | return nil 43 | } 44 | 45 | func (m *ResponseWrapperListApproveNFTListResponse) validateResult(formats strfmt.Registry) error { 46 | 47 | if swag.IsZero(m.Result) { // not required 48 | return nil 49 | } 50 | 51 | for i := 0; i < len(m.Result); i++ { 52 | if swag.IsZero(m.Result[i]) { // not required 53 | continue 54 | } 55 | 56 | if m.Result[i] != nil { 57 | if err := m.Result[i].Validate(formats); err != nil { 58 | if ve, ok := err.(*errors.Validation); ok { 59 | return ve.ValidateName("result" + "." + strconv.Itoa(i)) 60 | } 61 | return err 62 | } 63 | } 64 | 65 | } 66 | 67 | return nil 68 | } 69 | 70 | // MarshalBinary interface implementation 71 | func (m *ResponseWrapperListApproveNFTListResponse) MarshalBinary() ([]byte, error) { 72 | if m == nil { 73 | return nil, nil 74 | } 75 | return swag.WriteJSON(m) 76 | } 77 | 78 | // UnmarshalBinary interface implementation 79 | func (m *ResponseWrapperListApproveNFTListResponse) UnmarshalBinary(b []byte) error { 80 | var res ResponseWrapperListApproveNFTListResponse 81 | if err := swag.ReadJSON(b, &res); err != nil { 82 | return err 83 | } 84 | *m = res 85 | return nil 86 | } 87 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_list_approve_token_out_list_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ResponseWrapperListApproveTokenOutListResponse ResponseWrapperListApproveTokenOutListResponse 17 | // 18 | // swagger:model ResponseWrapperListApproveTokenOutListResponse 19 | type ResponseWrapperListApproveTokenOutListResponse struct { 20 | 21 | // Code 1: Success 22 | Code int32 `json:"code,omitempty"` 23 | 24 | // Response message 25 | Message string `json:"message,omitempty"` 26 | 27 | // Response result 28 | Result []*ApproveTokenOutListResponse `json:"result"` 29 | } 30 | 31 | // Validate validates this response wrapper list approve token out list response 32 | func (m *ResponseWrapperListApproveTokenOutListResponse) Validate(formats strfmt.Registry) error { 33 | var res []error 34 | 35 | if err := m.validateResult(formats); err != nil { 36 | res = append(res, err) 37 | } 38 | 39 | if len(res) > 0 { 40 | return errors.CompositeValidationError(res...) 41 | } 42 | return nil 43 | } 44 | 45 | func (m *ResponseWrapperListApproveTokenOutListResponse) validateResult(formats strfmt.Registry) error { 46 | 47 | if swag.IsZero(m.Result) { // not required 48 | return nil 49 | } 50 | 51 | for i := 0; i < len(m.Result); i++ { 52 | if swag.IsZero(m.Result[i]) { // not required 53 | continue 54 | } 55 | 56 | if m.Result[i] != nil { 57 | if err := m.Result[i].Validate(formats); err != nil { 58 | if ve, ok := err.(*errors.Validation); ok { 59 | return ve.ValidateName("result" + "." + strconv.Itoa(i)) 60 | } 61 | return err 62 | } 63 | } 64 | 65 | } 66 | 67 | return nil 68 | } 69 | 70 | // MarshalBinary interface implementation 71 | func (m *ResponseWrapperListApproveTokenOutListResponse) MarshalBinary() ([]byte, error) { 72 | if m == nil { 73 | return nil, nil 74 | } 75 | return swag.WriteJSON(m) 76 | } 77 | 78 | // UnmarshalBinary interface implementation 79 | func (m *ResponseWrapperListApproveTokenOutListResponse) UnmarshalBinary(b []byte) error { 80 | var res ResponseWrapperListApproveTokenOutListResponse 81 | if err := swag.ReadJSON(b, &res); err != nil { 82 | return err 83 | } 84 | *m = res 85 | return nil 86 | } 87 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_list_get_chains_list.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ResponseWrapperListGetChainsList ResponseWrapperListGetChainsList 17 | // 18 | // swagger:model ResponseWrapperListGetChainsList 19 | type ResponseWrapperListGetChainsList struct { 20 | 21 | // Code 1: Success 22 | Code int32 `json:"code,omitempty"` 23 | 24 | // Response message 25 | Message string `json:"message,omitempty"` 26 | 27 | // Response result 28 | Result []*ResponseWrapperListGetChainsListResultItems0 `json:"result"` 29 | } 30 | 31 | // Validate validates this response wrapper list get chains list 32 | func (m *ResponseWrapperListGetChainsList) Validate(formats strfmt.Registry) error { 33 | var res []error 34 | 35 | if err := m.validateResult(formats); err != nil { 36 | res = append(res, err) 37 | } 38 | 39 | if len(res) > 0 { 40 | return errors.CompositeValidationError(res...) 41 | } 42 | return nil 43 | } 44 | 45 | func (m *ResponseWrapperListGetChainsList) validateResult(formats strfmt.Registry) error { 46 | 47 | if swag.IsZero(m.Result) { // not required 48 | return nil 49 | } 50 | 51 | for i := 0; i < len(m.Result); i++ { 52 | if swag.IsZero(m.Result[i]) { // not required 53 | continue 54 | } 55 | 56 | if m.Result[i] != nil { 57 | if err := m.Result[i].Validate(formats); err != nil { 58 | if ve, ok := err.(*errors.Validation); ok { 59 | return ve.ValidateName("result" + "." + strconv.Itoa(i)) 60 | } 61 | return err 62 | } 63 | } 64 | 65 | } 66 | 67 | return nil 68 | } 69 | 70 | // MarshalBinary interface implementation 71 | func (m *ResponseWrapperListGetChainsList) MarshalBinary() ([]byte, error) { 72 | if m == nil { 73 | return nil, nil 74 | } 75 | return swag.WriteJSON(m) 76 | } 77 | 78 | // UnmarshalBinary interface implementation 79 | func (m *ResponseWrapperListGetChainsList) UnmarshalBinary(b []byte) error { 80 | var res ResponseWrapperListGetChainsList 81 | if err := swag.ReadJSON(b, &res); err != nil { 82 | return err 83 | } 84 | *m = res 85 | return nil 86 | } 87 | 88 | // ResponseWrapperListGetChainsListResultItems0 response wrapper list get chains list result items0 89 | // 90 | // swagger:model ResponseWrapperListGetChainsListResultItems0 91 | type ResponseWrapperListGetChainsListResultItems0 struct { 92 | 93 | // chain id 94 | ID string `json:"id,omitempty"` 95 | 96 | // chain name 97 | Name string `json:"name,omitempty"` 98 | } 99 | 100 | // Validate validates this response wrapper list get chains list result items0 101 | func (m *ResponseWrapperListGetChainsListResultItems0) Validate(formats strfmt.Registry) error { 102 | return nil 103 | } 104 | 105 | // MarshalBinary interface implementation 106 | func (m *ResponseWrapperListGetChainsListResultItems0) MarshalBinary() ([]byte, error) { 107 | if m == nil { 108 | return nil, nil 109 | } 110 | return swag.WriteJSON(m) 111 | } 112 | 113 | // UnmarshalBinary interface implementation 114 | func (m *ResponseWrapperListGetChainsListResultItems0) UnmarshalBinary(b []byte) error { 115 | var res ResponseWrapperListGetChainsListResultItems0 116 | if err := swag.ReadJSON(b, &res); err != nil { 117 | return err 118 | } 119 | *m = res 120 | return nil 121 | } 122 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_list_json_object.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "strconv" 10 | 11 | "github.com/go-openapi/errors" 12 | "github.com/go-openapi/strfmt" 13 | "github.com/go-openapi/swag" 14 | ) 15 | 16 | // ResponseWrapperListJSONObject ResponseWrapperListJSONObject 17 | // 18 | // swagger:model ResponseWrapperListJSONObject 19 | type ResponseWrapperListJSONObject struct { 20 | 21 | // Code 1: Success 22 | Code int32 `json:"code,omitempty"` 23 | 24 | // Response message 25 | Message string `json:"message,omitempty"` 26 | 27 | // Response result 28 | Result []JSONObject `json:"result"` 29 | } 30 | 31 | // Validate validates this response wrapper list JSON object 32 | func (m *ResponseWrapperListJSONObject) Validate(formats strfmt.Registry) error { 33 | var res []error 34 | 35 | if err := m.validateResult(formats); err != nil { 36 | res = append(res, err) 37 | } 38 | 39 | if len(res) > 0 { 40 | return errors.CompositeValidationError(res...) 41 | } 42 | return nil 43 | } 44 | 45 | func (m *ResponseWrapperListJSONObject) validateResult(formats strfmt.Registry) error { 46 | 47 | if swag.IsZero(m.Result) { // not required 48 | return nil 49 | } 50 | 51 | for i := 0; i < len(m.Result); i++ { 52 | 53 | if err := m.Result[i].Validate(formats); err != nil { 54 | if ve, ok := err.(*errors.Validation); ok { 55 | return ve.ValidateName("result" + "." + strconv.Itoa(i)) 56 | } 57 | return err 58 | } 59 | 60 | } 61 | 62 | return nil 63 | } 64 | 65 | // MarshalBinary interface implementation 66 | func (m *ResponseWrapperListJSONObject) MarshalBinary() ([]byte, error) { 67 | if m == nil { 68 | return nil, nil 69 | } 70 | return swag.WriteJSON(m) 71 | } 72 | 73 | // UnmarshalBinary interface implementation 74 | func (m *ResponseWrapperListJSONObject) UnmarshalBinary(b []byte) error { 75 | var res ResponseWrapperListJSONObject 76 | if err := swag.ReadJSON(b, &res); err != nil { 77 | return err 78 | } 79 | *m = res 80 | return nil 81 | } 82 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_map_string_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // ResponseWrapperMapStringString ResponseWrapperMapStringString 14 | // 15 | // swagger:model ResponseWrapperMapStringString 16 | type ResponseWrapperMapStringString struct { 17 | 18 | // Code 1: Success 19 | Code int32 `json:"code,omitempty"` 20 | 21 | // Response message 22 | Message string `json:"message,omitempty"` 23 | 24 | // Response result 25 | Result map[string]string `json:"result,omitempty"` 26 | } 27 | 28 | // Validate validates this response wrapper map string string 29 | func (m *ResponseWrapperMapStringString) Validate(formats strfmt.Registry) error { 30 | return nil 31 | } 32 | 33 | // MarshalBinary interface implementation 34 | func (m *ResponseWrapperMapStringString) MarshalBinary() ([]byte, error) { 35 | if m == nil { 36 | return nil, nil 37 | } 38 | return swag.WriteJSON(m) 39 | } 40 | 41 | // UnmarshalBinary interface implementation 42 | func (m *ResponseWrapperMapStringString) UnmarshalBinary(b []byte) error { 43 | var res ResponseWrapperMapStringString 44 | if err := swag.ReadJSON(b, &res); err != nil { 45 | return err 46 | } 47 | *m = res 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_parse_abi_data_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ResponseWrapperParseAbiDataResponse ResponseWrapperParseAbiDataResponse 15 | // 16 | // swagger:model ResponseWrapperParseAbiDataResponse 17 | type ResponseWrapperParseAbiDataResponse struct { 18 | 19 | // Code 1: Success 20 | Code int32 `json:"code,omitempty"` 21 | 22 | // Response message 23 | Message string `json:"message,omitempty"` 24 | 25 | // Response result 26 | Result *ParseAbiDataResponse `json:"result,omitempty"` 27 | } 28 | 29 | // Validate validates this response wrapper parse abi data response 30 | func (m *ResponseWrapperParseAbiDataResponse) Validate(formats strfmt.Registry) error { 31 | var res []error 32 | 33 | if err := m.validateResult(formats); err != nil { 34 | res = append(res, err) 35 | } 36 | 37 | if len(res) > 0 { 38 | return errors.CompositeValidationError(res...) 39 | } 40 | return nil 41 | } 42 | 43 | func (m *ResponseWrapperParseAbiDataResponse) validateResult(formats strfmt.Registry) error { 44 | 45 | if swag.IsZero(m.Result) { // not required 46 | return nil 47 | } 48 | 49 | if m.Result != nil { 50 | if err := m.Result.Validate(formats); err != nil { 51 | if ve, ok := err.(*errors.Validation); ok { 52 | return ve.ValidateName("result") 53 | } 54 | return err 55 | } 56 | } 57 | 58 | return nil 59 | } 60 | 61 | // MarshalBinary interface implementation 62 | func (m *ResponseWrapperParseAbiDataResponse) MarshalBinary() ([]byte, error) { 63 | if m == nil { 64 | return nil, nil 65 | } 66 | return swag.WriteJSON(m) 67 | } 68 | 69 | // UnmarshalBinary interface implementation 70 | func (m *ResponseWrapperParseAbiDataResponse) UnmarshalBinary(b []byte) error { 71 | var res ResponseWrapperParseAbiDataResponse 72 | if err := swag.ReadJSON(b, &res); err != nil { 73 | return err 74 | } 75 | *m = res 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapper_ta_token_security_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/errors" 10 | "github.com/go-openapi/strfmt" 11 | "github.com/go-openapi/swag" 12 | ) 13 | 14 | // ResponseWrapperTaTokenSecurityResponse ResponseWrapperTaTokenSecurityResponse 15 | // 16 | // swagger:model ResponseWrapperTaTokenSecurityResponse 17 | type ResponseWrapperTaTokenSecurityResponse struct { 18 | 19 | // Code 1: Success 20 | Code int32 `json:"code,omitempty"` 21 | 22 | // Response message 23 | Message string `json:"message,omitempty"` 24 | 25 | // Response result 26 | Result *TaTokenSecurityResponse `json:"result,omitempty"` 27 | } 28 | 29 | // Validate validates this response wrapper ta token security response 30 | func (m *ResponseWrapperTaTokenSecurityResponse) Validate(formats strfmt.Registry) error { 31 | var res []error 32 | 33 | if err := m.validateResult(formats); err != nil { 34 | res = append(res, err) 35 | } 36 | 37 | if len(res) > 0 { 38 | return errors.CompositeValidationError(res...) 39 | } 40 | return nil 41 | } 42 | 43 | func (m *ResponseWrapperTaTokenSecurityResponse) validateResult(formats strfmt.Registry) error { 44 | 45 | if swag.IsZero(m.Result) { // not required 46 | return nil 47 | } 48 | 49 | if m.Result != nil { 50 | if err := m.Result.Validate(formats); err != nil { 51 | if ve, ok := err.(*errors.Validation); ok { 52 | return ve.ValidateName("result") 53 | } 54 | return err 55 | } 56 | } 57 | 58 | return nil 59 | } 60 | 61 | // MarshalBinary interface implementation 62 | func (m *ResponseWrapperTaTokenSecurityResponse) MarshalBinary() ([]byte, error) { 63 | if m == nil { 64 | return nil, nil 65 | } 66 | return swag.WriteJSON(m) 67 | } 68 | 69 | // UnmarshalBinary interface implementation 70 | func (m *ResponseWrapperTaTokenSecurityResponse) UnmarshalBinary(b []byte) error { 71 | var res ResponseWrapperTaTokenSecurityResponse 72 | if err := swag.ReadJSON(b, &res); err != nil { 73 | return err 74 | } 75 | *m = res 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /pkg/gen/models/response_wrapperobject.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // ResponseWrapperobject ResponseWrapperobject 14 | // 15 | // swagger:model ResponseWrapperobject 16 | type ResponseWrapperobject struct { 17 | 18 | // Code 1: Success 19 | Code int32 `json:"code,omitempty"` 20 | 21 | // Response message 22 | Message string `json:"message,omitempty"` 23 | 24 | // Response result 25 | Result interface{} `json:"result,omitempty"` 26 | } 27 | 28 | // Validate validates this response wrapperobject 29 | func (m *ResponseWrapperobject) Validate(formats strfmt.Registry) error { 30 | return nil 31 | } 32 | 33 | // MarshalBinary interface implementation 34 | func (m *ResponseWrapperobject) MarshalBinary() ([]byte, error) { 35 | if m == nil { 36 | return nil, nil 37 | } 38 | return swag.WriteJSON(m) 39 | } 40 | 41 | // UnmarshalBinary interface implementation 42 | func (m *ResponseWrapperobject) UnmarshalBinary(b []byte) error { 43 | var res ResponseWrapperobject 44 | if err := swag.ReadJSON(b, &res); err != nil { 45 | return err 46 | } 47 | *m = res 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /pkg/gen/models/ta_token_security_response.go: -------------------------------------------------------------------------------- 1 | // Code generated by go-swagger; DO NOT EDIT. 2 | 3 | package models 4 | 5 | // This file was generated by the swagger tool. 6 | // Editing this file might prove futile when you re-run the swagger generate command 7 | 8 | import ( 9 | "github.com/go-openapi/strfmt" 10 | "github.com/go-openapi/swag" 11 | ) 12 | 13 | // TaTokenSecurityResponse TaTokenSecurityResponse 14 | // 15 | // swagger:model TaTokenSecurityResponse 16 | type TaTokenSecurityResponse struct { 17 | 18 | // data 19 | Data map[string]map[string]interface{} `json:"data,omitempty"` 20 | } 21 | 22 | // Validate validates this ta token security response 23 | func (m *TaTokenSecurityResponse) Validate(formats strfmt.Registry) error { 24 | return nil 25 | } 26 | 27 | // MarshalBinary interface implementation 28 | func (m *TaTokenSecurityResponse) MarshalBinary() ([]byte, error) { 29 | if m == nil { 30 | return nil, nil 31 | } 32 | return swag.WriteJSON(m) 33 | } 34 | 35 | // UnmarshalBinary interface implementation 36 | func (m *TaTokenSecurityResponse) UnmarshalBinary(b []byte) error { 37 | var res TaTokenSecurityResponse 38 | if err := swag.ReadJSON(b, &res); err != nil { 39 | return err 40 | } 41 | *m = res 42 | return nil 43 | } 44 | --------------------------------------------------------------------------------