The IXO MultiClient SDK provides a unified interface for building Spatial Web client applications that leverage interchain networks, decentralized IXO Matrix data storage, and Agentic Oracles for verifiable digital twins.
Key Features
Installation
# Using npm
npm install @ixo/impactxclient-sdk
# Using yarn
yarn add @ixo/impactxclient-sdk
Quick Start
Matrix Client
Matrix Example
Query Chain
import { createMatrixClient } from "@ixo/impactxclient-sdk" ;
// Initialize matrix client
const client = await createMatrixClient ({
baseUrl: "https://matrix.ixo.world" ,
accessToken: "YOUR_TOKEN"
});
// Create data room
const room = await client . createRoom ({
name: "Digital Twin Data" ,
encryption: true
});
// Store encrypted data
await client . sendEvent ( room . roomId , "m.room.message" , {
msgtype: "m.data" ,
body: encryptedData
});
Oracle Integration
Oracle Verification
Spatial Context
import { createOracleClient } from "@ixo/impactxclient-sdk" ;
// Initialize oracle client
const oracle = await createOracleClient ({
did: "did:ixo:oracle/123" ,
endpoint: "https://oracle.ixo.world"
});
// Verify digital twin data
const verification = await oracle . verify ({
twinId: "did:ixo:twin/456" ,
data: twinData ,
context: spatialContext
});
Authentication
SignX Integration
SignX provides secure authentication and key management for Spatial Web applications.
import { SignX } from "@ixo/impactxclient-sdk" ;
// Initialize SignX client
const signx = new SignX ({
serviceEndpoint: "https://signx.ixo.world" ,
appId: "YOUR_APP_ID"
});
// Authenticate user
const auth = await signx . authenticate ({
challenge: "random_challenge" ,
chainId: "impact-hub-1"
});
// Get signing capabilities
const signer = await signx . getSigner ( auth . sessionId );
The Spatial Web Stack
Core Components
Encrypted data rooms
// Create encrypted room
const room = await matrix . createRoom ({
name: "Twin Data" ,
encryption: true ,
visibility: "private"
});
// Set room permissions
await matrix . setRoomPermissions ( room . roomId , {
readAccess: [ "did:ixo:oracle/123" ],
writeAccess: [ "did:ixo:device/456" ]
});
Secure messaging
// Send encrypted message
await matrix . sendMessage ( room . roomId , {
type: "m.room.message" ,
content: {
msgtype: "m.text" ,
body: encryptedData
}
});
File storage
// Store file
const uri = await matrix . uploadFile ( file , {
encryption: true ,
contentType: "application/json"
});
Agentic verification Oracle
// Configure oracle
const oracle = await Oracle . create ({
type: "VerificationOracle" ,
model: "causal-inference-v1" ,
confidence: 0.95
});
// Run verification
const result = await oracle . verify ({
data: twinData ,
context: spatialContext ,
rules: verificationRules
});
Spatial awareness
// Get location context
const context = await oracle . getSpatialContext ({
coordinates: [ 51.5074 , - 0.1278 ],
precision: 6 ,
timestamp: Date . now ()
});
Predictive analytics
// Run prediction
const forecast = await oracle . predict ({
twinId: "did:ixo:twin/456" ,
metrics: [ "usage" , "performance" ],
horizon: "7d"
});
Digital twin management
// Create digital twin Domain
const twin = await Entity . create ({
type: "Asset" ,
controller: "did:ixo:org/123" ,
properties: {
model: "device-v1" ,
serialNumber: "SN123"
}
});
Spatial relationships
// Define relationships
await entity . addRelationships ([{
type: "contains" ,
target: "did:ixo:twin/789" ,
properties: {
startDate: Date . now ()
}
}]);
State transitions
// Update twin state
await entity . transition ({
from: "active" ,
to: "maintenance" ,
evidence: {
reason: "scheduled" ,
timestamp: Date . now ()
}
});
Verifiable credentials
// Issue credential
const credential = await Claims . issue ({
type: "VerifiableCredential" ,
subject: "did:ixo:twin/456" ,
claims: {
performance: "certified" ,
rating: 5
}
});
Location proofs
// Create location proof
const proof = await Claims . createLocationProof ({
twinId: "did:ixo:twin/456" ,
location: spatialContext ,
timestamp: Date . now ()
});
Oracle attestations
// Get oracle attestation
const attestation = await Claims . getAttestation ({
type: "DataVerification" ,
oracle: "did:ixo:oracle/123" ,
evidence: verificationResult
});
Blockchain Modules
import { cosmos } from "@ixo/impactxclient-sdk" ;
// Bank module
const bankMsg = cosmos . bank . v1beta1 . MsgSend . fromPartial ({ /*...*/ });
// Staking module
const stakingMsg = cosmos . staking . v1beta1 . MsgDelegate . fromPartial ({ /*...*/ });
// Gov module
const govMsg = cosmos . gov . v1beta1 . MsgSubmitProposal . fromPartial ({ /*...*/ });
Smart Contract Integration
Contract Deployment
import { cosmwasm , customQueries } from "@ixo/impactxclient-sdk" ;
// Get contract code
const codes = customQueries . contract . getContractCodes ( "devnet" , "ixo" );
const code = codes . find ( c => c . name === "ixo1155" );
// Instantiate contract
const instantiateMsg = {
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract" ,
value: cosmwasm . wasm . v1 . MsgInstantiateContract . fromPartial ({
sender: myAddress ,
admin: myAddress ,
codeId: code . code ,
label: ` ${ myAddress } -contract- ${ code . code } ` ,
msg: new TextEncoder (). encode ( JSON . stringify ({
minter: myAddress
})),
funds: [{
denom: "uixo" ,
amount: "1"
}]
})
};
Contract Interaction
// Execute contract message
const executeMsg = {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract" ,
value: cosmwasm . wasm . v1 . MsgExecuteContract . fromPartial ({
sender: myAddress ,
contract: contractAddress ,
msg: new TextEncoder (). encode ( JSON . stringify ({
batch_mint: {
to: recipient ,
batch: [[ tokenId , "1000" , "uri" ]]
}
})),
funds: [{
denom: "uixo" ,
amount: "1"
}]
})
};
Error Handling
Invalid message format or parameters
Unauthorized - check wallet connection
Use Cases
Digital Twin Management Create, update, and manage digital representations of real-world assets with verifiable state
Secure Data Storage Store sensitive data in encrypted IXO Matrix rooms with controlled access and blockchain verification
Interchain Operations Execute transactions across multiple blockchain networks with unified interface and consistent security
Agentic Verification Implement automated verification workflows using Agentic Oracles for data validation and intelligence
Best Practices
Follow these guidelines for robust application development
Security
Validate all user inputs
Use secure key management
Implement proper error handling
Monitor transaction status
Batch transactions when possible
Implement proper caching
Handle offline scenarios
Monitor gas usage
Next Steps
Components Guide Learn about IXO Spatial Web components
Smart Contracts Guide Deploy smart contracts
Query Guide Using GraphQL to query the Blocksync indexing database