Complete API reference for smart contract interactions
new Component( transactionBuilder: RadixTransactionBuilder, gatewayClient: RadixGatewayClient, networkId: number )
async callMethod( options: CallComponentMethodOptions, wallet: RadixWallet ): Promise\<string>
interface CallComponentMethodOptions { componentAddress: string; methodName: string; args?: any[]; resourceInputs?: ResourceInput[]; resourceOutputs?: ResourceOutput[]; }
const txHash = await component.callMethod({ componentAddress: "component_tdx_2_1c...", methodName: "buy_tokens", args: ["100", "USDT"], resourceInputs: [{ resourceAddress: "resource_tdx_2_1t...", amount: "100" }] }, wallet);
async getComponentState( options: GetComponentStateOptions ): Promise\<ComponentState>
const state = await component.getComponentState({ componentAddress: "component_tdx_2_1c..." }); console.log("Component state:", state);
async getComponentInfo(componentAddress: string): Promise\<ComponentInfo>
const info = await component.getComponentInfo("component_tdx_2_1c..."); console.log("Package address:", info.packageAddress); console.log("Blueprint name:", info.blueprintName);