Ownera API service
The purpose of this sdk is to provide an interface to the Ownera APIs.
It covers the following:
- Transactional API
- Query API
- Escrow API
- Custody adapter
- Regulation verifiers
It exposes types for Typescript.
To build the lib/
and use the package, just run yarn build
.
Detailed documentation available here
Setup
You need to create a .env
file in your project with the following keys
NODE_MSPID=<organization_id, e.g: bank-us>
OWNERA_API_ADDRESS=<API url, e.g: network-bank-us.api.local.ownera.io>
Usage
Core
import { Sdk } from '@owneraio/finp2p-sdk-js';
const sdk = new Sdk({
orgId: 'myOrdId',
owneraAPIAddress: 'https://my-ownera-node.io',
owneraRASAddress: 'https://my-ownera-reg-app-store.io',
authConfig: {
apiKey: '<my-api-key>',
secret: {
type: 1|2,
raw: '<my-stringified-private-key>',
},
},
custodyAdapterBaseURL: '<optional-custody-url>',
});
const asset = await sdk.createAsset({
name: `my-asset-name`,
type: 'Company',
issuerId: 'asset-issuer-finp2p-id',
verifiers: [],
denomination: { type: 'fiat', code: 'USD' },
});
Inner functions
import { Asset, AssetConfig, OwneraAPI } from '@owneraio/finp2p-sdk-js';
export default async () => {
const config: AssetConfig = {
recipientRules: [],
recipientClaimProviders: [],
};
// Create Asset
const result = await OwneraAPI.profiles.createAsset({ config });
// Get Assets
const assets: Asset[] = await OwneraAPI.oss.getAssets({});
console.info(assets);
};