diff --git a/ocp/common/mint.go b/ocp/common/mint.go index f4f1397..ec2fff3 100644 --- a/ocp/common/mint.go +++ b/ocp/common/mint.go @@ -28,10 +28,12 @@ var ( bogeyMintAccount, _ = NewAccountFromPublicKeyString(config.BogeyMintPublicKey) floatMintAccount, _ = NewAccountFromPublicKeyString(config.FloatMintPublicKey) jeffyMintAccount, _ = NewAccountFromPublicKeyString(config.JeffyMintPublicKey) + lightspeedMintAccount, _ = NewAccountFromPublicKeyString(config.LightspeedMintPublicKey) linksMintAccount, _ = NewAccountFromPublicKeyString(config.LinksMintPublicKey) marketCoinMintAccount, _ = NewAccountFromPublicKeyString(config.MarketCoinMintPublicKey) moonyMintAccount, _ = NewAccountFromPublicKeyString(config.MoonyMintPublicKey) testMintAccount, _ = NewAccountFromPublicKeyString(config.TestMintPublicKey) + toshiMintAccount, _ = NewAccountFromPublicKeyString(config.ToshiMintPublicKey) xpMintAccount, _ = NewAccountFromPublicKeyString(config.XpMintPublicKey) ) diff --git a/ocp/common/vm.go b/ocp/common/vm.go index 4245a90..e908f22 100644 --- a/ocp/common/vm.go +++ b/ocp/common/vm.go @@ -37,6 +37,10 @@ var ( jeffyVmAccount, _ = NewAccountFromPublicKeyString(config.JeffyVmAccountPublicKey) jeffyVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.JeffyVmOmnibusPublicKey) + lightspeedAuthority, _ = NewAccountFromPublicKeyString(config.LightspeedAuthorityPublicKey) + lightspeedVmAccount, _ = NewAccountFromPublicKeyString(config.LightspeedVmAccountPublicKey) + lightspeedVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.LightspeedVmOmnibusPublicKey) + linksAuthority, _ = NewAccountFromPublicKeyString(config.LinksAuthorityPublicKey) linksVmAccount, _ = NewAccountFromPublicKeyString(config.LinksVmAccountPublicKey) linksVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.LinksVmOmnibusPublicKey) @@ -53,6 +57,10 @@ var ( testVmAccount, _ = NewAccountFromPublicKeyString(config.TestVmAccountPublicKey) testVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.TestVmOmnibusPublicKey) + toshiAuthority, _ = NewAccountFromPublicKeyString(config.ToshiAuthorityPublicKey) + toshiVmAccount, _ = NewAccountFromPublicKeyString(config.ToshiVmAccountPublicKey) + toshiVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.ToshiVmOmnibusPublicKey) + xpAuthority, _ = NewAccountFromPublicKeyString(config.XpAuthorityPublicKey) xpVmAccount, _ = NewAccountFromPublicKeyString(config.XpVmAccountPublicKey) xpVmOmnibusAccount, _ = NewAccountFromPublicKeyString(config.XpVmOmnibusPublicKey) @@ -192,6 +200,25 @@ func GetVmConfigForMint(ctx context.Context, data ocp_data.Provider, mintAccount Omnibus: jeffyVmOmnibusAccount, Mint: mintAccount, }, nil + case lightspeedMintAccount.PublicKey().ToBase58(): + if lightspeedAuthority.PrivateKey() == nil { + vaultRecord, err := data.GetKey(ctx, lightspeedAuthority.PublicKey().ToBase58()) + if err != nil { + return nil, err + } + + lightspeedAuthority, err = NewAccountFromPrivateKeyString(vaultRecord.PrivateKey) + if err != nil { + return nil, err + } + } + + return &VmConfig{ + Authority: lightspeedAuthority, + Vm: lightspeedVmAccount, + Omnibus: lightspeedVmOmnibusAccount, + Mint: mintAccount, + }, nil case linksMintAccount.PublicKey().ToBase58(): if linksAuthority.PrivateKey() == nil { vaultRecord, err := data.GetKey(ctx, linksAuthority.PublicKey().ToBase58()) @@ -268,6 +295,25 @@ func GetVmConfigForMint(ctx context.Context, data ocp_data.Provider, mintAccount Omnibus: testVmOmnibusAccount, Mint: mintAccount, }, nil + case toshiMintAccount.PublicKey().ToBase58(): + if toshiAuthority.PrivateKey() == nil { + vaultRecord, err := data.GetKey(ctx, toshiAuthority.PublicKey().ToBase58()) + if err != nil { + return nil, err + } + + toshiAuthority, err = NewAccountFromPrivateKeyString(vaultRecord.PrivateKey) + if err != nil { + return nil, err + } + } + + return &VmConfig{ + Authority: toshiAuthority, + Vm: toshiVmAccount, + Omnibus: toshiVmOmnibusAccount, + Mint: mintAccount, + }, nil case xpMintAccount.PublicKey().ToBase58(): if xpAuthority.PrivateKey() == nil { vaultRecord, err := data.GetKey(ctx, xpAuthority.PublicKey().ToBase58()) diff --git a/ocp/config/config.go b/ocp/config/config.go index 7fb7038..5230503 100644 --- a/ocp/config/config.go +++ b/ocp/config/config.go @@ -55,6 +55,11 @@ const ( JeffyVmAccountPublicKey = "8rwgUXsLSq1Pn51UJs4NGVA1cTkemwBgKyWPfFYgnm3B" JeffyVmOmnibusPublicKey = "9XiqBPYSG2cBwpb8MqJeuFmLaQaAAr6gwikyBrPZDQ8R" + LightspeedMintPublicKey = "D4Srn1tRU69JWvPeNGre1AiF2swFhw6bpUNyH18Dfag6" + LightspeedAuthorityPublicKey = "1spdvA8EGbo56cnGUDzt2FjWCwEWF5hY3jw6yz8BcWw" + LightspeedVmAccountPublicKey = "GkYnW2md9TdWV7ZmSnShaFGg3S1e62UmJMDtnYXG4gpe" + LightspeedVmOmnibusPublicKey = "5sBqTvFrfu6hCJPrxEcQ2PXvzLTfy4UCJjYxDoJcaP19" + LinksMintPublicKey = "CPBcprSXXYerwh6LE6o3yc6NJqeZvm87GRSySgjTicE5" LinksAuthorityPublicKey = "1nkSmZ9VCLBiQqSuMdmv9SXQ2y5wTJVnBW5ZsESjvzd" LinksVmAccountPublicKey = "2s18j1EyBjRTcie48Hn6wyiZVCD9NrmkqH1JAKchoKT2" @@ -75,6 +80,11 @@ const ( TestVmAccountPublicKey = "CYtzE732LQ7YP9sngSPUQhCCTQ8GY14dmjWX2hXP16Np" TestVmOmnibusPublicKey = "65Ghp2FFPmdB3FLkC2NCKkBQ3RuXgmjZ56DDGZLVAZZa" + ToshiMintPublicKey = "EfBCnuhon2uWSRB3WFqmWRQumiHvhZXYbUZXUcHDHNyz" + ToshiAuthorityPublicKey = "tshUiGXuyb4ujawe2fByjissauSdgDjuysSeGoV9Aga" + ToshiVmAccountPublicKey = "9VpRW29UXcyAZkXJpk4Pqcdz2HyprKPft6pyBKH6LGC1" + ToshiVmOmnibusPublicKey = "AmYSBrPT5ozvxjYT7Gq3B3imRHGoEoNpZ7ZDzcxJ1xKp" + XpMintPublicKey = "6oZnhB1FPrUaDfhRCVZnbVWNKVx9wgj84vKGH7eMpzXL" XpAuthorityPublicKey = "xpTXV7BNXwsdvCaFKfeT4h6rSnKck2Bv5iBAFFS5Uwk" XpVmAccountPublicKey = "4qnCaQkGxCnr66cmPfpNfM2rxaaTMFSSfbY9gXZgCYdS" diff --git a/ocp/rpc/currency/worker.go b/ocp/rpc/currency/worker.go index a9032a6..05458e1 100644 --- a/ocp/rpc/currency/worker.go +++ b/ocp/rpc/currency/worker.go @@ -29,10 +29,12 @@ var ( bogeyMintAccount, _ = common.NewAccountFromPublicKeyString(config.BogeyMintPublicKey) floatMintAccount, _ = common.NewAccountFromPublicKeyString(config.FloatMintPublicKey) jeffyMintAccount, _ = common.NewAccountFromPublicKeyString(config.JeffyMintPublicKey) + lightspeedMintAccount, _ = common.NewAccountFromPublicKeyString(config.LightspeedMintPublicKey) linksMintAccount, _ = common.NewAccountFromPublicKeyString(config.LinksMintPublicKey) marketCoinMintAccount, _ = common.NewAccountFromPublicKeyString(config.MarketCoinMintPublicKey) moonyMintAccount, _ = common.NewAccountFromPublicKeyString(config.MoonyMintPublicKey) testMintAccount, _ = common.NewAccountFromPublicKeyString(config.TestMintPublicKey) + toshiMintAccount, _ = common.NewAccountFromPublicKeyString(config.ToshiMintPublicKey) xpMintAccount, _ = common.NewAccountFromPublicKeyString(config.XpMintPublicKey) ) @@ -45,10 +47,12 @@ var trackedLaunchpadMints = []*common.Account{ bogeyMintAccount, floatMintAccount, jeffyMintAccount, + lightspeedMintAccount, linksMintAccount, marketCoinMintAccount, moonyMintAccount, testMintAccount, + toshiMintAccount, xpMintAccount, } diff --git a/ocp/worker/currency/reserve.go b/ocp/worker/currency/reserve.go index eae3fed..c63ad17 100644 --- a/ocp/worker/currency/reserve.go +++ b/ocp/worker/currency/reserve.go @@ -235,6 +235,36 @@ func (p *reserveRuntime) UpdateAllLaunchpadCurrencyReserves(ctx context.Context) }) }() + err12 := func() error { + lightspeedMintAccount, _ := common.NewAccountFromPublicKeyString(config.LightspeedMintPublicKey) + + ciculatingSupply, ts, err := currency_util.GetLaunchpadCurrencyCirculatingSupply(ctx, p.data, lightspeedMintAccount) + if err != nil { + return err + } + + return p.data.PutCurrencyReserve(ctx, ¤cy.ReserveRecord{ + Mint: lightspeedMintAccount.PublicKey().ToBase58(), + SupplyFromBonding: ciculatingSupply, + Time: ts, + }) + }() + + err13 := func() error { + toshiMintAccount, _ := common.NewAccountFromPublicKeyString(config.ToshiMintPublicKey) + + ciculatingSupply, ts, err := currency_util.GetLaunchpadCurrencyCirculatingSupply(ctx, p.data, toshiMintAccount) + if err != nil { + return err + } + + return p.data.PutCurrencyReserve(ctx, ¤cy.ReserveRecord{ + Mint: toshiMintAccount.PublicKey().ToBase58(), + SupplyFromBonding: ciculatingSupply, + Time: ts, + }) + }() + if err1 != nil { return err1 } @@ -268,6 +298,12 @@ func (p *reserveRuntime) UpdateAllLaunchpadCurrencyReserves(ctx context.Context) if err11 != nil { return err11 } + if err12 != nil { + return err12 + } + if err13 != nil { + return err13 + } return nil } diff --git a/ocp/worker/geyser/handler.go b/ocp/worker/geyser/handler.go index 8e2040b..774bc21 100644 --- a/ocp/worker/geyser/handler.go +++ b/ocp/worker/geyser/handler.go @@ -91,10 +91,12 @@ func (h *TokenProgramAccountHandler) Handle(ctx context.Context, update *geyserp config.BogeyMintPublicKey, config.FloatMintPublicKey, config.JeffyMintPublicKey, + config.LightspeedMintPublicKey, config.LinksMintPublicKey, config.MarketCoinMintPublicKey, config.MoonyMintPublicKey, config.TestMintPublicKey, + config.ToshiMintPublicKey, config.XpMintPublicKey: // Not an ATA, so filter it out. It cannot be a VM deposit ATA if bytes.Equal(tokenAccount.PublicKey().ToBytes(), ownerAccount.PublicKey().ToBytes()) { diff --git a/ocp/worker/nonce/runtime.go b/ocp/worker/nonce/runtime.go index 4fe92ce..cd4ba53 100644 --- a/ocp/worker/nonce/runtime.go +++ b/ocp/worker/nonce/runtime.go @@ -76,10 +76,12 @@ func (p *runtime) Start(ctx context.Context, interval time.Duration) error { config.BogeyVmAccountPublicKey, config.FloatVmAccountPublicKey, config.JeffyVmAccountPublicKey, + config.LightspeedVmAccountPublicKey, config.LinksVmAccountPublicKey, config.MarketCoinVmAccountPublicKey, config.MoonyVmAccountPublicKey, config.TestVmAccountPublicKey, + config.ToshiVmAccountPublicKey, config.XpVmAccountPublicKey, } { for _, state := range []nonce.State{