Quick Start
Setup
deno add jsr:@colibri/coreYour First Contract Call
import {
NetworkConfig,
LocalSigner,
Contract,
initializeWithFriendbot,
} from "@colibri/core";
// 1. Configure the network
const network = NetworkConfig.TestNet();
// 2. Create a new random signer (or use an existing secret key)
const signer = LocalSigner.generateRandom();
console.log("Public Key:", signer.publicKey());
// 3. Fund the account on TestNet using Friendbot
await initializeWithFriendbot(network.friendbotUrl, signer.publicKey());
console.log("Account funded!");
// 4. Create a contract instance
const contract = Contract.create({
networkConfig: network,
contractConfig: {
contractId: "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
},
});
// 5. Invoke a contract method
const result = await contract.invoke({
method: "hello",
methodArgs: { to: "World" },
config: {
source: signer.publicKey(),
fee: "100000",
signers: [signer],
},
});
// 6. Handle the result
console.log("✅ Transaction successful!");
console.log(" Hash:", result.hash);
console.log(" Return Value:", result.returnValue);Using Pipelines Directly
Reading Contract State
Streaming Events
Understanding Error Handling
Next Steps
Last updated