@owneraio/finp2p-sdk-js
v0.21.27
Published
The Ownera sdk provides an easy to use set of APIs to work with Ownera FinP2P node for various use cases, the sdk handles most of the heavy lifting for executing operations on the FinP2P network, such as signature templates generation and signing, asset m
Downloads
462
Readme
FinP2P SDK Introduction
The Ownera sdk provides an easy to use set of APIs to work with Ownera FinP2P node for various use cases, the sdk handles most of the heavy lifting for executing operations on the FinP2P network, such as signature templates generation and signing, asset managements, escrow interface and more.
Ownera API service
The purpose of this sdk is to provide an interface to the Ownera APIs.
It covers the following:
It exposes types for Typescript.
To build the lib/
and use the package, just run yarn build
.
Usage
import { Sdk } from "@owneraio/finp2p-sdk-js";
const sdk = new Sdk({
orgId: "bank-il",
custodianOrgId: 'bank-il',
owneraAPIAddress: "https://my-ownera-node.io",
authConfig: {
apiKey: "<my-api-key>",
secret: {
type: 1|2,
raw: "<my-stringified-private-key>",
},
},
custodyAdapterBaseURL: "<optional-custody-url>",
});
Create Functions:
Get Functions
Create User
const user = await sdk.createUser({});
Create asset
const issuer = await user.getData();
const asset = await sdk.createAsset({
name: "Asset Name",
type: "company",
issuerId: issuer.id,
denomination: {
type: "fiat",
code: "USD"
}
});
const assetData = await asset.getData();
Get User
const user = await getSdk().getUser({ userId: "bank-il:101:be26b474-6c77-4d67-869f-defa7483c784" });
Get Asset
const assetInterface = await getAsset({ assetId });
const asset = await assetInterface.getData();
Get Organization
const org = sdk.getOrganization({});
Another examples
More extended recipes you can check here