diff --git a/foundation/rpc_server/asset_converter.go b/foundation/rpc_server/asset_converter.go index 6cf3004..043f173 100644 --- a/foundation/rpc_server/asset_converter.go +++ b/foundation/rpc_server/asset_converter.go @@ -1,6 +1,8 @@ package rpc import ( + "fmt" + "github.com/pkg/errors" "github.com/qubic/go-node-connector/types" "github.com/qubic/qubic-http/protobuff" @@ -78,3 +80,30 @@ func convertAssetPossession(source types.AssetPossession) (*protobuff.AssetPosse return &assetPossession, nil } + +func convertContractIpo(source types.ContractIpo) (*protobuff.IpoBidData, error) { + + ipoBidData := protobuff.IpoBidData{ + ContractIndex: source.ContractIndex, + TickNumber: source.TickNumber, + Bids: make(map[int32]*protobuff.IpoBid), + } + + for index := 0; index < types.NumberOfComputors; index++ { + if source.Prices[index] == 0 { + continue + } + + identity, err := new(types.Identity).FromPubKey(source.PubKeys[index], false) + if err != nil { + return nil, fmt.Errorf("failed to get identity for bid: %w", err) + } + + ipoBidData.Bids[int32(index)] = &protobuff.IpoBid{ + Identity: identity.String(), + Amount: source.Prices[index], + } + } + + return &ipoBidData, nil +} diff --git a/foundation/rpc_server/asset_converter_test.go b/foundation/rpc_server/asset_converter_test.go index 0308b3d..7d4c45f 100644 --- a/foundation/rpc_server/asset_converter_test.go +++ b/foundation/rpc_server/asset_converter_test.go @@ -109,3 +109,49 @@ func TestAssetConverter_convertAssetPossession(t *testing.T) { }, converted) } + +func TestAssetConverter_convertContractIpo(t *testing.T) { + + id := types.Identity("TESTIOGXQKYYZEQXOXFSWWAJNYLCDBWFAPNBLNBUZFHDVFMYPJZXGMEEJEGI") + pubKey, err := id.ToPubKey(false) + assert.NoError(t, err) + + source := types.ContractIpo{ + ContractIndex: 5, + TickNumber: 100, + } + + // set one bid with a known identity and price + source.PubKeys[0] = pubKey + source.Prices[0] = 1000 + + // set another bid at a different index + source.PubKeys[10] = pubKey + source.Prices[10] = 2000 + + // index 1 has zero price, should be skipped + source.PubKeys[1] = pubKey + source.Prices[1] = 0 + + converted, err := convertContractIpo(source) + assert.NoError(t, err) + + assert.Equal(t, uint32(5), converted.ContractIndex) + assert.Equal(t, uint32(100), converted.TickNumber) + + // only 2 bids should be present (zero-price skipped) + assert.Len(t, converted.Bids, 2) + + assert.Equal(t, &protobuff.IpoBid{ + Identity: "TESTIOGXQKYYZEQXOXFSWWAJNYLCDBWFAPNBLNBUZFHDVFMYPJZXGMEEJEGI", + Amount: 1000, + }, converted.Bids[0]) + + assert.Equal(t, &protobuff.IpoBid{ + Identity: "TESTIOGXQKYYZEQXOXFSWWAJNYLCDBWFAPNBLNBUZFHDVFMYPJZXGMEEJEGI", + Amount: 2000, + }, converted.Bids[10]) + + // zero-price bid should not be in the map + assert.Nil(t, converted.Bids[1]) +} diff --git a/foundation/rpc_server/rpc_server.go b/foundation/rpc_server/rpc_server.go index a5d4b6a..9d01b55 100644 --- a/foundation/rpc_server/rpc_server.go +++ b/foundation/rpc_server/rpc_server.go @@ -699,6 +699,28 @@ func (s *Server) GetActiveIpos(ctx context.Context, _ *emptypb.Empty) (*protobuf return &protobuff.GetActiveIposResponse{Ipos: ipos}, nil } +func (s *Server) GetContractIpoBids(ctx context.Context, request *protobuff.GetContractIpoBidsRequest) (*protobuff.GetContractIpoBidsResponse, error) { + + client, err := s.qPool.Get() + if err != nil { + return nil, status.Errorf(codes.Internal, "getting connection from pool: %v", err) + } + + nodeResponse, err := client.GetContractIpo(ctx, request.ContractIndex) + if err != nil { + s.qPool.Close(client) + return nil, status.Errorf(codes.Internal, "getting contract ipo data: %v", err) + } + s.qPool.Put(client) + + ipoBidData, err := convertContractIpo(nodeResponse) + if err != nil { + return nil, status.Errorf(codes.Internal, "converting node response: %v", err) + } + + return &protobuff.GetContractIpoBidsResponse{BidData: ipoBidData}, nil +} + func (s *Server) Start() error { srv := grpc.NewServer( grpc.MaxRecvMsgSize(600*1024*1024), diff --git a/go.mod b/go.mod index a830e74..a1c459c 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/gnostic v0.7.1 github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 github.com/pkg/errors v0.9.1 - github.com/qubic/go-node-connector v0.15.0 + github.com/qubic/go-node-connector v0.17.0 github.com/qubic/go-schnorrq v1.0.1 github.com/stretchr/testify v1.11.1 google.golang.org/genproto/googleapis/api v0.0.0-20251103181224-f26f9409b101 diff --git a/go.sum b/go.sum index 9123c09..024d7c7 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/qubic/go-node-connector v0.15.0 h1:fbd+wgEBtKMzmlsRdbYAKAGnDxew4HLjAPj4whGKWjY= -github.com/qubic/go-node-connector v0.15.0/go.mod h1:GOQGJ6IKhm3CU62bfLJJbBerjYmt6NNhDKzxC1i7HhU= +github.com/qubic/go-node-connector v0.17.0 h1:ifsqODfO3vw16av0GGQBcq8qgcQXfYD1Y4/xIvlasx8= +github.com/qubic/go-node-connector v0.17.0/go.mod h1:GOQGJ6IKhm3CU62bfLJJbBerjYmt6NNhDKzxC1i7HhU= github.com/qubic/go-schnorrq v1.0.1 h1:F0R/BQVf+O7Bp57NGJmc3uXlqsaIzerg/1bmU4jMLLE= github.com/qubic/go-schnorrq v1.0.1/go.mod h1:j2qw/zHiyjH9GAScAAETWpZk6iELbjYnzIg7CQwc5wM= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= diff --git a/protobuff/qubic.openapi.yaml b/protobuff/qubic.openapi.yaml index 1a520aa..be05062 100644 --- a/protobuff/qubic.openapi.yaml +++ b/protobuff/qubic.openapi.yaml @@ -3,747 +3,793 @@ openapi: 3.0.3 info: - title: Qubic Live API - description: Bridge service for Qubic network operations. - version: 1.0.0 + title: Qubic Live API + description: Bridge service for Qubic network operations. + version: 1.0.0 servers: - - url: https://rpc.qubic.org/live/v1 + - url: https://rpc.qubic.org/live/v1 paths: - /assets/issuances: - get: - tags: - - QubicLiveService - - Assets - summary: Search Asset Issuances - description: Returns a list of issued assets filtered by issuer identity and asset name. - operationId: QubicLiveService_GetIssuedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - schema: - type: string - - name: assetName - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetIssuances' - /assets/issuances/{index}: - get: - tags: - - QubicLiveService - - Assets - summary: Get Asset Issuance By Index - description: Returns an asset issuance by universe index. - operationId: QubicLiveService_GetIssuedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetIssuance' - /assets/ownerships: - get: - tags: - - QubicLiveService - - Assets - summary: Search Asset Ownerships - description: Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract. - operationId: QubicLiveService_GetOwnedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - description: Identity of the issuer. Defaults to the zero address (smart contract shares). - schema: - type: string - - name: assetName - in: query - description: Name of the asset (required). - schema: - type: string - - name: ownerIdentity - in: query - description: Identity of the owner of the asset (optional). - schema: - type: string - - name: ownershipManagingContract - in: query - description: Index of the contract that manages the ownership (optional). - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetOwnerships' - /assets/ownerships/{index}: - get: - tags: - - QubicLiveService - - Assets - summary: Get Asset Ownership By Index - description: Returns an asset ownership by universe index. - operationId: QubicLiveService_GetOwnedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetOwnership' - /assets/possessions: - get: - tags: - - QubicLiveService - - Assets - summary: Search Asset Possessions - description: Returns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts. - operationId: QubicLiveService_GetPossessedAssetsByFilter - parameters: - - name: issuerIdentity - in: query - description: Identity of the issuer (required). Defaults to the zero address (smart contract shares). - schema: - type: string - - name: assetName - in: query - description: Name of the asset (required). - schema: - type: string - - name: ownerIdentity - in: query - description: Identity of the owner of the asset (optional). - schema: - type: string - - name: possessorIdentity - in: query - description: Identity of the possessor of the asset (optional). - schema: - type: string - - name: ownershipManagingContract - in: query - description: Index of the contract that manages the ownership (optional). - schema: - type: integer - format: uint32 - - name: possessionManagingContract - in: query - description: Index of the contract that manages the possession (optional). - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetPossessions' - /assets/possessions/{index}: - get: - tags: - - QubicLiveService - - Assets - summary: Get Asset Possession By Index - description: Returns an asset possession by universe index. - operationId: QubicLiveService_GetPossessedAssetByUniverseIndex - parameters: - - name: index - in: path - required: true - schema: - type: integer - format: uint32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AssetPossession' - /assets/{identity}/issued: - get: - tags: - - QubicLiveService - - Assets - summary: List Issued Assets - description: Gets assets issued by the specified identity. - operationId: QubicLiveService_GetIssuedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/IssuedAssetsResponse' - /assets/{identity}/owned: - get: - tags: - - QubicLiveService - - Assets - summary: List Owned Assets - description: Gets assets that are owned by the specified identity. - operationId: QubicLiveService_GetOwnedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/OwnedAssetsResponse' - /assets/{identity}/possessed: - get: - tags: - - QubicLiveService - - Assets - summary: List Possessed Assets - description: Gets assets that are possessed by the specified identity. - operationId: QubicLiveService_GetPossessedAssets - parameters: - - name: identity - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PossessedAssetsResponse' - /balances/{id}: - get: - tags: - - QubicLiveService - - Accounts - summary: Get Balance - description: Gets the balance of the specified identity. - operationId: QubicLiveService_GetBalance - parameters: - - name: id - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetBalanceResponse' - /block-height: - get: - tags: - - QubicLiveService - - Network - summary: Get Block Height - description: 'Deprecated: use /tick-info instead.' - operationId: QubicLiveService_GetBlockHeight - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetBlockHeightResponse' - deprecated: true - /broadcast-transaction: - post: - tags: - - QubicLiveService - - Transactions - summary: Broadcast Transaction - description: Broadcasts a transaction to the network. - operationId: QubicLiveService_BroadcastTransaction - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BroadcastTransactionRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/BroadcastTransactionResponse' - /ipos/active: - get: - tags: - - QubicLiveService - - Smart Contracts - summary: Get Active IPOs - description: Returns a list of IPOs that are active in the current epoch. - operationId: QubicLiveService_GetActiveIpos - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetActiveIposResponse' - /querySmartContract: - post: - tags: - - QubicLiveService - - Smart Contracts - summary: Query Smart Contract - description: Queries a smart contract function. - operationId: QubicLiveService_QuerySmartContract - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySmartContractRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySmartContractResponse' - /tick-info: - get: - tags: - - QubicLiveService - - Network - summary: Get Tick Info - description: Gets the current tick information. - operationId: QubicLiveService_GetTickInfo - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetTickInfoResponse' + /assets/issuances: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Issuances + description: Returns a list of issued assets filtered by issuer identity and asset name. + operationId: QubicLiveService_GetIssuedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + schema: + type: string + - name: assetName + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetIssuances' + /assets/issuances/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Issuance By Index + description: Returns an asset issuance by universe index. + operationId: QubicLiveService_GetIssuedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetIssuance' + /assets/ownerships: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Ownerships + description: Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract. + operationId: QubicLiveService_GetOwnedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + description: Identity of the issuer. Defaults to the zero address (smart contract shares). + schema: + type: string + - name: assetName + in: query + description: Name of the asset (required). + schema: + type: string + - name: ownerIdentity + in: query + description: Identity of the owner of the asset (optional). + schema: + type: string + - name: ownershipManagingContract + in: query + description: Index of the contract that manages the ownership (optional). + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetOwnerships' + /assets/ownerships/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Ownership By Index + description: Returns an asset ownership by universe index. + operationId: QubicLiveService_GetOwnedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetOwnership' + /assets/possessions: + get: + tags: + - QubicLiveService + - Assets + summary: Search Asset Possessions + description: Returns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts. + operationId: QubicLiveService_GetPossessedAssetsByFilter + parameters: + - name: issuerIdentity + in: query + description: Identity of the issuer (required). Defaults to the zero address (smart contract shares). + schema: + type: string + - name: assetName + in: query + description: Name of the asset (required). + schema: + type: string + - name: ownerIdentity + in: query + description: Identity of the owner of the asset (optional). + schema: + type: string + - name: possessorIdentity + in: query + description: Identity of the possessor of the asset (optional). + schema: + type: string + - name: ownershipManagingContract + in: query + description: Index of the contract that manages the ownership (optional). + schema: + type: integer + format: uint32 + - name: possessionManagingContract + in: query + description: Index of the contract that manages the possession (optional). + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetPossessions' + /assets/possessions/{index}: + get: + tags: + - QubicLiveService + - Assets + summary: Get Asset Possession By Index + description: Returns an asset possession by universe index. + operationId: QubicLiveService_GetPossessedAssetByUniverseIndex + parameters: + - name: index + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AssetPossession' + /assets/{identity}/issued: + get: + tags: + - QubicLiveService + - Assets + summary: List Issued Assets + description: Gets assets issued by the specified identity. + operationId: QubicLiveService_GetIssuedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IssuedAssetsResponse' + /assets/{identity}/owned: + get: + tags: + - QubicLiveService + - Assets + summary: List Owned Assets + description: Gets assets that are owned by the specified identity. + operationId: QubicLiveService_GetOwnedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OwnedAssetsResponse' + /assets/{identity}/possessed: + get: + tags: + - QubicLiveService + - Assets + summary: List Possessed Assets + description: Gets assets that are possessed by the specified identity. + operationId: QubicLiveService_GetPossessedAssets + parameters: + - name: identity + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PossessedAssetsResponse' + /balances/{id}: + get: + tags: + - QubicLiveService + - Accounts + summary: Get Balance + description: Gets the balance of the specified identity. + operationId: QubicLiveService_GetBalance + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceResponse' + /block-height: + get: + tags: + - QubicLiveService + - Network + summary: Get Block Height + description: 'Deprecated: use /tick-info instead.' + operationId: QubicLiveService_GetBlockHeight + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockHeightResponse' + deprecated: true + /broadcast-transaction: + post: + tags: + - QubicLiveService + - Transactions + summary: Broadcast Transaction + description: Broadcasts a transaction to the network. + operationId: QubicLiveService_BroadcastTransaction + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BroadcastTransactionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BroadcastTransactionResponse' + /ipos/active: + get: + tags: + - QubicLiveService + - Smart Contracts + summary: Get Active IPOs + description: Returns a list of IPOs that are active in the current epoch. + operationId: QubicLiveService_GetActiveIpos + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetActiveIposResponse' + /ipos/{contractIndex}/bids: + get: + tags: + - QubicLiveService + - Smart Contracts + summary: Get contract IPO bid information + description: Returns the bid information for a given IPO active in the current epoch. + operationId: QubicLiveService_GetContractIpoBids + parameters: + - name: contractIndex + in: path + required: true + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetContractIpoBidsResponse' + /querySmartContract: + post: + tags: + - QubicLiveService + - Smart Contracts + summary: Query Smart Contract + description: Queries a smart contract function. + operationId: QubicLiveService_QuerySmartContract + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySmartContractRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySmartContractResponse' + /tick-info: + get: + tags: + - QubicLiveService + - Network + summary: Get Tick Info + description: Gets the current tick information. + operationId: QubicLiveService_GetTickInfo + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetTickInfoResponse' components: - schemas: - AssetInfo: - type: object - properties: - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetInfo - AssetIssuance: - type: object - properties: - data: - $ref: '#/components/schemas/AssetIssuanceData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetIssuance - AssetIssuanceData: - type: object - properties: - issuerIdentity: - type: string - type: - type: integer - format: uint32 - name: - type: string - numberOfDecimalPlaces: - type: integer - format: int32 - unitOfMeasurement: - type: array - items: - type: integer - format: int32 - description: AssetIssuanceData - AssetIssuances: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetIssuance' - description: AssetIssuances - AssetOwnership: - type: object - properties: - data: - $ref: '#/components/schemas/AssetOwnershipData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetOwnership - AssetOwnershipData: - type: object - properties: - ownerIdentity: - type: string - type: - type: integer - format: uint32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - description: AssetOwnershipData - AssetOwnerships: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetOwnership' - description: AssetOwnerships - AssetPossession: - type: object - properties: - data: - $ref: '#/components/schemas/AssetPossessionData' - tick: - type: integer - format: uint32 - universeIndex: - type: integer - format: uint32 - description: AssetPossession - AssetPossessionData: - type: object - properties: - possessorIdentity: - type: string - type: - type: integer - format: uint32 - managingContractIndex: - type: integer - format: uint32 - ownershipIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - description: AssetPossessionData - AssetPossessions: - type: object - properties: - assets: - type: array - items: - $ref: '#/components/schemas/AssetPossession' - description: AssetPossessions - Balance: - type: object - properties: - id: - type: string - description: The identity relevant to this balance. - balance: - type: string - description: The amount of funds the identity holds. - validForTick: - type: integer - description: The tick that this balance is valid for. - format: uint32 - latestIncomingTransferTick: - type: integer - description: The last tick when this identity received funds through a transfer. - format: uint32 - latestOutgoingTransferTick: - type: integer - description: The last tick when this identity sent funds through a transfer. - format: uint32 - incomingAmount: - type: string - description: The total sum of received funds over time. - outgoingAmount: - type: string - description: The total sum of sent funds over time. - numberOfIncomingTransfers: - type: integer - description: The number of incoming transfers. - format: uint32 - numberOfOutgoingTransfers: - type: integer - description: The number of outgoing transfers. - format: uint32 - description: Balance - BroadcastTransactionRequest: - type: object - properties: - encodedTransaction: - type: string - description: Base64 encoded binary transaction data. - description: BroadcastTransactionRequest - BroadcastTransactionResponse: - type: object - properties: - peersBroadcasted: - type: integer - description: The number of Qubic node peers this transactions has been broadcast to. - format: int32 - encodedTransaction: - type: string - description: The Base 64 encoded binary transaction from the request. - transactionId: - type: string - description: The id / hash of the transaction. - description: BroadcastTransactionResponse - GetActiveIposResponse: - type: object - properties: - ipos: - type: array - items: - $ref: '#/components/schemas/Ipo' - description: GetActiveIposResponse - GetBalanceResponse: - type: object - properties: - balance: - $ref: '#/components/schemas/Balance' - description: GetBalanceResponse - GetBlockHeightResponse: - type: object - properties: - blockHeight: - $ref: '#/components/schemas/TickInfo' - description: GetBlockHeightResponse - GetTickInfoResponse: - type: object - properties: - tickInfo: - $ref: '#/components/schemas/TickInfo' - description: GetTickInfoResponse - Ipo: - type: object - properties: - contractIndex: - type: integer - description: The index of the related contract (contract address). - format: uint32 - assetName: - type: string - description: The name of the related asset. - description: IPO - IssuedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/IssuedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: IssuedAsset - IssuedAssetData: - type: object - properties: - issuerIdentity: - type: string - type: - type: integer - format: uint32 - name: - type: string - numberOfDecimalPlaces: - type: integer - format: int32 - unitOfMeasurement: - type: array - items: - type: integer - format: int32 - description: IssuedAssetData - IssuedAssetsResponse: - type: object - properties: - issuedAssets: - type: array - items: - $ref: '#/components/schemas/IssuedAsset' - description: IssuedAssetsResponse - OwnedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/OwnedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: OwnedAsset - OwnedAssetData: - type: object - properties: - ownerIdentity: - type: string - type: - type: integer - format: uint32 - padding: - type: integer - format: int32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - issuedAsset: - $ref: '#/components/schemas/IssuedAssetData' - description: OwnedAssetData - OwnedAssetsResponse: - type: object - properties: - ownedAssets: - type: array - items: - $ref: '#/components/schemas/OwnedAsset' - description: OwnedAssetsResponse - PossessedAsset: - type: object - properties: - data: - $ref: '#/components/schemas/PossessedAssetData' - info: - $ref: '#/components/schemas/AssetInfo' - description: PossessedAsset - PossessedAssetData: - type: object - properties: - possessorIdentity: - type: string - type: - type: integer - format: uint32 - padding: - type: integer - format: int32 - managingContractIndex: - type: integer - format: uint32 - issuanceIndex: - type: integer - format: uint32 - numberOfUnits: - type: string - ownedAsset: - $ref: '#/components/schemas/OwnedAssetData' - description: PossessedAssetData - PossessedAssetsResponse: - type: object - properties: - possessedAssets: - type: array - items: - $ref: '#/components/schemas/PossessedAsset' - description: PossessedAssetsResponse - QuerySmartContractRequest: - type: object - properties: - contractIndex: - type: integer - description: identifies the smart contract - format: uint32 - inputType: - type: integer - description: identifies the function to be queried - format: uint32 - inputSize: - type: integer - description: the size of the input data (request data) - format: uint32 - requestData: - type: string - description: base64 encoded input data - description: QuerySmartContractRequest - QuerySmartContractResponse: - type: object - properties: - responseData: - type: string - description: Binary data encoded as Base64. This data is returned directly from the called SC function. - description: QuerySmartContractResponse - TickInfo: - type: object - properties: - tick: - type: integer - description: current network tick - format: uint32 - duration: - type: integer - format: uint32 - epoch: - type: integer - description: current epoch - format: uint32 - initialTick: - type: integer - description: initial tick of epoch - format: uint32 - description: TickInfo + schemas: + AssetInfo: + type: object + properties: + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetInfo + AssetIssuance: + type: object + properties: + data: + $ref: '#/components/schemas/AssetIssuanceData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetIssuance + AssetIssuanceData: + type: object + properties: + issuerIdentity: + type: string + type: + type: integer + format: uint32 + name: + type: string + numberOfDecimalPlaces: + type: integer + format: int32 + unitOfMeasurement: + type: array + items: + type: integer + format: int32 + description: AssetIssuanceData + AssetIssuances: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetIssuance' + description: AssetIssuances + AssetOwnership: + type: object + properties: + data: + $ref: '#/components/schemas/AssetOwnershipData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetOwnership + AssetOwnershipData: + type: object + properties: + ownerIdentity: + type: string + type: + type: integer + format: uint32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + description: AssetOwnershipData + AssetOwnerships: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetOwnership' + description: AssetOwnerships + AssetPossession: + type: object + properties: + data: + $ref: '#/components/schemas/AssetPossessionData' + tick: + type: integer + format: uint32 + universeIndex: + type: integer + format: uint32 + description: AssetPossession + AssetPossessionData: + type: object + properties: + possessorIdentity: + type: string + type: + type: integer + format: uint32 + managingContractIndex: + type: integer + format: uint32 + ownershipIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + description: AssetPossessionData + AssetPossessions: + type: object + properties: + assets: + type: array + items: + $ref: '#/components/schemas/AssetPossession' + description: AssetPossessions + Balance: + type: object + properties: + id: + type: string + description: The identity relevant to this balance. + balance: + type: string + description: The amount of funds the identity holds. + validForTick: + type: integer + description: The tick that this balance is valid for. + format: uint32 + latestIncomingTransferTick: + type: integer + description: The last tick when this identity received funds through a transfer. + format: uint32 + latestOutgoingTransferTick: + type: integer + description: The last tick when this identity sent funds through a transfer. + format: uint32 + incomingAmount: + type: string + description: The total sum of received funds over time. + outgoingAmount: + type: string + description: The total sum of sent funds over time. + numberOfIncomingTransfers: + type: integer + description: The number of incoming transfers. + format: uint32 + numberOfOutgoingTransfers: + type: integer + description: The number of outgoing transfers. + format: uint32 + description: Balance + BroadcastTransactionRequest: + type: object + properties: + encodedTransaction: + type: string + description: Base64 encoded binary transaction data. + description: BroadcastTransactionRequest + BroadcastTransactionResponse: + type: object + properties: + peersBroadcasted: + type: integer + description: The number of Qubic node peers this transactions has been broadcast to. + format: int32 + encodedTransaction: + type: string + description: The Base 64 encoded binary transaction from the request. + transactionId: + type: string + description: The id / hash of the transaction. + description: BroadcastTransactionResponse + GetActiveIposResponse: + type: object + properties: + ipos: + type: array + items: + $ref: '#/components/schemas/Ipo' + description: GetActiveIposResponse + GetBalanceResponse: + type: object + properties: + balance: + $ref: '#/components/schemas/Balance' + description: GetBalanceResponse + GetBlockHeightResponse: + type: object + properties: + blockHeight: + $ref: '#/components/schemas/TickInfo' + description: GetBlockHeightResponse + GetContractIpoBidsResponse: + type: object + properties: + bidData: + $ref: '#/components/schemas/IpoBidData' + GetTickInfoResponse: + type: object + properties: + tickInfo: + $ref: '#/components/schemas/TickInfo' + description: GetTickInfoResponse + Ipo: + type: object + properties: + contractIndex: + type: integer + description: The index of the related contract (contract address). + format: uint32 + assetName: + type: string + description: The name of the related asset. + description: IPO + IpoBid: + type: object + properties: + identity: + type: string + amount: + type: string + IpoBidData: + type: object + properties: + contractIndex: + type: integer + format: uint32 + tickNumber: + type: integer + format: uint32 + bids: + type: object + additionalProperties: + $ref: '#/components/schemas/IpoBid' + IssuedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/IssuedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: IssuedAsset + IssuedAssetData: + type: object + properties: + issuerIdentity: + type: string + type: + type: integer + format: uint32 + name: + type: string + numberOfDecimalPlaces: + type: integer + format: int32 + unitOfMeasurement: + type: array + items: + type: integer + format: int32 + description: IssuedAssetData + IssuedAssetsResponse: + type: object + properties: + issuedAssets: + type: array + items: + $ref: '#/components/schemas/IssuedAsset' + description: IssuedAssetsResponse + OwnedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/OwnedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: OwnedAsset + OwnedAssetData: + type: object + properties: + ownerIdentity: + type: string + type: + type: integer + format: uint32 + padding: + type: integer + format: int32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + issuedAsset: + $ref: '#/components/schemas/IssuedAssetData' + description: OwnedAssetData + OwnedAssetsResponse: + type: object + properties: + ownedAssets: + type: array + items: + $ref: '#/components/schemas/OwnedAsset' + description: OwnedAssetsResponse + PossessedAsset: + type: object + properties: + data: + $ref: '#/components/schemas/PossessedAssetData' + info: + $ref: '#/components/schemas/AssetInfo' + description: PossessedAsset + PossessedAssetData: + type: object + properties: + possessorIdentity: + type: string + type: + type: integer + format: uint32 + padding: + type: integer + format: int32 + managingContractIndex: + type: integer + format: uint32 + issuanceIndex: + type: integer + format: uint32 + numberOfUnits: + type: string + ownedAsset: + $ref: '#/components/schemas/OwnedAssetData' + description: PossessedAssetData + PossessedAssetsResponse: + type: object + properties: + possessedAssets: + type: array + items: + $ref: '#/components/schemas/PossessedAsset' + description: PossessedAssetsResponse + QuerySmartContractRequest: + type: object + properties: + contractIndex: + type: integer + description: identifies the smart contract + format: uint32 + inputType: + type: integer + description: identifies the function to be queried + format: uint32 + inputSize: + type: integer + description: the size of the input data (request data) + format: uint32 + requestData: + type: string + description: base64 encoded input data + description: QuerySmartContractRequest + QuerySmartContractResponse: + type: object + properties: + responseData: + type: string + description: Binary data encoded as Base64. This data is returned directly from the called SC function. + description: QuerySmartContractResponse + TickInfo: + type: object + properties: + tick: + type: integer + description: current network tick + format: uint32 + duration: + type: integer + format: uint32 + epoch: + type: integer + description: current epoch + format: uint32 + initialTick: + type: integer + description: initial tick of epoch + format: uint32 + description: TickInfo tags: - - name: Accounts - description: Check account balances and transfer history. - - name: Assets - description: Query and manage assets including issuances, ownerships, and possessions. - - name: Network - description: Network status and tick information. - - name: QubicLiveService - x-scalar-ignore: true - - name: Smart Contracts - description: Query smart contracts and view active IPOs. - - name: Transactions - description: Broadcast transactions to the network. + - name: Accounts + description: Check account balances and transfer history. + - name: Assets + description: Query and manage assets including issuances, ownerships, and possessions. + - name: Network + description: Network status and tick information. + - name: QubicLiveService + - name: Smart Contracts + description: Query smart contracts and view active IPOs. + - name: Transactions + description: Broadcast transactions to the network. externalDocs: - description: GitHub - url: https://github.com/qubic/qubic-http + description: GitHub + url: https://github.com/qubic/qubic-http diff --git a/protobuff/qubic.pb.go b/protobuff/qubic.pb.go index dee0418..1e52a88 100644 --- a/protobuff/qubic.pb.go +++ b/protobuff/qubic.pb.go @@ -2265,6 +2265,206 @@ func (x *GetActiveIposResponse) GetIpos() []*Ipo { return nil } +type IpoBid struct { + state protoimpl.MessageState `protogen:"open.v1"` + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IpoBid) Reset() { + *x = IpoBid{} + mi := &file_qubic_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IpoBid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpoBid) ProtoMessage() {} + +func (x *IpoBid) ProtoReflect() protoreflect.Message { + mi := &file_qubic_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpoBid.ProtoReflect.Descriptor instead. +func (*IpoBid) Descriptor() ([]byte, []int) { + return file_qubic_proto_rawDescGZIP(), []int{38} +} + +func (x *IpoBid) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *IpoBid) GetAmount() int64 { + if x != nil { + return x.Amount + } + return 0 +} + +type IpoBidData struct { + state protoimpl.MessageState `protogen:"open.v1"` + ContractIndex uint32 `protobuf:"varint,1,opt,name=contract_index,json=contractIndex,proto3" json:"contract_index,omitempty"` + TickNumber uint32 `protobuf:"varint,2,opt,name=tick_number,json=tickNumber,proto3" json:"tick_number,omitempty"` + Bids map[int32]*IpoBid `protobuf:"bytes,3,rep,name=bids,proto3" json:"bids,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IpoBidData) Reset() { + *x = IpoBidData{} + mi := &file_qubic_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IpoBidData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IpoBidData) ProtoMessage() {} + +func (x *IpoBidData) ProtoReflect() protoreflect.Message { + mi := &file_qubic_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IpoBidData.ProtoReflect.Descriptor instead. +func (*IpoBidData) Descriptor() ([]byte, []int) { + return file_qubic_proto_rawDescGZIP(), []int{39} +} + +func (x *IpoBidData) GetContractIndex() uint32 { + if x != nil { + return x.ContractIndex + } + return 0 +} + +func (x *IpoBidData) GetTickNumber() uint32 { + if x != nil { + return x.TickNumber + } + return 0 +} + +func (x *IpoBidData) GetBids() map[int32]*IpoBid { + if x != nil { + return x.Bids + } + return nil +} + +type GetContractIpoBidsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ContractIndex uint32 `protobuf:"varint,1,opt,name=contract_index,json=contractIndex,proto3" json:"contract_index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetContractIpoBidsRequest) Reset() { + *x = GetContractIpoBidsRequest{} + mi := &file_qubic_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetContractIpoBidsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetContractIpoBidsRequest) ProtoMessage() {} + +func (x *GetContractIpoBidsRequest) ProtoReflect() protoreflect.Message { + mi := &file_qubic_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetContractIpoBidsRequest.ProtoReflect.Descriptor instead. +func (*GetContractIpoBidsRequest) Descriptor() ([]byte, []int) { + return file_qubic_proto_rawDescGZIP(), []int{40} +} + +func (x *GetContractIpoBidsRequest) GetContractIndex() uint32 { + if x != nil { + return x.ContractIndex + } + return 0 +} + +type GetContractIpoBidsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + BidData *IpoBidData `protobuf:"bytes,1,opt,name=bid_data,json=bidData,proto3" json:"bid_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetContractIpoBidsResponse) Reset() { + *x = GetContractIpoBidsResponse{} + mi := &file_qubic_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetContractIpoBidsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetContractIpoBidsResponse) ProtoMessage() {} + +func (x *GetContractIpoBidsResponse) ProtoReflect() protoreflect.Message { + mi := &file_qubic_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetContractIpoBidsResponse.ProtoReflect.Descriptor instead. +func (*GetContractIpoBidsResponse) Descriptor() ([]byte, []int) { + return file_qubic_proto_rawDescGZIP(), []int{41} +} + +func (x *GetContractIpoBidsResponse) GetBidData() *IpoBidData { + if x != nil { + return x.BidData + } + return nil +} + var File_qubic_proto protoreflect.FileDescriptor const file_qubic_proto_rawDesc = "" + @@ -2417,31 +2617,65 @@ const file_qubic_proto_rawDesc = "" + "\n" + "asset_name\x18\x02 \x01(\tR\tassetName\"E\n" + "\x15GetActiveIposResponse\x12,\n" + - "\x04ipos\x18\x01 \x03(\v2\x18.qubic.http.qubic.pb.IpoR\x04ipos2\x8e\x1a\n" + - "\x10QubicLiveService\x12\xb2\x01\n" + + "\x04ipos\x18\x01 \x03(\v2\x18.qubic.http.qubic.pb.IpoR\x04ipos\"<\n" + + "\x06IpoBid\x12\x1a\n" + + "\bidentity\x18\x01 \x01(\tR\bidentity\x12\x16\n" + + "\x06amount\x18\x02 \x01(\x03R\x06amount\"\xe9\x01\n" + + "\n" + + "IpoBidData\x12%\n" + + "\x0econtract_index\x18\x01 \x01(\rR\rcontractIndex\x12\x1f\n" + + "\vtick_number\x18\x02 \x01(\rR\n" + + "tickNumber\x12=\n" + + "\x04bids\x18\x03 \x03(\v2).qubic.http.qubic.pb.IpoBidData.BidsEntryR\x04bids\x1aT\n" + + "\tBidsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\x05R\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.qubic.http.qubic.pb.IpoBidR\x05value:\x028\x01\"B\n" + + "\x19GetContractIpoBidsRequest\x12%\n" + + "\x0econtract_index\x18\x01 \x01(\rR\rcontractIndex\"X\n" + + "\x1aGetContractIpoBidsResponse\x12:\n" + + "\bbid_data\x18\x01 \x01(\v2\x1f.qubic.http.qubic.pb.IpoBidDataR\abidData2\xc2\x1d\n" + + "\x10QubicLiveService\x12\xbc\x01\n" + "\n" + - "GetBalance\x12&.qubic.http.qubic.pb.GetBalanceRequest\x1a'.qubic.http.qubic.pb.GetBalanceResponse\"S\xbaG:\x12\vGet Balance\x1a+Gets the balance of the specified identity.\x82\xd3\xe4\x93\x02\x10\x12\x0e/balances/{id}\x12\xd2\x01\n" + - "\x12QuerySmartContract\x12..qubic.http.qubic.pb.QuerySmartContractRequest\x1a/.qubic.http.qubic.pb.QuerySmartContractResponse\"[\xbaG:\x12\x14Query Smart Contract\x1a\"Queries a smart contract function.\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/querySmartContract\x12\xe2\x01\n" + - "\x14BroadcastTransaction\x120.qubic.http.qubic.pb.BroadcastTransactionRequest\x1a1.qubic.http.qubic.pb.BroadcastTransactionResponse\"e\xbaGA\x12\x15Broadcast Transaction\x1a(Broadcasts a transaction to the network.\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/broadcast-transaction\x12\x99\x01\n" + - "\vGetTickInfo\x12\x16.google.protobuf.Empty\x1a(.qubic.http.qubic.pb.GetTickInfoResponse\"H\xbaG3\x12\rGet Tick Info\x1a\"Gets the current tick information.\x82\xd3\xe4\x93\x02\f\x12\n" + - "/tick-info\x12\xa8\x01\n" + - "\x0eGetBlockHeight\x12\x16.google.protobuf.Empty\x1a+.qubic.http.qubic.pb.GetBlockHeightResponse\"Q\xbaG9\x12\x10Get Block Height\x1a#Deprecated: use /tick-info instead.P\x01\x82\xd3\xe4\x93\x02\x0f\x12\r/block-height\x12\xcf\x01\n" + - "\x0fGetIssuedAssets\x12(.qubic.http.qubic.pb.IssuedAssetsRequest\x1a).qubic.http.qubic.pb.IssuedAssetsResponse\"g\xbaGC\x12\x12List Issued Assets\x1a-Gets assets issued by the specified identity.\x82\xd3\xe4\x93\x02\x1b\x12\x19/assets/{identity}/issued\x12\xd2\x01\n" + - "\x0eGetOwnedAssets\x12'.qubic.http.qubic.pb.OwnedAssetsRequest\x1a(.qubic.http.qubic.pb.OwnedAssetsResponse\"m\xbaGJ\x12\x11List Owned Assets\x1a5Gets assets that are owned by the specified identity.\x82\xd3\xe4\x93\x02\x1a\x12\x18/assets/{identity}/owned\x12\xea\x01\n" + - "\x12GetPossessedAssets\x12+.qubic.http.qubic.pb.PossessedAssetsRequest\x1a,.qubic.http.qubic.pb.PossessedAssetsResponse\"y\xbaGR\x12\x15List Possessed Assets\x1a9Gets assets that are possessed by the specified identity.\x82\xd3\xe4\x93\x02\x1e\x12\x1c/assets/{identity}/possessed\x12\xf7\x01\n" + - "\x17GetIssuedAssetsByFilter\x123.qubic.http.qubic.pb.GetIssuedAssetsByFilterRequest\x1a#.qubic.http.qubic.pb.AssetIssuances\"\x81\x01\xbaGe\x12\x16Search Asset Issuances\x1aKReturns a list of issued assets filtered by issuer identity and asset name.\x82\xd3\xe4\x93\x02\x13\x12\x11/assets/issuances\x12\xe4\x01\n" + - "\x1dGetIssuedAssetByUniverseIndex\x12..qubic.http.qubic.pb.GetByUniverseIndexRequest\x1a\".qubic.http.qubic.pb.AssetIssuance\"o\xbaGK\x12\x1bGet Asset Issuance By Index\x1a,Returns an asset issuance by universe index.\x82\xd3\xe4\x93\x02\x1b\x12\x19/assets/issuances/{index}\x12\x8c\x02\n" + - "\x16GetOwnedAssetsByFilter\x122.qubic.http.qubic.pb.GetOwnedAssetsByFilterRequest\x1a$.qubic.http.qubic.pb.AssetOwnerships\"\x97\x01\xbaGz\x12\x17Search Asset Ownerships\x1a_Returns a list of asset ownerships filtered by issuer, asset name, owner and managing contract.\x82\xd3\xe4\x93\x02\x14\x12\x12/assets/ownerships\x12\xe7\x01\n" + - "\x1cGetOwnedAssetByUniverseIndex\x12..qubic.http.qubic.pb.GetByUniverseIndexRequest\x1a#.qubic.http.qubic.pb.AssetOwnership\"r\xbaGM\x12\x1cGet Asset Ownership By Index\x1a-Returns an asset ownership by universe index.\x82\xd3\xe4\x93\x02\x1c\x12\x1a/assets/ownerships/{index}\x12\xa5\x02\n" + - "\x1aGetPossessedAssetsByFilter\x126.qubic.http.qubic.pb.GetPossessedAssetsByFilterRequest\x1a%.qubic.http.qubic.pb.AssetPossessions\"\xa7\x01\xbaG\x88\x01\x12\x18Search Asset Possessions\x1alReturns a list of asset possessions filtered by issuer, asset name, owner, possessor and managing contracts.\x82\xd3\xe4\x93\x02\x15\x12\x13/assets/possessions\x12\xef\x01\n" + - " GetPossessedAssetByUniverseIndex\x12..qubic.http.qubic.pb.GetByUniverseIndexRequest\x1a$.qubic.http.qubic.pb.AssetPossession\"u\xbaGO\x12\x1dGet Asset Possession By Index\x1a.Returns an asset possession by universe index.\x82\xd3\xe4\x93\x02\x1d\x12\x1b/assets/possessions/{index}\x12\xbb\x01\n" + - "\rGetActiveIpos\x12\x16.google.protobuf.Empty\x1a*.qubic.http.qubic.pb.GetActiveIposResponse\"f\xbaGO\x12\x0fGet Active IPOs\x1a\n" + + "\x0fSmart Contracts\x12+Query smart contracts and view active IPOs.B-\n" + "\x06GitHub\x12#https://github.com/qubic/qubic-httpZ&github.com/qubic/qubic-http/protobuff/b\x06proto3" var ( @@ -2456,7 +2690,7 @@ func file_qubic_proto_rawDescGZIP() []byte { return file_qubic_proto_rawDescData } -var file_qubic_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_qubic_proto_msgTypes = make([]protoimpl.MessageInfo, 43) var file_qubic_proto_goTypes = []any{ (*Balance)(nil), // 0: qubic.http.qubic.pb.Balance (*GetBalanceRequest)(nil), // 1: qubic.http.qubic.pb.GetBalanceRequest @@ -2496,7 +2730,12 @@ var file_qubic_proto_goTypes = []any{ (*GetPossessedAssetsByFilterRequest)(nil), // 35: qubic.http.qubic.pb.GetPossessedAssetsByFilterRequest (*Ipo)(nil), // 36: qubic.http.qubic.pb.Ipo (*GetActiveIposResponse)(nil), // 37: qubic.http.qubic.pb.GetActiveIposResponse - (*emptypb.Empty)(nil), // 38: google.protobuf.Empty + (*IpoBid)(nil), // 38: qubic.http.qubic.pb.IpoBid + (*IpoBidData)(nil), // 39: qubic.http.qubic.pb.IpoBidData + (*GetContractIpoBidsRequest)(nil), // 40: qubic.http.qubic.pb.GetContractIpoBidsRequest + (*GetContractIpoBidsResponse)(nil), // 41: qubic.http.qubic.pb.GetContractIpoBidsResponse + nil, // 42: qubic.http.qubic.pb.IpoBidData.BidsEntry + (*emptypb.Empty)(nil), // 43: google.protobuf.Empty } var file_qubic_proto_depIdxs = []int32{ 0, // 0: qubic.http.qubic.pb.GetBalanceResponse.balance:type_name -> qubic.http.qubic.pb.Balance @@ -2520,41 +2759,46 @@ var file_qubic_proto_depIdxs = []int32{ 29, // 18: qubic.http.qubic.pb.AssetPossession.data:type_name -> qubic.http.qubic.pb.AssetPossessionData 30, // 19: qubic.http.qubic.pb.AssetPossessions.assets:type_name -> qubic.http.qubic.pb.AssetPossession 36, // 20: qubic.http.qubic.pb.GetActiveIposResponse.ipos:type_name -> qubic.http.qubic.pb.Ipo - 1, // 21: qubic.http.qubic.pb.QubicLiveService.GetBalance:input_type -> qubic.http.qubic.pb.GetBalanceRequest - 21, // 22: qubic.http.qubic.pb.QubicLiveService.QuerySmartContract:input_type -> qubic.http.qubic.pb.QuerySmartContractRequest - 3, // 23: qubic.http.qubic.pb.QubicLiveService.BroadcastTransaction:input_type -> qubic.http.qubic.pb.BroadcastTransactionRequest - 38, // 24: qubic.http.qubic.pb.QubicLiveService.GetTickInfo:input_type -> google.protobuf.Empty - 38, // 25: qubic.http.qubic.pb.QubicLiveService.GetBlockHeight:input_type -> google.protobuf.Empty - 11, // 26: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssets:input_type -> qubic.http.qubic.pb.IssuedAssetsRequest - 15, // 27: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssets:input_type -> qubic.http.qubic.pb.OwnedAssetsRequest - 19, // 28: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssets:input_type -> qubic.http.qubic.pb.PossessedAssetsRequest - 33, // 29: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetIssuedAssetsByFilterRequest - 32, // 30: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest - 34, // 31: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetOwnedAssetsByFilterRequest - 32, // 32: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest - 35, // 33: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetPossessedAssetsByFilterRequest - 32, // 34: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest - 38, // 35: qubic.http.qubic.pb.QubicLiveService.GetActiveIpos:input_type -> google.protobuf.Empty - 2, // 36: qubic.http.qubic.pb.QubicLiveService.GetBalance:output_type -> qubic.http.qubic.pb.GetBalanceResponse - 22, // 37: qubic.http.qubic.pb.QubicLiveService.QuerySmartContract:output_type -> qubic.http.qubic.pb.QuerySmartContractResponse - 4, // 38: qubic.http.qubic.pb.QubicLiveService.BroadcastTransaction:output_type -> qubic.http.qubic.pb.BroadcastTransactionResponse - 6, // 39: qubic.http.qubic.pb.QubicLiveService.GetTickInfo:output_type -> qubic.http.qubic.pb.GetTickInfoResponse - 7, // 40: qubic.http.qubic.pb.QubicLiveService.GetBlockHeight:output_type -> qubic.http.qubic.pb.GetBlockHeightResponse - 12, // 41: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssets:output_type -> qubic.http.qubic.pb.IssuedAssetsResponse - 16, // 42: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssets:output_type -> qubic.http.qubic.pb.OwnedAssetsResponse - 20, // 43: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssets:output_type -> qubic.http.qubic.pb.PossessedAssetsResponse - 25, // 44: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetIssuances - 24, // 45: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetIssuance - 28, // 46: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetOwnerships - 27, // 47: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetOwnership - 31, // 48: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetPossessions - 30, // 49: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetPossession - 37, // 50: qubic.http.qubic.pb.QubicLiveService.GetActiveIpos:output_type -> qubic.http.qubic.pb.GetActiveIposResponse - 36, // [36:51] is the sub-list for method output_type - 21, // [21:36] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 42, // 21: qubic.http.qubic.pb.IpoBidData.bids:type_name -> qubic.http.qubic.pb.IpoBidData.BidsEntry + 39, // 22: qubic.http.qubic.pb.GetContractIpoBidsResponse.bid_data:type_name -> qubic.http.qubic.pb.IpoBidData + 38, // 23: qubic.http.qubic.pb.IpoBidData.BidsEntry.value:type_name -> qubic.http.qubic.pb.IpoBid + 1, // 24: qubic.http.qubic.pb.QubicLiveService.GetBalance:input_type -> qubic.http.qubic.pb.GetBalanceRequest + 21, // 25: qubic.http.qubic.pb.QubicLiveService.QuerySmartContract:input_type -> qubic.http.qubic.pb.QuerySmartContractRequest + 3, // 26: qubic.http.qubic.pb.QubicLiveService.BroadcastTransaction:input_type -> qubic.http.qubic.pb.BroadcastTransactionRequest + 43, // 27: qubic.http.qubic.pb.QubicLiveService.GetTickInfo:input_type -> google.protobuf.Empty + 43, // 28: qubic.http.qubic.pb.QubicLiveService.GetBlockHeight:input_type -> google.protobuf.Empty + 11, // 29: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssets:input_type -> qubic.http.qubic.pb.IssuedAssetsRequest + 15, // 30: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssets:input_type -> qubic.http.qubic.pb.OwnedAssetsRequest + 19, // 31: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssets:input_type -> qubic.http.qubic.pb.PossessedAssetsRequest + 33, // 32: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetIssuedAssetsByFilterRequest + 32, // 33: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest + 34, // 34: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetOwnedAssetsByFilterRequest + 32, // 35: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest + 35, // 36: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetsByFilter:input_type -> qubic.http.qubic.pb.GetPossessedAssetsByFilterRequest + 32, // 37: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetByUniverseIndex:input_type -> qubic.http.qubic.pb.GetByUniverseIndexRequest + 43, // 38: qubic.http.qubic.pb.QubicLiveService.GetActiveIpos:input_type -> google.protobuf.Empty + 40, // 39: qubic.http.qubic.pb.QubicLiveService.GetContractIpoBids:input_type -> qubic.http.qubic.pb.GetContractIpoBidsRequest + 2, // 40: qubic.http.qubic.pb.QubicLiveService.GetBalance:output_type -> qubic.http.qubic.pb.GetBalanceResponse + 22, // 41: qubic.http.qubic.pb.QubicLiveService.QuerySmartContract:output_type -> qubic.http.qubic.pb.QuerySmartContractResponse + 4, // 42: qubic.http.qubic.pb.QubicLiveService.BroadcastTransaction:output_type -> qubic.http.qubic.pb.BroadcastTransactionResponse + 6, // 43: qubic.http.qubic.pb.QubicLiveService.GetTickInfo:output_type -> qubic.http.qubic.pb.GetTickInfoResponse + 7, // 44: qubic.http.qubic.pb.QubicLiveService.GetBlockHeight:output_type -> qubic.http.qubic.pb.GetBlockHeightResponse + 12, // 45: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssets:output_type -> qubic.http.qubic.pb.IssuedAssetsResponse + 16, // 46: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssets:output_type -> qubic.http.qubic.pb.OwnedAssetsResponse + 20, // 47: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssets:output_type -> qubic.http.qubic.pb.PossessedAssetsResponse + 25, // 48: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetIssuances + 24, // 49: qubic.http.qubic.pb.QubicLiveService.GetIssuedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetIssuance + 28, // 50: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetOwnerships + 27, // 51: qubic.http.qubic.pb.QubicLiveService.GetOwnedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetOwnership + 31, // 52: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetsByFilter:output_type -> qubic.http.qubic.pb.AssetPossessions + 30, // 53: qubic.http.qubic.pb.QubicLiveService.GetPossessedAssetByUniverseIndex:output_type -> qubic.http.qubic.pb.AssetPossession + 37, // 54: qubic.http.qubic.pb.QubicLiveService.GetActiveIpos:output_type -> qubic.http.qubic.pb.GetActiveIposResponse + 41, // 55: qubic.http.qubic.pb.QubicLiveService.GetContractIpoBids:output_type -> qubic.http.qubic.pb.GetContractIpoBidsResponse + 40, // [40:56] is the sub-list for method output_type + 24, // [24:40] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_qubic_proto_init() } @@ -2568,7 +2812,7 @@ func file_qubic_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_qubic_proto_rawDesc), len(file_qubic_proto_rawDesc)), NumEnums: 0, - NumMessages: 38, + NumMessages: 43, NumExtensions: 0, NumServices: 1, }, diff --git a/protobuff/qubic.pb.gw.go b/protobuff/qubic.pb.gw.go index 2da3e41..81f91d3 100644 --- a/protobuff/qubic.pb.gw.go +++ b/protobuff/qubic.pb.gw.go @@ -610,6 +610,58 @@ func local_request_QubicLiveService_GetActiveIpos_0(ctx context.Context, marshal } +func request_QubicLiveService_GetContractIpoBids_0(ctx context.Context, marshaler runtime.Marshaler, client QubicLiveServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetContractIpoBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["contract_index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contract_index") + } + + protoReq.ContractIndex, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contract_index", err) + } + + msg, err := client.GetContractIpoBids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_QubicLiveService_GetContractIpoBids_0(ctx context.Context, marshaler runtime.Marshaler, server QubicLiveServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetContractIpoBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["contract_index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "contract_index") + } + + protoReq.ContractIndex, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "contract_index", err) + } + + msg, err := server.GetContractIpoBids(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQubicLiveServiceHandlerServer registers the http handlers for service QubicLiveService to "mux". // UnaryRPC :call QubicLiveServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -991,6 +1043,31 @@ func RegisterQubicLiveServiceHandlerServer(ctx context.Context, mux *runtime.Ser }) + mux.Handle("GET", pattern_QubicLiveService_GetContractIpoBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/qubic.http.qubic.pb.QubicLiveService/GetContractIpoBids", runtime.WithHTTPPathPattern("/ipos/{contract_index}/bids")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QubicLiveService_GetContractIpoBids_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_QubicLiveService_GetContractIpoBids_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1362,6 +1439,28 @@ func RegisterQubicLiveServiceHandlerClient(ctx context.Context, mux *runtime.Ser }) + mux.Handle("GET", pattern_QubicLiveService_GetContractIpoBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/qubic.http.qubic.pb.QubicLiveService/GetContractIpoBids", runtime.WithHTTPPathPattern("/ipos/{contract_index}/bids")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QubicLiveService_GetContractIpoBids_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_QubicLiveService_GetContractIpoBids_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1395,6 +1494,8 @@ var ( pattern_QubicLiveService_GetPossessedAssetByUniverseIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"assets", "possessions", "index"}, "")) pattern_QubicLiveService_GetActiveIpos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ipos", "active"}, "")) + + pattern_QubicLiveService_GetContractIpoBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"ipos", "contract_index", "bids"}, "")) ) var ( @@ -1427,4 +1528,6 @@ var ( forward_QubicLiveService_GetPossessedAssetByUniverseIndex_0 = runtime.ForwardResponseMessage forward_QubicLiveService_GetActiveIpos_0 = runtime.ForwardResponseMessage + + forward_QubicLiveService_GetContractIpoBids_0 = runtime.ForwardResponseMessage ) diff --git a/protobuff/qubic.proto b/protobuff/qubic.proto index de83889..d3ff67c 100644 --- a/protobuff/qubic.proto +++ b/protobuff/qubic.proto @@ -322,6 +322,25 @@ message GetActiveIposResponse { repeated Ipo ipos = 1; } +message IpoBid { + string identity = 1; + int64 amount = 2; +} + +message IpoBidData { + uint32 contract_index = 1; + uint32 tick_number = 2; + map bids = 3; +} + +message GetContractIpoBidsRequest { + uint32 contract_index = 1; +} + +message GetContractIpoBidsResponse { + IpoBidData bid_data = 1; +} + service QubicLiveService { rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) { @@ -492,4 +511,15 @@ service QubicLiveService { get: "/ipos/active" }; } + + rpc GetContractIpoBids(GetContractIpoBidsRequest) returns (GetContractIpoBidsResponse) { + option (openapi.v3.operation) = { + tags: ["Smart Contracts"] + summary: "Get contract IPO bid information" + description: "Returns the bid information for a given IPO active in the current epoch." + }; + option (google.api.http) = { + get: "/ipos/{contract_index}/bids" + }; + } } \ No newline at end of file diff --git a/protobuff/qubic_grpc.pb.go b/protobuff/qubic_grpc.pb.go index fdab4b0..7d777c0 100644 --- a/protobuff/qubic_grpc.pb.go +++ b/protobuff/qubic_grpc.pb.go @@ -35,6 +35,7 @@ const ( QubicLiveService_GetPossessedAssetsByFilter_FullMethodName = "/qubic.http.qubic.pb.QubicLiveService/GetPossessedAssetsByFilter" QubicLiveService_GetPossessedAssetByUniverseIndex_FullMethodName = "/qubic.http.qubic.pb.QubicLiveService/GetPossessedAssetByUniverseIndex" QubicLiveService_GetActiveIpos_FullMethodName = "/qubic.http.qubic.pb.QubicLiveService/GetActiveIpos" + QubicLiveService_GetContractIpoBids_FullMethodName = "/qubic.http.qubic.pb.QubicLiveService/GetContractIpoBids" ) // QubicLiveServiceClient is the client API for QubicLiveService service. @@ -56,6 +57,7 @@ type QubicLiveServiceClient interface { GetPossessedAssetsByFilter(ctx context.Context, in *GetPossessedAssetsByFilterRequest, opts ...grpc.CallOption) (*AssetPossessions, error) GetPossessedAssetByUniverseIndex(ctx context.Context, in *GetByUniverseIndexRequest, opts ...grpc.CallOption) (*AssetPossession, error) GetActiveIpos(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetActiveIposResponse, error) + GetContractIpoBids(ctx context.Context, in *GetContractIpoBidsRequest, opts ...grpc.CallOption) (*GetContractIpoBidsResponse, error) } type qubicLiveServiceClient struct { @@ -216,6 +218,16 @@ func (c *qubicLiveServiceClient) GetActiveIpos(ctx context.Context, in *emptypb. return out, nil } +func (c *qubicLiveServiceClient) GetContractIpoBids(ctx context.Context, in *GetContractIpoBidsRequest, opts ...grpc.CallOption) (*GetContractIpoBidsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetContractIpoBidsResponse) + err := c.cc.Invoke(ctx, QubicLiveService_GetContractIpoBids_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // QubicLiveServiceServer is the server API for QubicLiveService service. // All implementations must embed UnimplementedQubicLiveServiceServer // for forward compatibility. @@ -235,6 +247,7 @@ type QubicLiveServiceServer interface { GetPossessedAssetsByFilter(context.Context, *GetPossessedAssetsByFilterRequest) (*AssetPossessions, error) GetPossessedAssetByUniverseIndex(context.Context, *GetByUniverseIndexRequest) (*AssetPossession, error) GetActiveIpos(context.Context, *emptypb.Empty) (*GetActiveIposResponse, error) + GetContractIpoBids(context.Context, *GetContractIpoBidsRequest) (*GetContractIpoBidsResponse, error) mustEmbedUnimplementedQubicLiveServiceServer() } @@ -290,6 +303,9 @@ func (UnimplementedQubicLiveServiceServer) GetPossessedAssetByUniverseIndex(cont func (UnimplementedQubicLiveServiceServer) GetActiveIpos(context.Context, *emptypb.Empty) (*GetActiveIposResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetActiveIpos not implemented") } +func (UnimplementedQubicLiveServiceServer) GetContractIpoBids(context.Context, *GetContractIpoBidsRequest) (*GetContractIpoBidsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetContractIpoBids not implemented") +} func (UnimplementedQubicLiveServiceServer) mustEmbedUnimplementedQubicLiveServiceServer() {} func (UnimplementedQubicLiveServiceServer) testEmbeddedByValue() {} @@ -581,6 +597,24 @@ func _QubicLiveService_GetActiveIpos_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _QubicLiveService_GetContractIpoBids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetContractIpoBidsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QubicLiveServiceServer).GetContractIpoBids(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QubicLiveService_GetContractIpoBids_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QubicLiveServiceServer).GetContractIpoBids(ctx, req.(*GetContractIpoBidsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // QubicLiveService_ServiceDesc is the grpc.ServiceDesc for QubicLiveService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -648,6 +682,10 @@ var QubicLiveService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetActiveIpos", Handler: _QubicLiveService_GetActiveIpos_Handler, }, + { + MethodName: "GetContractIpoBids", + Handler: _QubicLiveService_GetContractIpoBids_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "qubic.proto",