{"id":36573147,"url":"https://github.com/ostdotcom/ost-sdk-java","last_synced_at":"2026-01-12T07:20:21.334Z","repository":{"id":32659965,"uuid":"135231167","full_name":"ostdotcom/ost-sdk-java","owner":"ostdotcom","description":"OST Platform SDK for Java","archived":false,"fork":false,"pushed_at":"2022-05-20T20:52:44.000Z","size":167,"stargazers_count":13,"open_issues_count":4,"forks_count":3,"subscribers_count":15,"default_branch":"develop","last_synced_at":"2025-08-15T11:02:34.964Z","etag":null,"topics":["blockchain-platform","brand-tokens","economy","java","ost","sdk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ostdotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-29T02:26:51.000Z","updated_at":"2020-03-04T06:31:04.000Z","dependencies_parsed_at":"2022-09-12T21:00:33.874Z","dependency_job_id":null,"html_url":"https://github.com/ostdotcom/ost-sdk-java","commit_stats":null,"previous_names":["openstfoundation/ost-sdk-java"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ostdotcom/ost-sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostdotcom%2Fost-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostdotcom%2Fost-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostdotcom%2Fost-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostdotcom%2Fost-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ostdotcom","download_url":"https://codeload.github.com/ostdotcom/ost-sdk-java/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostdotcom%2Fost-sdk-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain-platform","brand-tokens","economy","java","ost","sdk"],"created_at":"2026-01-12T07:20:20.617Z","updated_at":"2026-01-12T07:20:21.323Z","avatar_url":"https://github.com/ostdotcom.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OST Server-Side Java SDK\n[![Build Status](https://travis-ci.org/ostdotcom/ost-sdk-java.svg?branch=develop)](https://travis-ci.org/ostdotcom/ost-sdk-java)\n\n[OST](https://dev.ost.com/) Platform SDK for Java.\n\n## Introduction\n\nOST is a complete technology solution enabling mainstream businesses \nto easily launch blockchain based economies without requiring blockchain development.\n\nBrand Tokens (BTs) are white-label cryptocurrency tokens with utility representations \nrunning on highly-scalable Ethereum-based utility blockchains, \nbacked by value token (such as OST, USDC) staked on Ethereum mainnet. Within a business`s \ntoken economy, BTs can only be transferred to whitelisted user addresses. \nThis ensures that they stay within the token economy.\n\nThe OST technology stack is designed to give businesses everything they need \nto integrate, test, and deploy BTs. Within the OST suite of products, developers \ncan use OST Platform to create, test, and launch Brand Tokens.\n\nOST APIs and server-side SDKs make it simple and easy for developers to \nintegrate blockchain tokens into their apps.\n\nFor documentation, visit [https://dev.ost.com/](https://dev.ost.com/)\n\n## Getting Started\n\n### Setup Brand Token\n1. Sign-up on [OST Platform](https://platform.ost.com) and setup your Brand Token.\n2. Obtain your API Key and API Secret from [developers page](https://platform.ost.com/mainnet/developer).\n\n### Installation\n\n#### Maven users\n\nAdd this dependency to your project's POM\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.ost\u003c/groupId\u003e\n  \u003cartifactId\u003eost-sdk-java\u003c/artifactId\u003e\n  \u003cversion\u003e2.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Building from source using Maven\n\nClone the repository:\n```bash\ngit clone https://github.com/ostdotcom/ost-sdk-java.git\ncd ost-sdk-java\n```\n\nPackage using MVN (without dependencies):\n```bash\nmvn clean package -DskipTests\n```\n\nPackage using MVN (with dependencies):\n```bash\nmvn clean compile assembly:single -DskipTests\n```\n\nThe jar file can be found in the target folder.\n\n## Usage\n\n* Initialize the SDK object:\n\t```java\n\t// Declare connection parameters.\n\n\t// Mandatory API parameters\n\n\tString apiKey = \"__abc\"; // OBTAINED FROM DEVELOPER PAGE\n\tString apiSecret = \"_xyz\";  // OBTAINED FROM DEVELOPER PAGE\n\n\t/* \n\t  The valid API endpoints are:\n\t  1. Mainnet: \"https://api.ost.com/mainnet/v2/\"\n\t  2. Testnet: \"https://api.ost.com/testnet/v2/\"\n\t*/\n\n\tString apiEndPoint = \"https://api.ost.com/testnet/v2/\";\n\n\tHashMap \u003cString,Object\u003e sdkConfig = new HashMap\u003cString,Object\u003e();\n\tsdkConfig.put(\"apiEndpoint\", apiEndPoint);\n\tsdkConfig.put(\"apiKey\", apiKey);\n\tsdkConfig.put(\"apiSecret\", apiSecret);\n\n\t// Optional API parameters\n\n\t// This is the timeout in seconds for which the socket connection will remain open.\n\tlong timeoutInSeconds = 60; // The value of timeout will always be of type long.\n\t\n\tHashMap \u003cString,Object\u003e nestedparam = new HashMap\u003cString,Object\u003e();\n\n\tnestedparam.put(\"timeout\", timeoutInSeconds);\n\tsdkConfig.put(\"config\", nestedparam);\n\n    // OST server side sdk object.\n\tOSTSDK ostObj = new OSTSDK(sdkConfig);\n\tcom.ost.services.Manifest services = (com.ost.services.Manifest) ostObj.services;\n\t```\n\n### Users Module\n\n* Initialize Users service object to perform user specific actions.\n\n\t```java\n\tcom.ost.services.Users usersService = services.users;\n\t```\n\n* Create User. This creates a unique identifier for each user.\n\n\t```java\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tJsonObject response = usersService.create( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get User Detail using the userId obtained in user create.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom user details needs to be fetched.\n\tString userId = \"c2c__\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tJsonObject response = usersService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get Users List. Pagination is supported in this API.\n\n\t```java\n\t// Mandatory API parameters\n\t// No mandatory parameters.\n\n\t// Optional API parameters  \n\n\t// Array of userIds for which data needs to be fetched.\n\tArrayList\u003cObject\u003e userIdsArray = new ArrayList\u003cObject\u003e();\n\tuserIdsArray.add(\"c2c__\");\n    userIdsArray.add(\"d2c__\");\n\n\t// Pagination identifier from the previous API call response. Not needed for page one.\n\tString paginationIdentifier = \"e77y___\";\n\n\t// Limit.\n\tlong limit = 10;\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"ids\", userIdsArray);\n\tparams.put(\"limit\", limit);\n\tparams.put(\"pagination_identifier\", paginationIdentifier);\n\n\tJsonObject response = usersService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Devices Module\n\n* Initialize Devices service object to perform device specific actions.\n\n\t```java\n\tcom.ost.services.Devices devicesService = services.devices;\n\t```\n\n* Create a Device for User.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom device needs to be created.\n\tString userId = \"c2c___\";\n\n\t// Device address of user's device.\n\tString deviceAddress = \"0x1Ea___\";\n\n\t// Device API signer address.\n\tString apiSignerAddress = \"0x5F8___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"address\", deviceAddress);\n\tparams.put(\"api_signer_address\", apiSignerAddress);\n\n\tJsonObject response = devicesService.create( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get User Device Detail using userId and deviceAddress.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom device details needs to be fetched.\n\tString userId = \"c2c___\";\n\n\t// Device address of user's device.\n\tString deviceAddress = \"0x1E___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"device_address\", deviceAddress);\n\n\tJsonObject response = devicesService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get User Devices List. Pagination is supported by this API.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom device details needs to be fetched.\n\tString userId = \"c2c6___\";\n\n\t// Optional API parameters\n\n\t// Pagination identifier from the previous API call response. Not needed for page one.\n\tString paginationIdentifier = \"eyJ___\";\n\n\t// Array of device addresses of end user.\n\tArrayList\u003cObject\u003e deviceAddressesArray = new ArrayList\u003cObject\u003e();\n\tdeviceAddressesArray.add(\"0x59___\");\n\tdeviceAddressesArray.add(\"0xab___\");\n\n\t// Limit.\n\tlong limit = 10; \n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"addresses\", deviceAddressesArray);\n\tparams.put(\"pagination_identifier\", paginationIdentifier);\n\tparams.put(\"limit\", limit);\n\n\tJsonObject response = devicesService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Device Managers Module\n\n* Initialize Device Manager service object to perform device manager specific actions.\n\n\t```java\n\tcom.ost.services.DeviceManagers deviceManagersService = services.deviceManagers;\n\t```\n\n* Get Device Manager Detail using userId.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom device manager details needs to be fetched.\n\tString userId = \"c2c___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\n\tJsonObject response = deviceManagersService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Sessions Module\n\n* Initialize Sessions service object to perform session specific actions.\n\n\t```java\n\tcom.ost.services.Sessions sessionsService = services.sessions;\n\t```\n\n* Get User Session Detail using userId and session address.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom session details needs to be fetched.\n\tString userId = \"c2c___\";\n\n\t// Session address of user for which details needs to be fetched.\n\tString sessionAddress = \"0x1Ea___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"session_address\", sessionAddress);\n\n\tJsonObject response = sessionsService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get User Sessions List using userId. Pagination is supported by this API.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of user for whom session details needs to be fetched.\n\tString userId = \"c2c___\";\n\n\t// Optional API parameters:\n\n\t// Pagination identifier from the previous API call response. Not needed for page one.\n\tString paginationIdentifier = \"eyJs___\";\n\n\t// Array of session addresses of end user.\n\tArrayList\u003cObject\u003e sessionAddressesArray = new ArrayList\u003cObject\u003e();\n\tsessionAddressesArray.add(\"0x59___\");\n\tsessionAddressesArray.add(\"0xab___\");\n\n\t// Limit.\n\tlong limit = 10; \n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"pagination_identifier\", paginationIdentifier);\n\tparams.put(\"addresses\", sessionAddressesArray);\n\tparams.put(\"limit\", limit);\n\n\tJsonObject response = sessionsService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Executing Transactions\n\nFor executing transactions, you need to understand the 4 modules described below.\n\n#### Rules Module\n\n* Initialize Rules service object to perform rules specific actions.\n\n\t```java\n\tcom.ost.services.Rules rulesService = services.rules;\n\t```\n\n* List Rules.\n\n\t```java\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tJsonObject response = rulesService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n#### Price Points Module\n\n* Initialize Price Points service object to perform price points specific actions.\n\n\t```java\n\tcom.ost.services.PricePoints pricePointsService = services.pricePoints;\n\t```\n\n* Get Price Points Detail.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// ChainId of your brand token economy.\n\tlong chainId = 2000;\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"chain_id\", chainId);\n\n\tJsonObject response = pricePointsService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n#### Transactions Module\n\n* Initialize Transactions service object to perform transaction specific actions.\n\n\t```java\n\tcom.ost.services.Transactions transactionsService = services.transactions;\n\t```\n\n* DIRECT-TRANSFERS execute transaction should be used to transfer BTs to your end-users.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// Token holder address of receiver.\n\tString transferToAddress = \"0xa3___\";\n\n\t// Amount of tokens to be transferred.\n\tString transferAmount = \"1\";\n\n\t// Company userId.\n\tString companyUserId = \"ee89___\";\n\n\t// Address of DirectTransfer rule. Use list rules API of Rules module to get the address of rules.\n\t// In the rules array which you will get in response, use the address having name \"Direct Transfer\".\n\tString directTransferRuleAddress = \"0xe379___\";\n\n\t// Parameters required for rule execution.\n\tArrayList\u003cObject\u003e arrayListForReceiverTokenHolderAddress = new ArrayList\u003cObject\u003e();\n\tarrayListForReceiverTokenHolderAddress.add(transferToAddress);\n\n\tArrayList\u003cObject\u003e arrayListAmount = new ArrayList\u003cObject\u003e();\n\tarrayListAmount.add(transferAmount);\n\n\tArrayList\u003cArrayList\u003e nestedArraylist = new ArrayList\u003cArrayList\u003e();\n\tnestedArraylist.add(arrayListForReceiverTokenHolderAddress);\n\tnestedArraylist.add(arrayListAmount);\n\n\t// Parameters required for rule execution.\n\tHashMap \u003cString,Object\u003e nestedparams = new HashMap\u003cString,Object\u003e();\n\tnestedparams.put(\"method\", \"directTransfers\");  // Rule name which needs to be passed as-is.\n\tnestedparams.put(\"parameters\", nestedArraylist);\n\n\tGson gsonObj = new Gson();\n\tString jsonStr = gsonObj.toJson(nestedparams);\n\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\n\tparams.put(\"user_id\", companyUserId);\n\tparams.put(\"to\", directTransferRuleAddress);\n\tparams.put(\"raw_calldata\", jsonStr);\n\n\t// Optional API parameters\n\n\t// Name of the transaction. Eg. \"like\", \"download\", etc.\n\t// NOTE: Max length 25 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString transactionName = \"like\";\n\n\t// Transaction type. Possible values: \"company_to_user\", \"user_to_user\", \"user_to_company\".\n\tString transactionType = \"company_to_user\";\n\n\t// Some extra information about transaction.\n\t// NOTE: Max length 125 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString details = \"lorem_ipsum\";\n\n\t// Additional transaction information. There is no dependency between any of the metaProperty keys. \n\t// However, if a key is present, its value cannot be null or undefined.       \n\tHashMap \u003cString,Object\u003e metaProperty = new HashMap\u003cString,Object\u003e();\n\tmetaProperty.put(\"name\", transactionName); \n\tmetaProperty.put(\"type\", transactionType); \n\tmetaProperty.put(\"details\", details); \n\n\tparams.put(\"meta_property\", metaProperty);\n\n\tJsonObject response = transactionsService.execute( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* PAY Execute Transaction should be used when transactions of BTs equivalent to some fiat amount need to be executed.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// Token holder address of receiver.\n\tString transferToAddress = \"0xa31__\";\n\n\t// Company token holder address.\n\tString companyTokenHolderAddress = \"0xa963___\";\n\n\n\t// Pay currency code. Supported currency codes are \"USD\", \"EUR\" and \"GBP\".\n\tString payCurrencyCode = \"USD\";\n\n\t// In pay transaction, the transfer amounts are in pay currency (fiat currency like USD) which then are converted \n\t// into tokens. Use get price point detail API of Price Points module to get this value.\n\tdouble pricePoint = 0.020606673;\n\n\t// Price point needs to be passed in atto. Multiply the price point with 10^18. Also, this value should be a string.\n\tBigDecimal intendedPricePointBD = new BigDecimal(pricePoint).multiply((new BigDecimal(10)).pow(18));\n\tString intendedPricePointInAtto = intendedPricePointBD.toString().split(\"\\\\.\")[0];\n\n\t// Amount of Fiat to be transferred.\n\tdouble transferAmountInFiat = 0.1;\n\n    // Transfer amount in wei needs to be passed in atto. Multiply the fiat transfer amount with 10^18. Also, this value should be a string. \n    BigDecimal fiatTransferAmountInWeiBD = new BigDecimal(transferAmountInFiat).multiply((new BigDecimal(10)).pow(18));\n\tString fiatTransferAmountInAtto = fiatTransferAmountInWeiBD.toString().split(\"\\\\.\")[0];\n\t  \n\t// Parameters required for rule execution.\n\tArrayList\u003cObject\u003e arrayListForReceiverTokenHolderAddress = new ArrayList\u003cObject\u003e();\n\tarrayListForReceiverTokenHolderAddress.add(transferToAddress);\n\n\tArrayList\u003cObject\u003e arrayListAmount = new ArrayList\u003cObject\u003e();\n\tarrayListAmount.add(fiatTransferAmountInAtto);\n\tGson gsonObj = new Gson();\n\n\tArrayList\u003cObject\u003e nestedArraylist = new ArrayList\u003cObject\u003e();\n\tnestedArraylist.add(companyTokenHolderAddress);\n\tnestedArraylist.add(arrayListForReceiverTokenHolderAddress);\n\tnestedArraylist.add(arrayListAmount);\n\tnestedArraylist.add(payCurrencyCode);\n\tnestedArraylist.add(intendedPricePointInAtto);\n\n\tHashMap \u003cString,Object\u003e nestedparams = new HashMap\u003cString,Object\u003e();\n\tnestedparams.put(\"method\", \"pay\");  // Rule name which needs to be passed as-is.\n\tnestedparams.put(\"parameters\", nestedArraylist);\n  \n\tString jsonRawCallData = gsonObj.toJson(nestedparams);\n\n\t// Company userId.\n\tString companyUserId = \"ee8___\";\n\n\t// Address of Pay rule. Use list rules API to get the address of rules.\n\t// In the rules array which you will get in response, use the address having name \"Pricer\".\n\tString payRuleAddress = \"0xe37___\";\n\t  \n\t/* Optional API parameters: */\n\t    \n\t// Name of the transaction. Eg. \"like\", \"download\", etc.\n\t// NOTE: Max length 25 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString transactionName = \"like\";\n\n\t// Transaction type. Possible values: \"company_to_user\", \"user_to_user\", \"user_to_company\".\n\tString transactionType = \"company_to_user\";\n\n\t// Some extra information about transaction.\n\t// NOTE: Max length 125 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString details = \"lorem_ipsum\";\n\n\tHashMap \u003cString,Object\u003e metaProperty = new HashMap\u003cString,Object\u003e();\n\tmetaProperty.put(\"name\", transactionName);\n\tmetaProperty.put(\"type\", transactionType);\n\tmetaProperty.put(\"details\", details); \n\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", companyUserId);\n\tparams.put(\"to\", payRuleAddress);\n\n\tparams.put(\"meta_property\", metaProperty);\n\tparams.put(\"raw_calldata\", jsonRawCallData);\n\n\tJsonObject response = transactionsService.execute( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get Transaction Detail using userId and transactionId.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of end-user.\n\tString userId = \"ee8___\";\n\n\t// Unique identifier of the transaction to be retrieved.\n\tString transactionId = \"f1d___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"transaction_id\", transactionId);\n\n\tJsonObject response = transactionsService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get User Transactions using userId. Pagination is supported by this API.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId of end-user.\n\tString userId = \"ee89___\";\n\n\t// Optional API parameters\n\n\t// Array of status values.\n\tArrayList\u003cObject\u003e statusesArray = new ArrayList\u003cObject\u003e();\n\tstatusesArray.add(\"CREATED\");\n\tstatusesArray.add(\"SUBMITTED\");\n\tstatusesArray.add(\"SUCCESS\");\n\tstatusesArray.add(\"FAILED\");\n\n    // To get transactions between a specific time interval, add start timestamp and end timestamp. \n    long startTime = 1563260786;\n    long endTime = 1563280786;\n \n\t// Name of the transaction. Eg. \"like\", \"download\", etc. \n\t// NOTE: Max length 25 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString transactionName = \"like\";\n\n\t// Transaction type. Possible values: \"company_to_user\", \"user_to_user\", \"user_to_company\".\n\tString transactionType = \"company_to_user\";\n\n\t// NOTE: Max length 125 characters (Allowed characters: [A-Za-z0-9_/s])\n\tString details = \"lorem_ipsum\";\n\n\t// Additional transaction information. There is no dependency between any of the metaProperty keys. \n\t// However, if a key is present, its value cannot be null or undefined. \n\tArrayList\u003cHashMap\u003cString, Object\u003e\u003e metaPropertyArray = new ArrayList\u003cHashMap\u003cString, Object\u003e\u003e();\n\tHashMap \u003cString,Object\u003e metaPropertyArrayParams = new HashMap\u003cString,Object\u003e();\n\tmetaPropertyArrayParams.put(\"name\", transactionName); \n\tmetaPropertyArrayParams.put(\"type\", transactionType); \n\tmetaPropertyArrayParams.put(\"details\", details); \n\tmetaPropertyArray.add(metaPropertyArrayParams);\n\n\tGson gsonObj = new Gson();\n\tString metaPropertyArrayJsonStr = gsonObj.toJson(metaPropertyArray);\n\n\t// Limit.\n\tlong limit = 10;\n\n\t// Pagination identifier from the previous API call response.  Not needed for page one.\n\tString paginationIdentifier = \"eyJsY___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n    params.put(\"start_time\", startTime);\n    params.put(\"end_time\", endTime);\n\tparams.put(\"statuses\", statusesArray);\n\tparams.put(\"meta_properties\", metaPropertyArrayJsonStr);\n\tparams.put(\"limit\", limit);\n\tparams.put(\"pagination_identifier\", paginationIdentifier);\n\n\tJsonObject response = transactionsService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n#### Balances Module\n\n* Initialize Balances service object to perform balances specific actions.\n\n\t```java\n\tcom.ost.services.Balance balancesService = services.balance;\n\t```\n\n* Get User Balance using userId.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId for whom balance needs to be fetched.\n\tString userId = \"c2c6___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\n\tJsonObject response = balancesService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Recovery Owners Module\n\n* Initialize Recovery Owners service object to perform recovery owners specific actions.\n\n\t```java\n\tcom.ost.services.RecoveryOwners recoveryOwnersService = services.recoveryOwners;\n\t```\n\n* Get Recovery Owner Detail using userId and recovery owner address.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// UserId for whom recovery details needs to be fetched.\n\tString userId = \"c2c___\";\n\n\t// Recovery address of user.\n\tString recoveryOwnerAddress = \"0xe37___\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"user_id\", userId);\n\tparams.put(\"recovery_owner_address\", recoveryOwnerAddress);\n\n\tJsonObject response = recoveryOwnersService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Tokens Module\n\n* Initialize Tokens service object to perform tokens specific actions.\n\n\t```java\n\tcom.ost.services.Tokens tokensService = services.tokens;\n\t```\n\n* Get Token Detail.\n\n\t```java\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tJsonObject response = tokensService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Chains Module\n\n* Initialize Chains service object to perform chains specific actions.\n\n\t```java\n\tcom.ost.services.Chains chainsService = services.chains;\n\t```\n\n* Get Chain Detail using chainId.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// ChainId for which details needs to be fetched. Only origin chainId and OST-specific auxiliary chainIds are allowed.\n\tString chainId = \"2000\";\n\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tparams.put(\"chain_id\", chainId);\n\n\tJsonObject response = chainsService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Base Tokens Module\n\n* Initialize Base Tokens service object to perform base tokens specific actions.\n\n\t```java\n\tcom.ost.services.BaseTokens baseTokensService = services.baseTokens;\n\t```\n\n* Get Base Tokens Detail.\n\n\t```java\n\tHashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n\tJsonObject response = baseTokensService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n### Webhooks Module\n\n* Initialize Webhooks service object to perform webhooks specific actions.\n\n\t```java\n\tcom.ost.services.Webhooks webhooksService = services.webhooks;\n\t```\n\n* Create Webhook using the topics and the subscription url.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// Array of topics.\n\tArrayList\u003cString\u003e topicParams = new ArrayList\u003cString\u003e();\n\ttopicParams.add(\"transactions/initiate\");\n\ttopicParams.add(\"transactions/success\");\n\t  \n\t// URL where you want to receive the event notifications.\n\tString url = \"https://www.testingWebhooks.com\";\n\n\t// Optional API parameters\n\n\t// Status of a webhook. Possible values are \"active\" and \"inactive\".\n\tString status = \"active\"; \n\n\tHashMap\u003cString, Object\u003e params = new HashMap\u003cString, Object\u003e();\n\tparams.put(\"url\", url);\n\tparams.put(\"status\", status);\n\tparams.put(\"topics\", topicParams);\n\n\tJsonObject response = webhooksService.create( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Update existing Webhook using a webhookId and an array of topics.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// Array of topics.\n\tArrayList\u003cString\u003e topicParams = new ArrayList\u003cString\u003e();\n\ttopicParams.add(\"transactions/initiate\");\n\ttopicParams.add(\"transactions/success\");\n\n\t// Unique identifier for a webhook.\n\tString webhookId = \"a743___\";\n\n\t// Optional API parameters\n\n\t// Status of a webhook. Possible values are \"active\" and \"inactive\".\n\tString status = \"active\";\n\n\tHashMap\u003cString, Object\u003e params = new HashMap\u003cString, Object\u003e();\n\tparams.put(\"webhook_id\", webhookId);\n\tparams.put(\"status\", status);\n\tparams.put(\"topics\", topicParams);\n\n\tJsonObject response = webhooksService.update( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get Webhook using webhookId.\n\n\t```java\n\t// Mandatory API parameters\n\n    // Unique identifier for a webhook.\n\tString webhookId = \"a743___\";\n\n\n\tHashMap\u003cString, Object\u003e params = new HashMap\u003cString, Object\u003e();\n\tparams.put(\"webhook_id\", webhookId);\n\n\tJsonObject response = webhooksService.get( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Get Webhook List. Pagination is supported by this API.\n\n\t```java\n\t// Mandatory API parameters\n\t// No mandatory parameters.\n\n\t// Optional API parameters\n\n\t// Limit.\n\tlong limit = 10;\n\n\t// Pagination identifier from the previous API call response.  Not needed for page one.\n\tString paginationIdentifier = \"eyJwY___\";\n\n\tHashMap\u003cString, Object\u003e params = new HashMap\u003cString, Object\u003e();\n\tparams.put(\"limit\", limit);\n\tparams.put(\"pagination_identifier\", paginationIdentifier);\n\n\tJsonObject response = webhooksService.getList( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Delete Webhook using webhookId.\n\n\t```java\n\t// Mandatory API parameters\n\n\t// Unique identifier for a webhook.\n\tString webhookId = \"a743___\";\n\n\tHashMap\u003cString, Object\u003e params = new HashMap\u003cString, Object\u003e();\n\tparams.put(\"webhook_id\", webhookId);\n\n\tJsonObject response = webhooksService.deleteWebhook( params );\n\tSystem.out.println(\"response: \" + response.toString() );\n\t```\n\n* Verify webhook request signature. This can be used to validate if the webhook received at your end from OST platform is correctly signed.\n\t\n\t```java\n\t// Webhook data obtained.\n\tString webhookEventData = \"{\\\"id\\\":\\\"54e3cd1c-afd7-4dcf-9c78-137c56a53582\\\",\\\"topic\\\":\\\"transactions/success\\\",\\\"created_at\\\":1560838772,\\\"webhook_id\\\":\\\"0823a4ea-5d87-44cf-8ca8-1e5a31bf8e46\\\",\\\"version\\\":\\\"v2\\\",\\\"data\\\":{\\\"result_type\\\":\\\"transaction\\\",\\\"transaction\\\":{\\\"id\\\":\\\"ddebe817-b94f-4b51-9227-f543fae4715a\\\",\\\"transaction_hash\\\":\\\"0x7ee737db22b58dc4da3f4ea4830ca709b388d84f31e77106cb79ee09fc6448f9\\\",\\\"from\\\":\\\"0x69a581096dbddf6d1e0fff7ebc1254bb7a2647c6\\\",\\\"to\\\":\\\"0xc2f0dde92f6f3a3cb13bfff43e2bd136f7dcfe47\\\",\\\"nonce\\\":3,\\\"value\\\":\\\"0\\\",\\\"gas_price\\\":\\\"1000000000\\\",\\\"gas_used\\\":120558,\\\"transaction_fee\\\":\\\"120558000000000\\\",\\\"block_confirmation\\\":24,\\\"status\\\":\\\"SUCCESS\\\",\\\"updated_timestamp\\\":1560838699,\\\"block_timestamp\\\":1560838698,\\\"block_number\\\":1554246,\\\"rule_name\\\":\\\"Pricer\\\",\\\"meta_property\\\":{},\\\"transfers\\\":[{\\\"from\\\":\\\"0xc2f0dde92f6f3a3cb13bfff43e2bd136f7dcfe47\\\",\\\"from_user_id\\\":\\\"acfdea7d-278e-4ffc-aacb-4a21398a280c\\\",\\\"to\\\":\\\"0x0a754aaab96d634337aac6556312de396a0ca46a\\\",\\\"to_user_id\\\":\\\"7bc8e0bd-6761-4604-8f8e-e33f86f81309\\\",\\\"amount\\\":\\\"112325386\\\",\\\"kind\\\":\\\"transfer\\\"}]}}}\";\n\n\t// Get webhoook version from webhook events data.\n\tString version = \"v2\";\n\n\t// Get ost-timestamp from the response received in event.\n\tString requestTimestamp = \"1559902637\";\n\n\t// Get signature from the response received in event.\n\tString signature = \"2c56c143550c603a6ff47054803f03ee4755c9c707986ae27f7ca1dd1c92a824\";\n\n\tString webhookSecret = \"mySecret\";\n\tString stringifiedData = webhookEventData;\n\n\tBoolean response = webhooksService.verifySignature( version, stringifiedData, requestTimestamp, signature, webhookSecret );\n\tSystem.out.println(\"response: \" + response );\n\t```\n\n\n### Redemption Modules\n\nTwo modules of redemption, \"Redeemable SKUs\" and \"User Redemptions\", are described below.\n\n#### Redeemable SKUs Module\n\n* Initialize Redeemable SKUs service object to perform redeemable skus specific actions.\n\n    ```java\n    com.ost.services.RedeemableSkus redeemableSkusService = services.redeemableSkus;\n    ```\n  \n* Get Redeemable SKU detail using the redeemable sku id.\n\n    ```java\n    // Mandatory API parameters\n\n    // Fetch details of following redeemable sku.\n    String redeemableSkuId = 'c2c__';\n    \n    HashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n    params.put(\"redeemable_sku_id\", redeemableSkuId);\n    \n    JsonObject response = redeemableSkusService.get( params );\n    System.out.println(\"response: \" + response.toString() );\n    ```\n\n* Get Redeemable SKUs List. Pagination is supported by this API.\n\n    ```java\n    // Mandatory API parameters\n    // NOTE: No mandatory parameters.\n  \n    // Optional API parameters\n  \n    // Limit.\n    long limit = 10; \n\n    // Array of redeemable SKU ids.\n    ArrayList\u003cObject\u003e redemptionSkuIdsArray = new ArrayList\u003cObject\u003e();\n    redemptionSkuIdsArray.add(\"1001\");\n    redemptionSkuIdsArray.add(\"1002\");\n\n    // Pagination identifier from the previous API call response.  Not needed for page one.\n    String paginationIdentifier = \"eyJ___\";\n \n    HashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n    params.put(\"redemption_ids\", redemptionSkuIdsArray);\n    params.put(\"pagination_identifier\", paginationIdentifier);\n    params.put(\"limit\", limit);\n    \n    JsonObject response = redeemableSkusService.getList( params );\n    System.out.println(\"response: \" + response.toString() );\n    ```\n#### User Redemptions Module\n\n* Initialize Redemptions service object to perform user redemption specific actions.\n\n    ```java\n    com.ost.services.Redemptions redemptionsService = services.redemptions;\n    ```\n\n* Get User redemption details using the userId and redemptionId.\n\n    ```java\n    // Mandatory API parameters\n\n    // UserId of user for whom redemption details needs to be fetched.\n    String userId = \"c2c6___\";\n  \n    // Unique identifier of the redemption of user.\n    String redemptionId = \"c2c___\";\n    \n    HashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n    params.put(\"user_id\", userId);\n    params.put(\"redemption_id\", redemptionId);\n    \n    JsonObject response = redemptionsService.get( params );\n    System.out.println(\"response: \" + response.toString() );\n    ```\n\n* Get User Redemptions List. Pagination is supported by this API.\n\n    ```java\n    // Mandatory API parameters\n    String userId = \"c2c6___\";\n\n    // Optional API parameters\n\n    // Limit.\n    long limit = 10;\n\n    // Array of user redemption uuids.\n    ArrayList\u003cObject\u003e redemptionIdsArray = new ArrayList\u003cObject\u003e();\n    redemptionIdsArray.add(\"eyJ___\");\n    redemptionIdsArray.add(\"eyJ___\");\n\n    // Pagination identifier from the previous API call response.  Not needed for page one.\n    String paginationIdentifier = \"eyJ___\";\n\n    HashMap \u003cString,Object\u003e params = new HashMap\u003cString,Object\u003e();\n    params.put(\"user_id\", userId);\n    params.put(\"redemption_ids\", redemptionIdsArray);\n    params.put(\"pagination_identifier\", paginationIdentifier);\n    params.put(\"limit\", limit);\n\n    JsonObject response = redemptionsService.getList( params );\n    System.out.println(\"response: \" + response.toString() );\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostdotcom%2Fost-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fostdotcom%2Fost-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostdotcom%2Fost-sdk-java/lists"}