0.5.1 • Published 4 months ago

propeasy-sdk v0.5.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
4 months ago

propeasy-sdk

How to use

Get PropertyClient

import {
  PublicKey,
  Connection,
  Keypair,
  Commitment,
} from "@solana/web3.js";
import { AnchorProvider, Wallet, BN, Address } from "@project-serum/anchor";
import { Context, PropertyClient,
  PROPEASY_PROGRAM, PROP
} from "@renec-foundation/propeasy-sdk";


...
// yourKey = Keypair.fromSecretKey(Uint8Array.from([124, 149, 222, 31, 236, 142, 29, 95...]));

const commitment: Commitment = "confirmed";
const connection = new Connection(RPC_ENDPOINT_URL, { commitment });
const wallet = new Wallet(yourKey);
const provider = new AnchorProvider(connection, wallet, { commitment });

const ctx = Context.withProvider(provider, PROPEASY_PROGRAM);

const propertyMintAccount = new PublicKey('');

let propertyClient = await PropertyClient.getProperty(ctx, propertyMintAccount);

console.log("property", propertyClient)

const purchaseTx = await propertyClient.purchasePropertyToken(new BigNumber(10));
const purchaseTxSig = await purchaseTx.buildAndExecute();

propertyClient = await propertyClient.refresh();
const locker = await propertyClient.getLocker();

console.log("locker", locker);

const individualCommission = propertyClient.getCommissionAmount(new BigNumber(10))

Initialize platform

  • update .wallet/owner.js
yarn build:sdk
yarn cli initialize -n mainnet

Create new property

  • update .wallet/owner.js
  • update data/property.ts
yarn build:sdk
yarn cli createProperty -n mainnet
0.5.0

4 months ago

0.5.1

4 months ago

0.4.3

5 months ago

0.4.2

5 months ago

0.3.9

5 months ago

0.3.8

5 months ago

0.4.1

5 months ago

0.4.0

5 months ago

0.3.6

5 months ago

0.3.5

5 months ago

0.3.7

5 months ago

0.3.2

5 months ago

0.3.1

5 months ago

0.3.4

5 months ago

0.3.3

5 months ago

0.3.0

5 months ago

0.2.7

5 months ago

0.2.6

5 months ago

0.2.9

5 months ago

0.2.8

5 months ago

0.2.1

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.5

5 months ago

0.2.4

5 months ago

0.1.5

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago