Getting Started
This guide will help you get up and running with the memejob SDK quickly.
Prerequisites
Before you begin, make sure you have:
- Node.js (v18 or higher)
- A package manager (npm, pnpm, yarn or bun)
- A Hedera account with sufficient HBAR for transactions
Installation
sh
$ npm i @buidlerlabs/memejob-sdk-js @hashgraph/sdk viem
sh
$ pnpm add @buidlerlabs/memejob-sdk-js @hashgraph/sdk viem
sh
$ yarn add @buidlerlabs/memejob-sdk-js @hashgraph/sdk viem
sh
$ bun add @buidlerlabs/memejob-sdk-js @hashgraph/sdk viem
Usage
Setup a new memejob client
typescript
import { AccountId, ContractId, PrivateKey } from "@hashgraph/sdk";
import {
CONTRACT_DEPLOYMENTS,
createAdapter,
getChain,
MJClient,
NativeAdapter,
} from "@buidlerlabs/memejob-sdk-js";
const contractId = ContractId.fromString(
CONTRACT_DEPLOYMENTS.mainnet.contractId
);
const client = new MJClient(
createAdapter(NativeAdapter, {
operator: {
accountId: AccountId.fromString("0.0.123456"),
privateKey: PrivateKey.fromStringED25519("<private-key>"),
},
}),
{
chain: getChain("mainnet"),
contractId,
}
);
typescript
import { ContractId } from "@hashgraph/sdk";
import { privateKeyToAccount } from "viem/accounts";
import {
CONTRACT_DEPLOYMENTS,
createAdapter,
EvmAdapter,
getChain,
MJClient,
} from "@buidlerlabs/memejob-sdk-js";
const contractId = ContractId.fromEvmAddress(
0,
0,
CONTRACT_DEPLOYMENTS.mainnet.evmAddress
);
const client = new MJClient(
createAdapter(EvmAdapter, {
account: privateKeyToAccount("0x123..456"),
}),
{
chain: getChain("mainnet"),
contractId,
}
);
Create Your First Token
Here’s a simple example of how you can create a new MemeJob token by calling the client’s createToken
method with the required parameters.
typescript
const receipt = await client.createToken({
name: "My awesome token",
symbol: "MAT",
memo: "ipfs://1q2w...3e4r",
});
console.log("Transaction receipt:", receipt);
Next Steps
- Learn about Configuration options