Whitelist users

For user with account whitelisted as regulator only

Parameters

Name

Description

Required?

Validation

address

Address of the account you want to whitelist.

Yes

  • Stellar address format

role

Role of the user to be whitelisted. Should be in the list [Regulator, TrustedPartner, PriceFeeder]

Yes

  • Must be in [PRICE_FEEDER, TRUSTED_PARTNER, REGULATOR].

currency

Currency of the price the feeder want to feed

  • Required if role is price feeder

  • Leave blank for non-price feeder

  • Must be in [SGD, USD,THB]

GO SDK
GO SDK
package main
import (
"context"
"github.com/velo-protocol/DRSv1/libs/client"
"github.com/velo-protocol/DRSv1/libs/txnbuild"
"github.com/velo-protocol/DRSv1/testkit/helper"
"log"
)
func main() {
// Init Velo SDK From First Regulator Secret Key
client, err := vclient.NewDefaultTestNetClient("testnet-drsv1-0.velo.org", "<FIRST REGULATOR SECRET KEY>")
if err != nil {
panic(err)
}
defer func() {
_ = client.Close()
}()
// Using Velo SDK WhiteList Operation
result, err := client.Whitelist(context.Background(), vtxnbuild.Whitelist{
Address: "<ADDRESS>", // Ex: GC5F4E7IKMDFNOL7Z5WDHC42LBLLQL2UFY6KQALO2RRHC5EMJJRECPI3
Role: "<ROLE>", // Ex: PRICE_FEEDER (TRUSTED_PARTNER, REGULATOR, PRICE_FEEDER)
Currency: "<CURRENCY>", // Ex: USD (USD, THB, SGD)
})
if err != nil {
panic(err)
}
log.Println("Transaction Hash: ", result.HorizonResult.TransactionSuccessToString())
}

Error

SDK
SDK

Description

Message

Response code

Cannot parse XDR

The XDR message cannot be decoded

3

Source account not found in user table or does not have permission to perform setup credit issuance

The signer is not found or does not have sufficient permission to perform setup credit issuance

7

Signature and source account does not match

The signature and source account does not match

16

Source account is blank

sourceAccount for the transaction must not be blank

3

Source account format is incorrect

invalid sourceAccount format

3

Cannot connect to Stellar

Internal server error

13