@@ -37,12 +37,12 @@ const (
3737 // BASE_URL BASE_URL
3838 BASE_URL = config .BASE_RPC
3939 // TX_PARAMS TX_PARAMS
40- TX_PARAMS = "service=bottos&method=CoreApi.PushTrx &request=%s"
40+ TX_PARAMS = "service=bottos&method=Chain.SendTransaction &request=%s"
4141)
4242
4343// BlockHeader get block header
4444func BlockHeader () (* user_proto.BlockHeader , error ) {
45- params := `service=bottos&method=CoreApi.QueryChainInfo &request={}`
45+ params := `service=bottos&method=Chain.GetInfo &request={}`
4646 resp , err := http .Post (BASE_URL , "application/x-www-form-urlencoded" ,
4747 strings .NewReader (params ))
4848 if err != nil {
@@ -135,7 +135,7 @@ func PushTransaction(i interface{}) (*bean.CoreCommonReturn, error) {
135135
136136// AccountInfo get account info
137137func AccountInfo (account string ) (* user_proto.AccountInfoData , error ) {
138- params := `service=bottos&method=CoreApi.QueryAccount &request={"account_name":"%s"}`
138+ params := `service=bottos&method=Chain.GetAccount &request={"account_name":"%s"}`
139139 resp , err := http .Post (BASE_URL , "application/x-www-form-urlencoded" ,
140140 strings .NewReader (fmt .Sprintf (params , string (account ))))
141141 if err != nil {
@@ -197,10 +197,10 @@ func AccountInfo(account string) (*user_proto.AccountInfoData, error) {
197197 }
198198}
199199
200- // QueryObject get Object
201- func QueryObject (contract , object , key string ) ([]byte , error ) {
202- log .Info ("Start QueryObject ." )
203- params := `service=bottos&method=CoreApi.QueryObject &request={"contract":"%s","object":"%s","key":"%s"}`
200+ // GetKeyValue get Object
201+ func GetKeyValue (contract , object , key string ) ([]byte , error ) {
202+ log .Info ("Start GetKeyValue ." )
203+ params := `service=bottos&method=Chain.GetKeyValue &request={"contract":"%s","object":"%s","key":"%s"}`
204204 resp , err := http .Post (BASE_URL , "application/x-www-form-urlencoded" ,
205205 strings .NewReader (fmt .Sprintf (params , contract , object , key )))
206206 //strings.NewReader(fmt.Sprintf(params, "bottoscontract", "DTO", "bbb")))
@@ -237,7 +237,7 @@ func QueryObject(contract, object, key string) ([]byte, error) {
237237 return nil , err
238238 }
239239
240- var queryObjectRes = & bean.QueryObjectResult {}
240+ var queryObjectRes = & bean.GetKeyValueResult {}
241241 err = json .Unmarshal (resultBuf , queryObjectRes )
242242 if err != nil {
243243 log .Error (err )
0 commit comments