@owneraio/finp2p-sdk-js 0.14.21 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/OwneraAPI/finp2p-node-api/tokens.js +3 -0
- package/lib/OwneraAPI/finp2p-node-api/tokens.js.map +1 -1
- package/lib/OwneraAPI/oss-api/oss.js +245 -39
- package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
- package/lib/core/consts.d.ts +1 -1
- package/lib/core/consts.js +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/intent.d.ts +20 -3
- package/lib/core/intent.js +281 -15
- package/lib/core/intent.js.map +1 -1
- package/lib/core/organization.js +19 -0
- package/lib/core/organization.js.map +1 -1
- package/lib/core/signatures.d.ts +8 -1
- package/lib/core/signatures.js +29 -1
- package/lib/core/signatures.js.map +1 -1
- package/lib/core/user.d.ts +2 -2
- package/lib/core/user.js +23 -15
- package/lib/core/user.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/Core/Intents.d.ts +22 -0
- package/lib/types/Core/Organization.d.ts +10 -0
- package/lib/types/Core/User.d.ts +6 -4
- package/lib/types/Core/index.d.ts +1 -1
- package/lib/types/Oss/ExecutionPlan/OssResponses.d.ts +21 -0
- package/lib/types/Oss/ExecutionPlan/OssResponses.js +3 -0
- package/lib/types/Oss/ExecutionPlan/OssResponses.js.map +1 -0
- package/lib/types/Oss/ExecutionPlan/OssSchemas.d.ts +84 -0
- package/lib/types/Oss/ExecutionPlan/OssSchemas.js +13 -0
- package/lib/types/Oss/ExecutionPlan/OssSchemas.js.map +1 -0
- package/lib/types/Oss/ExecutionPlan/index.d.ts +2 -0
- package/lib/types/Oss/ExecutionPlan/index.js +6 -0
- package/lib/types/Oss/ExecutionPlan/index.js.map +1 -0
- package/lib/types/Oss/Oss.d.ts +13 -5
- package/lib/types/Oss/OssResponses.d.ts +10 -1
- package/lib/types/Oss/OssSchemas.d.ts +31 -2
- package/lib/types/Oss/OssSchemas.js.map +1 -1
- package/lib/types/Oss/index.d.ts +2 -1
- package/lib/types/Oss/index.js +3 -1
- package/lib/types/Oss/index.js.map +1 -1
- package/lib/types/Oss/utils.d.ts +6 -1
- package/lib/types/Profiles/Intents.d.ts +29 -3
- package/lib/types/Tokens/Tokens.d.ts +71 -0
- package/lib/types/Tokens/index.d.ts +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGhB,cAHF,cAAG,CAGE;AAFZ,4DAAoC;AAG3B,oBAHF,mBAAS,CAGE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGhB,cAHF,cAAG,CAGE;AAFZ,4DAAoC;AAG3B,oBAHF,mBAAS,CAGE;AAwFlB,2CAA0E;AAAjE,+GAAA,iBAAiB,OAAA;AAAE,qHAAA,uBAAuB,OAAA"}
|
|
@@ -15,6 +15,10 @@ export interface BuyingSettlementInstructionRequest extends SettlementInstructio
|
|
|
15
15
|
sourceAccount: SettlementInstructionSourceAccount;
|
|
16
16
|
expiry: number;
|
|
17
17
|
}
|
|
18
|
+
export interface LoanSettlementInstructionRequest extends SettlementInstructionBase {
|
|
19
|
+
paymentOrgId: string;
|
|
20
|
+
expiry: number;
|
|
21
|
+
}
|
|
18
22
|
declare type SettlementInstructionRequest = BuyingSettlementInstructionRequest | SellingSettlementInstructionRequest;
|
|
19
23
|
export interface CreateIntent {
|
|
20
24
|
assetId: string;
|
|
@@ -25,6 +29,19 @@ export interface CreateIntent {
|
|
|
25
29
|
signaturePolicy: ManualSignaturePolicy;
|
|
26
30
|
settlement: SettlementInstructionRequest;
|
|
27
31
|
}
|
|
32
|
+
export interface CreateLoanIntent {
|
|
33
|
+
amount: string;
|
|
34
|
+
assetId: string;
|
|
35
|
+
closeAmount: string;
|
|
36
|
+
closeDate: number;
|
|
37
|
+
counterpartId: string;
|
|
38
|
+
end: number;
|
|
39
|
+
interestRate?: string;
|
|
40
|
+
openDate: number;
|
|
41
|
+
role: 'borrower' | 'lender';
|
|
42
|
+
settlement: LoanSettlementInstructionRequest;
|
|
43
|
+
start: number;
|
|
44
|
+
}
|
|
28
45
|
export interface IntentExecution {
|
|
29
46
|
assetId: string;
|
|
30
47
|
intentId: string;
|
|
@@ -33,4 +50,9 @@ export interface IntentExecution {
|
|
|
33
50
|
sourceAccount: SettlementInstructionSourceAccount;
|
|
34
51
|
idempotency?: string;
|
|
35
52
|
}
|
|
53
|
+
export interface LoanIntentExecutionData {
|
|
54
|
+
assetId: string;
|
|
55
|
+
executorType: 'borrower' | 'lender';
|
|
56
|
+
intentId: string;
|
|
57
|
+
}
|
|
36
58
|
export {};
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { MappedUserHoldings, OutgoingMessage } from '../Oss/utils';
|
|
2
|
+
import { ExecutionPlanStatus, GetExecutionPlanResponse } from '../Oss';
|
|
2
3
|
export interface OrganizationInterface {
|
|
3
4
|
getAllUsersHoldings: () => Promise<MappedUserHoldings[]>;
|
|
4
5
|
getAllOutbox: () => Promise<OutgoingMessage[]>;
|
|
6
|
+
getExecutionPlans: (r: {
|
|
7
|
+
id?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
}) => Promise<GetExecutionPlanResponse[]>;
|
|
10
|
+
waitExecutionPlanCompletion: (r: {
|
|
11
|
+
delayMillis?: number;
|
|
12
|
+
expiryMs: number;
|
|
13
|
+
planId: string;
|
|
14
|
+
}) => Promise<ExecutionPlanStatus>;
|
|
5
15
|
}
|
|
6
16
|
export interface GetOrganizationRequest {
|
|
7
17
|
}
|
package/lib/types/Core/User.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IdResponse } from '../Commons';
|
|
3
3
|
import { CertificateInterface } from './Certificates';
|
|
4
|
-
import { CreateIntent, IntentExecution, IntentInterface } from './Intents';
|
|
4
|
+
import { CreateIntent, CreateLoanIntent, IntentExecution, IntentInterface, LoanIntentExecutionData } from './Intents';
|
|
5
5
|
import { MappedUser, Receipt } from '../Oss';
|
|
6
6
|
import { EscrowAccountAsset, EscrowAccountResponse } from '../Escrow';
|
|
7
|
-
import {
|
|
7
|
+
import { ExecuteResponse } from '../Tokens';
|
|
8
8
|
import { SignatureProvider } from './SignatureProvider';
|
|
9
9
|
import { CertificateRequest } from '../Certificates';
|
|
10
10
|
import { DepositRequest, DepositResponse, WithdrawRequest, WithdrawResponse } from '../Payments';
|
|
@@ -17,11 +17,13 @@ export interface UserInterface extends IdResponse {
|
|
|
17
17
|
createCertificate: (r: Omit<CertificateRequest, 'subjectId'>) => Promise<CertificateInterface>;
|
|
18
18
|
getCertificate: (certificateId: string) => CertificateInterface;
|
|
19
19
|
createIntent: (r: CreateIntent) => Promise<IntentInterface>;
|
|
20
|
+
createLoanIntent: (r: CreateLoanIntent) => Promise<IntentInterface>;
|
|
20
21
|
getIntent: (r: {
|
|
21
22
|
assetId: string;
|
|
22
23
|
intentId: string;
|
|
23
24
|
}) => IntentInterface;
|
|
24
|
-
executeIntent: (r: IntentExecution) => Promise<
|
|
25
|
+
executeIntent: (r: IntentExecution) => Promise<ExecuteResponse>;
|
|
26
|
+
executeLoanIntent: (r: LoanIntentExecutionData) => Promise<ExecuteResponse>;
|
|
25
27
|
getUserHoldings: () => Promise<UserAccount[]>;
|
|
26
28
|
getUserReceipt: () => Promise<Receipt[]>;
|
|
27
29
|
updateEscrowBalance: (r: UserUpdateBalance) => Promise<EscrowAccountResponse>;
|
|
@@ -43,7 +45,7 @@ export interface CreateUserRequest {
|
|
|
43
45
|
withSignatureProvider: SignatureProvider;
|
|
44
46
|
}
|
|
45
47
|
export interface GetUserRequest {
|
|
46
|
-
userId
|
|
48
|
+
userId: string;
|
|
47
49
|
publicKey?: string;
|
|
48
50
|
withSignatureProvider?: SignatureProvider;
|
|
49
51
|
}
|
|
@@ -10,7 +10,7 @@ export interface SDK {
|
|
|
10
10
|
createAsset: (r: CreateAssetRequest) => Promise<AssetInterface>;
|
|
11
11
|
getAsset: (r: GetAssetRequest) => AssetInterface;
|
|
12
12
|
createUser: (r: CreateUserRequest) => Promise<UserInterface>;
|
|
13
|
-
getUser: (r: GetUserRequest) =>
|
|
13
|
+
getUser: (r: GetUserRequest) => UserInterface;
|
|
14
14
|
owneraAPI: OwneraAPIInterface;
|
|
15
15
|
utils: SDKUtils;
|
|
16
16
|
logger: Logger;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExecutionPlan, ExecutionPlanInstruction, ExecutionPlanStatus, InstructionApproval } from './OssSchemas';
|
|
2
|
+
export interface GetExecutionPlanResponse {
|
|
3
|
+
id: ExecutionPlan['id'];
|
|
4
|
+
intent: ExecutionPlan['intent'];
|
|
5
|
+
organizations: ExecutionPlan['organizations'];
|
|
6
|
+
status: ExecutionPlan['status'];
|
|
7
|
+
instructions: ExecutionPlanInstructionResponse[];
|
|
8
|
+
approvals: ExecutionPlan['approvals'];
|
|
9
|
+
}
|
|
10
|
+
declare type ExecutionPlanInstructionResponse = Omit<ExecutionPlanInstruction, 'approvals'> & {
|
|
11
|
+
approvals: InstructionApproval[];
|
|
12
|
+
};
|
|
13
|
+
export interface GetExecutionPlanStatus {
|
|
14
|
+
plans: {
|
|
15
|
+
nodes: {
|
|
16
|
+
id: string;
|
|
17
|
+
status: ExecutionPlanStatus;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OssResponses.js","sourceRoot":"","sources":["../../../../src/types/Oss/ExecutionPlan/OssResponses.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Account, Intent } from '../OssSchemas';
|
|
2
|
+
export interface PlanApproval {
|
|
3
|
+
planId: string;
|
|
4
|
+
orgId: string;
|
|
5
|
+
status: string;
|
|
6
|
+
}
|
|
7
|
+
export interface InstructionApproval {
|
|
8
|
+
planId: string;
|
|
9
|
+
sequence: number;
|
|
10
|
+
orgId: string;
|
|
11
|
+
status: string;
|
|
12
|
+
}
|
|
13
|
+
export declare type InstructionDetails = IssueInstruction | TransferInstruction | HoldInstruction | ReleaseInstruction | AwaitInstruction;
|
|
14
|
+
export declare type InstructionCompletionState = ErrorState | SuccessState | UnknownState;
|
|
15
|
+
export interface ExecutionPlanInstruction {
|
|
16
|
+
sequence: number;
|
|
17
|
+
organizations: ExecutionOrganization[];
|
|
18
|
+
details: InstructionDetails;
|
|
19
|
+
status: number;
|
|
20
|
+
state: InstructionCompletionState;
|
|
21
|
+
approvals: InstructionApprovals;
|
|
22
|
+
}
|
|
23
|
+
export interface IssueInstruction {
|
|
24
|
+
buyer: string;
|
|
25
|
+
destinationAccount: Account;
|
|
26
|
+
amount: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TransferInstruction {
|
|
29
|
+
source: string;
|
|
30
|
+
destination: string;
|
|
31
|
+
sourceAccount: Account;
|
|
32
|
+
destinationAccount: Account;
|
|
33
|
+
amount: string;
|
|
34
|
+
}
|
|
35
|
+
export interface HoldInstruction {
|
|
36
|
+
source: string;
|
|
37
|
+
destination: string;
|
|
38
|
+
sourceAccount: Account;
|
|
39
|
+
destinationAccount: Account;
|
|
40
|
+
amount: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ReleaseInstruction {
|
|
43
|
+
sourceAccount: Account;
|
|
44
|
+
destinationAccount: Account;
|
|
45
|
+
amount: string;
|
|
46
|
+
}
|
|
47
|
+
export interface AwaitInstruction {
|
|
48
|
+
waitTime: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ErrorState {
|
|
51
|
+
code: number;
|
|
52
|
+
message: string;
|
|
53
|
+
}
|
|
54
|
+
export interface SuccessState {
|
|
55
|
+
}
|
|
56
|
+
export interface UnknownState {
|
|
57
|
+
}
|
|
58
|
+
export interface ExecutionOrganization {
|
|
59
|
+
organizationId: string;
|
|
60
|
+
}
|
|
61
|
+
export declare enum ExecutionPlanStatus {
|
|
62
|
+
Unknown = "Unknown",
|
|
63
|
+
Pending = "Pending",
|
|
64
|
+
Approved = "Approved",
|
|
65
|
+
Completed = "Completed",
|
|
66
|
+
Failed = "Failed",
|
|
67
|
+
Rejected = "Rejected"
|
|
68
|
+
}
|
|
69
|
+
export interface InstructionApprovals {
|
|
70
|
+
nodes: InstructionApproval[];
|
|
71
|
+
}
|
|
72
|
+
export interface ExecutionPlan {
|
|
73
|
+
id: string;
|
|
74
|
+
intent: Intent;
|
|
75
|
+
organizations: ExecutionOrganization[];
|
|
76
|
+
status: ExecutionPlanStatus;
|
|
77
|
+
instructions: ExecutionPlanInstruction[];
|
|
78
|
+
approvals: PlanApproval[];
|
|
79
|
+
}
|
|
80
|
+
export interface ExecutionsPlans {
|
|
81
|
+
plans: {
|
|
82
|
+
nodes: ExecutionPlan[];
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionPlanStatus = void 0;
|
|
4
|
+
var ExecutionPlanStatus;
|
|
5
|
+
(function (ExecutionPlanStatus) {
|
|
6
|
+
ExecutionPlanStatus["Unknown"] = "Unknown";
|
|
7
|
+
ExecutionPlanStatus["Pending"] = "Pending";
|
|
8
|
+
ExecutionPlanStatus["Approved"] = "Approved";
|
|
9
|
+
ExecutionPlanStatus["Completed"] = "Completed";
|
|
10
|
+
ExecutionPlanStatus["Failed"] = "Failed";
|
|
11
|
+
ExecutionPlanStatus["Rejected"] = "Rejected";
|
|
12
|
+
})(ExecutionPlanStatus = exports.ExecutionPlanStatus || (exports.ExecutionPlanStatus = {}));
|
|
13
|
+
//# sourceMappingURL=OssSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OssSchemas.js","sourceRoot":"","sources":["../../../../src/types/Oss/ExecutionPlan/OssSchemas.ts"],"names":[],"mappings":";;;AA8EA,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;IACrB,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAPW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAO9B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { PlanApproval, InstructionApproval, InstructionDetails, InstructionCompletionState, ExecutionPlanInstruction, IssueInstruction, TransferInstruction, HoldInstruction, ReleaseInstruction, AwaitInstruction, ErrorState, SuccessState, UnknownState, ExecutionOrganization, ExecutionPlanStatus, InstructionApprovals, ExecutionPlan, ExecutionsPlans, } from './OssSchemas';
|
|
2
|
+
export { GetExecutionPlanResponse } from './OssResponses';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionPlanStatus = void 0;
|
|
4
|
+
var OssSchemas_1 = require("./OssSchemas");
|
|
5
|
+
Object.defineProperty(exports, "ExecutionPlanStatus", { enumerable: true, get: function () { return OssSchemas_1.ExecutionPlanStatus; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/Oss/ExecutionPlan/index.ts"],"names":[],"mappings":";;;AAAA,2CAmBsB;AAJpB,iHAAA,mBAAmB,OAAA"}
|
package/lib/types/Oss/Oss.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Asset } from '../Profiles';
|
|
2
|
-
import { GetAssetsFilter, GetUsersFilter, MappedUser, OssSubscribeRequest, ProfileType, IncomingMessage, OutgoingMessage, MappedUserHoldings } from './utils';
|
|
2
|
+
import { GetAssetsFilter, GetUsersFilter, MappedUser, OssSubscribeRequest, ProfileType, IncomingMessage, OutgoingMessage, MappedUserHoldings, MappedLoanIntent } from './utils';
|
|
3
3
|
import { Certificate } from '../Certificates';
|
|
4
4
|
import { Receipt } from './OssSchemas';
|
|
5
5
|
import { EscrowPaymentAsset } from '../Escrow';
|
|
6
6
|
import { UserAccount } from './OssResponses';
|
|
7
|
+
import { ExecutionPlanStatus, GetExecutionPlanResponse } from './ExecutionPlan';
|
|
7
8
|
export interface OSS {
|
|
8
9
|
getAssets: (r: {
|
|
9
10
|
filter?: GetAssetsFilter;
|
|
10
11
|
retry?: boolean;
|
|
11
12
|
}) => Promise<Asset[]>;
|
|
13
|
+
getLoanIntent: (r: {
|
|
14
|
+
assetId: string;
|
|
15
|
+
intentId: string;
|
|
16
|
+
}) => Promise<MappedLoanIntent>;
|
|
12
17
|
getIssuerAssets: (r: {
|
|
13
18
|
issuerId: string;
|
|
14
19
|
}) => Promise<Asset[]>;
|
|
@@ -26,10 +31,6 @@ export interface OSS {
|
|
|
26
31
|
filter?: GetUsersFilter;
|
|
27
32
|
retry?: boolean;
|
|
28
33
|
}) => Promise<MappedUser[]>;
|
|
29
|
-
getUserIdByPublicKey: (r: {
|
|
30
|
-
publicKey: string;
|
|
31
|
-
retry?: boolean;
|
|
32
|
-
}) => Promise<string>;
|
|
33
34
|
getUserHoldings: (r: {
|
|
34
35
|
userId: string;
|
|
35
36
|
}) => Promise<UserAccount[]>;
|
|
@@ -56,5 +57,12 @@ export interface OSS {
|
|
|
56
57
|
getAllOutbox: (r: {
|
|
57
58
|
orgId: string;
|
|
58
59
|
}) => Promise<OutgoingMessage[]>;
|
|
60
|
+
getExecutionPlanStatus: (r: {
|
|
61
|
+
planId: string;
|
|
62
|
+
}) => Promise<ExecutionPlanStatus>;
|
|
63
|
+
getAllExecutionPlans: (r: {
|
|
64
|
+
id?: string;
|
|
65
|
+
status?: string;
|
|
66
|
+
}) => Promise<GetExecutionPlanResponse[]>;
|
|
59
67
|
getReceiptSubscription: (r: Omit<OssSubscribeRequest, 'query'>) => void;
|
|
60
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Assets, Certificates, Users, TokensBalance, Escrow, AssetType, AccountIdentifier, Receipt, OssMessage, Recipients } from './OssSchemas';
|
|
1
|
+
import { Assets, Certificates, Users, TokensBalance, Escrow, AssetType, AccountIdentifier, Receipt, OssMessage, Recipients, Intents } from './OssSchemas';
|
|
2
2
|
import { OrganizationData, ProfileType } from './utils';
|
|
3
3
|
declare type CapTableIssuedTokenNode = Pick<TokensBalance, 'quantity' | 'userId'>;
|
|
4
4
|
interface CapTableAssetNode {
|
|
@@ -141,4 +141,13 @@ export interface OssGetMessagesByOrg {
|
|
|
141
141
|
nodes: MessageByIssuer[];
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
+
export interface GetLoanIntent {
|
|
145
|
+
assets: {
|
|
146
|
+
nodes: {
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
intents: Intents;
|
|
150
|
+
}[];
|
|
151
|
+
};
|
|
152
|
+
}
|
|
144
153
|
export {};
|
|
@@ -54,7 +54,7 @@ export interface Intent {
|
|
|
54
54
|
export interface Intents {
|
|
55
55
|
nodes: Intent[];
|
|
56
56
|
}
|
|
57
|
-
export declare type IntentDetails = PrimarySale | BuyingIntent | SellingIntent;
|
|
57
|
+
export declare type IntentDetails = PrimarySale | BuyingIntent | SellingIntent | LoanIntent;
|
|
58
58
|
export interface PrimarySale {
|
|
59
59
|
issuerId: string;
|
|
60
60
|
sellingSettlementInstruction: SellingIntentSettlementInstruction;
|
|
@@ -67,6 +67,35 @@ export interface SellingIntent {
|
|
|
67
67
|
seller: string;
|
|
68
68
|
sellingSettlementInstruction: SellingIntentSettlementInstruction;
|
|
69
69
|
}
|
|
70
|
+
export interface LoanIntent {
|
|
71
|
+
borrower: string;
|
|
72
|
+
lender: string;
|
|
73
|
+
loanSettlementInstruction: {
|
|
74
|
+
type: EscrowLoanSettlementInstruction;
|
|
75
|
+
borrowerAccount: AccountIdentifier;
|
|
76
|
+
lenderAccount: AccountIdentifier;
|
|
77
|
+
};
|
|
78
|
+
loanInstruction: {
|
|
79
|
+
openDate: number;
|
|
80
|
+
closeDate: number;
|
|
81
|
+
loanConditions: LoanConditions;
|
|
82
|
+
};
|
|
83
|
+
signaturePolicyType: 'presignedPolicy';
|
|
84
|
+
signaturePolicy: {
|
|
85
|
+
transferSignature: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface EscrowLoanSettlementInstruction {
|
|
89
|
+
expiry: number;
|
|
90
|
+
escrow: string;
|
|
91
|
+
}
|
|
92
|
+
export declare type LoanConditions = RepaymentTerm | InterestRate;
|
|
93
|
+
export interface RepaymentTerm {
|
|
94
|
+
repaymentVolume: string;
|
|
95
|
+
}
|
|
96
|
+
export interface InterestRate {
|
|
97
|
+
annualPercentageRate: string;
|
|
98
|
+
}
|
|
70
99
|
export declare type SignaturePolicyType = 'manualPolicy';
|
|
71
100
|
export declare type BuyingSignaturePolicy = PresignedBuyingIntentSignaturePolicy | ManualIntentSignaturePolicy;
|
|
72
101
|
export declare type SellingSignaturePolicy = PresignedSellingIntentSignaturePolicy | ManualIntentSignaturePolicy;
|
|
@@ -79,7 +108,7 @@ export interface PresignedSellingIntentSignaturePolicy {
|
|
|
79
108
|
export interface ManualIntentSignaturePolicy {
|
|
80
109
|
callbackURL: string;
|
|
81
110
|
}
|
|
82
|
-
export declare type IntentType = 'primarySale' | 'buyingIntent' | 'sellingIntent';
|
|
111
|
+
export declare type IntentType = 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'loanIntent';
|
|
83
112
|
export interface Issuer extends Profile {
|
|
84
113
|
name: string;
|
|
85
114
|
assets: Assets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OssSchemas.js","sourceRoot":"","sources":["../../../src/types/Oss/OssSchemas.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OssSchemas.js","sourceRoot":"","sources":["../../../src/types/Oss/OssSchemas.ts"],"names":[],"mappings":";;;AA2SA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,8CAAiC,CAAA;IACjC,0BAAa,CAAA;IACb,8BAAiB,CAAA;AACnB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAOD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B"}
|
package/lib/types/Oss/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OSS } from './Oss';
|
|
2
2
|
import { OssCapTableResponse, OssGetAssetsResponse, OssGetIssuerAssetsResponse, OssGetCertificatesResponse, OssGetProfileCertificatesResponse, OssGetUsersResponse, OssGetUserAccountsResponse, OssGetOrganizations, OssReceiptResponse, OssPaymentAssetsResponse, EscrowHolding } from './OssResponses';
|
|
3
3
|
import { Profile, Asset, Assets, Certificate, Certificates, Document, Documents, Issuer, Issuers, Organization, Organizations, User, Users, ProfileMetadata, Receipt, RegulationVerifier, TokensBalance, TokensBalances, Intent, Intents, IntentDetails, IntentType, SignaturePolicyType, BuyingIntent, SellingIntent, PaymentAsset, SettlementTerm, AssetInstruction, AssetType, PaymentIdentifier, Iban, PrimarySale } from './OssSchemas';
|
|
4
|
+
import { GetExecutionPlanResponse, PlanApproval, InstructionApproval, InstructionDetails, InstructionCompletionState, ExecutionPlanInstruction, IssueInstruction, TransferInstruction, HoldInstruction, ReleaseInstruction, AwaitInstruction, ErrorState, SuccessState, UnknownState, ExecutionOrganization, ExecutionPlanStatus, InstructionApprovals, ExecutionPlan, ExecutionsPlans } from './ExecutionPlan';
|
|
4
5
|
import { GetAssetsFilter, GetUsersFilter, ProfileType, MappedUser, OrganizationData, OssSubscribeRequest } from './utils';
|
|
5
|
-
export { OSS, OssCapTableResponse, OssGetAssetsResponse, OssGetIssuerAssetsResponse, OssGetCertificatesResponse, OssGetProfileCertificatesResponse, OssGetUsersResponse, OssGetUserAccountsResponse, OssGetOrganizations, OssReceiptResponse, Profile, Asset, Assets, Certificate, Certificates, Document, Documents, Issuer, Issuers, Organization, Organizations, User, Users, ProfileMetadata, Receipt, RegulationVerifier, TokensBalance, TokensBalances, GetAssetsFilter, GetUsersFilter, ProfileType, MappedUser, OrganizationData, Intent, Intents, IntentDetails, IntentType, SignaturePolicyType, BuyingIntent, SellingIntent, PaymentAsset, OssPaymentAssetsResponse, SettlementTerm, AssetInstruction as OssAssetInstruction, AssetType, PaymentIdentifier, EscrowHolding, OssSubscribeRequest, Iban as IbanOss, PrimarySale as PrimarySaleOss, };
|
|
6
|
+
export { OSS, OssCapTableResponse, OssGetAssetsResponse, OssGetIssuerAssetsResponse, OssGetCertificatesResponse, OssGetProfileCertificatesResponse, OssGetUsersResponse, OssGetUserAccountsResponse, OssGetOrganizations, OssReceiptResponse, Profile, Asset, Assets, Certificate, Certificates, Document, Documents, Issuer, Issuers, Organization, Organizations, User, Users, ProfileMetadata, Receipt, RegulationVerifier, TokensBalance, TokensBalances, GetAssetsFilter, GetUsersFilter, ProfileType, MappedUser, OrganizationData, Intent, Intents, IntentDetails, IntentType, SignaturePolicyType, BuyingIntent, SellingIntent, PaymentAsset, OssPaymentAssetsResponse, SettlementTerm, AssetInstruction as OssAssetInstruction, AssetType, PaymentIdentifier, EscrowHolding, OssSubscribeRequest, Iban as IbanOss, PrimarySale as PrimarySaleOss, GetExecutionPlanResponse, PlanApproval, InstructionApproval, InstructionDetails, InstructionCompletionState, ExecutionPlanInstruction, IssueInstruction, TransferInstruction, HoldInstruction, ReleaseInstruction, AwaitInstruction, ErrorState, SuccessState, UnknownState, ExecutionOrganization, ExecutionPlanStatus, InstructionApprovals, ExecutionPlan, ExecutionsPlans, };
|
package/lib/types/Oss/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentIdentifier = exports.AssetType = void 0;
|
|
3
|
+
exports.ExecutionPlanStatus = exports.PaymentIdentifier = exports.AssetType = void 0;
|
|
4
4
|
const OssSchemas_1 = require("./OssSchemas");
|
|
5
5
|
Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return OssSchemas_1.AssetType; } });
|
|
6
6
|
Object.defineProperty(exports, "PaymentIdentifier", { enumerable: true, get: function () { return OssSchemas_1.PaymentIdentifier; } });
|
|
7
|
+
const ExecutionPlan_1 = require("./ExecutionPlan");
|
|
8
|
+
Object.defineProperty(exports, "ExecutionPlanStatus", { enumerable: true, get: function () { return ExecutionPlan_1.ExecutionPlanStatus; } });
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/Oss/index.ts"],"names":[],"mappings":";;;AAcA,6CAiCsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/Oss/index.ts"],"names":[],"mappings":";;;AAcA,6CAiCsB;AA4EpB,0FAhFA,sBAAS,OAgFA;AACT,kGAhFA,8BAAiB,OAgFA;AA5EnB,mDAoByB;AA4EvB,oGAhFA,mCAAmB,OAgFA"}
|
package/lib/types/Oss/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Certificate, Organization, OssMessage, ProfileMetadata } from './OssSchemas';
|
|
1
|
+
import { Certificate, Intent, Organization, OssMessage, ProfileMetadata } from './OssSchemas';
|
|
2
2
|
import { UserAccount } from './OssResponses';
|
|
3
3
|
export interface GetAssetsFilter {
|
|
4
4
|
assetIds?: string[];
|
|
@@ -45,4 +45,9 @@ export interface MappedUserHoldings {
|
|
|
45
45
|
id: string;
|
|
46
46
|
holdings: UserAccount[];
|
|
47
47
|
}
|
|
48
|
+
export interface MappedLoanIntent {
|
|
49
|
+
assetId: string;
|
|
50
|
+
assetName: string;
|
|
51
|
+
intent: Intent;
|
|
52
|
+
}
|
|
48
53
|
export {};
|
|
@@ -15,8 +15,9 @@ export interface BuyingIntentSettlementInstruction {
|
|
|
15
15
|
expiry: number;
|
|
16
16
|
}
|
|
17
17
|
export interface PresignedIntentSignaturePolicy {
|
|
18
|
-
|
|
18
|
+
nonce: string;
|
|
19
19
|
signature: string;
|
|
20
|
+
type: 'presignedPolicy';
|
|
20
21
|
}
|
|
21
22
|
export interface ManualSignaturePolicy {
|
|
22
23
|
type: 'manualPolicy';
|
|
@@ -24,7 +25,7 @@ export interface ManualSignaturePolicy {
|
|
|
24
25
|
secret: string;
|
|
25
26
|
}
|
|
26
27
|
export interface IntentRequestWithType {
|
|
27
|
-
type: 'primarySale' | 'buyingIntent' | 'sellingIntent';
|
|
28
|
+
type: 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'loanIntent';
|
|
28
29
|
}
|
|
29
30
|
export interface PrimarySaleIntentRequest extends IntentRequestWithType {
|
|
30
31
|
type: 'primarySale';
|
|
@@ -43,14 +44,39 @@ export interface SellingIntentRequest extends IntentRequestWithType {
|
|
|
43
44
|
settlementInstruction: SellingIntentSettlementInstruction;
|
|
44
45
|
signaturePolicy: ManualSignaturePolicy;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
interface LoanInstruction {
|
|
48
|
+
closeDate: number;
|
|
49
|
+
openDate: number;
|
|
50
|
+
conditions: {
|
|
51
|
+
type: 'repaymentTerm';
|
|
52
|
+
closeAmount: string;
|
|
53
|
+
interestRate?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface LoanIntent {
|
|
57
|
+
type: 'loanIntent';
|
|
58
|
+
creatorType: 'borrower' | 'lender';
|
|
59
|
+
borrower: string;
|
|
60
|
+
lender: string;
|
|
61
|
+
settlementInstruction: {
|
|
62
|
+
type: 'escrow';
|
|
63
|
+
borrowerAccount: SettlementInstructionDestinationAccount;
|
|
64
|
+
lenderAccount: SettlementInstructionDestinationAccount;
|
|
65
|
+
expiry: number;
|
|
66
|
+
};
|
|
67
|
+
loanInstruction: LoanInstruction;
|
|
68
|
+
signaturePolicy: PresignedIntentSignaturePolicy;
|
|
69
|
+
}
|
|
70
|
+
export declare type IntentRequest = PrimarySaleIntentRequest | BuyingIntentRequest | SellingIntentRequest | LoanIntent;
|
|
47
71
|
export interface IntentCoreRequest {
|
|
48
72
|
start: number;
|
|
49
73
|
end: number;
|
|
50
74
|
assetTerm: AssetTerm;
|
|
51
75
|
assetInstruction: {
|
|
52
76
|
account: AssetInstruction;
|
|
77
|
+
destinationAccount?: AssetInstruction;
|
|
53
78
|
};
|
|
54
79
|
settlementTerm: IntentCreationSettlementTerm;
|
|
55
80
|
intent: IntentRequest;
|
|
56
81
|
}
|
|
82
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export interface Tokens {
|
|
|
7
7
|
redeem(r: RedeemRequest): Promise<RedeemResponse>;
|
|
8
8
|
balance(r: BalanceRequest): Promise<BalanceResponse>;
|
|
9
9
|
signatureResult(r: SignatureResultRequest): Promise<void>;
|
|
10
|
+
executeTokenIntent(r: ExecuteRequest, options?: RequestOptions): Promise<ExecuteResponse>;
|
|
10
11
|
}
|
|
11
12
|
export interface IssueRequest {
|
|
12
13
|
buyer: string;
|
|
@@ -164,4 +165,74 @@ export interface IssueAssetInstruction {
|
|
|
164
165
|
export interface TransferAssetInstruction extends IssueAssetInstruction {
|
|
165
166
|
sourceAccount: AssetInstruction;
|
|
166
167
|
}
|
|
168
|
+
export interface CommonIntentExecution {
|
|
169
|
+
nonce: string;
|
|
170
|
+
settlement: TransferRequestSettlement;
|
|
171
|
+
signature: string;
|
|
172
|
+
}
|
|
173
|
+
export interface PrimarySaleExecution extends CommonIntentExecution {
|
|
174
|
+
asset: {
|
|
175
|
+
term: AssetTerm;
|
|
176
|
+
instruction: IssueAssetInstruction;
|
|
177
|
+
};
|
|
178
|
+
buyer: string;
|
|
179
|
+
issuer: string;
|
|
180
|
+
type: 'primarySaleExecution';
|
|
181
|
+
}
|
|
182
|
+
export interface BuyingIntentExecution extends CommonIntentExecution {
|
|
183
|
+
asset: {
|
|
184
|
+
term: AssetTerm;
|
|
185
|
+
instruction: TransferAssetInstruction;
|
|
186
|
+
};
|
|
187
|
+
seller: string;
|
|
188
|
+
type: 'buyingIntentExecution';
|
|
189
|
+
}
|
|
190
|
+
export interface SellingIntentExecution extends CommonIntentExecution {
|
|
191
|
+
asset: {
|
|
192
|
+
term: AssetTerm;
|
|
193
|
+
instruction: TransferAssetInstruction;
|
|
194
|
+
};
|
|
195
|
+
buyer: string;
|
|
196
|
+
type: 'sellingIntentExecution';
|
|
197
|
+
}
|
|
198
|
+
interface RepaymentTerm {
|
|
199
|
+
type: 'repaymentTerm';
|
|
200
|
+
closeAmount: string;
|
|
201
|
+
interestRate?: string;
|
|
202
|
+
}
|
|
203
|
+
export interface LoanIntentExecution {
|
|
204
|
+
asset: {
|
|
205
|
+
term: AssetTerm;
|
|
206
|
+
instruction: TransferAssetInstruction;
|
|
207
|
+
};
|
|
208
|
+
borrower: string;
|
|
209
|
+
executorType: 'borrower' | 'lender';
|
|
210
|
+
lender: string;
|
|
211
|
+
loanInstruction: {
|
|
212
|
+
closeDate: number;
|
|
213
|
+
conditions: RepaymentTerm;
|
|
214
|
+
openDate: number;
|
|
215
|
+
};
|
|
216
|
+
nonce: string;
|
|
217
|
+
settlement: TransferRequestSettlement;
|
|
218
|
+
signature: string;
|
|
219
|
+
type: 'loanIntentExecution';
|
|
220
|
+
}
|
|
221
|
+
declare type IntentExecutionType = PrimarySaleExecution | BuyingIntentExecution | SellingIntentExecution | LoanIntentExecution;
|
|
222
|
+
export interface ExecuteRequest {
|
|
223
|
+
user: string;
|
|
224
|
+
intentId: string;
|
|
225
|
+
intent: IntentExecutionType;
|
|
226
|
+
}
|
|
227
|
+
export interface ExecuteResponse extends Operation {
|
|
228
|
+
type: 'execution';
|
|
229
|
+
metadata: string;
|
|
230
|
+
error: {
|
|
231
|
+
code: number;
|
|
232
|
+
message: string;
|
|
233
|
+
};
|
|
234
|
+
response: {
|
|
235
|
+
executionPlanId: string;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
167
238
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BalanceRequest, BalanceResponse, Tokens, IssueRequest, IssueResponse, TransferRequest, NoIntentTransferRequest, TransferResponse, RedeemRequest, RedeemResponse, Receipt, ErrorInformation, Settlement, SignatureResultRequest, } from './Tokens';
|
|
1
|
+
export { BalanceRequest, BalanceResponse, Tokens, IssueRequest, IssueResponse, TransferRequest, NoIntentTransferRequest, TransferResponse, RedeemRequest, RedeemResponse, Receipt, ErrorInformation, Settlement, SignatureResultRequest, ExecuteRequest, ExecuteResponse, } from './Tokens';
|
|
2
2
|
export { Transaction, TransactionId } from './Transaction';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { Asset, Profile, Profiles, PublicKey, User, CreateAssetRequest, CreateUserRequest, UpdateAssetRequest, ProfileOperation, ShareProfileRequest, CreateIntentRequest, UpdateIntentRequest, IntentRequest, IntentQuery, AssetDenomination, FiatAsset, FinP2PAsset, CryptocurrencyAsset, SettlementAssetTerm, AssetTerm, AssetInstruction, IntentCreationSettlementTerm, IntentExecutionSettlementTerm, SettlementInstructionDestinationAccount, SettlementInstructionSourceAccount, HashFunction, } from './Profiles';
|
|
2
2
|
export { Certificate, Certificates, UpdateCertificatesRequest, CertificateRequest, CertificateRequestCore, } from './Certificates';
|
|
3
3
|
export { Document, Documents, CreateDocumentsRequest, GetDocumentRequest, UpdateDocumentsRequest, DocumentResponse, } from './Documents';
|
|
4
|
-
export { Tokens, Transaction, TransactionId, IssueRequest, TransferRequest, BalanceRequest, BalanceResponse, IssueResponse, TransferResponse, Receipt, ErrorInformation, Settlement, SignatureResultRequest, } from './Tokens';
|
|
4
|
+
export { Tokens, Transaction, TransactionId, IssueRequest, TransferRequest, BalanceRequest, BalanceResponse, IssueResponse, TransferResponse, Receipt, ErrorInformation, Settlement, SignatureResultRequest, ExecuteRequest, ExecuteResponse, } from './Tokens';
|
|
5
5
|
export { RegulationVerifierFromStore, RegulationVerifiers } from './RegulationVerifiers';
|
|
6
|
-
export { OSS, Organization, Organizations, ProfileMetadata, OrganizationData, RegulationVerifier, Intent, IntentType, SignaturePolicyType, BuyingIntent, SellingIntent, SettlementTerm, OssAssetInstruction, IntentDetails, MappedUser, EscrowHolding, Receipt as OssReceipt, IbanOss, PrimarySaleOss, } from './Oss';
|
|
6
|
+
export { OSS, Organization, Organizations, ProfileMetadata, OrganizationData, RegulationVerifier, Intent, IntentType, SignaturePolicyType, BuyingIntent, SellingIntent, SettlementTerm, OssAssetInstruction, IntentDetails, MappedUser, EscrowHolding, Receipt as OssReceipt, IbanOss, PrimarySaleOss, GetExecutionPlanResponse, PlanApproval, InstructionApproval, InstructionDetails, InstructionCompletionState, ExecutionPlanInstruction, IssueInstruction, TransferInstruction, HoldInstruction, ReleaseInstruction, AwaitInstruction, ErrorState, SuccessState, UnknownState, ExecutionOrganization, ExecutionPlanStatus, InstructionApprovals, ExecutionPlan, ExecutionsPlans, } from './Oss';
|
|
7
7
|
export { IdResponse, Operation } from './Commons';
|
|
8
8
|
export { Account, AccountRequest, Signature, SignatureRequest, SignatureDetails, CustodyAdapter, } from './CustodyAdapter';
|
|
9
9
|
export { EscrowAccountFinId, EscrowAccount, EscrowAccountResponse, EscrowAccountAsset, Payout, PayoutStatus, } from './Escrow';
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HashFunction = void 0;
|
|
3
|
+
exports.ExecutionPlanStatus = exports.HashFunction = void 0;
|
|
4
4
|
var Profiles_1 = require("./Profiles");
|
|
5
5
|
Object.defineProperty(exports, "HashFunction", { enumerable: true, get: function () { return Profiles_1.HashFunction; } });
|
|
6
|
+
var Oss_1 = require("./Oss");
|
|
7
|
+
Object.defineProperty(exports, "ExecutionPlanStatus", { enumerable: true, get: function () { return Oss_1.ExecutionPlanStatus; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,uCA2BoB;AADlB,wGAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,uCA2BoB;AADlB,wGAAA,YAAY,OAAA;AAmCd,6BAuCe;AAJb,0GAAA,mBAAmB,OAAA"}
|