EVER SDK
Developer ToolsEver PlatformForum
  • Ever SDK
  • Quick start (JavaScript)
  • Add EVER to your backend
  • Reference
    • Types and Methods
      • Modules
      • Module abi
      • Module boc
      • Module client
      • Module crypto
      • Module debot
      • Module net
      • Module processing
      • Module proofs
      • Module tvm
      • Module utils
    • Error API
    • Error Codes
    • JavaScript Reference
    • Rust Reference
  • Samples
    • JavaScript Samples
  • guides
    • Installation
      • Add SDK to your App
    • Configuration
      • Endpoint Configuration
      • Message Expiration
      • Message Retry
      • Config Reference
    • Work with contracts
      • Add Contract to your App
      • Use your own Giver
      • Deploy
      • Run on-chain
      • Run ABI Get Method
      • Run Fift Get Method
      • Query/Subscribe for messages(events)
      • Decode Messages(Event)
      • External Signing
      • Emulate Transaction
      • Estimate Fees
      • Validate address, convert address
      • Monitor Messages
      • Trace message processing with REMP
    • Crypto
      • Mnemonics and Keys
    • Queries and subscriptions
      • Use-cases
      • How to work with net module
      • net.query syntax
      • Data pagination
      • Subscribe to Updates
      • Query Collection
      • Aggregate Collection
  • For Binding Developers
    • How to work with Application Objects in binding generators
    • JSON Interface to Ton Client
  • Links
    • Ever SDK repository
    • AppKit JS documentation
Powered by GitBook
On this page
  • When you may need it?
  • Get address type
  • Convert
  • Validate
  • Sample source code

Was this helpful?

  1. guides
  2. Work with contracts

Validate address, convert address

Validate and convert address to different formats

When you may need it?

If you want to validate an address and/or convert address to bounceable/non-bounceable base64/base64url formats and back. These types of address are sometimes used in some clients so may be useful for integration.

Get address type

let initialAddressType = await client.utils.get_address_type({address});
console.log(`Address type is ${JSON.stringify(initialAddressType)}`);

Convert

Use utils.convert_address function for that.

let convertedAddress = (await client.utils.convert_address({
    address,
    output_format: {
        type: "Hex"
    },
})).address;
console.log(`Address in raw format: ${convertedAddress}`);

Validate

If address is incorrect the function utils.convert_address will fail with an error.

Sample source code

PreviousEstimate FeesNextMonitor Messages

Last updated 1 year ago

Was this helpful?

https://github.com/everx-labs/sdk-samples/blob/master/core-examples/node-js/utils.convert_address/index.js