1.2.0 ā€¢ Published 9 months ago

@roamin/koinos-sdk-as v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Test

koinos-sdk-as

AssemblyScript (AS) Software Development Toolkit (SDK) for the Koinos Blockchain

See documentation: https://roaminro.github.io/koinos-sdk-as/

Learn how to create smart contracts by looking at the examples repo: https://github.com/roaminro/koinos-sdk-as-examples

Requirements:

You need to install NodeJS v16 or higher download

Installation

# with npm
npm install @roamin/koinos-sdk-as

# with yarn
yarn add @roamin/koinos-sdk-as

Run unit tests

# with npm
npm test

# with yarn
yarn test

Build test contract

# with npm
npm run buildTestContract

# with yarn
yarn run buildTestContract

Upload and trigger the test contract on a local devnet using Local-Koinos

šŸš« šŸ” > open wallets/bob.wallet bob
Opened wallet: wallets/bob.wallet

šŸš« šŸ”“ > connect http://localhost:8080
Connected to endpoint http://localhost:8080

šŸ”“ > register foobar 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g /test/abi/foobar.abi
Contract 'foobar' at address 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g registered

šŸ”“ > foobar.foobar 42
Calling foobar.foobar with arguments 'value:42'
Transaction with ID 0x1220654597dfe99b4d5f841c129be39d3fe725539240b9efb43f8ea8ab4d9cd35742 containing 1 operations submitted.
Mana cost: 0.01831902 (Disk: 10, Network: 254, Compute: 1830532)
Logs:
entryPoint: 3282800625
contractArgs: 42
contractId (b58): 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
headInfo.head_block_time: 1645327982254
headInfo.head_topology.height: 7771
headInfo.last_irreversible_block.: 7711
callerData.caller_privilege: 1
lastIrreversibleBlock: 7711
putRes: 0
obj: testValue
putRes: 0
obj: testValue2
obj: testValue2
putRes3: 0
obj5.value: 42
no obj5
recoveredKey (b58): 1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe
value2
no key5
value3
key3
value1
key1
nothing before key1
nothing after key3
obj201.value: 200
next obj202.value: 300
prev obj202.value: 100
nothing before key1
nothing after key3
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
1.2.0

9 months ago

1.1.0

10 months ago