Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meetusvr/blockchain-sdk

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meetusvr/blockchain-sdk

Meetusvr blockchain SDK to interact with smart contracts and call blockchain specific APIs for NFT minting, NFT marketplace and token reward system.

  • 0.0.9
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

MeetusVR-blockchain-sdk

SDK is divided into multiple services

  • Building Service
  • Room Service

Buy Building example

const MockUSDT = "0xEe189f1558924f26cba1281E6898B0CCe8b2f657";
const MeetusVRBuilding = "0x53C5dc153acD44274832c0B1eEDf2b1A48358ba1";
const MeetusVRRoom = "0x8f5Eb4A827b0084066D9458e88930608CEC02F6A";
const MeetusVRSale = "0x0f9d4Ca17445CABb0Db1E71Fe6979C4dccB73F51";
const MeetusVRReward = "0x1F106EA0Db7429DFA5CdF2a12389923dEc59e1C7";

const provider = new providers.JsonRpcProvider("RPC_URL");
const wallet = new Wallet("PrivateKey", provider);

const sdk = new MeetusVRBlockchainSDK({
    buildingNFTAddress: MeetusVRBuilding,
    saleAddress: MeetusVRSale,
    rewardAddress: MeetusVRReward,
    roomNFTAddress: MeetusVRRoom,
    defaultPaymentTokenAddress: MockUSDT,
    providerOrSigner: wallet,
});

const tokenSaleData = await api.getTokenSaleData(userAddress);

const { approveAction, isApproved, buyAction } =
    sdk.buildingService.buyBuilding({
        tokenId: tokenSaleData.tokenId,
        paymentToken: tokenSaleData.paymentToken,
        price: tokenSaleData.price,
        saleType: tokenSaleData.saleType,
        signature: tokenSaleData.signature,
        deadline: tokenSaleData.deadline,
    });
if (!(await isApproved())) {
    await approveAction();
}
const result = await buyAction("UserAddress");

Claim Room Reward

const tokenRewardClaims = api.getTokenRewardClaims(userAddress);

const rewardClaim = tokenRewardClaims[0];
const claimRoomResult = await sdk.roomService.claimReward({
    user: rewardClaim.user,
    amount: rewardClaim.amount,
    nonce: rewardClaim.nonce,
    token: rewardClaim.token,
    tokenId: rewardClaim.tokenId,
    tokenStandard: rewardClaim.tokenStandard,
    claimMethod: rewardClaim.claimMethod,
    signatureTimestamp: rewardClaim.signatureTimestamp,
    signatures: rewardClaim.signatures,
    deadline: rewardClaim.deadline,
});

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc