Documentation Index
Fetch the complete documentation index at: https://docs.story.foundation/llms.txt
Use this file to discover all available pages before exploring further.
IPAccount
Methods
- set_ip_metadata
- execute
- execute_with_sig
- transfer_erc20
Sets the metadataURI for an IP asset.
Parameters:
ip_id: The IP to set the metadata for.
metadata_uri: The metadataURI to set for the IP asset. Should be a URL pointing to metadata that fits the IPA Metadata Standard.
metadata_hash: The hash of metadata at metadataURI.
tx_options: [Optional] Transaction options dictionary.
tx_hash = story_client.IPAccount.set_ip_metadata(
ip_id="0x01",
metadata_uri="https://ipfs.io/ipfs/bafkreiardkgvkejqnnkdqp4pamkx2e5bs4lzus5trrw3hgmoa7dlbb6foe",
# example hash (not accurate)
metadata_hash="0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997",
)
execute
Executes a transaction from the IP Account.
Parameters:
ip_id: The IP Id to get ip account.
to: The recipient of the transaction.
value: The amount of Ether to send.
data: The data to send along with the transaction.
tx_options: [Optional] Transaction options dictionary.
response = story_client.IPAccount.execute(
ip_id="0x01",
to="0x1234567890123456789012345678901234567890",
value=1000000000000000000, # 1 ETH
data="0x1234567890123456789012345678901234567890",
)
execute_with_sig
Executes a transaction from the IP Account.
Parameters:
ip_id: The IP to set the metadata for.
to: The recipient of the transaction.
data: The data to send along with the transaction.
signer: The signer of the transaction.
deadline: The deadline of the transaction signature.
signature: The signature of the transaction, EIP-712 encoded.
value: [Optional] The amount of Ether to send. Default: 0
tx_options: [Optional] Transaction options dictionary.
response = story_client.IPAccount.execute_with_sig(
ip_id="0x01",
to="0x1234567890123456789012345678901234567890",
data="0x1234567890123456789012345678901234567890",
signer="0x1234567890123456789012345678901234567890",
deadline=1000000000000000000,
signature="0x1234567890123456789012345678901234567890",
value=1000000000000000000, # 1 ETH
)
transfer_erc20
Transfers an ERC20 token from the IP Account.
Parameters:
ip_id: The ipId of the account
tokens: The token info to transfer
tokens.address: The address of the ERC20 token including WIP and standard ERC20.
tokens.amount: The amount of tokens to transfer
tokens.target: The address of the recipient.
tx_options: [Optional] Transaction options dictionary.
response = story_client.IPAccount.transferERC20(
ip_id="0x01",
tokens=[
{
"address": "0x1514000000000000000000000000000000000000", # $WIP
"target": "0x02",
"amount": 1000000 # Equivalent to 0.001 ether
}
]
)