salt-sdk - v0.0.45
    Preparing search index...

    Interface FeePayment

    One payment made toward a fee, over x402, as returned by Salt.getAccountFeePayments and Salt.getOrganisationFeePayments.

    interface FeePayment {
        accountId: string | null;
        expiresAt: string | null;
        failure:
            | {
                cancellationReason: string
                | null;
                errorReason: string | null;
                failedAt: string;
                kind: "verify_failed" | "settlement_failed" | "not_attempted" | "expired";
                message: string | null;
                network: string;
            }
            | null;
        id: string;
        lastUpdated: string
        | null;
        organisationId: string;
        payer: string;
        reason: "account_creation" | "transaction";
        requestedAt: string;
        settlement:
            | {
                amount: string
                | null;
                network: string;
                observedAt: string;
                transactionHash: string;
            }
            | null;
        status: FeePaymentStatus;
        terms: {
            amount: string;
            asset: string;
            flow: string
            | null;
            maxTimeoutSeconds: number;
            network: string;
            payTo: string;
            scheme: string;
        };
        transactionId: string
        | null;
        x402Version: number;
    }
    Index
    accountId: string | null

    The ID of the account the payment is for: the one it created, or the one a paid transaction runs on. null when an account creation never produced one.

    '6a98725e4d49ceccdf6ff7b7'
    
    expiresAt: string | null

    When the signed authorisation stops being redeemable, as an ISO timestamp.

    '2026-06-25T01:00:00.000Z'
    
    failure:
        | {
            cancellationReason: string
            | null;
            errorReason: string | null;
            failedAt: string;
            kind: "verify_failed" | "settlement_failed" | "not_attempted" | "expired";
            message: string | null;
            network: string;
        }
        | null

    Why the payment ended failed or canceled.

    Type Declaration

    • {
          cancellationReason: string | null;
          errorReason: string | null;
          failedAt: string;
          kind: "verify_failed" | "settlement_failed" | "not_attempted" | "expired";
          message: string | null;
          network: string;
      }
      • cancellationReason: string | null

        Why the payment was released uncharged. Only set on canceled.

        'handler_failed'
        
      • errorReason: string | null

        The facilitator's error code, verbatim.

        'invalid_exact_evm_insufficient_balance'
        
      • failedAt: string

        When the failure was recorded, as an ISO timestamp.

        '2026-06-25T00:00:05.000Z'
        
      • kind: "verify_failed" | "settlement_failed" | "not_attempted" | "expired"

        Which way the payment failed.

        'settlement_failed'
        
      • message: string | null

        A human-readable description of the failure.

        'Payer balance too low'
        
      • network: string

        CAIP-2 network the failed attempt was made on.

        'eip155:421614'
        
    • null
    {
    kind: 'settlement_failed',
    errorReason: 'invalid_exact_evm_insufficient_balance',
    cancellationReason: null,
    message: 'Payer balance too low',
    network: 'eip155:421614',
    failedAt: '2026-06-25T00:00:05.000Z',
    }
    id: string

    The ID of the payment.

    '6a9b1c2d3e4f5a6b7c8d9e0f'
    
    lastUpdated: string | null

    When the payment last changed, as an ISO timestamp.

    '2026-06-25T00:00:05.000Z'
    
    organisationId: string

    The ID of the organisation the payment is for.

    '6a98725e4d49ceccdf6ff7b1'
    
    payer: string

    The wallet that funded the payment.

    '0x9d47521F4A08018a58772883A2cB09e536460e38'
    
    reason: "account_creation" | "transaction"

    The kind of operation whose fee this pays.

    'account_creation'
    
    requestedAt: string

    When the payment was first presented, as an ISO timestamp.

    '2026-06-25T00:00:00.000Z'
    
    settlement:
        | {
            amount: string
            | null;
            network: string;
            observedAt: string;
            transactionHash: string;
        }
        | null

    The transaction carrying the payment, once one has been broadcast. Set even when it failed.

    Type Declaration

    • {
          amount: string | null;
          network: string;
          observedAt: string;
          transactionHash: string;
      }
      • amount: string | null

        Amount actually settled, when it differs from the quote.

        '10000'
        
      • network: string

        CAIP-2 network the transaction was sent on.

        'eip155:421614'
        
      • observedAt: string

        When the settlement was recorded, as an ISO timestamp.

        '2026-06-25T00:00:05.000Z'
        
      • transactionHash: string

        Hash of the transaction that moved the funds.

        '0xb1d5f2c9a34e8c7f0e6d2a9b4c8e1f3a7d5b9c2e4f6a8d0b2c4e6f8a0b2d4c6e'
        
    • null
    {
    transactionHash: '0xb1d5f2c9a34e8c7f0e6d2a9b4c8e1f3a7d5b9c2e4f6a8d0b2c4e6f8a0b2d4c6e',
    network: 'eip155:421614',
    amount: null,
    observedAt: '2026-06-25T00:00:05.000Z',
    }

    Where the payment is in its life. See FeePaymentStatus.

    'settled'
    
    terms: {
        amount: string;
        asset: string;
        flow: string | null;
        maxTimeoutSeconds: number;
        network: string;
        payTo: string;
        scheme: string;
    }

    The terms the payer signed against.

    Type Declaration

    • amount: string

      Amount in the asset's smallest unit.

      '10000'
      
    • asset: string

      Token contract the payment is made in.

      '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d'
      
    • flow: string | null

      When the money moves relative to the request. null when the backend quoted no flow.

      'upfront'
      
    • maxTimeoutSeconds: number

      How long settlement is allowed to take, in seconds.

      60
      
    • network: string

      CAIP-2 network the payment settles on.

      'eip155:421614'
      
    • payTo: string

      Who the payment is made to.

      '0x1F98431c8aD98523631AE4a59f267346ea31F984'
      
    • scheme: string

      The x402 payment scheme.

      'exact'
      
    {
    scheme: 'exact',
    flow: 'upfront',
    network: 'eip155:421614',
    amount: '10000',
    asset: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
    payTo: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
    maxTimeoutSeconds: 60,
    }
    transactionId: string | null

    The ID of the transaction the payment bought. null for an account creation, or when the transaction was never created.

    '6a98725e4d49ceccdf6ff7c3'
    
    x402Version: number

    The x402 protocol version of the payment.

    2