
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
one-country-sdk
Advanced tools
Web3 library for 1.country smart contracts.
Supported contracts:
npm i one-country-sdk --save
import detectEthereumProvider from '@metamask/detect-provider'
import { OneCountry } from 'one-country-sdk'
const provider = await detectEthereumProvider()
const oneCountry = new OneCountry({
provider,
contractAddress: '0x3cC3C5F98AC3FF544279919DfceBfb7aFe03A2cA'
})
const [ address ] = await window.ethereum.request({ method: 'eth_requestAccounts' })
oneCountry.setAccountAddress(address)
const price = await oneCountry.getPriceByName('all')
const oneCountry = new OneCountry({
contractAddress: '0x3cC3C5F98AC3FF544279919DfceBfb7aFe03A2cA',
privateKey: '12345'
})
const price = await oneCountry.getPriceByName('all')
const oneCountry = new OneCountry({ contractAddress: '0x3cC3C5F98AC3FF544279919DfceBfb7aFe03A2cA' })
const price = await oneCountry.getPriceByName('all')
import { OneCountry, VanityUrl, ShortReelsVideos, DC, DCEns } from 'one-country-sdk'
const provider = await detectEthereumProvider()
const oneCountry = new OneCountry({ provider, contractAddress: '0x3cC3C5F98AC3FF544279919DfceBfb7aFe03A2cA' })
const vanityUrl = new VanityUrl({ provider, contractAddress: '0x88a1afC4134f385337Dd5F530D452079fC9E14CC' })
const shortVideos = new ShortReelsVideos({ provider, contractAddress: '0x3a6843f2AbC3CA960845108908Eae8D9d9CE058D' })
const dc = new DC({ provider, contractAddress: '0x3C84F4690De96a0428Bc6777f5aA5f5a92150Ef2' })
const dcEns = new DCEns({ provider, contractAddress: '0xeFC73fB07660464aA03A5790D011DA0512c5854f' })
Param | Default value | Description |
---|---|---|
contractAddress | undefined | Contract address |
provider? | undefined | Web3 provider, optional |
rpcUrl? | https://api.harmony.one | RPC url, optional |
privateKey? | undefined | Private key, optional. Use only on backend side. |
const price = oneCountry.getPriceByName('artem')
const record = oneCountry.getRecordByName('artem')
const price = getPriceByName('artem')
const tx = await oneCountry.rent('artem', 'https://twitter.com/halfin/status/1072874040', price)
const tx = await oneCountry.updateURL('artem', 'https://twitter.com/halfin/status/321214052')
const tx = await oneCountry.setNameForRenter('artem')
const name = await oneCountry.getNameForRenter('0x726A7a5403c9C1F49f72789794358A2FfdacCA85')
const price = await vanityUrl.getUrlUpdatePrice()
const tx = await vanityUrl.setNewURL('artem', 'someAlias', 'https://twitter.com', '1000000000000000000')
const price = await vanityUrl.getVanityUrlPrice('artem', 'someAlias')
const tx = await shortReelsVideos.payForVanityURLAccessFor('0x95D02e967Dd2D2B1839347e0B84E59136b11A073', 'artem', 'someAlias', '1000000000000000000', 12345)
const tx = await shortReelsVideos.sendDonationFor('0x95D02e967Dd2D2B1839347e0B84E59136b11A073', 'artem', 'someAlias', '1000000000000000000')
const isAvailable = await dc.isAvailable('artem')
const record = await dc.getRecord('artem')
const price = await dc.getPrice('artem')
const params = await dc.getParameters()
const num = await dc.getNumUrls('artem')
.env
file in root directory, add private keyPRIVATE_KEY=12345
npm run test
oneCountry: '0x3cC3C5F98AC3FF544279919DfceBfb7aFe03A2cA',
vanityUrlContractAddress: '0x88a1afC4134f385337Dd5F530D452079fC9E14CC',
shortReelsVideosContractAddress: '0x3a6843f2AbC3CA960845108908Eae8D9d9CE058D',
DC: '0x3C84F4690De96a0428Bc6777f5aA5f5a92150Ef2',
FAQs
One Country SDK
We found that one-country-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.