Skip to content

requestAirdrop() throws error when funding contract addresses #1313

@yripper

Description

@yripper

rpc.Server.requestAirdrop() throws "No account created in transaction" when funding contract addresses (C...), even though the funding transaction succeeds on-chain. This happens because findCreatedAccountSequenceInTransactionMeta() expects a CreateAccount operation, but contract funding uses SAC transfers.

What version are you on?
@stellar/stellar-sdk@14.4.3

To Reproduce

  1. Create a random contract address using StrKey.encodeContract(randomBytes(32))
  2. Call rpcServer.requestAirdrop(contractAddress)
  3. Observe error: "No account created in transaction"
import { rpc, StrKey } from "@stellar/stellar-sdk";
import { randomBytes } from "crypto";

const server = new rpc.Server("https://soroban-testnet.stellar.org");
const contractAddress = StrKey.encodeContract(randomBytes(32));
await server.requestAirdrop(contractAddress); // throws

Expected behavior
requestAirdrop() should succeed for contract addresses and return transaction info without throwing.

Additional context
SDF recently added friendbot support for contract addresses (smart wallets). The Horizon friendbot() endpoint works correctly for C... addresses, but the RPC implementation does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions