near-sdk-js
  • README
  • packages
  • api
    • functions
      • accountBalance
      • accountLockedBalance
      • altBn128G1Multiexp
      • altBn128G1Sum
      • altBn128PairingCheck
      • attachedDeposit
      • blockHeight
      • blockIndex
      • blockTimestamp
      • currentAccountId
      • ecrecover
      • epochHeight
      • input
      • inputRaw
      • keccak256
      • keccak512
      • log
      • logUtf16
      • logUtf8
      • panicUtf8
      • predecessorAccountId
      • prepaidGas
      • promiseAnd
      • promiseBatchActionAddKeyWithFullAccess
      • promiseBatchActionAddKeyWithFunctionCall
      • promiseBatchActionCreateAccount
      • promiseBatchActionDeleteAccount
      • promiseBatchActionDeleteKey
      • promiseBatchActionDeployContract
      • promiseBatchActionFunctionCall
      • promiseBatchActionFunctionCallRaw
      • promiseBatchActionFunctionCallWeight
      • promiseBatchActionFunctionCallWeightRaw
      • promiseBatchActionStake
      • promiseBatchActionTransfer
      • promiseBatchCreate
      • promiseBatchThen
      • promiseCreate
      • promiseCreateRaw
      • promiseResult
      • promiseResultRaw
      • promiseResultsCount
      • promiseReturn
      • promiseThen
      • promiseThenRaw
      • randomSeed
      • ripemd160
      • sha256
      • signerAccountId
      • signerAccountPk
      • storageByteCost
      • storageGetEvicted
      • storageGetEvictedRaw
      • storageHasKey
      • storageHasKeyRaw
      • storageRead
      • storageReadRaw
      • storageRemove
      • storageRemoveRaw
      • storageUsage
      • storageWrite
      • storageWriteRaw
      • usedGas
      • validatorStake
      • validatorTotalStake
      • valueReturn
      • valueReturnRaw
  • collections
    • lookup-map
      • classes
        • LookupMap
    • lookup-set
      • classes
        • LookupSet
    • subtype
      • classes
        • SubType
    • unordered-map
      • classes
        • UnorderedMap
    • unordered-set
      • classes
        • UnorderedSet
    • vector
      • classes
        • Vector
        • VectorIterator
  • index
    • functions
      • includeBytes
  • near-bindgen
    • functions
      • NearBindgen
      • call
      • initialize
      • middleware
      • migrate
      • view
  • promise
    • classes
      • AddAccessKey
      • AddFullAccessKey
      • CreateAccount
      • DeleteAccount
      • DeleteKey
      • DeployContract
      • FunctionCall
      • FunctionCallRaw
      • FunctionCallWeight
      • FunctionCallWeightRaw
      • NearPromise
      • PromiseAction
      • PromiseJoint
      • Stake
      • Transfer
    • type-aliases
      • PromiseOrValue
  • types
    • account_id
      • type-aliases
        • AccountId
    • collections
      • interfaces
        • GetOptions
    • gas
      • type-aliases
        • Gas
      • variables
        • ONE_TERA_GAS
    • primitives
      • type-aliases
        • Balance
        • BlockHeight
        • EpochHeight
        • GasWeight
        • Nonce
        • StorageUsage
      • variables
        • ONE_NEAR
        • ONE_YOCTO
    • public_key
      • classes
        • Base58Error
        • InvalidLengthError
        • ParsePublicKeyError
        • PublicKey
        • UnknownCurve
      • enumerations
        • CurveType
      • functions
        • curveTypeFromStr
    • vm_types
      • enumerations
        • PromiseError
        • PromiseResult
      • type-aliases
        • IteratorIndex
        • ReceiptIndex
  • utils
    • classes
      • TextDecoder
      • TextEncoder
    • functions
      • assert
      • bytes
      • concat
      • decode
      • decodeObj2class
      • deserialize
      • encode
      • getValueWithOptions
      • serialize
      • serializeValueWithOptions
      • str
      • validateAccountId
    • interfaces
      • Env
      • IntoStorageKey
    • type-aliases
      • Mutable
      • NearAmount
      • PromiseIndex
      • Register
    • variables
      • ERR_INCONSISTENT_STATE
      • ERR_INDEX_OUT_OF_BOUNDS
  • version
    • variables
      • LIB_VERSION
  • cli
    • abi
      • functions
        • runAbiCompilerPlugin
    • cli
      • functions
        • buildCom
        • checkTypescriptCom
        • createJsFileWithRollupCom
        • generateAbi
        • transpileJsAndBuildWasmCom
        • validateCom
    • post-install
    • utils
      • functions
        • download
        • executeCommand
        • validateContract
    • build-tools
      • include-bytes
        • functions
          • default
      • near-bindgen-exporter
        • functions
          • default
Powered by GitBook
On this page
  • Function: NearBindgen()
  • Parameters
  • Returns
  • Defined in
  1. near-bindgen
  2. functions

NearBindgen

PreviousfunctionsNextcall

Last updated 7 months ago

• Docs


/ / NearBindgen

Function: NearBindgen()

NearBindgen(options): any

Extends this class with the methods needed to make the contract storable/serializable and readable/deserializable to and from the blockchain. Also tells the SDK to capture and expose all view, call and initialize functions. Tells the SDK whether the contract requires initialization and whether to use a custom serialization/deserialization function when storing/reading the state.

Parameters

• options

Options to configure the contract behaviour.

• options.requireInit?: boolean

Whether the contract requires initialization.

• options.deserializer?

Custom deserializer function to use for reading the contract state.

• options.serializer?

Custom serializer function to use for storing the contract state.

Returns

any

Defined in

near-bindgen
near-sdk-js v2.0.0
near-bindgen
packages/near-sdk-js/src/near-bindgen.ts:167