Velo-Protocol
Search…
Setup stable credit
Inception of price stable credit

Parameters

In Testnet, we only support USD,SGD and THB
Name
Description
Required?
Validation
CollateralAssetCode
The collateral asset code
Yes
collateral asset code must be in collateralAssets
assetCode
The name of your custom asset.
Yes
    Unique for trusted partner.
    Correct format (1-7 alphanumeric characters).
peggedCurrency
The currency you want to pegged this asset to.
Yes
    Must be in [SGD, THB, USD].
peggedValue
The ratio of currency value vs 1 unit of custom asset.
Yes
    Must be a positive number greater than 0 and has less than or equal to 7 decimal places.
GO SDK
1
package main
2
​
3
import (
4
"context"
5
"github.com/velo-protocol/DRSv1/libs/vclient"
6
"log"
7
)
8
​
9
func main() {
10
​
11
client, err := vclient.NewClient("<evrynet rpc>", "<account private key>", ContractAddress{
12
DrsAddress: "<drs address>",
13
HeartAddress: "<heart address>",
14
})
15
​
16
if err != nil {
17
panic(err)
18
}
19
​
20
output, err := client.SetupCredit(context.Background(), &SetupCreditInput{
21
CollateralAssetCode: "VELO",
22
PeggedCurrency: "USD",
23
AssetCode: "vUSD",
24
PeggedValue: "1.0",
25
})
26
​
27
if err != nil {
28
panic(err)
29
}
30
​
31
log.Println("Transaction Hash: ", output.Tx.Hash().String())
32
log.Println("Block Number: ", output.Receipt.BlockNumber.String())
33
log.Println("Event.PeggedCurrency: ", output.Event.PeggedCurrency)
34
log.Println("Event.PeggedValue: ", output.Event.PeggedValue)
35
log.Println("Event.AssetCode: ", output.Event.AssetCode)
36
log.Println("Event.CollateralAssetCode: ", output.Event.CollateralAssetCode)
37
log.Println("Event.AssetAddress: ", output.Event.AssetAddress)
38
}
39
​
Copied!

What's next?

Now that you have set up your stable credit, go to Mint price-stable credit to mint it into existence!
Last modified 1yr ago
Copy link