
Product
Introducing Reachability for PHP
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.
@kiichain/kiijs-rwa
Advanced tools
A TypeScript SDK for interacting with Real World Assets (RWA) on Cosmos-based blockchains, providing modules for compliance, identity management, token operations, and RWA protocol functionality.
npm install @kiichain/kiijs-rwa
# or
yarn add @kiichain/kiijs-rwa
First, set up your environment and initialize the client:
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
import { RwaClient } from '@kiichain/kiijs-rwa';
// Initialize wallet
const mnemonic = "your wallet mnemonic";
const signer = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: "kii",
});
// Create RWA client
const rpcUrl = "https://json-rpc.dos.sentry.testnet.v3.kiivalidator.com/";
const chainId = "oro_1336-1";
const denom = "akii";
const gasPrice = "0.025akii";
const rwaClient = await RwaClient.new(
rpcUrl,
chainId,
denom,
gasPrice,
signer
);
The base rwaClient that provides connection to the blockchain and core functionality.
Key Methods:
execute() - Execute contract transactionsquery() - Query contract stateThe RwaProtocolModule provides functionality for minting, transferring, and redeeming tokenized RWAs, as well as querying asset metadata, collateral status, and issuer credentials.
import { RwaClient, RwaProtocolModule } from '@kiichain/kiijs-rwa';
// Initialize the RWA Protocol module with your client and contract address
const rwaProtocolAddress = 'kii1rwaprotocoladdress';
const rwaProtocolModule = new RwaProtocolModule(rwaClient, rwaProtocolAddress);
Key Methods:
Asset Operations:
mintAsset() - Mint new tokenized RWA assetstransferAsset() - Transfer tokenized RWA assetsredeemAsset() - Redeem tokenized RWA assetsupdateAssetMetadata() - Update asset metadataQueries:
queryAssetMetadata() - Query asset metadataqueryCollateralStatus() - Query collateral statusqueryIssuerCredentials() - Query issuer credentialsCollateral and Issuer Management:
updateCollateralStatus() - Update collateral statusverifyIssuerCredentials() - Verify issuer credentialsExample: Minting a new RWA asset
const fromAddress = 'kii1youraddress';
const toAddress = 'kii1recipientaddress';
const mintResult = await rwaProtocolModule.mintAsset({
from: fromAddress,
to: toAddress,
assetId: 'asset123',
amount: '1000',
metadata: {
assetId: 'asset123',
name: 'Real Estate Token',
symbol: 'RET',
description: 'Tokenized real estate asset',
imageUri: 'https://example.com/image.png',
externalLink: 'https://example.com/asset',
issuer: 'issuer123',
issuanceDate: new Date().toISOString(),
denomination: 'USD',
totalSupply: '1000000'
},
gas_limit: 200000
});
Example: Querying asset metadata
const assetMetadata = await rwaProtocolModule.queryAssetMetadata({
assetId: 'asset123'
});
console.log('Asset Name:', assetMetadata.name);
console.log('Asset Symbol:', assetMetadata.symbol);
console.log('Total Supply:', assetMetadata.totalSupply);
Here's a complete example demonstrating how to use the RWA protocol module:
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
import { RwaClient, RwaProtocolModule } from '@kiichain/kiijs-rwa';
async function main() {
// Initialize wallet
const mnemonic = "your wallet mnemonic";
const signer = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: "kii",
});
// Get wallet address
const [{ address }] = await signer.getAccounts();
// Create RWA client
const rpcUrl = "https://json-rpc.dos.sentry.testnet.v3.kiivalidator.com/";
const chainId = "oro_1336-1";
const denom = "akii";
const gasPrice = "0.025akii";
const rwaClient = await RwaClient.new(
rpcUrl,
chainId,
denom,
gasPrice,
signer
);
// Initialize RWA Protocol module
const rwaProtocolAddress = 'kii1rwaprotocoladdress';
const rwaProtocolModule = new RwaProtocolModule(rwaClient, rwaProtocolAddress);
// Mint a new RWA asset
const assetId = 'asset' + Date.now();
const recipientAddress = 'kii1recipientaddress';
try {
// Mint the asset
const mintResult = await rwaProtocolModule.mintAsset({
from: address,
to: recipientAddress,
assetId: assetId,
amount: '1000',
metadata: {
assetId: assetId,
name: 'Real Estate Token',
symbol: 'RET',
description: 'Tokenized real estate asset',
imageUri: 'https://example.com/image.png',
externalLink: 'https://example.com/asset',
issuer: address,
issuanceDate: new Date().toISOString(),
denomination: 'USD',
totalSupply: '1000000'
},
gas_limit: 200000
});
console.log('Asset minted successfully:', mintResult.transactionHash);
// Query the asset metadata
const assetMetadata = await rwaProtocolModule.queryAssetMetadata({
assetId: assetId
});
console.log('Asset Metadata:', assetMetadata);
// Update collateral status
const updateCollateralResult = await rwaProtocolModule.updateCollateralStatus({
from: address,
assetId: assetId,
collateralStatus: {
collateralType: 'FIAT',
collateralAmount: '1000000',
collateralRatio: '1.0',
lastUpdated: new Date().toISOString(),
custodian: 'Test Custodian'
},
gas_limit: 200000
});
console.log('Collateral status updated:', updateCollateralResult.transactionHash);
// Query collateral status
const collateralStatus = await rwaProtocolModule.queryCollateralStatus({
assetId: assetId
});
console.log('Collateral Status:', collateralStatus);
// Transfer some assets
const transferResult = await rwaProtocolModule.transferAsset({
from: address,
to: recipientAddress,
assetId: assetId,
amount: '500',
gas_limit: 200000
});
console.log('Asset transferred successfully:', transferResult.transactionHash);
} catch (error) {
console.error('Error:', error);
}
}
main().catch(console.error);
getChainId() - Get connected chain IDgetRpcClient() - Access underlying Stargate clientManages compliance modules for RWA tokens.
import { ComplianceModule } from '@kiichain/kiijs-rwa';
const complianceAddress = "kii1compliancecontract...";
const compliance = new ComplianceModule(rwaClient, complianceAddress);
// Add compliance module
await compliance.addComplianceModule({
from: "kii1yourwallet...",
module_addr: "kii1moduleaddress...",
gas_limit: 200000,
});
// Remove compliance module
await compliance.removeComplianceModule({
from: "kii1yourwallet...",
module_addr: "kii1moduleaddress...",
gas_limit: 200000,
});
Manages identity information for RWA participants.
import { IdentityModule } from '@kiichain/kiijs-rwa';
const identityAddress = "kii1identitycontract...";
const identity = new IdentityModule(rwaClient, identityAddress);
// Add identity
await identity.addIdentity({
from: "kii1yourwallet...",
country: "BR",
gas_limit: 200000,
});
// Update identity
await identity.updateIdentity({
from: "kii1yourwallet...",
new_country: "FR",
identity_owner: "kii1useraddress...",
gas_limit: 200000,
});
// Remove identity
await identity.removeIdentity({
from: "kii1yourwallet...",
identity_owner: "kii1useraddress...",
gas_limit: 200000,
});
Handles RWA token operations including transfers, balances, and approvals.
import { TokenModule } from '@kiichain/kiijs-rwa';
const tokenAddress = "kii1tokencontract...";
const token = new TokenModule(rwaClient, tokenAddress);
// Transfer tokens
await token.transfer({
from: "kii1sender...",
to: "kii1recipient...",
amount: 1000, // Amount in base units
gas_limit: 200000,
});
// Get balance
const { balance } = await token.balance({
address: "kii1useraddress...",
});
// Get token info
const tokenInfo = await token.tokenInfo();
// Approve spender
await token.approve({
from: "kii1owner...",
spender: "kii1spender...",
amount: 500,
gas_limit: 200000,
});
// Check allowance
const { allowance } = await token.allowance(
"kii1owner...",
"kii1spender..."
);
// Initialize
const signer = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic);
const rwaClient = await RwaClient.new(rpcUrl, chainId, denom, gasPrice, signer);
// Set up modules
const token = new TokenModule(rwaClient, tokenAddress);
const identity = new IdentityModule(rwaClient, identityAddress);
const compliance = new ComplianceModule(rwaClient, complianceAddress);
// Register identity
await identity.addIdentity({
from: walletAddress,
country: "US",
gas_limit: 200000,
});
// Transfer tokens
const transferResult = await token.transfer({
from: walletAddress,
to: recipientAddress,
amount: 1000,
gas_limit: 250000,
});
console.log(`Transfer tx hash: ${transferResult.transactionHash}`);
Run tests with:
npm test
# or
yarn test
FAQs
JS SDK for kiichain rwa
We found that @kiichain/kiijs-rwa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.