Skip to content

Commit bcea9e1

Browse files
author
Jeff Yanta
committed
Implement additional CurrencyCreatorMintMetadata in GetMints
1 parent 77b5065 commit bcea9e1

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
filippo.io/edwards25519 v1.1.0
77
github.com/aws/aws-sdk-go-v2 v0.17.0
88
github.com/bits-and-blooms/bloom/v3 v3.1.0
9-
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825171158-5f02a8a5924b
9+
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825175844-b5a79ae87f0a
1010
github.com/code-payments/code-vm-indexer v0.1.11-0.20241028132209-23031e814fba
1111
github.com/emirpasic/gods v1.12.0
1212
github.com/envoyproxy/protoc-gen-validate v1.2.1

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I
8282
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
8383
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825171158-5f02a8a5924b h1:dwgr/zhcF7eZsBgRAX+AAjOhBdk9fEs1oO2csc0lI0U=
8484
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825171158-5f02a8a5924b/go.mod h1:ee6TzKbgMS42ZJgaFEMG3c4R3dGOiffHSu6MrY7WQvs=
85+
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825175528-dab522122ad6 h1:5OUwxIX95ReOieQGdeihVRiQajpZhmN5dsY6HgseZf8=
86+
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825175528-dab522122ad6/go.mod h1:ee6TzKbgMS42ZJgaFEMG3c4R3dGOiffHSu6MrY7WQvs=
87+
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825175844-b5a79ae87f0a h1:oVponiCqodzMIR/9gucEbxG4pCQSFwcUQnydJjPv01U=
88+
github.com/code-payments/code-protobuf-api v1.19.1-0.20250825175844-b5a79ae87f0a/go.mod h1:ee6TzKbgMS42ZJgaFEMG3c4R3dGOiffHSu6MrY7WQvs=
8589
github.com/code-payments/code-vm-indexer v0.1.11-0.20241028132209-23031e814fba h1:Bkp+gmeb6Y2PWXfkSCTMBGWkb2P1BujRDSjWeI+0j5I=
8690
github.com/code-payments/code-vm-indexer v0.1.11-0.20241028132209-23031e814fba/go.mod h1:jSiifpiBpyBQ8q2R0MGEbkSgWC6sbdRTyDBntmW+j1E=
8791
github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw=

pkg/code/server/currency/currency.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ func (s *currencyServer) GetMints(ctx context.Context, req *currencypb.GetMintsR
9797
}
9898
case "52MNGpgvydSwCtC2H4qeiZXZ1TxEuRVCRGa8LAfk2kSj": // todo: load from DB populated by worker
9999
authorityAccount, _ := common.NewAccountFromPublicKeyString("jfy1btcfsjSn2WCqLVaxiEjp4zgmemGyRsdCPbPwnZV")
100+
vmAccount, _ := common.NewAccountFromPublicKeyString("Bii3UFB9DzPq6UxgewF5iv9h1Gi8ZnP6mr7PtocHGNta")
101+
seed, _ := common.NewAccountFromPublicKeyString("H7WNaHtCa5h2k7AwZ8DbdLfM6bU2bi2jmWiUkFqgeBYk")
102+
currencyConfigAccount, _ := common.NewAccountFromPublicKeyString("BDfFyqfasvty3cjSbC2qZx2Dmr4vhhVBt9Ban5XsTcEH")
103+
liquidityPoolAccount, _ := common.NewAccountFromPublicKeyString("5cH99GSbr9ECP8gd1vLiAAFPHt1VeCNKzzrPFGmAB61c")
100104
jeffyVaultAccount, _ := common.NewAccountFromPublicKeyString("BFDanLgELhpCCGTtaa7c8WGxTXcTxgwkf9DMQd4qheSK")
101105
coreMintVaultAccount, _ := common.NewAccountFromPublicKeyString("A9NVHVuorNL4y2YFxdwdU3Hqozxw1Y1YJ81ZPxJsRrT4")
102-
vmAccount, _ := common.NewAccountFromPublicKeyString("Bii3UFB9DzPq6UxgewF5iv9h1Gi8ZnP6mr7PtocHGNta")
106+
coreMintFeesAccount, _ := common.NewAccountFromPublicKeyString("5EcVYL8jHRKeeQqg6eYVBzc73ecH1PFzzaavoQBKRYy5")
103107

104108
var tokenAccount token.Account
105109
ai, err := s.data.GetBlockchainAccountInfo(ctx, jeffyVaultAccount.PublicKey().ToBase58(), solana.CommitmentFinalized)
@@ -129,17 +133,23 @@ func (s *currencyServer) GetMints(ctx context.Context, req *currencypb.GetMintsR
129133
LockDurationInDays: 21,
130134
},
131135
CurrencyCreatorMetadata: &currencypb.CurrencyCreatorMintMetadata{
136+
CurrencyConfig: currencyConfigAccount.ToProto(),
137+
LiquidityPool: liquidityPoolAccount.ToProto(),
138+
Seed: seed.ToProto(),
139+
Authority: authorityAccount.ToProto(),
140+
MintVault: jeffyVaultAccount.ToProto(),
141+
CoreMintVault: coreMintVaultAccount.ToProto(),
142+
CoreMintFees: coreMintFeesAccount.ToProto(),
132143
SupplyFromBonding: currencycreator.DefaultMintMaxQuarkSupply - jeffyVaultBalance,
133144
CoreMintTokensLocked: coreMintVaultBalance,
134-
BuyFeeBps: currencycreator.DefaultBuyFeeBps,
135145
SellFeeBps: currencycreator.DefaultSellFeeBps,
136146
},
137147
}
138148
default:
139149
return &currencypb.GetMintsResponse{Result: currencypb.GetMintsResponse_NOT_FOUND}, nil
140150
}
141151

142-
resp.MetadataByAddress[common.CoreMintAccount.PublicKey().ToBase58()] = protoMetadata
152+
resp.MetadataByAddress[mintAccount.PublicKey().ToBase58()] = protoMetadata
143153
}
144154
return resp, nil
145155
}

0 commit comments

Comments
 (0)