Register Digital Assets
The Genesis Protocol TypeScript SDK enables developers to integrate with the Genesis Protocol, providing functionalities for digital asset registration, licensing, royalty distribution, dispute resolution, access controls, and collaboration.
Installation
To install the SDK, run:
npm install @genesisprotocol/sdk
Importing the SDK
import { GenesisProtocol } from "@genesisprotocol/sdk";
const genesis = new GenesisProtocol({ apiKey: "YOUR_API_KEY" });
Modules & Methods
1. Digital Asset Registration
Methods for registering intellectual property (IP) on the blockchain.
registerAsset
Registers a new digital asset on the Genesis Protocol.
async registerAsset(metadata: AssetMetadata): Promise<AssetResponse>;
getAsset
Retrieves details of a registered asset.
async getAsset(assetId: string): Promise<AssetDetails>;
updateAsset
Updates metadata of an existing asset.
async updateAsset(assetId: string, metadata: AssetMetadata): Promise<AssetResponse>;
2. Licensing & Tokenization
Methods for managing asset licensing and tokenization.
CreateLicense
Generates a smart contract-based license for an asset.
async createLicense(assetId: string, terms: LicenseTerms): Promise<LicenseResponse>;
getLicense
Retrieves details of an existing license.
async getLicense(licenseId: string): Promise<LicenseDetails>;
transferLicense
Transfers a license to another party.
async transferLicense(licenseId: string, newOwner: string): Promise<TransferResponse>;
3. Royalty Distribution
Methods for automating royalty payments.
setupRoyaltyContract
Creates a smart contract for automatic royalty payments.
async setupRoyaltyContract(assetId: string, beneficiaries: Beneficiary[]): Promise<RoyaltyContractResponse>;
getRoyaltyInfo
Retrieves details of a royalty contract.
async getRoyaltyInfo(contractId: string): Promise<RoyaltyDetails>;
distributeRoyalties
Triggers a royalty payment distribution.
async distributeRoyalties(contractId: string): Promise<DistributionResponse>;
4. Dispute Resolution
Handles disputes related to digital assets.
fileDispute
Files a dispute related to an asset or license.
async fileDispute(assetId: string, reason: string): Promise<DisputeResponse>;
getDisputeStatus
Retrieves the status of an ongoing dispute.
async getDisputeStatus(disputeId: string): Promise<DisputeStatus>;
resolveDispute
Resolves a dispute via the Genesis Protocol governance mechanism.
async resolveDispute(disputeId: string, resolution: ResolutionDetails): Promise<ResolutionResponse>;
5. Access Control & Permissions
Manages access rights to digital assets.
grantAccess
Grants access permissions to a user or organization.
async grantAccess(assetId: string, userId: string, permissions: AccessPermissions): Promise<AccessResponse>;
revokeAccess
Revokes access permissions.
async revokeAccess(assetId: string, userId: string): Promise<AccessResponse>;
getAccessList
Retrieves a list of users with access to an asset.
async getAccessList(assetId: string): Promise<AccessList>;
6. Group Collaboration & Governance
Enables decentralized governance and group decision-making.
CreateGroup
Creates a new collaboration group.
async createGroup(name: string, members: string[]): Promise<GroupResponse>;
addMember
Adds a member to an existing group.
async addMember(groupId: string, memberId: string): Promise<GroupResponse>;
removeMember
Removes a member from a group.
async removeMember(groupId: string, memberId: string): Promise<GroupResponse>;
proposeDecision
Creates a new governance proposal within a group.
async proposeDecision(groupId: string, proposal: ProposalDetails): Promise<ProposalResponse>;
voteOnProposal
Casts a vote on an active proposal.
async voteOnProposal(proposalId: string, vote: boolean): Promise<VoteResponse>;
Error Handling
All methods throw structured error messages in case of failures. Example:
{
"error": true,
"message": "Asset not found",
"code": 404
}
Conclusion
The Genesis Protocol SDK provides a powerful interface for managing digital assets, licensing, royalties, dispute resolution, and governance on the blockchain. For further details, refer to the official API documentation.
Last updated