Blink GraphQL API

website·Indexed 35 days ago

https://dev.blink.sv

Technical reference and OpenAPI 3.0.0 specifications for the Blink GraphQL API, supporting wallet services and LLM integration. Includes schema definitions for object types, input structures, and payloads such as OnChainAddressCreateInput and UserEmailDeletePayload.

Tokens
20K
Snippets
139
Records
213
Agent score
19%

What's inside Blink

  1. Reference the Country object type

    The Country object provides information about a specific country, including its CCA2 country code and supported authentication channels.
    type Country {
      id: CountryCode!
      supportedAuthChannels: [PhoneCodeChannelType!]!
    }
  2. Reference the Currency object type

    The Currency object provides details about a currency, including its display symbol, name, and formatting properties.
    type Currency {
      id: ID!
      name: String!
      symbol: String!
      flag: String!
      fractionDigits: Int!
    }
  3. Transaction object fields in Blink GraphQL API

    The Transaction object provides detailed information about a financial transaction, including settlement amounts, currencies, fees, and status. Key fields include:

    • settlementAmount: The amount of settlement currency sent or received (Type: SignedAmount).
    • settlementCurrency: The wallet currency used for the transaction (Type: WalletCurrency).
    • settlementDisplayAmount: The formatted display amount (Type: SignedDisplayMajorAmount).
    • settlementDisplayCurrency: The display currency (Type: DisplayCurrency).
    • settlementFee and settlementDisplayFee: The fees associated with the settlement.
    • settlementPrice: The price in WALLETCURRENCY/SETTLEMENTUNIT at the time of settlement (Type: PriceOfOneSettlementMinorUnitInDisplayMinorUnit).
    • settlementVia: The protocol on which the payment settled (Type: SettlementVia union).
    • status: The current status of the transaction (Type: TxStatus enum).
    • memo: An optional memo associated with the transaction (Type: Memo scalar).
  4. Transaction object details

    The Transaction object provides details about an individual transaction. Blink uses a smart routing system that may settle transactions intraledger if both payer and payee use the same wallet, regardless of whether the transaction was initiated on-chain or via Lightning.
    type Transaction {
      id: ID!
      createdAt: Timestamp!
      direction: TxDirection!
      externalId: TxExternalId
      initiationVia: String! # Note: Type truncated in source, but field exists
    }
  5. Blink GraphQL API: BuildInformation Object Reference

    The BuildInformation object provides metadata about the current system build, including the commit hash and the Helm revision number.
    # Fields for BuildInformation object
    { 
      commitHash: String 
      helmRevision: Int 
    }
  6. Understand AccountLimit pagination and limits

    The AccountLimit interface provides information about spending limits for a 24-hour period. It includes remainingLimit (the amount of cents remaining below the limit) and totalLimit (the maximum limit for the period), both represented as CentAmount scalars.
  7. Use the OnChainUpdate object

    The OnChainUpdate object provides details about on-chain updates. Note that several fields have been deprecated in favor of the transaction field.
    type OnChainUpdate {
      transaction: Transaction! # Recommended field
      txNotificationType: TxNotificationType!
      
      # Deprecated fields:
      amount: SatAmount! # Use transaction instead
      displayCurrencyPerSat: Float! # Use transaction instead
      txHash: OnChainTxHash! # Use transaction instead
      usdPerSat: Float! # Updated over displayCurrencyPerSat
      walletId: WalletId! # Use transaction instead
    }
  8. Use the Merchant object to retrieve business details

    The Merchant object provides details about a business entity, including its identification, validation status, and location. Key fields include:

    • id: Unique identifier (ID).
    • title: The name of the merchant (String).
    • username: The merchant's username (Username).
    • validated: Boolean indicating if the merchant has been validated.
    • coordinates: GPS coordinates used to place the business on a map (Coordinates object).
    • createdAt: Timestamp of creation (Timestamp).
  9. Validate TOTP registration

    Use the UserTotpRegistrationValidateInput object to verify and finalize TOTP setup. It requires the registration ID and the TOTP code, with an optional authentication token.
    input UserTotpRegistrationValidateInput {
      totpRegistrationId: TotpRegistrationId!
      totpCode: TotpCode!
      authToken: AuthToken
    }
  10. Paginate transactions using TransactionConnection

    To retrieve a list of transactions with pagination, use the TransactionConnection object. It follows the relay-style connection pattern:

    • edges: A list of TransactionEdge objects, each containing a cursor (String) for pagination and the node (the Transaction object itself).
    • pageInfo: A PageInfo object containing metadata to aid in pagination.
    query GetTransactions {
      transactions {
        edges {
          cursor
          node {
            id
            status
            settlementAmount
          }
        }
        pageInfo {
          hasNextPage
          endCursor
        }
      }
    }
  11. User login input requirements

    The UserLoginInput and UserLoginUpgradeInput objects are used for authentication. Both require a non-null code (type OneTimeAuthCode) and a non-null phone (type Phone).
    {
      "code": "123456",
      "phone": "+1234567890"
    }
  12. Create a Lightning invoice with no amount

    Use the LnNoAmountInvoiceCreateInput object to provide parameters for creating a Lightning invoice without a fixed amount. The invoice will be associated with a wallet belonging to the current user.
    {
      "walletId": "WalletId", // Required: ID for USD or BTC wallet of current user
      "expiresIn": "Minutes",   // Optional: Expiration time in minutes
      "externalId": "TxExternalId", // Optional
      "memo": "Memo"           // Optional: Memo for the lightning invoice
    }