Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/frol/near-connect-ios/llms.txt

Use this file to discover all available pages before exploring further.

TransactionResult contains the transaction hashes and raw result data returned by the wallet after successfully signing and sending a transaction.

Properties

transactionHashes
[String]
required
Array of transaction hash strings. Each hash is a unique identifier for a transaction that was sent to the NEAR blockchain.
rawResult
String?
required
Optional raw JSON result string returned by the wallet. Contains the full transaction outcome data from the blockchain.

Usage

TransactionResult is returned by the following methods:
  • signAndSendTransaction(receiverId:actions:)
  • sendNEAR(to:amountYocto:)
  • callFunction(contractId:methodName:args:gas:deposit:)

Example: Sending NEAR

do {
    let result = try await walletManager.sendNEAR(
        to: "recipient.testnet",
        amountYocto: "1000000000000000000000000" // 1 NEAR
    )
    
    print("Transaction sent successfully!")
    print("Transaction hashes: \(result.transactionHashes)")
    
    if let rawResult = result.rawResult {
        print("Raw result: \(rawResult)")
    }
} catch {
    print("Transaction failed: \(error)")
}

Example: Calling a Contract Function

do {
    let result = try await walletManager.callFunction(
        contractId: "contract.testnet",
        methodName: "set_status",
        args: ["message": "Hello, NEAR!"],
        gas: "30000000000000",
        deposit: "0"
    )
    
    print("Function call successful!")
    print("Transaction hash: \(result.transactionHashes.first ?? "none")")
} catch {
    print("Function call failed: \(error)")
}

Notes

  • The transactionHashes array typically contains one hash for single transactions
  • For batch transactions, multiple hashes may be returned
  • The rawResult field contains detailed blockchain response data that can be parsed for transaction receipts and outcomes
  • Transaction hashes can be used to query transaction status via the NEAR RPC API

Build docs developers (and LLMs) love