0.2.1 • Published 24 days ago

@orao-network/aptos-vrf v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
24 days ago

VRF for Aptos JS SDK

Library to interact with orao-vrf smart contract on Aptos network.

Provides interface to request for a verifiable randomness (Ed25519 Signature) on the Aptos network.

V1

const oraoVrf = new OraoVrfClient(Network.MAINNET);

const alice = new AptosAccount();

const txnHash = await oraoVrf.request(alice, seed);
await oraoVrf.aptosClient.waitForTransaction(txnHash);
console.log("Your transaction hash is", txnHash);

const randomness = await oraoVrf.waitFulfilled(alice.address(), seed);
console.log("Your randomness is", randomness)

V2

const oraoVrfV2 = new OraoVrfV2Client(Network.MAINNET);

const alice = new AptosAccount();

let txnHash = await oraoVrfV2.deposit(alice, '0x1::aptos_coin::AptosCoin', '100000000');
await oraoVrfV2.provider.waitForTransaction(txnHash);
console.log("Your transaction hash is", txnHash);

txnHash = await oraoVrfV2.request(alice, seed);
await oraoVrf.aptosClient.waitForTransaction(txnHash);
console.log("Your transaction hash is", txnHash);

const randomness = await oraoVrfV2.waitFulfilled(alice.address(), seed);
console.log("Your randomness is", randomness)
0.2.1

24 days ago

0.2.0

3 months ago

0.1.7

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago