SlideShare a Scribd company logo
1 of 13
Harmony
Marketplace
SDK
By Blockcoders
About Us
Our team has been contributing with different projects in blockchain for a few years, building
APIs, SDKs and developer tools. Our goal is to continue to drive the crypto space forward by
investing intellectual capital into projects, participating actively to help shape the ecosystems
we believe in.
Harmony Marketplace SDK
It provides a collection of interfaces to interact with:
● HRC20
● HRC721
● HRC1155
● Any Smart Contracts that extends those standards.
This library is written in TypeScript and is based on @harmony-js.
Installing the library on a Node
> npm i harmony-marketplace-sdk
// JavaScript
const { HRC721 } = require('harmony-marketplace-sdk')
// TypeScript
import { HRC721 } from 'harmony-marketplace-sdk'
Installing the library on a Browser
Include the ESM module (harmony-marketplace-sdk.esm.js) and import using:
<script type="module">
import { HRC721 } from './harmony-marketplace-sdk.esm.js'
</script>
Setting up a Wallet
Harmony Marketplace SDK provides different implementations of Wallet which will help to create a
Signer from a private key or mnemonic effortless.
import { HttpProvider } from '@harmony-js/network'
import { PrivateKey, HarmonyShards, HRC20 } from 'harmony-marketplace-sdk'
const wallet = new PrivateKey(new HttpProvider(HarmonyShards.SHARD_0),
'45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e')
Interacting with contracts
The BaseToken abstract class is an extension over a regular Contract which is Harmony's
recommendation to interact with smart contracts.
Classes that extend from BaseToken are:
● HRC20
● HRC721
● HRC1155
Note: The ABI of the contract is required to instantiate it.
Interacting with contracts
import { HttpProvider } from '@harmony-js/network'
import { PrivateKey, HarmonyShards, HRC20 } from 'harmony-marketplace-sdk'
import * as ABI from './abi.json'
const wallet = new PrivateKey(new HttpProvider(HarmonyShards.SHARD_0),
'45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e')
const contract = new HRC20('0x...00', ABI, wallet)
Transfer
Once the contract is instantiated transfer tokens between accounts as simple as calling a
function a pass it the receiver address and the amount.
const transaction = await contract.transfer('0x...01', '1')
Other examples
const balance = await contract.balanceOf('0x...01')
const tx = await contract.allowance('0x...01', '0x...02')
const tx = await contract.approve('0x...01', 100)
const tx = await contract.transferFrom('0x...01', '0x...02', 100)
const symbol = await contract.symbol()
What about NFTs?
This library can handle HRC721 and HRC1155 too.
const balance = await hrc721Contract.ownerOf('1')
const tx = await hrc721Contract.approve('0x...01', '1')
const uri = await hrc721Contract.tokenURI()
const tx = await hrc721Contract.transferFrom('0x...01', '0x...02', '1')
const symbol = await hrc721Contract.symbol()
const symbol = await hrc721Contract.name()
Q&A Session
Thanks!

More Related Content

Similar to Harmony Marketplace SDK.pptx

Blockchain Development Company in Delhi
Blockchain Development Company in Delhi  Blockchain Development Company in Delhi
Blockchain Development Company in Delhi Al Hadaf Technologies
 
Primer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset managementPrimer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset managementTim Swanson
 
Blockchain Development Kit
Blockchain Development KitBlockchain Development Kit
Blockchain Development KitHuda Seyam
 
03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composerMerlec Mpyana
 
Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts ArcBlock
 
Banking on a Blockchain
Banking on a BlockchainBanking on a Blockchain
Banking on a BlockchainAltoros
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart ContractDeepak Aryal
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code ContractsRainer Stropek
 
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 [Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 Yunho Maeng
 
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger WorkshopIBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger WorkshopIBM France Lab
 
All in-one-smart node-v1.2.4
All in-one-smart node-v1.2.4All in-one-smart node-v1.2.4
All in-one-smart node-v1.2.4SmartCash VN
 
Contract Practice with Remix
Contract Practice with RemixContract Practice with Remix
Contract Practice with RemixKC Tam
 
Interledger DvP Settlement on Amazon Managed Blockchain
Interledger DvP Settlement on Amazon Managed BlockchainInterledger DvP Settlement on Amazon Managed Blockchain
Interledger DvP Settlement on Amazon Managed BlockchainAmazon Web Services
 
What Is A Smart Contract Audit?
What Is A Smart Contract Audit?What Is A Smart Contract Audit?
What Is A Smart Contract Audit?Blocktech Brew
 
Token platform based on sidechain
Token platform based on sidechainToken platform based on sidechain
Token platform based on sidechainLuniverse Dunamu
 

Similar to Harmony Marketplace SDK.pptx (20)

Blockchain Development Company in Delhi
Blockchain Development Company in Delhi  Blockchain Development Company in Delhi
Blockchain Development Company in Delhi
 
Blockchain PDF.pdf
Blockchain PDF.pdfBlockchain PDF.pdf
Blockchain PDF.pdf
 
Primer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset managementPrimer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset management
 
Fluence.sh
Fluence.sh Fluence.sh
Fluence.sh
 
Blockchain Development Kit
Blockchain Development KitBlockchain Development Kit
Blockchain Development Kit
 
03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer
 
Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts
 
Banking on a Blockchain
Banking on a BlockchainBanking on a Blockchain
Banking on a Blockchain
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code Contracts
 
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 [Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
 
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger WorkshopIBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
 
All in-one-smart node-v1.2.4
All in-one-smart node-v1.2.4All in-one-smart node-v1.2.4
All in-one-smart node-v1.2.4
 
Contract Practice with Remix
Contract Practice with RemixContract Practice with Remix
Contract Practice with Remix
 
Interledger DvP Settlement on Amazon Managed Blockchain
Interledger DvP Settlement on Amazon Managed BlockchainInterledger DvP Settlement on Amazon Managed Blockchain
Interledger DvP Settlement on Amazon Managed Blockchain
 
Chaincode Use Cases
Chaincode Use Cases Chaincode Use Cases
Chaincode Use Cases
 
What Is A Smart Contract Audit?
What Is A Smart Contract Audit?What Is A Smart Contract Audit?
What Is A Smart Contract Audit?
 
Token platform based on sidechain
Token platform based on sidechainToken platform based on sidechain
Token platform based on sidechain
 
Fast exchange
Fast exchangeFast exchange
Fast exchange
 
Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17
 

More from TinaBregovi

Building LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostBuilding LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostTinaBregovi
 
Urbit Launch Event
Urbit Launch EventUrbit Launch Event
Urbit Launch EventTinaBregovi
 
Layer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeLayer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeTinaBregovi
 
Layer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMLayer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMTinaBregovi
 
Rollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsRollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsTinaBregovi
 
Layer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopLayer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopTinaBregovi
 
Layer Hack Launch Event
Layer Hack Launch EventLayer Hack Launch Event
Layer Hack Launch EventTinaBregovi
 
Bridging with StarkNet
Bridging with StarkNetBridging with StarkNet
Bridging with StarkNetTinaBregovi
 
How To Build Better NFTs with Briq
How To Build Better NFTs with BriqHow To Build Better NFTs with Briq
How To Build Better NFTs with BriqTinaBregovi
 
NFTs on StarkNet
NFTs on StarkNetNFTs on StarkNet
NFTs on StarkNetTinaBregovi
 
How to build a dApp in StarkNet
How to build a dApp in StarkNetHow to build a dApp in StarkNet
How to build a dApp in StarkNetTinaBregovi
 
Braavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfBraavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfTinaBregovi
 
StarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxStarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxTinaBregovi
 
Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase NodeTinaBregovi
 
MANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionMANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionTinaBregovi
 
Public SP Meeting
Public SP MeetingPublic SP Meeting
Public SP MeetingTinaBregovi
 
Welcome to the Web 3.0
Welcome to the Web 3.0Welcome to the Web 3.0
Welcome to the Web 3.0TinaBregovi
 
Introduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionIntroduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionTinaBregovi
 

More from TinaBregovi (20)

Building LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostBuilding LSD Use Cases on Bifrost
Building LSD Use Cases on Bifrost
 
Urbit Launch Event
Urbit Launch EventUrbit Launch Event
Urbit Launch Event
 
Layer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeLayer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid Compute
 
Layer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMLayer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVM
 
Rollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsRollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dApps
 
Layer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopLayer Hack: AltLayer Workshop
Layer Hack: AltLayer Workshop
 
Layer Hack Launch Event
Layer Hack Launch EventLayer Hack Launch Event
Layer Hack Launch Event
 
Bridging with StarkNet
Bridging with StarkNetBridging with StarkNet
Bridging with StarkNet
 
How To Build Better NFTs with Briq
How To Build Better NFTs with BriqHow To Build Better NFTs with Briq
How To Build Better NFTs with Briq
 
NFTs on StarkNet
NFTs on StarkNetNFTs on StarkNet
NFTs on StarkNet
 
How to build a dApp in StarkNet
How to build a dApp in StarkNetHow to build a dApp in StarkNet
How to build a dApp in StarkNet
 
Braavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfBraavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdf
 
StarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxStarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptx
 
Coinbase Node
Coinbase NodeCoinbase Node
Coinbase Node
 
Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase Node
 
MANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionMANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty Competition
 
Public SP Meeting
Public SP MeetingPublic SP Meeting
Public SP Meeting
 
Ecosystem WG
Ecosystem WGEcosystem WG
Ecosystem WG
 
Welcome to the Web 3.0
Welcome to the Web 3.0Welcome to the Web 3.0
Welcome to the Web 3.0
 
Introduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionIntroduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer version
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Harmony Marketplace SDK.pptx

  • 2. About Us Our team has been contributing with different projects in blockchain for a few years, building APIs, SDKs and developer tools. Our goal is to continue to drive the crypto space forward by investing intellectual capital into projects, participating actively to help shape the ecosystems we believe in.
  • 3. Harmony Marketplace SDK It provides a collection of interfaces to interact with: ● HRC20 ● HRC721 ● HRC1155 ● Any Smart Contracts that extends those standards. This library is written in TypeScript and is based on @harmony-js.
  • 4. Installing the library on a Node > npm i harmony-marketplace-sdk // JavaScript const { HRC721 } = require('harmony-marketplace-sdk') // TypeScript import { HRC721 } from 'harmony-marketplace-sdk'
  • 5. Installing the library on a Browser Include the ESM module (harmony-marketplace-sdk.esm.js) and import using: <script type="module"> import { HRC721 } from './harmony-marketplace-sdk.esm.js' </script>
  • 6. Setting up a Wallet Harmony Marketplace SDK provides different implementations of Wallet which will help to create a Signer from a private key or mnemonic effortless. import { HttpProvider } from '@harmony-js/network' import { PrivateKey, HarmonyShards, HRC20 } from 'harmony-marketplace-sdk' const wallet = new PrivateKey(new HttpProvider(HarmonyShards.SHARD_0), '45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e')
  • 7. Interacting with contracts The BaseToken abstract class is an extension over a regular Contract which is Harmony's recommendation to interact with smart contracts. Classes that extend from BaseToken are: ● HRC20 ● HRC721 ● HRC1155 Note: The ABI of the contract is required to instantiate it.
  • 8. Interacting with contracts import { HttpProvider } from '@harmony-js/network' import { PrivateKey, HarmonyShards, HRC20 } from 'harmony-marketplace-sdk' import * as ABI from './abi.json' const wallet = new PrivateKey(new HttpProvider(HarmonyShards.SHARD_0), '45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e') const contract = new HRC20('0x...00', ABI, wallet)
  • 9. Transfer Once the contract is instantiated transfer tokens between accounts as simple as calling a function a pass it the receiver address and the amount. const transaction = await contract.transfer('0x...01', '1')
  • 10. Other examples const balance = await contract.balanceOf('0x...01') const tx = await contract.allowance('0x...01', '0x...02') const tx = await contract.approve('0x...01', 100) const tx = await contract.transferFrom('0x...01', '0x...02', 100) const symbol = await contract.symbol()
  • 11. What about NFTs? This library can handle HRC721 and HRC1155 too. const balance = await hrc721Contract.ownerOf('1') const tx = await hrc721Contract.approve('0x...01', '1') const uri = await hrc721Contract.tokenURI() const tx = await hrc721Contract.transferFrom('0x...01', '0x...02', '1') const symbol = await hrc721Contract.symbol() const symbol = await hrc721Contract.name()