File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/adapters/peggedAssets/usn Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { bridgedSupply } from "../helper/getSupply";
1212const chainContracts : ChainContracts = {
1313 near : {
1414 issued : [ "usn" ] ,
15+ unreleased : [ "usn-burn.near" ]
1516 } ,
1617 aurora : {
1718 bridgedFromNear : [ "0x5183e1B1091804BC2602586919E6880ac1cf2896" ] ,
@@ -40,9 +41,32 @@ async function chainMinted(chain: string, decimals: number) {
4041 } ;
4142}
4243
44+ async function chainUnreleased ( chain : string , decimals : number ) {
45+ return async function (
46+ _timestamp : number ,
47+ _ethBlock : number ,
48+ _chainBlocks : ChainBlocks
49+ ) {
50+ let balances = { } as Balances ;
51+ for ( let issued of chainContracts [ chain ] . issued ) {
52+ const totalSupply = await call ( issued , "ft_balance_of" , { account_id : chainContracts [ chain ] . unreleased [ 0 ] } ) ;
53+
54+ sumSingleBalance (
55+ balances ,
56+ "peggedUSD" ,
57+ totalSupply / 10 ** decimals ,
58+ "issued" ,
59+ false
60+ ) ;
61+ }
62+ return balances ;
63+ } ;
64+ }
65+
4366const adapter : PeggedIssuanceAdapter = {
4467 near : {
4568 minted : chainMinted ( "near" , 18 ) ,
69+ unreleased : chainUnreleased ( "near" , 18 )
4670 } ,
4771 aurora : {
4872 near : bridgedSupply ( "aurora" , 18 , chainContracts . aurora . bridgedFromNear ) ,
You can’t perform that action at this time.
0 commit comments