1212 CoreMintVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .CoreMintVmOmnibusPublicKey )
1313
1414 // todo: DB store to track VM per mint
15+
16+ bitsAuthority , _ = NewAccountFromPublicKeyString (config .BitsAuthorityPublicKey )
17+ bitsVmAccount , _ = NewAccountFromPublicKeyString (config .BitsVmAccountPublicKey )
18+ bitsVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .BitsVmOmnibusPublicKey )
19+
20+ bogeyAuthority , _ = NewAccountFromPublicKeyString (config .BogeyAuthorityPublicKey )
21+ bogeyVmAccount , _ = NewAccountFromPublicKeyString (config .BogeyVmAccountPublicKey )
22+ bogeyVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .BogeyVmOmnibusPublicKey )
23+
24+ floatAuthority , _ = NewAccountFromPublicKeyString (config .FloatAuthorityPublicKey )
25+ floatVmAccount , _ = NewAccountFromPublicKeyString (config .FloatVmAccountPublicKey )
26+ floatVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .FloatVmOmnibusPublicKey )
27+
1528 jeffyAuthority , _ = NewAccountFromPublicKeyString (config .JeffyAuthorityPublicKey )
1629 jeffyVmAccount , _ = NewAccountFromPublicKeyString (config .JeffyVmAccountPublicKey )
1730 jeffyVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .JeffyVmOmnibusPublicKey )
31+
32+ marketCoinAuthority , _ = NewAccountFromPublicKeyString (config .MarketCoinAuthorityPublicKey )
33+ marketCoinVmAccount , _ = NewAccountFromPublicKeyString (config .MarketCoinVmAccountPublicKey )
34+ marketCoinVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .MarketCoinVmOmnibusPublicKey )
35+
36+ xpAuthority , _ = NewAccountFromPublicKeyString (config .XpAuthorityPublicKey )
37+ xpVmAccount , _ = NewAccountFromPublicKeyString (config .XpVmAccountPublicKey )
38+ xpVmOmnibusAccount , _ = NewAccountFromPublicKeyString (config .XpVmOmnibusPublicKey )
1839)
1940
2041type VmConfig struct {
@@ -37,6 +58,63 @@ func GetVmConfigForMint(ctx context.Context, data ocp_data.Provider, mintAccount
3758 Omnibus : CoreMintVmOmnibusAccount ,
3859 Mint : CoreMintAccount ,
3960 }, nil
61+ case bitsMintAccount .PublicKey ().ToBase58 ():
62+ if bitsAuthority .PrivateKey () == nil {
63+ vaultRecord , err := data .GetKey (ctx , bitsAuthority .PublicKey ().ToBase58 ())
64+ if err != nil {
65+ return nil , err
66+ }
67+
68+ bitsAuthority , err = NewAccountFromPrivateKeyString (vaultRecord .PrivateKey )
69+ if err != nil {
70+ return nil , err
71+ }
72+ }
73+
74+ return & VmConfig {
75+ Authority : bitsAuthority ,
76+ Vm : bitsVmAccount ,
77+ Omnibus : bitsVmOmnibusAccount ,
78+ Mint : mintAccount ,
79+ }, nil
80+ case bogeyMintAccount .PublicKey ().ToBase58 ():
81+ if bogeyAuthority .PrivateKey () == nil {
82+ vaultRecord , err := data .GetKey (ctx , bogeyAuthority .PublicKey ().ToBase58 ())
83+ if err != nil {
84+ return nil , err
85+ }
86+
87+ bogeyAuthority , err = NewAccountFromPrivateKeyString (vaultRecord .PrivateKey )
88+ if err != nil {
89+ return nil , err
90+ }
91+ }
92+
93+ return & VmConfig {
94+ Authority : bogeyAuthority ,
95+ Vm : bogeyVmAccount ,
96+ Omnibus : bogeyVmOmnibusAccount ,
97+ Mint : mintAccount ,
98+ }, nil
99+ case floatMintAccount .PublicKey ().ToBase58 ():
100+ if floatAuthority .PrivateKey () == nil {
101+ vaultRecord , err := data .GetKey (ctx , floatAuthority .PublicKey ().ToBase58 ())
102+ if err != nil {
103+ return nil , err
104+ }
105+
106+ floatAuthority , err = NewAccountFromPrivateKeyString (vaultRecord .PrivateKey )
107+ if err != nil {
108+ return nil , err
109+ }
110+ }
111+
112+ return & VmConfig {
113+ Authority : floatAuthority ,
114+ Vm : floatVmAccount ,
115+ Omnibus : floatVmOmnibusAccount ,
116+ Mint : mintAccount ,
117+ }, nil
40118 case jeffyMintAccount .PublicKey ().ToBase58 ():
41119 if jeffyAuthority .PrivateKey () == nil {
42120 vaultRecord , err := data .GetKey (ctx , jeffyAuthority .PublicKey ().ToBase58 ())
@@ -56,6 +134,44 @@ func GetVmConfigForMint(ctx context.Context, data ocp_data.Provider, mintAccount
56134 Omnibus : jeffyVmOmnibusAccount ,
57135 Mint : mintAccount ,
58136 }, nil
137+ case marketCoinMintAccount .PublicKey ().ToBase58 ():
138+ if marketCoinAuthority .PrivateKey () == nil {
139+ vaultRecord , err := data .GetKey (ctx , marketCoinAuthority .PublicKey ().ToBase58 ())
140+ if err != nil {
141+ return nil , err
142+ }
143+
144+ marketCoinAuthority , err = NewAccountFromPrivateKeyString (vaultRecord .PrivateKey )
145+ if err != nil {
146+ return nil , err
147+ }
148+ }
149+
150+ return & VmConfig {
151+ Authority : marketCoinAuthority ,
152+ Vm : marketCoinVmAccount ,
153+ Omnibus : marketCoinVmOmnibusAccount ,
154+ Mint : mintAccount ,
155+ }, nil
156+ case xpMintAccount .PublicKey ().ToBase58 ():
157+ if xpAuthority .PrivateKey () == nil {
158+ vaultRecord , err := data .GetKey (ctx , xpAuthority .PublicKey ().ToBase58 ())
159+ if err != nil {
160+ return nil , err
161+ }
162+
163+ xpAuthority , err = NewAccountFromPrivateKeyString (vaultRecord .PrivateKey )
164+ if err != nil {
165+ return nil , err
166+ }
167+ }
168+
169+ return & VmConfig {
170+ Authority : xpAuthority ,
171+ Vm : xpVmAccount ,
172+ Omnibus : xpVmOmnibusAccount ,
173+ Mint : mintAccount ,
174+ }, nil
59175 default :
60176 return nil , ErrUnsupportedMint
61177 }
0 commit comments