Velo-Protocol
Search…
Mint stable credit
Mint the stable credit you set up

Parameters

Name
Description
Required?
Validation
AssetCode
The name of your custom asset.
Yes
​
    Unique for trusted partner.
    Correct format (1-7 alphanumeric characters).
collateralAmount
The amount of collateral that you which to exchange into the stable credit.
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/DRSv2_Evrynet/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
result, err := client.MintFromCollateralAmount(context.Background(), &MintFromCollateralAmountInput{
21
AssetCode: "vUSD",
22
CollateralAmount: "100",
23
})
24
if err != nil {
25
panic(err)
26
}
27
​
28
log.Println("Mint From Collateral Amount Transaction Hash: ", result.Tx.Hash().String())
29
log.Println("Asset Address: ", result.Event.AssetAddress)
30
log.Println("Asset Code: ", result.Event.AssetCode)
31
log.Println("Collateral Amount: ", result.Event.CollateralAmount)
32
log.Println("Collateral Asset Code: ", result.Event.CollateralAssetCode)
33
log.Println("Stable Credit Amount: ", result.Event.StableCreditAmount)
34
}
35
​
Copied!

What's next?

You now have stable credit. Play around with it! When you are ready, you can redeem the collateral back.
Last modified 1yr ago
Copy link