Skip to content

Commit

Permalink
Fix bad merge (duplicated types)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebolsin authored and charlie-wasp committed Apr 8, 2019
1 parent 6b3d689 commit a1d8ef3
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/schema/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ export const typeDefs = gql`
effects(first: Int, after: String, last: Int, before: String): EffectConnection
}
type OperationConnection {
pageInfo: PageInfo!
nodes: [Operation]
edges: [OperationEdge]
}
type OperationEdge {
cursor: String!
node: Operation
}
type AccountValues implements IAccount {
id: AccountID!
sequenceNumber: String!
Expand Down
8 changes: 8 additions & 0 deletions src/schema/offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ export const typeDefs = gql`
sellingAssetEq: AssetInput
}
"Offers list sorting options"
enum OfferOrderByInput {
"Sort by id in descending order"
id_DESC
"Sort by id in ascending order"
id_ASC
}
"Represents best bid/ask pair for the pair of assets"
type Tick {
selling: AssetID
buying: AssetID
Expand All @@ -62,6 +66,7 @@ export const typeDefs = gql`
}
extend type Query {
"Get list of offers"
offers(
seller: AccountID
selling: AssetCode
Expand All @@ -70,11 +75,14 @@ export const typeDefs = gql`
first: Int!
offset: Int
): [Offer]
"Get current best bid/ask offer for the given pair of assets"
tick(selling: AssetID!, buying: AssetID!): Tick
}
extend type Subscription {
"Subscribe on offers updates"
offer(args: OfferEventInput): OfferSubscriptionPayload
"Subscribe on best bid/ask updates"
tick(selling: AssetID, buying: AssetID): Tick
}
Expand Down
54 changes: 54 additions & 0 deletions src/schema/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,89 +15,121 @@ export const typeDefs = gql`
pathPayment
}
"Attributes all Stellar [operations](https://www.stellar.org/developers/guides/concepts/operations.html) share"
interface Operation {
"Operation id, assigned by Horizon"
id: String!
kind: OperationKind!
"Account on which behalf operation was executed"
sourceAccount: Account!
"When operations was executed"
dateTime: DateTime!
"Transaction that contains this operation"
transaction: Transaction!
}
"Represents [payment operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#payment)"
type PaymentOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Account address that received the payment"
destination: Account!
"Asset that was sent to the destination account"
asset: Asset!
"Amount of the asset that was sent"
amount: String!
}
"Represents [set options operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#set-options)"
type SetOptionsOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Indicates which flags to clear"
clearFlags: Int
"Indicates which flags to set"
setFlags: Int
"Indicates, which home domain to set on account"
homeDomain: String
"Indicates value of master weight to set"
masterWeight: Int
"Account thresholds to set"
thresholds: SetOptionsThresholds
"Represents a signer to add to the account"
signer: SetOptionsSigner
"Account to use as the inflation destination"
inflationDestination: Account
}
"Represents [account merge operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#account-merge)"
type AccountMergeOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"The account that receives the remaining XLM balance of the source account"
destination: Account!
}
"Represents [allow trust operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#allow-trust)"
type AllowTrustOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"The account of the recipient of the trustline"
trustor: Account!
"Flag indicating whether the trustline is authorized"
authorize: Boolean!
"The asset of the trustline the source account is authorizing"
asset: Asset!
}
"Represents [bump sequence operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#bump-sequence)"
type BumpSequenceOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Desired value for the operation’s source account sequence number"
bumpTo: Int!
}
"Represents [change trust operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#change-trust)"
type ChangeTrustOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"The limit of the trustline"
limit: String!
"The asset of the trustline"
asset: Asset!
}
"Represents [create account operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#create-account)"
type CreateAccountOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Amount of XLM to send to the newly created account"
startingBalance: String!
"Account address that is created and funded"
destination: Account!
}
"Represents [manage data operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#manage-data)"
type ManageDatumOperation implements Operation {
id: String!
kind: OperationKind!
Expand All @@ -108,20 +140,27 @@ export const typeDefs = gql`
value: String
}
"Represents [manage offer operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#manage-offer)"
type ManageOfferOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Rational representation of the price"
priceComponents: OfferPriceComponents!
"Price of 1 unit of \`selling\` in terms of \`buying\`"
price: String!
offerId: String!
"Amount of \`selling\` being sold"
amount: String!
"Asset the offer creator is selling"
assetSelling: Asset!
"Asset the offer creator is buying"
assetBuying: Asset!
}
"Represents [create passive offer operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#create-passive-offer)"
type CreatePassiveOfferOperation implements Operation {
id: String!
kind: OperationKind!
Expand All @@ -135,20 +174,31 @@ export const typeDefs = gql`
assetBuying: Asset!
}
"Represents [path payment operation](https://www.stellar.org/developers/guides/concepts/list-of-operations.html#path-payment)"
type PathPaymentOperation implements Operation {
id: String!
kind: OperationKind!
sourceAccount: Account!
dateTime: DateTime!
transaction: Transaction!
"Max send amount"
sendMax: String!
"Amount of \`sourceAsset\` sent by the source account"
amountSent: String!
"Amount of \`destinationAsset\` received by the destination account"
amountReceived: String!
"What asset sender wants receiver to receive in the end"
destinationAsset: Asset!
"What asset sender wants to send"
sourceAsset: Asset!
"Payment receiver account"
destinationAccount: Account!
}
"""
\`{numerator, denominator}\` representation of the price
For example, if you want to sell 30 XLM and buy 5 BTC, the price would be \`{5,30}\`
"""
type OfferPriceComponents {
n: Int!
d: Int!
Expand Down Expand Up @@ -177,12 +227,16 @@ export const typeDefs = gql`
}
extend type Query {
"Get list of operations"
operations(first: Int, after: String, last: Int, before: String, order: Order): OperationConnection
"Get single operation by its id"
operation(id: String): Operation
"Get payment-related operations"
payments(first: Int, after: String, last: Int, before: String): OperationConnection
}
extend type Subscription {
"Subscribe to new operations on the network"
operations(
txSource: [AccountID]
opSource: [AccountID]
Expand Down

0 comments on commit a1d8ef3

Please sign in to comment.