mirror of
https://github.com/alexgo-io/peggedassets-server.git
synced 2026-01-12 16:53:14 +08:00
add VNX VCHF on the Stellar network
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user