add VNX VCHF on the Stellar network

This commit is contained in:
Elliot Voris
2024-06-26 14:39:35 -05:00
parent 0debb0b5dc
commit 061e2c1f43

View File

@@ -7,6 +7,7 @@ import {
PeggedIssuanceAdapter, ChainContracts,
} from "../peggedAsset.type";
import { getTotalSupply as tezosGetTotalSupply } from "../helper/tezos";
import { getTotalSupply as stellarGetTotalSupply } from "../helper/stellar";
const chainContracts: ChainContracts = {
@@ -28,6 +29,9 @@ const chainContracts: ChainContracts = {
tezos: {
issued: ["KT1LssxZqfQtRFv1CRkzX9E9gzap9iFrtWmq"],
},
stellar: {
issued: ["VCHF:GDXLSLCOPPHTWOQXLLKSVN4VN3G67WD2ENU7UMVAROEYVJLSPSEWXIZN"],
},
};
async function chainMinted(chain: string, decimals: number) {
@@ -71,6 +75,19 @@ async function tezosMinted(contract: string) {
};
}
async function stellarMinted(assetID: string) {
return async function (
_timestamp: number,
_ethBlock: number,
_chainBlocks: ChainBlocks
) {
let balances = {} as Balances;
const totalSupply = await stellarGetTotalSupply(assetID);
sumSingleBalance(balances, "peggedCHF", totalSupply, "issued", false);
return balances;
};
}
const adapter: PeggedIssuanceAdapter = {
ethereum: {
minted: chainMinted("ethereum", 18),
@@ -90,5 +107,8 @@ const adapter: PeggedIssuanceAdapter = {
tezos: {
minted: tezosMinted(chainContracts.tezos.issued[0]),
},
stellar: {
minted: stellarMinted(chainContracts.stellar.issued[0]),
},
};
export default adapter;