上海数据交易所系统接入Go SDK
import (
"github.com/yuhu-tech/chinadep-go-sdk"
)
client := chinadep.NewClient(appId, appSecret)
if err := client.ApplyToken(); err != nil {
// ...
}
if err := client.RefreshToken(); err != nil {
// ...
}
client := chinadep.NewClient("appId", "appSecret")
if err := client.AssetsRegister([]*chinadep.AssetsRegisterRequest{
{
MetaverseAssetType: chinadep.MetaverseAssetTypeDigitalAsset,
ChainId: "xxx",
// 其他参数
},
{
// 可填多个资产
},
}); err != nil {
// ...
}
// or
assets := make([]*chinadep.AssetsRegisterRequest, 0, n)
for i := 0; i < n; i++ {
assets = append(assets, &chinadep.AssetsRegisterRequest{
MetaverseAssetType: chinadep.MetaverseAssetTypeDigitalAsset,
ChainId: "xxx",
// 其他参数
})
}