Create Project
About Projects
Projects are your starting point for the Buildcore platform. You need a project to create spaces, modify your billing information, create NFT collections, tokens, and more. This how-to will show you how to create a project.
Example
Use the createProject
function to create a project
createProject
takes an object of type Build5Request
<
ProjectCreateRequest
>
as parameter.
Soonaverse Project API
In the following examples, we will connect to the soonaverse project (its API keys are part of the SDK for ease of use). You can also create your own project to give you your API key.
responseProject = await https(origin).createProject({
address: address.bech32,
signature: userSign.signature,
publicKey: {
hex: userSign.publicKey,
network: Network.RMS,
},
body: {
name: 'TanKRURK',
config: {
billing: 'volume_based',
},
},
});
createProject
returns an oject of type ProjectCreateResponse
.
Full How-To Code
import { Network, ProjectCreateResponse } from '@build-5/interfaces';
import { Build5, https } from '@build-5/sdk';
import { address } from './utils/secret';
import { walletSign } from './utils/utils';
async function main() {
const origin = Build5.TEST;
let responseProject: ProjectCreateResponse;
let userSign = await walletSign(address.bech32, address);
try {
responseProject = await https(origin).createProject({
address: address.bech32,
signature: userSign.signature,
publicKey: {
hex: userSign.publicKey,
network: Network.RMS,
},
body: {
name: 'TanKRURK',
config: {
billing: 'volume_based',
},
},
});
console.log(
'Project created id: ',
responseProject.project.uid,
', API Key: ',
responseProject.token,
);
} catch (error) {
console.error('Error: ', error);
}
}
main().then(() => process.exit());