Klaytn 문서 아카이브
시작하기스마트 컨트랙트노드 운영dApp 개발자
  • Klaytn 문서
  • -
    • Klaytn Overview
      • 왜 클레이튼일까요?
      • 클레이튼 디자인
        • 합의 메커니즘
        • 계정
        • 트랜잭션
          • 기본
          • 수수료 위임 트랜잭션
          • 수수료 부분 위임 트랜잭션
          • Ethereum
        • 연산
          • 클레이튼 스마트 컨트랙트
          • 실행 모델(Execution Model)
          • Computation Cost
            • 연산 비용 (구 버전 문서)
          • Klaytn 가상머신
            • 클레이튼 가상머신 (구 버전 문서)
        • 스토리지
        • 트랜잭션 비용
          • 트랜잭션 비용 (구 버전 문서)
        • 클레이튼의 네이티브 코인 - KLAY
        • 토큰 이코노미
        • 거버넌스
        • 다중 채널
        • KNI
      • 확장성 솔루션
    • Getting Started
      • Deploying Smart Contract Using Foundry
      • Deploying Smart Contract Using Hardhat
      • Deploying Smart Contract Using KEN
        • Launch an Endpoint Node
        • Top up your Account
        • Install Development Tools
        • Deploy a Smart Contract
        • Check the Deployment
        • Account Management
          • Creating Accounts
          • Managing Accounts
      • Development Environment
      • Getting KLAY
    • 스마트 컨트랙트
      • 솔리디티 - 스마트 컨트랙트 언어
      • 미리 컴파일된 컨트랙트
        • 미리 컴파일된 컨트랙트 (구 버전 문서)
      • IDE 및 도구
        • Truffle
      • 샘플 컨트랙트
        • KlaytnGreeter
        • ERC-20
          • 1. ERC-20 스마트 컨트랙트 작성
          • 2. 스마트 컨트랙트 배포
          • 3. 클레이튼 월렛에서 ERC-20 토큰 사용
        • ERC-721
          • 1. ERC-721 스마트 컨트랙트 작성
          • 2. Deploying Smart Contract
      • 테스트 가이드
      • 배포 가이드
      • 클레이튼 호환 토큰
      • 이더리움 컨트랙트 이식
    • Run a Node
      • 배포
        • Endpoint Node
          • 시스템 요구사항
          • 설치 가이드
            • 다운로드
            • Installation Guide
            • 환경설정
            • EN 실행하기
            • 설치 테스트하기
          • ken CLI 명령어
          • JSON-RPC API
        • 코어 셀
          • System Requirements
          • 네트워크 설정
          • Installation Guide
            • Download
            • 설치하기 전에
            • 컨센서스 노드 설정
              • Installation Guide
              • Configuration
              • CN 실행하기
            • 프록시 노드 설정
              • Installation Guide
              • Configuration
              • PN 실행하기
            • 코어 셀 테스트하기
          • 모니터링 설정
          • H/A 설정
        • Service Chain
          • Getting Started
            • 4개 노드 서비스 체인 설정하기
            • Connecting to Baobab
            • 크로스체인 토큰 전송
            • HA(High Availability) for ServiceChain
            • Nested ServiceChain
            • Value Transfer between Sibling ServiceChains
          • 참조 매뉴얼
            • System Requirements
            • Download
            • SCN User Guide
              • Installation
              • Configuration
              • SCN 실행 및 중지하기
              • 노드 상태 확인하기
              • kscn commands
              • homi commands
            • SPN/SEN User Guide
              • Installation
              • Configuration
              • 노드 실행 및 중지
              • Checking Node Status
            • Bridge Configuration
            • 앵커링
            • KAS 앵커링
            • 토큰 전송
            • Configuration Files
            • 로그 파일
            • Genesis JSON
            • 업그레이드 및 하드포크
          • How-To Guides
        • Download Node Packages
          • v1.11.1
          • v1.11.0
          • v1.10.2
          • v1.10.1
          • v1.10.0
          • v1.9.1
          • v1.9.0
          • v1.8.4
          • v1.8.3
          • v1.8.2
          • v1.8.1
          • v1.8.0
          • v1.7.3
          • v1.7.2
          • v1.7.1
          • v1.7.0
          • v1.6.4
          • v1.6.3
          • v1.6.2
          • v1.6.1
          • v1.6.0
          • v1.5.3
          • v1.5.2
          • v1.5.1
          • v1.5.0
          • v1.4.2
          • v1.4.1
          • v1.4.0
          • v1.3.0
          • v1.2.0
          • v1.1.1
          • v1.0.0
          • v0.9.6
          • v0.8.2
    • 운영 가이드
      • Configuration
      • 노드 로그
      • Log operation
      • 에러 및 문제 해결
      • Klaytn Command
      • Chaindata Change
      • Chaindata Migration
    • dApp Developers
      • JSON-RPC APIs
        • API references
          • eth
            • Caution
            • Account
            • Block
            • Transaction
            • Config
            • Filter
            • Gas
            • Miscellaneous
          • klay
            • Account
            • Block
            • Transaction
              • Working with Klaytn Transaction Types
            • Configuration
            • Filter
            • Gas
            • Miscellaneous
          • net
          • debug
            • Logging
            • Profiling
            • Runtime Tracing
            • Runtime Debugging
            • VM Tracing
            • VM Standard Tracing
            • Blockchain Inspection
          • admin
          • personal
          • txpool
          • governance
        • Service Chain API references
          • mainbridge
          • subbridge
        • Transaction Error Codes
      • RPC Service Providers
        • Public Endpoints
      • SDK & Libraries for interacting with Klaytn Node
        • caver-js
          • Getting Started
          • Sending a sample transaction
          • API references
            • caver.account
            • caver.wallet
              • caver.wallet.keyring
            • caver.transaction
              • Basic
              • Fee Delegation
              • Partial Fee Delegation
            • caver.rpc
              • caver.rpc.klay
              • caver.rpc.net
              • caver.rpc.governance
            • caver.contract
            • caver.abi
            • caver.kct
              • caver.kct.kip7
              • caver.kct.kip17
              • caver.kct.kip37
            • caver.validator
            • caver.utils
            • caver.ipfs
          • caver-js ~v1.4.1
            • Getting Started (~v1.4.1)
            • API references
              • caver.klay
                • Account
                • Block
                • Transaction
                  • Legacy
                  • Value Transfer
                  • Value Transfer Memo
                  • Account Update
                  • Smart Contract Deploy
                  • Smart Contract Execution
                  • Cancel
                • Configuration
                • Filter
                • Miscellaneous
              • caver.klay.net
              • caver.klay.accounts
              • caver.klay.Contract
              • caver.klay.KIP7
              • caver.klay.KIP17
              • caver.klay.abi
              • caver.utils (~v1.4.1)
            • Porting from web3.js
        • caver-java
          • Getting Started
          • API references
          • caver-java ~v1.4.0
            • Getting Started (~v1.4.0)
            • Porting from web3j
        • ethers.js
        • web3.js
      • Tutorials
        • Klaytn Online Toolkit
        • Fee Delegation Example
        • Count DApp
          • 1. Environment Setup
          • 2. Clone Count DApp
          • 3. Directory Structure
          • 4. Write Smart Contract
          • 5. Frontend Code Overview
            • 5-1. Blocknumber Component
            • 5-2. Auth Component
            • 5-3. Count Component
          • 6. Deploy Contract
          • 7. Run App
        • Klaystagram
          • 1. Environment Setup
          • 2. Clone Klaystagram DApp
          • 3. Directory Structure
          • 4. Write Klaystagram Smart Contract
          • 5. Deploy Contract
          • 6. Frontend Code Overview
          • 7. FeedPage
            • 7-1. Connect Contract to Frontend
            • 7-2. UploadPhoto Component
            • 7-3. Feed Component
            • 7-4. TransferOwnership Component
          • 8. Run App
        • Building a Buy Me a Coffee dApp
          • 1. Project Setup
          • 2. Creating a BMC Smart Contract
          • 3. Testing the contract using scripts
          • 4. Deploying BMC Smart contract
          • 5. Building the BMC Frontend with React and Web3Onboard
          • 6. Deploying Frontend code on IPFS using Fleek
          • 7. Conclusion
        • Migrating Ethereum App to Klaytn
        • Connecting MetaMask
        • Connecting Remix
        • Verifying Smart Contracts Using Block Explorers
      • Developer Tools
        • Wallets
          • Kaikas
          • Klaytn Wallet
          • Klaytn Safe
            • Klaytn Safe Design
            • Create a Safe
            • Add assets
            • Send assets
            • Contract Interaction
            • Transaction Builder
            • Points to Note
            • Frequently Asked Questions
          • Wallet Libraries
            • Web3Auth
            • Web3Modal
            • Web3-Onboard
        • Oracles
          • Orakl Network
          • Witnet
          • SupraOracles
        • Block Explorers
          • Klaytnscope
          • Klaytnfinder
        • Klaytn Contracts Wizard
    • Glossary
  • ---
    • Klaytn 하드포크
    • 클레이튼 2.0
      • 메타버스 패키지
      • 완결성과 개선 사항들
      • 이더리움 호환성
      • 거버넌스 탈중앙화
      • 대규모 에코 펀드
    • FAQ
    • 오픈 소스
    • 이용약관
    • 지원 언어
  • ℹ️최신 Klaytn 문서
Powered by GitBook
On this page
  • caver.kct.kip17.deploy
  • caver.kct.kip17.detectInterface
  • caver.kct.kip17.create
  • new KIP17
  • kip17.clone
  • kip17.detectInterface
  • kip17.supportsInterface
  • kip17.name
  • kip17.symbol
  • kip17.totalSupply
  • kip17.tokenURI
  • kip17.tokenOfOwnerByIndex
  • kip17.tokenByIndex
  • kip17.balanceOf
  • kip17.ownerOf
  • kip17.getApproved
  • kip17.isApprovedForAll
  • kip17.isMinter
  • kip17.paused
  • kip17.isPauser
  • kip17.approve
  • kip17.setApprovalForAll
  • kip17.transferFrom
  • kip17.safeTransferFrom
  • kip17.addMinter
  • kip17.renounceMinter
  • kip17.mintWithTokenURI
  • kip17.burn
  • kip17.pause
  • kip17.unpause
  • kip17.addPauser
  • kip17.renouncePauser

Was this helpful?

  1. -
  2. dApp Developers
  3. SDK & Libraries for interacting with Klaytn Node
  4. caver-js
  5. API references
  6. caver.kct

caver.kct.kip17

Previouscaver.kct.kip7Nextcaver.kct.kip37

Last updated 2 years ago

Was this helpful?

caver.kct.kip17 helps you easily handle a smart contract that implements as a JavaScript object on the Klaytn blockchain.

caver.kct.kip17는 KIP-17 토큰 컨트랙트를 구현하기 위해 를 상속합니다. caver.kct.kip17은 caver.contract와 동일한 속성값들을 가지며, 추가 기능 구현을 위해 메서드를 더 가지고 있습니다. 이 장은 caver.kct.kip17 메서드들 중 오직 새롭게 추가된 것만을 소개합니다.

The code that implements KIP-17 for caver-js is available on the . KIP-17 for caver-js supports Ownable interface. Using this, you can designate a contract owner when deploying a contract

For more information about KIP-17, see .

caver.kct.kip17.deploy

caver.kct.kip17.deploy(tokenInfo, deployer)

KIP-17 토큰 컨트랙트를 Klaytn 블록체인에 배포합니다. caver.kct.kip17.deploy를 사용해 배포한 컨트랙트는 KIP-17 표준을 따르는 대체 불가 토큰입니다.

성공적으로 배포된 후, 프로미스는 새로운 KIP17 인스턴스를 반환할 것입니다.

Parameters

Name
Type
Description

tokenInfo

object

Klaytn 블록체인에 KIP-17 토큰 컨트랙트를 배포하는 데 필요한 정보입니다. 자세한 내용은 아래 표를 참조하세요.

deployer

string | object

tokenInfo 객체는 다음을 반드시 포함해야 합니다:

Name
Type
Description

name

string

토큰 이름입니다.

기호

string

토큰 심볼입니다.

Return Value

PromiEvent: 이벤트 이미터와 결합된 프로미스이며 새로운 KIP17 인스턴스를 반환합니다. 추가로 다음 이벤트가 발생할 수 있습니다.

Name
Type
Description

transactionHash

string

트랜잭션이 전송된 직후 및 트랜잭션 해시를 사용할 수 있을 때 발생합니다.

receipt

object

error

Error

전송 중 오류가 나타나면 발생됩니다.

Token Enrollment

  1. To enroll a token on a block explorer, the contract creator must fill out a submission request form. Make note of the specified information required on the form.

  2. Smart Contract Environment

    • Compiler Type: Solidity

    • Compiler version: v0.8.4+commit.c7e474f2

    • Open Source License Type: MIT

  3. Smart Contract Detail

    • Optimization: --optimize-run 200

Example

// using the promise
> caver.kct.kip17.deploy({
    name: 'Jasmine',
    symbol: 'JAS',
}, '0x{address in hex}').then(console.log)
KIP17 {
    ...
    _address: '0xfA7D967f414468083aDAd85257a2cBD6019693C2',
    _jsonInterface: [
        ...
        {
            anonymous: false,
            inputs: [
                { indexed: true, name: 'owner', type: 'address' },
                { indexed: true, name: 'operator', type: 'address' },
                { indexed: false, name: 'approved', type: 'bool' }
            ],
            name: 'ApprovalForAll',
            type: 'event',
            signature: '0x17307...'
        }
    ] 
}

// 객체를 두 번째 매개변수로 전달
> caver.kct.kip17.deploy({
        name: 'Jasmine',
        symbol: 'JAS',
    },
    {
        from: '0x{address in hex}',
        feeDelegation: true,
        feePayer: '0x{address in hex}',
    }).then(console.log)

// 이벤트 이미터와 프로미스 사용
> caver.kct.kip17.deploy({
    name: 'Jasmine',
    symbol: 'JAS',
}, '0x{address in hex}')
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
    console.log(receipt.contractAddress) // contains the new token contract address
})
.then(function(newKIP17Instance) {
    console.log(newKIP17Instance.options.address) // instance with the new token contract address
})

caver.kct.kip17.detectInterface

caver.kct.kip17.detectInterface(contractAddress)

Parameters

Name
Type
Description

contractAddress

string

KIP-7 토큰 컨트랙트의 주소입니다.

Return Value

Example

> caver.kct.kip17.detectInterface('0x{address in hex}').then(console.log)
{
    IKIP17: true,
    IKIP17Metadata: true,
    IKIP17Enumerable: true,
    IKIP17Mintable: true,
    IKIP17MetadataMintable: true,
    IKIP17Burnable: true,
    IKIP17Pausable: true,
}

caver.kct.kip17.create

caver.kct.kip17.create([tokenAddress])

Parameters

Return Value

Example

// 매개변수 없는 KIP17 인스턴스 생성
> const kip17 = caver.kct.kip17.create()

// 토큰 주소를 가진 KIP17 인스턴스 생성
> const kip17 = caver.kct.kip17.create('0x{address in hex}')

new KIP17

new caver.kct.kip17([tokenAddress])

Creates a new KIP17 instance with its bound methods and events.

Parameters

Name
Type
Description

tokenAddress

string

(선택 사항) KIP-17 토큰 컨트랙트 주소이며 나중에 kip17.options.address = '0x1234..'로 값을 설정할 수 있습니다.

Return Value

Type
Description

object

인스턴스 메소드와 이벤트들을 갖고 있는 KIP17 인스턴스입니다.

Example

// 매개변수 없는 KIP17 인스턴스 생성
> const kip17 = caver.kct.kip17()

// 토큰 주소를 가진 KIP17 인스턴스 생성
> const kip17 = caver.kct.kip17('0x{address in hex}')

kip17.clone

kip17.clone([tokenAddress])

Clones the current KIP17 instance.

Parameters

Name
Type
Description

tokenAddress

string

(선택 사항) 다른 KIP17 토큰을 배포했던 스마트 컨트랙트 주소입니다. 입력을 생략하면, 이 주소는 원본 인스턴스의 컨트랙트 주소로 설정됩니다.

Return Value

Type
Description

object

원본 KIP17 인스턴스를 복제한 인스턴스입니다.

Example

> const kip17 = new caver.kct.kip17(address)

// 매개변수 없이 클론
> const cloned = kip17.clone()

// 새로운 토큰 컨트랙트 주소를 가지고 클론
> const cloned = kip17.clone('0x{address in hex}')

kip17.detectInterface

kip17.detectInterface 

Returns the information of the interface implemented by the token contract.

Parameters

None

Return Value

Example

> kip17.detectInterface().then(console.log)
{
    IKIP17: true,
    IKIP17Metadata: true,
    IKIP17Enumerable: true,
    IKIP17Mintable: true,
    IKIP17MetadataMintable: true,
    IKIP17Burnable: true,
    IKIP17Pausable: true,
}

kip17.supportsInterface

kip17.supportsInterface(interfaceId)

Returns true if this contract implements the interface defined by interfaceId.

Parameters

Name
Type
Description

interfaceId

string

확인할 interfaceId입니다.

Return Value

Promise returns boolean: true if this contract implements the interface defined by interfaceId.

Example

> kip17.supportsInterface('0x80ac58cd').then(console.log)
true

> kip17.supportsInterface('0xa22cb465').then(console.log)
false

kip17.name

kip17.name()

Returns the name of the token.

Parameters

None

Return Value

Promise returns string: The name of the token.

Example

> kip17.name().then(console.log)
Jasmine

kip17.symbol

kip17.symbol()

Returns the symbol of the token.

Parameters

None

Return Value

Promise returns string: The symbol of the token.

Example

> kip17.symbol().then(console.log)
JAS

kip17.totalSupply

kip17.totalSupply()

Returns the total number of tokens minted by the contract.

Parameters

None

Return Value

Promise returns BigNumber: The total number of tokens.

Example

> kip17.totalSupply().then(console.log)
10

kip17.tokenURI

kip17.tokenURI(tokenId)

Returns the URI for a given token id.

Parameters

Name
Type
Description

tokenId

BigNumber | string | number

토큰 ID입니다.

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Promise returns string: The URI of the given token.

Example

> kip17.tokenURI(0).then(console.log)
https://kip17.example/uri-ex-caver.json

kip17.tokenOfOwnerByIndex

kip17.tokenOfOwnerByIndex(owner, index)

Searches the owner's token list for the given index, and returns the token id of a token positioned at the matched index in the list if there is a match.

Parameters

Name
Type
Description

owner

string

토큰을 소유한 계정 주소입니다.

index

BigNumber | string | number

토큰 소유자가 가지고 있는 토큰 목록 중 특정 토큰의 위치 인덱스입니다.

NOTE The index parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Promise returns BigNumber: The id of the token.

Example

> kip17.tokenOfOwnerByIndex('0x{address in hex}', 5).then(console.log)
5

kip17.tokenByIndex

kip17.tokenByIndex(index)

Searches the list of all tokens in this contract for the given index, and returns the token id of a token positioned at the matched index in the list if there is a match. It reverts if the index is greater or equal to the total number of tokens.

Parameters

Name
Type
Description

index

BigNumber | string | number

검색할 토큰의 인덱스입니다.

NOTE The index parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Promise returns BigNumber: The id of the token.

Example

> kip17.tokenByIndex(1).then(console.log)
1

kip17.balanceOf

kip17.balanceOf(address)

Returns the balance of the given account address. The balance of an account in KIP-17 is the total number of NFTs (Non-Fungible Tokens) owned by the account.

Parameters

Name
Type
Description

address

string

잔액을 확인할 계정 주소입니다.

Return Value

Promise returns BigNumber: The account balance.

Example

> kip17.balanceOf('0x{address in hex}').then(console.log)
9

kip17.ownerOf

kip17.ownerOf(tokenId)

Returns the address of the owner of the specified token id.

Parameters

Name
Type
Description

tokenId

BigNumber | string | number

The id of the token.

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Promise returns string: The address of the account that owns the given token.

Example

> kip17.ownerOf(8).then(console.log)
0x0e0E95426343d97CC7BB913C7D7DBea065A31814

kip17.getApproved

kip17.getApproved(tokenId)

Returns the address who was permitted to transfer this token, or 'zero' address, if no address was approved. It reverts if the given token id does not exist.

Parameters

Name
Type
Description

tokenId

BigNumber | string | number

The id of the token.

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Promise returns string: The address of the account that has the right to transfer the given token.

Example

// 권한 있는 계정 주소가 존재할 경우
> kip17.getApproved(10).then(console.log)
0x23D8E9cae17b22d3DAC65b4F7D2C737C6A7b865d

//권한 있는 계정 주소가 존재하지 않을 경우
> kip17.getApproved(3).then(console.log)
0x0000000000000000000000000000000000000000

kip17.isApprovedForAll

kip17.isApprovedForAll(owner, operator)

Returns true if an operator is approved to transfer all tokens that belong to the owner.

Parameters

Name
Type
Description

owner

string

토큰을 소유한 계정 주소입니다. 이 계정은 operator에게 자신의 모든 토큰을 전송하도록 허락한 계정입니다.

operator

string

토큰 소유자를 대신해 토큰 소유자의 모든 토큰을 전송하도록 허락받은 계정 주소입니다.

Return Value

Promise returns boolean: true if an operator is approved to send all tokens that belong to the owner.

Example

> kip17.isApprovedForAll('0x{address in hex}', '0x{address in hex}').then(console.log)
false

> kip17.isApprovedForAll('0x{address in hex}', '0x{address in hex}').then(console.log)
true

kip17.isMinter

kip17.isMinter(address)

Returns true if the given account is a minter who can issue new tokens in the current contract conforming to KIP-17.

Parameters

Name
Type
Description

address

string

발행 권한을 가지고 있는지를 확인받을 계정 주소입니다.

Return Value

Promise returns boolean: true if the account is a minter.

Example

> kip17.isMinter('0x{address in hex}').then(console.log)
true

> kip17.isMinter('0x{address in hex}').then(console.log)
false

kip17.paused

kip17.paused()

Returns true if the contract is paused, and false otherwise.

Parameters

None

Return Value

Promise returns boolean: true if the contract is paused.

Example

> kip17.paused().then(console.log)
true

> kip17.paused().then(console.log)
false

kip17.isPauser

kip17.isPauser(address)

Returns true if the given account is a pauser who can suspend transferring tokens.

Parameters

Name
Type
Description

address

string

토큰 전송을 멈출 권한이 있는지를 확인받을 계정 주소입니다.

Return Value

Promise returns boolean: true if the account is a pauser.

Example

> kip17.isPauser('0x{address in hex}').then(console.log)
true

> kip17.isPauser('0x{address in hex}').then(console.log)
false

kip17.approve

kip17.approve(to, tokenId [, sendParam])

Approves another address to transfer a token of the given token id. The zero address indicates there is no approved address. There can only be one approved address per token. This method is allowed to call only by the token owner or an approved operator.

Note that this method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

to

string

토큰 소유자를 대신해 토큰을 사용하는 계정 주소입니다.

tokenId

BigNumber | string | number

토큰 사용자가 사용을 허락받은 토큰의 ID입니다.

sendParam

object

(선택 사항) 트랜잭션 전송을 위해 사용될 파라미터들이 정의된 객체입니다.

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

The sendParam object can contain the following:

Name
Type
Description

from

string

(선택 사항) 트랜잭션 발신자 주소입니다. 미입력시 kip17.options.from에 의해 지정됩니다. sendParam객체의 from 또는 kip17.options.from가 주어지지 않으면 오류가 발생합니다.

gas

number | string

(선택 사항) 트랜잭션에 규정된 최대 가스입니다 (가스 제한). 미입력시 caver-js가 kip17.methods.approve(spender, tokenId).estimateGas({from})를 호출하여 이 값을 지정합니다.

gasPrice

number | string

(optional) The gas price in peb to use for this transaction. 생략하면 caver.klay.getGasPrice 값으로 caver-js가 설정합니다.

value

number | string | BN | BigNumber

(선택 사항) peb으로 환산한 전송될 토큰 가치.

feeDelegation

boolean

(optional, default false) Whether to use fee delegation transaction. 미입력시 kip17.options.feeDelegation를 사용합니다. 둘 다 미입력시 수수료 위임은 사용되지 않습니다.

feePayer

string

(optional) The address of the fee payer paying the transaction fee. When feeDelegation is true, the value is set to the feePayer field in the transaction. 미입력시 kip17.options.feePayer를 사용합니다. 둘 다 미입력시 오류를 반환합니다.

feeRatio

string

(optional) The ratio of the transaction fee the fee payer will be burdened with. If feeDelegation is true and feeRatio is set to a valid value, a partial fee delegation transaction is used. The valid range of this is between 1 and 99. The ratio of 0, or 100 and above are not allowed. 미입력시 kip17.options.feeRatio를 사용합니다.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.approve('0x{address in hex}', 10, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x3875c3f3120c1773c3adeb97260808c8a385bf8427bc203d10cbc5d262f67dbc',
    blockNumber: 2650,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x5e0e6f1f0bdf9a263e1b1bb6e9759ba182982377',
    ...
    events: {
        Approval: {
            address: '0x5E0e6F1F0bDf9A263e1B1bB6e9759Ba182982377',
            blockNumber: 2650,
            transactionHash: '0x0ae92570560d64fa103c8be1861c8625d34ac560066398d9ad0d389ad5f7e441',
            transactionIndex: 0,
            blockHash: '0x3875c3f3120c1773c3adeb97260808c8a385bf8427bc203d10cbc5d262f67dbc',
            logIndex: 0,
            id: 'log_55296c9d',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                '1': '0x58746F9D739bC81713E5F5512529876F508a6166',
                '2': '2',
                owner: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                approved: '0x58746F9D739bC81713E5F5512529876F508a6166',
                tokenId: '2',
            },
            event: 'Approval',
            signature: '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925',
            raw: {
                data: '0x',
                topics: [ '0x8c5be...', '0x00...afd', '0x00...166', '0x00...002' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 대납 트랜잭션 사용
> kip17.approve('0x{address in hex}', 10, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.approve('0x{address in hex}', 10).then(console.log)

kip17.setApprovalForAll

kip17.setApprovalForAll(to, approved [, sendParam])

Approves the given operator to, or disallow the given operator, to transfer all tokens of the owner.

Note that the setApprovalForAll method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

to

string

토큰 소유자의 모든 토큰을 전송할 권한을 받거나 전송할 권한을 잃게될 계정 주소입니다.

approved

Boolean

true이면 이 operator는 전송할 권한을 받습니다. false이면 이 operator는 전송할 권한을 잃습니다.

sendParam

object

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.setApprovalForAll('0x{address in hex}', false, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x34379ac5b71f16f41d5171d021ca2945e02c60d9fb7f85fc0127262c2ce72b47',
    blockNumber: 3340,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x1f15b1a4da5437b29bfb7f248b5e344e6b16b654',
    ...
    events: {
        ApprovalForAll: {
            address: '0x1f15B1A4DA5437b29BfB7f248B5e344E6b16b654',
            blockNumber: 3340,
            transactionHash: '0x72fdf23482b9cf164638e6cbdfdf56541a6189c88639e21f076a8a50ef749a50',
            transactionIndex: 0,
            blockHash: '0x34379ac5b71f16f41d5171d021ca2945e02c60d9fb7f85fc0127262c2ce72b47',
            logIndex: 0,
            id: 'log_1069ad22',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                '1': '0x399bE7034F26feFB5AE683e488903B8bE5ad38b8',
                '2': false,
                owner: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                operator: '0x399bE7034F26feFB5AE683e488903B8bE5ad38b8',
                approved: false,
            },
            event: 'ApprovalForAll',
            signature: '0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31',
            raw: {
                data: '0x0000000000000000000000000000000000000000000000000000000000000000',
                topics: [ '0x17307...', '0x00...afd', '0x00...8b8' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 트랜잭션 사용
> kip17.setApprovalForAll('0x{address in hex}', false, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.setApprovalForAll('0x{address in hex}', true).then(console.log)

kip17.transferFrom

kip17.transferFrom(from, to, tokenId [, sendParam])

Note that sending this transaction will charge the transaction fee to the transaction sender.

Parameters

Name
Type
Description

from

string

주어진 토큰 소유자 주소 또는 주어진 토큰을 전송하도록 승인받은 operator 주소입니다.

to

string

토큰을 받을 계정 주소입니다.

tokenId

BigNumber | string | number

전송하고 싶은 토큰의 토큰 ID입니다.

sendParam

object

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.transferFrom('0x{address in hex}', '0x{address in hex}', 2, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x9cae3aa93d327804f333674a77d5d01d8c7908c49749b0d747b6391faa232b58',
    blockNumber: 3592,
    contractAddress: null,
    from: '0x9c4fc0ab840914a29c7deb5cc5c625a4cec3a9cd',
    ...
    status: true,
    to: '0x6e611498570bbc8cb127899c4d24e156ec72473a',
    ...
    events: {
        Transfer: {
            address: '0x6e611498570bBc8cb127899C4D24e156ec72473a',
            blockNumber: 3592,
            transactionHash: '0x386af961e5acda2c5bd58ec71ee52f579dc2b07a2e5ec97678453f04cc1b709a',
            transactionIndex: 0,
            blockHash: '0x9cae3aa93d327804f333674a77d5d01d8c7908c49749b0d747b6391faa232b58',
            logIndex: 0,
            id: 'log_c2ba5874',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                '1': '0x045796ABC035001CF50274FcA8A2614Abf5dd6bf',
                '2': '2',
                from: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                to: '0x045796ABC035001CF50274FcA8A2614Abf5dd6bf',
                tokenId: '2',
            },
            event: 'Transfer',
            signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
            raw: {
                data: '0x',
                topics: [ '0xddf25...', '0x00...afd', '0x00...6bf', '0x00...002' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 트랜잭션 사용
> kip17.transferFrom('0x{address in hex}', '0x{address in hex}', 2, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.transferFrom('0x{address in hex}', '0x{address in hex}', 2).then(console.log)

kip17.safeTransferFrom

kip17.safeTransferFrom(from, to, tokenId [, data] [, sendParam])

Safely transfers the token of the given token id tokenId from the token owner's balance to another address. The address that was authorized to send the token owner's token (the operator) or the token owner him/herself is expected to execute this token transfer transaction. Thus, an authorized address or the token owner should be the sender of this transaction whose address must be given at sendParam.from or kip17Instance.options.from. Unless both sendParam.from and kip17Instance.options.from are provided, an error would occur.

Note that sending this transaction will charge the transaction fee to the transaction sender.

Parameters

Name
Type
Description

from

string

The address of the owner or the approved operator of the given token.

to

string

The address of the account to receive the token.

tokenId

BigNumber | string | number

The id of the token you want to transfer.

data

Buffer | string | number

(선택 사항) 호출 시 함께 보낼 데이터입니다.

sendParam

object

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Example

// (데이터 없이) 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.safeTransferFrom('0x{address in hex}', '0x{address in hex}', 9, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x14c5bebc2be86081d8375ba11edba0e541be1df24c1beced1a9e82e3083a8035',
    blockNumber: 6260,
    contractAddress: null,
    from: '0x80b88b47361cec0baee1947868fc872b784cf91e',
    ...
    status: true,
    to: '0xa9066e2b62483bcdf6358874cb87f9e0046e8ad3',
    ...
    events: {
        Transfer: {
            address: '0xA9066e2B62483bcdf6358874CB87f9e0046E8ad3',
            blockNumber: 6260,
            transactionHash: '0x0a92436289e70018f9ebef0df5d3ce87874afd8e5058fcc08fefc6de3e0e9b36',
            transactionIndex: 0,
            blockHash: '0x14c5bebc2be86081d8375ba11edba0e541be1df24c1beced1a9e82e3083a8035',
            logIndex: 0,
            id: 'log_c9c17595',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                '1': '0x0F47Ea1A10B8F7D61c894E392EfaC990A314d313',
                '2': '9',
                from: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                to: '0x0F47Ea1A10B8F7D61c894E392EfaC990A314d313',
                tokenId: '9',
            },
            event: 'Transfer',
            signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
            raw: {
                data: '0x',
                topics: [ '0xddf25...', '0x00...afd', '0x00...313', '0x00...009' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 트랜잭션 사용
> kip17.safeTransferFrom('0x{address in hex}', '0x{address in hex}', 9, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

//  주어진 from 필드(데이터 있음)에서 sendParam 객체를 통해 전송
> kip17.safeTransferFrom('0x{address in hex}', '0x{address in hex}', 11, '0x1234', { from: '0x{address in hex}' }).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.safeTransferFrom('0x{address in hex}', '0x{address in hex}', 11).then(console.log)

kip17.addMinter

kip17.addMinter(account [, sendParam])

Adds an account as a minter, who are permitted to mint tokens.

Note that the addMinter method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

account

string

발행자에 추가될 계정 주소입니다.

sendParam

object

NOTE If sendParam.from or kip17.options.from were given, it should be a minter.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.addMinter('0x{address in hex}', { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0xecd0fb45a32323d5cb14558d1d9299393022d5e7284519598dbd8b14c4c55930',
    blockNumber: 8307,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x1595b5c1027ed36dcb32e4d39766b896d5b97ecb',
    ...
    events: {
        MinterAdded: {
            address: '0x1595b5c1027ed36dCB32e4D39766b896d5B97ecb',
            blockNumber: 8307,
            transactionHash: '0xf8da21958c84aa3ed8bfa5eea0649c5b9a895efa8c7a715196e000bef4f0b8bd',
            transactionIndex: 0,
            blockHash: '0xecd0fb45a32323d5cb14558d1d9299393022d5e7284519598dbd8b14c4c55930',
            logIndex: 0,
            id: 'log_f40a92bf',
            returnValues: {
                '0': '0x90170C1E7E8C14BBf1124f52980372088BA540Dc',
                account: '0x90170C1E7E8C14BBf1124f52980372088BA540Dc',
            },
            event: 'MinterAdded',
            signature: '0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6',
            raw: {
                data: '0x',
                topics: [ '0x6ae17...', '0x00...0dc' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.addMinter('0x{address in hex}', {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.addMinter('0x{address in hex}').then(console.log)

kip17.renounceMinter

kip17.renounceMinter([sendParam])

Renounces the right to mint tokens. Only a minter address can renounce the minting right.

Note that the renounceMinter method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

sendParam

object

If sendParam.from or kip17.options.from were given, it should be a minter with MinterRole.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.renounceMinter({ from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0xe130d7ee71a2c55b3cf4e2bce9ea26e7c2cde556c7f8288abac60121b27c26c8',
    blockNumber: 8542,
    contractAddress: null,
    from: '0xb72f5cf2627e6614984d8a9f27ee426b29191831',
    ...
    status: true,
    to: '0xf9d0663fc29c48495f42c0b061cb06df6df76c34',
    ...
    events: {
        MinterRemoved: {
            address: '0xF9D0663fC29c48495F42c0b061cB06Df6DF76c34',
            blockNumber: 8542,
            transactionHash: '0x557a4e7b9fd6577ffdb14c2e1f00c0009a7bbda2294502fa765250632b5b0f99',
            transactionIndex: 0,
            blockHash: '0xe130d7ee71a2c55b3cf4e2bce9ea26e7c2cde556c7f8288abac60121b27c26c8',
            logIndex: 0,
            id: 'log_04b47645',
            returnValues: {
                '0': '0xB72F5cF2627e6614984D8A9F27eE426b29191831',
                account: '0xB72F5cF2627e6614984D8A9F27eE426b29191831',
            },
            event: 'MinterRemoved',
            signature: '0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692',
            raw: {
                data: '0x',
                topics: [ '0xe9447...', '0x00...831' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.renounceMinter({
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.renounceMinter().then(console.log)

kip17.mintWithTokenURI

kip17.mintWithTokenURI(to, tokenId, tokenURI [, sendParam])

Creates a token with the given uri and assigns them to the given account. This method increases the total supply of this token.

Note that the mintWithTokenURI method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

to

string

토큰이 발행될 계정 주소입니다.

tokenId

BigNumber | string | number

발행될 토큰 ID입니다.

tokenURI

string

발행될 토큰 URI입니다.

sendParam

object

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

NOTE If sendParam.from or kip17.options.from were given, it should be a minter with MinterRole.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.mintWithTokenURI('0x{address in hex}', 18, tokenURI, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0xd2473b9853ad33c5fa0a75187e65733614ed4f8c937d06e239768a5ca32d7c7f',
    blockNumber: 9313,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x7fbf73709054007f5262692f8faf27dee75ab3a6',
    ...
    events: {
        Transfer: {
            address: '0x7FBf73709054007f5262692f8FaF27dEE75Ab3A6',
            blockNumber: 9313,
            transactionHash: '0x17c2eda25c8a817915e3dd77b4fb4838259e8b49ae1c0d8e369167f715a08e7f',
            transactionIndex: 0,
            blockHash: '0xd2473b9853ad33c5fa0a75187e65733614ed4f8c937d06e239768a5ca32d7c7f',
            logIndex: 0,
            id: 'log_d060e77e',
            returnValues: {
                '0': '0x0000000000000000000000000000000000000000',
                '1': '0x203ad91221290901CFDAC9399aCf664499924744',
                '2': '18',
                from: '0x0000000000000000000000000000000000000000',
                to: '0x203ad91221290901CFDAC9399aCf664499924744',
                tokenId: '18',
            },
            event: 'Transfer',
            signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
            raw: {
                data: '0x',
                topics: [ '0xddf25...', '0x00...000', '0x00...744', '0x00...012' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.mintWithTokenURI('0x{address in hex}', 18, tokenURI, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.mintWithTokenURI('0x{address in hex}', 18, tokenURI).then(console.log)

kip17.burn

kip17.burn(tokenId [, sendParam])

Destroys the token of the given token id. Without sendParam.from nor kip17.options.from being provided, an error would occur.

Note that the burn method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

tokenId

BigNumber | string | number

제거할 토큰 ID입니다.

sendParam

object

NOTE The tokenId parameter accepts number type but if the fed value were out of the range capped by number.MAX_SAFE_INTEGER, it might cause an unexpected result or error. In this case, it is recommended to use the BigNumber type, especially for a uint256 sized numeric input value.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.burn(14, { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x09d8ed5582fdd1c39b0f19f14f065659fe275a60856d86a1840535f6df1a2d51',
    blockNumber: 18237,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x2032e61c79a951aacef8033adca96fc3b9b747b4',
    ...
    events: {
        Transfer: {
            address: '0x2032e61C79A951AACEf8033AdCa96fC3b9b747b4',
            blockNumber: 18237,
            transactionHash: '0x4e377d8d65c8565c7bc91568bcdcc0fddeb46a02a778725e437f368a8d9c6165',
            transactionIndex: 0,
            blockHash: '0x09d8ed5582fdd1c39b0f19f14f065659fe275a60856d86a1840535f6df1a2d51',
            logIndex: 0,
            id: 'log_5af49695',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                '1': '0x0000000000000000000000000000000000000000',
                '2': '14',
                from: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                to: '0x0000000000000000000000000000000000000000',
                tokenId: '14',
            },
            event: 'Transfer',
            signature: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
            raw: {
                data: '0x',
                topics: [ '0xddf25...', '0x00...afd', '0x00...000', '0x00...00e' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.burn(14, {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.burn(14).then(console.log)

kip17.pause

kip17.pause([sendParam])

Suspends functions related to sending tokens.

Note that the pause method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

sendParam

object

NOTE If sendParam.from or kip17.options.from were given, it should be a pauser with PauserRole.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.pause({ from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0xd73c026474b2077a04808ed0ce6713821eaa8afaed476b19d22b28e483747e04',
    blockNumber: 19826,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x601c11f396e92436df8d9bbaff3fbfec906b7f67',
    ...
    events: {
        Paused: {
            address: '0x601C11F396E92436Df8d9bBAFf3fbfEc906B7f67',
            blockNumber: 19826,
            transactionHash: '0x549f7786ca5d2c1877be20126fc51c2418194ecaa8cea536d08f72c2f01919d0',
            transactionIndex: 0,
            blockHash: '0xd73c026474b2077a04808ed0ce6713821eaa8afaed476b19d22b28e483747e04',
            logIndex: 0,
            id: 'log_93d26310',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                account: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
            },
            event: 'Paused',
            signature: '0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258',
            raw: {
                data: '0x0000000000000000000000001147c04b90d1546d76983e19937ad2cdae8b8afd',
                topics: ['0x62e78...'],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.pause({
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.pause().then(console.log)

kip17.unpause

kip17.unpause([sendParam])

Resumes the paused contract.

Note that the unpause method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

sendParam

object

NOTE If sendParam.from or kip17.options.from were given, it should be a pauser with PauserRole.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.unpause({ from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x6a9fc0c70853e696e687b119ba95971a42d91616a040ec17afe1fd4803f5a6cb',
    blockNumber: 19845,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x601c11f396e92436df8d9bbaff3fbfec906b7f67',
    ...
    events: {
        Unpaused: {
            address: '0x601C11F396E92436Df8d9bBAFf3fbfEc906B7f67',
            blockNumber: 19845,
            transactionHash: '0x4f0d2767fc36e5062a34753bc447a2c15b476c304f8e9e013ddf06124db33229',
            transactionIndex: 0,
            blockHash: '0x6a9fc0c70853e696e687b119ba95971a42d91616a040ec17afe1fd4803f5a6cb',
            logIndex: 0,
            id: 'log_364c25d2',
            returnValues: {
                '0': '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
                account: '0x1147c04b90D1546d76983e19937aD2cDAE8b8afD',
            },
            event: 'Unpaused',
            signature: '0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa',
            raw: {
                data: '0x0000000000000000000000001147c04b90d1546d76983e19937ad2cdae8b8afd',
                topics: ['0x5db9e...'],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.unpause({
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.unpause().then(console.log)

kip17.addPauser

kip17.addPauser(account [, sendParam])

Adds an account as a pauser that has the right to suspend the contract.

Note that the addPauser method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

account

string

컨트랙트 중지 권한을 가질 계정 주소입니다.

sendParam

object

NOTE If sendParam.from or kip17.options.from were given, it should be a pauser with PauserRole.

Return Value

Example

// 주어진 from 필드에서  sendParam 객체를 통해 전송
> kip17.addPauser('0x{address in hex}', { from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0xd9f18912c9666a67a2e7445af0abe5140212955b3d35c491e5475d512fdee7d5',
    blockNumber: 20502,
    contractAddress: null,
    from: '0x1147c04b90d1546d76983e19937ad2cdae8b8afd',
    ...
    status: true,
    to: '0x4010afbfbf8d94830b226fc5ff311859af806b90',
    ...
    events: {
        PauserAdded: {
            address: '0x4010afbfbF8d94830b226Fc5ff311859AF806B90',
            blockNumber: 20502,
            transactionHash: '0x5f6fef2df70dcbe67e6d74e201005b618da5d53ac2f85ad31fce39226fd1b70b',
            transactionIndex: 0,
            blockHash: '0xd9f18912c9666a67a2e7445af0abe5140212955b3d35c491e5475d512fdee7d5',
            logIndex: 0,
            id: 'log_bf9f8982',
            returnValues: {
                '0': '0xD050b56bB04Da257D144e6b382318A2B8c58b0B2',
                account: '0xD050b56bB04Da257D144e6b382318A2B8c58b0B2',
            },
            event: 'PauserAdded',
            signature: '0x6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f8',
            raw: {
                data: '0x',
                topics: [ '0x6719d...', '0x00...0b2' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.addPauser('0x{address in hex}', {
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.addPauser('0x{address in hex}').then(console.log)

kip17.renouncePauser

kip17.renouncePauser([sendParam])

Renounces the right to pause the contract. Only a pauser address can renounce its own pausing right.

Note that the renouncePauser method will submit a transaction to the Klaytn network, which will charge the transaction fee to the sender.

Parameters

Name
Type
Description

sendParam

object

NOTE If sendParam.from or kip17.options.from were given, it should be a pauser with PauserRole.

Return Value

Example

// 주어진 from 필드에서 sendParam 객체를 통해 전송
> kip17.renouncePauser({ from: '0x{address in hex}' }).then(console.log)
{
    blockHash: '0x32bb338ca23846478934416d1b1f4152b69a49411d61b316cff8b3a7d62ca91e',
    blockNumber: 20512,
    contractAddress: null,
    from: '0xe04cb220e94e6595427568c954b5d819392813bc',
    ...
    status: true,
    to: '0x4010afbfbf8d94830b226fc5ff311859af806b90',
    ...
    events: {
        PauserRemoved: {
            address: '0x4010afbfbF8d94830b226Fc5ff311859AF806B90',
            blockNumber: 20512,
            transactionHash: '0x72982fa8a8de25c961cd19bd91aa7acf0111feb8e9026e607d89843bcd8f783a',
            transactionIndex: 0,
            blockHash: '0x32bb338ca23846478934416d1b1f4152b69a49411d61b316cff8b3a7d62ca91e',
            logIndex: 0,
            id: 'log_0a9d1350',
            returnValues: {
                '0': '0xE04cB220e94E6595427568c954b5D819392813bC',
                account: '0xE04cB220e94E6595427568c954b5D819392813bC',
            },
            event: 'PauserRemoved',
            signature: '0xcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e',
            raw: {
                data: '0x',
                topics: [ '0xcd265...', '0x00...3bc' ],
            },
        },
    },
}

// 스마트 컨트랙트 실행에 수수료 대납 사용
> kip17.renouncePauser({
    from: '0x{address in hex}'
    feeDelegation: true,
    feePayer: '0x{address in hex}'
}).then(console.log)

// kip17.options.from 사용
// kip17 인스턴스로 트랜잭션을 보낼 때 sendParam 객체에서 `from`을 지정하지 않는다면
// kip17.options.from 값이 설정되어 있을 시 기본 값으로 사용
> kip17.options.from = '0x{address in hex}'
> kip17.renouncePauser().then(console.log)

keyring 인스턴스에 있는 계정 주소입니다. 이 주소가 KIP-17 토큰 컨트랙트를 배포합니다. 이 주소는 반드시 배포를 위해 충분한 KLAY를 가지고 있어야 합니다. 자세한 내용은 을 참조하세요. 트랜잭션 전송 시 사용할 필드를 자체적으로 정의하고 싶다면 객체 타입을 매개변수로 전달하면 됩니다. KIP-17 컨트랙트 배포 시 수수료 위임을 이용하고 싶다면, 객체 내 수수료 위임과 관련된 필드를 정의할 수 있습니다. 이 필드의 사용에 관한 내용은 의 매개변수 설명을 참고하십시오.

트랜잭션 영수증을 사용할 수 있을 때 발생합니다. 영수증 객체 속성값들에 관한 자세한 정보는 를 참고하십시오. KIP17 인스턴스의 영수증은 'logs' 속성 대신에 ABI로 파싱된 'events' 속성을 가지고 있습니다.

Source code: .

ABI-encoded Value:

Returns the information of the interface implemented by the token contract. This static function will use .

Promise returns an object containing the result with boolean values whether each is implemented.

Creates a new KIP17 instance with its bound methods and events. This function works the same as .

NOTE caver.kct.kip17.create is supported since caver-js .

See the .

See the .

Promise returns an object containing the result with boolean values whether each is implemented.

NOTE feeDelegation, feePayer and feeRatio are supported since caver-js .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. sendParam에 관한 자세한 정보는 의 파라미터 설명을 참고하십시오.

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

Transfers the token of the given token id, tokenId from the token owner's balance to another address. The address that was authorized to send the token owner's token (the operator) or the token owner him/herself is expected to execute this token transfer transaction. Thus, an authorized account or the token owner should be the sender of this transaction whose address must be given at sendParam.from or kip17Instance.options.from. Unless both sendParam.from and kip17Instance.options.from are provided, an error would occur. It is recommended to use whenever possible instead of this method.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

If the to is a contract address, it must implement . otherwise, the transfer is reverted.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

(optional) An object with defined parameters for sending a transaction. For more information about sendParam, refer to the parameter description of .

Promise returns object - The receipt containing the result of the transaction execution. If you want to know about the properties inside the receipt object, see the description of . Receipts from KIP-17 instances have an 'events' attribute parsed via ABI instead of a 'logs' attribute.

KIP-17
caver.contract
Klaytn Contracts Github Repo
Klaytn Improvement Proposals
KIP17 Contracts Github Link
kip17JsonInterface at dev · klaytn/caver-js · GitHub
KIP-17 interface
v1.6.1
KIP-17 interface
v1.6.1
IKIP17Receiver.onKIP17Received
kip17.detectInterface
new KIP17
new KIP17
new KIP17
safeTransferFrom
approve
approve
approve
approve
approve
approve
approve
approve
approve
approve
approve
approve
Keyring
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt
getTransactionReceipt