UNPKG

@bridgesplit/rwa-token-sdk

Version:

RWA Token SDK for the development of permissioned tokens on SVM blockchains.

1,334 lines (1,333 loc) 41.9 kB
{ "address": "acpcFrzEYKjVLvZGWueTV8vyDjhu3oKC7sN38QELLan", "metadata": { "name": "asset_controller", "version": "0.0.1", "spec": "0.1.0", "description": "The Asset Controller Program (ACP) enables core asset management functionality for newly issued assets, including transfer controls and transaction privacy." }, "instructions": [ { "name": "burn_tokens", "docs": [ "burn shares of the rwa asset" ], "discriminator": [ 76, 15, 51, 254, 229, 215, 121, 66 ], "accounts": [ { "name": "owner", "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "token_account", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "owner" }, { "kind": "account", "path": "token_program" }, { "kind": "account", "path": "asset_mint" } ], "program": { "kind": "const", "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" } ], "args": [ { "name": "amount", "type": "u64" } ] }, { "name": "close_mint_account", "docs": [ "close mint account" ], "discriminator": [ 14, 121, 72, 246, 96, 224, 42, 162 ], "accounts": [ { "name": "authority", "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" } ], "args": [] }, { "name": "close_token_account", "docs": [ "close a token account" ], "discriminator": [ 132, 172, 24, 60, 100, 156, 135, 97 ], "accounts": [ { "name": "payer", "writable": true, "signer": true }, { "name": "owner", "signer": true }, { "name": "asset_mint" }, { "name": "token_account", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "owner" }, { "kind": "const", "value": [ 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169 ] }, { "kind": "account", "path": "asset_mint" } ], "program": { "kind": "const", "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" } ], "args": [] }, { "name": "create_asset_controller", "docs": [ "create an rwa asset" ], "discriminator": [ 97, 185, 6, 250, 248, 242, 68, 105 ], "accounts": [ { "name": "payer", "writable": true, "signer": true }, { "name": "authority" }, { "name": "asset_controller", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "asset_mint", "writable": true, "signer": true }, { "name": "extra_metas_account", "writable": true }, { "name": "policy_engine_account", "writable": true }, { "name": "identity_registry_account", "writable": true }, { "name": "data_registry_account", "writable": true }, { "name": "policy_engine", "address": "po1cPf1eyUJJPqULw4so3T4JU9pdFn83CDyuLEKFAau" }, { "name": "identity_registry", "address": "idtynCMYbdisCTv4FrCWPSQboZb1uM4TV2cPi79yxQf" }, { "name": "data_registry", "address": "dataeP5X1e7XsWN1ovDSEDP5cqaEUnKBmHE5iZhXPVw" }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } ] } }, { "name": "program" } ], "args": [ { "name": "args", "type": { "defined": { "name": "CreateAssetControllerArgs" } } } ] }, { "name": "disable_memo_transfer", "docs": [ "memo transfer disable" ], "discriminator": [ 68, 156, 197, 9, 43, 91, 114, 19 ], "accounts": [ { "name": "owner", "signer": true }, { "name": "token_account", "writable": true }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } ] } }, { "name": "program" } ], "args": [] }, { "name": "enable_memo_transfer", "docs": [ "memo transfer enable" ], "discriminator": [ 186, 78, 97, 172, 71, 172, 99, 0 ], "accounts": [ { "name": "payer", "writable": true, "signer": true }, { "name": "owner", "signer": true }, { "name": "asset_mint" }, { "name": "token_account", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "owner" }, { "kind": "account", "path": "token_program" }, { "kind": "account", "path": "asset_mint" } ], "program": { "kind": "const", "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } ] } }, { "name": "program" } ], "args": [] }, { "name": "freeze_token_account", "docs": [ "freeze token account" ], "discriminator": [ 138, 168, 178, 109, 205, 224, 209, 93 ], "accounts": [ { "name": "authority", "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "token_account", "writable": true }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" } ], "args": [] }, { "name": "issue_tokens", "docs": [ "issue shares of the rwa asset" ], "discriminator": [ 40, 207, 145, 106, 249, 54, 23, 179 ], "accounts": [ { "name": "authority", "writable": true, "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "to" }, { "name": "token_account", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "to" }, { "kind": "account", "path": "token_program" }, { "kind": "account", "path": "asset_mint" } ], "program": { "kind": "const", "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "amount", "type": "u64" } ] }, { "name": "revoke_tokens", "docs": [ "revoke shares of the rwa asset" ], "discriminator": [ 215, 42, 15, 134, 173, 80, 33, 21 ], "accounts": [ { "name": "authority", "writable": true, "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "authority_token_account", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "asset_controller" }, { "kind": "account", "path": "token_program" }, { "kind": "account", "path": "asset_mint" } ], "program": { "kind": "const", "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "name": "revoke_token_account", "writable": true }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "amount", "type": "u64" } ] }, { "name": "thaw_token_account", "docs": [ "thaw token account" ], "discriminator": [ 199, 172, 96, 93, 244, 252, 137, 171 ], "accounts": [ { "name": "authority", "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "token_account", "writable": true }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" } ], "args": [] }, { "name": "update_interest_bearing_mint_rate", "docs": [ "interest bearing mint rate update" ], "discriminator": [ 29, 174, 109, 163, 227, 75, 2, 144 ], "accounts": [ { "name": "authority", "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } ] } }, { "name": "program" } ], "args": [ { "name": "rate", "type": "i16" } ] }, { "name": "update_metadata", "docs": [ "edit metadata of the rwa asset" ], "discriminator": [ 170, 182, 43, 239, 97, 78, 225, 186 ], "accounts": [ { "name": "payer", "writable": true, "signer": true }, { "name": "authority", "writable": true, "signer": true }, { "name": "asset_mint", "writable": true }, { "name": "asset_controller", "pda": { "seeds": [ { "kind": "account", "path": "asset_mint" } ] } }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { "name": "token_program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } ] } }, { "name": "program" } ], "args": [ { "name": "args", "type": { "defined": { "name": "UpdateAssetMetadataArgs" } } } ] } ], "accounts": [ { "name": "AssetControllerAccount", "discriminator": [ 70, 136, 149, 138, 12, 87, 52, 105 ] } ], "events": [ { "name": "AssetMetadataEvent", "discriminator": [ 90, 19, 200, 229, 103, 82, 218, 16 ] }, { "name": "ExtensionMetadataEvent", "discriminator": [ 22, 198, 253, 69, 234, 122, 248, 117 ] } ], "errors": [ { "code": 6000, "name": "TransferMintNotApproved", "msg": "Transfer hasnt been approved for the asset mint" }, { "code": 6001, "name": "TransferFromNotApproved", "msg": "Transfer hasnt been approved for from account" }, { "code": 6002, "name": "TransferToNotApproved", "msg": "Transfer hasnt been approved for to account" }, { "code": 6003, "name": "TransferAmountNotApproved", "msg": "Transfer hasnt been approved for the specified amount" }, { "code": 6004, "name": "InvalidPolicyAccount", "msg": "Invalid policy account passed" }, { "code": 6005, "name": "TransferSlotNotApproved", "msg": "Invalid slot for approve account" }, { "code": 6006, "name": "TransferHistoryFull", "msg": "Transfer history is full" }, { "code": 6007, "name": "Unauthorized", "msg": "Unauthorized" }, { "code": 6008, "name": "InvalidPdaPassedIn", "msg": "Pda passed in for transfer is wrong" } ], "types": [ { "name": "AssetControllerAccount", "type": { "kind": "struct", "fields": [ { "name": "version", "type": "u8" }, { "name": "asset_mint", "docs": [ "mint pubkey" ], "type": "pubkey" }, { "name": "authority", "docs": [ "authority has the ability to change delegate, freeze token accounts, etc." ], "type": "pubkey" }, { "name": "delegate", "docs": [ "delegate has the ability to generate tranasction approval accounts,", "by default points to self, which allows any programs to generate an approval account", "update to any other account to control cpis" ], "type": "pubkey" } ] } }, { "name": "AssetMetadataEvent", "type": { "kind": "struct", "fields": [ { "name": "mint", "type": "string" }, { "name": "name", "type": { "option": "string" } }, { "name": "symbol", "type": { "option": "string" } }, { "name": "uri", "type": { "option": "string" } }, { "name": "decimals", "type": { "option": "u8" } } ] } }, { "name": "CreateAssetControllerArgs", "type": { "kind": "struct", "fields": [ { "name": "decimals", "type": "u8" }, { "name": "name", "type": "string" }, { "name": "symbol", "type": "string" }, { "name": "uri", "type": "string" }, { "name": "delegate", "type": { "option": "pubkey" } }, { "name": "interest_rate", "type": { "option": "i16" } } ] } }, { "name": "ExtensionMetadataEvent", "type": { "kind": "struct", "fields": [ { "name": "address", "type": "string" }, { "name": "extension_type", "type": "u8" }, { "name": "metadata", "type": "bytes" } ] } }, { "name": "UpdateAssetMetadataArgs", "type": { "kind": "struct", "fields": [ { "name": "name", "type": { "option": "string" } }, { "name": "symbol", "type": { "option": "string" } }, { "name": "uri", "type": { "option": "string" } } ] } } ] }