WIP
메서드
deposit
withdraw
approve
balance_of
transfer
transfer_from
allowance
deposit
선택한 양의 IP를 WIP로 래핑합니다. WIP는 IP를 전송한 지갑으로 입금됩니다.
Parameters:
amount
: 입금할 금액.
tx_options
: [선택사항] 트랜잭션 옵션 딕셔너리.
Python
Request Parameters
Response
from web3 import Web3
response = story_client.WIP.deposit(
amount =Web3.to_wei( 10 , 'ether' ), # 10 IP tokens
tx_options ={ "wait_for_transaction" : True }
)
print ( f "Deposited IP to WIP at transaction hash { response[ 'tx_hash' ] } " )
withdraw
선택한 양의 WIP를 IP로 언래핑합니다.
Parameters:
amount
: 출금할 금액.
tx_options
: [선택사항] 트랜잭션 옵션 딕셔너리.
Python
Request Parameters
Response
from web3 import Web3
response = story_client.WIP.withdraw(
amount =Web3.to_wei( 5 , 'ether' ), # 5 WIP tokens
tx_options ={ "wait_for_transaction" : True }
)
print ( f "Withdrew WIP to IP at transaction hash { response[ 'tx_hash' ] } " )
approve
지갑의 WIP 잔액을 사용할 수 있도록 지출자를 승인합니다.
Parameters:
amount
: 승인할 WIP 토큰의 양.
spender
: WIP 토큰을 사용할 주소.
tx_options
: [선택사항] 트랜잭션 옵션 딕셔너리.
Python
Request Parameters
Response
from web3 import Web3
response = story_client.WIP.approve(
spender = "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba" ,
amount =Web3.to_wei( 20 , 'ether' ), # 20 WIP tokens
tx_options ={ "wait_for_transaction" : True }
)
print ( f "Approved WIP spending at transaction hash { response[ 'tx_hash' ] } " )
balance_of
주소의 WIP 잔액을 반환합니다.
Parameters:
Python
Request Parameters
Response
balance = story_client.WIP.balance_of( "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba" )
print ( f "WIP balance: { balance } " )
transfer
수신자에게 amount
WIP를 전송합니다 to
.
Parameters:
to
: 전송할 대상.
amount
: 전송할 금액.
tx_options
: [선택사항] 트랜잭션 옵션 딕셔너리.
Python
Request Parameters
Response
from web3 import Web3
response = story_client.WIP.transfer(
to = "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba" ,
amount =Web3.to_wei( 3 , 'ether' ), # 3 WIP tokens
tx_options ={ "wait_for_transaction" : True }
)
print ( f "Transferred WIP at transaction hash { response[ 'tx_hash' ] } " )
transfer_from
수신자에게 amount
WIP를 from
에서 전송합니다 to
.
Parameters:
to
: 전송할 대상.
amount
: 전송할 금액.
from_address
: 전송할 주소.
tx_options
: [선택사항] 트랜잭션 옵션 딕셔너리.
Python
Request Parameters
Response
from web3 import Web3
response = story_client.WIP.transfer_from(
to = "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba" ,
amount =Web3.to_wei( 2 , 'ether' ), # 2 WIP tokens
from_address = "0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68" ,
tx_options ={ "wait_for_transaction" : True }
)
print ( f "Transferred WIP from another account at transaction hash { response[ 'tx_hash' ] } " )
allowance
가 spender
대신 사용할 수 있는 WIP 토큰의 양을 반환합니다 owner
.
Parameters:
owner
: 토큰 소유자의 주소.
spender
: 지출자의 주소.
Python
Request Parameters
Response
response = story_client.WIP.allowance(
owner = "0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba" ,
spender = "0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68"
)
print ( f "Allowance: { response } " )