Account
Methods
GetAccount
GetAccount(address: string) => (account: Account)
No Authentication Required
- Typescript
- Curl
- Golang
import {
SkyWeaverAPI
} from 'skyweaver';
const client = new SkyWeaverAPI('https://api.skyweaver.net', fetch);
client.getAccount(
{
address: '0x0000000000000000000000000000000000000000',
},
).then(account => console.log('ACCOUNT FOUND ', { account }))
.catch(err => console.log('ACCOUNT NOT FOUND ', err))
curl -X POST -H 'content-type: application/json' \
-d '{"address":"0x0000000000000000000000000000000000000000"}' \
'https://api.skyweaver.net/rpc/SkyWeaverAPI/GetAccount'
package main
import (
"context"
"net/http"
"github.com/horizon-games/skyweaverapi/proto"
)
var DefaultHTTPClient = &http.Client{}
func newAPIClient(baseURL string) (proto.SkyWeaverAPI, error) {
client := proto.NewSkyWeaverAPIClient(baseURL, DefaultHTTPClient)
return client, nil
}
func main(){
ctx := context.Background()
client, err := newAPIClient("base url")
account, err := client.GetAccount(ctx, '0x0000000000000000000000000000000000000000')
// do something with resp
}
GetAccountStats
GetAccountStats(address: string) => (constructedStats: []AccountStat, discoveryStats: []AccountStat)
No Authentication Required
- Typescript
- Curl
- Golang
import {
SkyWeaverAPI
} from 'skyweaver';
const client = new SkyWeaverAPI('https://api.skyweaver.net', fetch);
client.getAccountStats(
{
address: '0x0000000000000000000000000000000000000000',
},
).then(account => console.log('ACCOUNT FOUND ', { account }))
.catch(err => console.log('ACCOUNT NOT FOUND ', err))
curl -X POST -H 'content-type: application/json' \
-d '{"address":"0x0000000000000000000000000000000000000000"}' \
'https://api.skyweaver.net/rpc/SkyWeaverAPI/GetAccountStats'
package main
import (
"context"
"net/http"
"github.com/horizon-games/skyweaverapi/proto"
)
var DefaultHTTPClient = &http.Client{}
func newAPIClient(baseURL string) (proto.SkyWeaverAPI, error) {
client := proto.NewSkyWeaverAPIClient(baseURL, DefaultHTTPClient)
return client, nil
}
func main(){
ctx := context.Background()
client, err := newAPIClient("base url")
discoveryStats, constructedStats, err := client.GetAccountStats(ctx, '0x0000000000000000000000000000000000000000')
// do something with response
}