@dfns/sdk
Advanced tools
Comparing version 0.2.5 to 0.3.0
@@ -6,7 +6,6 @@ import { DfnsBaseApiOptions } from './baseAuthApi'; | ||
import { CallbacksClient } from './codegen/Callbacks'; | ||
import { PermissionsClient } from './codegen/Permissions'; | ||
import { PolicyExecutionClient } from './codegen/PolicyExecution'; | ||
import { PolicyManagementClient } from './codegen/PolicyManagement'; | ||
import { PublicKeysClient } from './codegen/PublicKeys'; | ||
import { PermissionsClient as PermissionsV2Client } from './generated/permissions'; | ||
import { PermissionsClient } from './generated/permissions'; | ||
import { PoliciesClient } from './generated/policies'; | ||
@@ -27,7 +26,3 @@ import { SignersClient } from './generated/signers'; | ||
get callbacks(): CallbacksClient; | ||
/** | ||
* @deprecated use permissions v2 instead | ||
*/ | ||
get permissions(): PermissionsClient; | ||
get permissionsV2(): PermissionsV2Client; | ||
get policies(): PoliciesClient; | ||
@@ -34,0 +29,0 @@ /** |
@@ -8,3 +8,2 @@ "use strict"; | ||
const Callbacks_1 = require("./codegen/Callbacks"); | ||
const Permissions_1 = require("./codegen/Permissions"); | ||
const PolicyExecution_1 = require("./codegen/PolicyExecution"); | ||
@@ -34,9 +33,3 @@ const PolicyManagement_1 = require("./codegen/PolicyManagement"); | ||
} | ||
/** | ||
* @deprecated use permissions v2 instead | ||
*/ | ||
get permissions() { | ||
return new Permissions_1.PermissionsClient(this.apiOptions); | ||
} | ||
get permissionsV2() { | ||
return new permissions_1.PermissionsClient(this.apiOptions); | ||
@@ -43,0 +36,0 @@ } |
@@ -6,7 +6,6 @@ import { DfnsBaseApiOptions } from './baseAuthApi'; | ||
import { DelegatedCallbacksClient } from './codegen/Callbacks'; | ||
import { DelegatedPermissionsClient } from './codegen/Permissions'; | ||
import { DelegatedPolicyExecutionClient } from './codegen/PolicyExecution'; | ||
import { DelegatedPolicyManagementClient } from './codegen/PolicyManagement'; | ||
import { DelegatedPublicKeysClient } from './codegen/PublicKeys'; | ||
import { DelegatedPermissionsClient as DelegatedPermissionsV2Client } from './generated/permissions'; | ||
import { DelegatedPermissionsClient } from './generated/permissions'; | ||
import { DelegatedPoliciesClient } from './generated/policies'; | ||
@@ -26,7 +25,3 @@ import { DelegatedSignersClient } from './generated/signers'; | ||
get callbacks(): DelegatedCallbacksClient; | ||
/** | ||
* @deprecated use permissions v2 instead | ||
*/ | ||
get permissions(): DelegatedPermissionsClient; | ||
get permissionsV2(): DelegatedPermissionsV2Client; | ||
get policies(): DelegatedPoliciesClient; | ||
@@ -33,0 +28,0 @@ /** |
@@ -8,3 +8,2 @@ "use strict"; | ||
const Callbacks_1 = require("./codegen/Callbacks"); | ||
const Permissions_1 = require("./codegen/Permissions"); | ||
const PolicyExecution_1 = require("./codegen/PolicyExecution"); | ||
@@ -34,9 +33,3 @@ const PolicyManagement_1 = require("./codegen/PolicyManagement"); | ||
} | ||
/** | ||
* @deprecated use permissions v2 instead | ||
*/ | ||
get permissions() { | ||
return new Permissions_1.DelegatedPermissionsClient(this.apiOptions); | ||
} | ||
get permissionsV2() { | ||
return new permissions_1.DelegatedPermissionsClient(this.apiOptions); | ||
@@ -43,0 +36,0 @@ } |
@@ -5,2 +5,7 @@ export declare class DfnsError extends Error { | ||
constructor(httpStatus: number, message: string, context?: unknown); | ||
toString(): string; | ||
} | ||
export declare class PolicyPendingError extends DfnsError { | ||
static HTTP_ACCEPTED: number; | ||
constructor(context: unknown); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DfnsError = void 0; | ||
exports.PolicyPendingError = exports.DfnsError = void 0; | ||
class DfnsError extends Error { | ||
@@ -10,3 +10,17 @@ constructor(httpStatus, message, context) { | ||
} | ||
toString() { | ||
return JSON.stringify({ | ||
httpStatus: this.httpStatus, | ||
message: this.message, | ||
...(this.context && this.context), | ||
}, null, 2); | ||
} | ||
} | ||
exports.DfnsError = DfnsError; | ||
class PolicyPendingError extends DfnsError { | ||
constructor(context) { | ||
super(PolicyPendingError.HTTP_ACCEPTED, 'Operation triggered a policy pending approval', context); | ||
} | ||
} | ||
exports.PolicyPendingError = PolicyPendingError; | ||
PolicyPendingError.HTTP_ACCEPTED = 202; |
@@ -11,3 +11,3 @@ "use strict"; | ||
async archivePermission(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/archive', { | ||
path: request ?? {}, | ||
@@ -24,3 +24,3 @@ query: {}, | ||
async createAssignment(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments', { | ||
path: request ?? {}, | ||
@@ -37,3 +37,3 @@ query: {}, | ||
async createPermission(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions', { | ||
path: request ?? {}, | ||
@@ -50,3 +50,3 @@ query: {}, | ||
async deleteAssignment(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments/:assignmentId', { | ||
path: request ?? {}, | ||
@@ -63,3 +63,3 @@ query: {}, | ||
async getPermission(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId', { | ||
path: request ?? {}, | ||
@@ -75,3 +75,3 @@ query: {}, | ||
async listAssignments(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments', { | ||
path: request ?? {}, | ||
@@ -87,3 +87,3 @@ query: {}, | ||
async listPermissions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions', { | ||
path: request ?? {}, | ||
@@ -99,3 +99,3 @@ query: request?.query ?? {}, | ||
async updatePermission(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId', { | ||
path: request ?? {}, | ||
@@ -102,0 +102,0 @@ query: {}, |
@@ -12,3 +12,3 @@ "use strict"; | ||
async archivePermissionInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/archive', { | ||
path: request ?? {}, | ||
@@ -26,3 +26,3 @@ query: {}, | ||
async archivePermissionComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/archive', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/archive', { | ||
path: request ?? {}, | ||
@@ -41,3 +41,3 @@ query: {}, | ||
async createAssignmentInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments', { | ||
path: request ?? {}, | ||
@@ -55,3 +55,3 @@ query: {}, | ||
async createAssignmentComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments', { | ||
path: request ?? {}, | ||
@@ -70,3 +70,3 @@ query: {}, | ||
async createPermissionInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions', { | ||
path: request ?? {}, | ||
@@ -84,3 +84,3 @@ query: {}, | ||
async createPermissionComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions', { | ||
path: request ?? {}, | ||
@@ -99,3 +99,3 @@ query: {}, | ||
async deleteAssignmentInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments/:assignmentId', { | ||
path: request ?? {}, | ||
@@ -113,3 +113,3 @@ query: {}, | ||
async deleteAssignmentComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments/:assignmentId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments/:assignmentId', { | ||
path: request ?? {}, | ||
@@ -128,3 +128,3 @@ query: {}, | ||
async getPermission(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId', { | ||
path: request ?? {}, | ||
@@ -140,3 +140,3 @@ query: {}, | ||
async listAssignments(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId/assignments', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId/assignments', { | ||
path: request ?? {}, | ||
@@ -152,3 +152,3 @@ query: {}, | ||
async listPermissions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions', { | ||
path: request ?? {}, | ||
@@ -164,3 +164,3 @@ query: request?.query ?? {}, | ||
async updatePermissionInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId', { | ||
path: request ?? {}, | ||
@@ -178,3 +178,3 @@ query: {}, | ||
async updatePermissionComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/v2/permissions/:permissionId', { | ||
const path = (0, url_1.buildPathAndQuery)('/permissions/:permissionId', { | ||
path: request ?? {}, | ||
@@ -181,0 +181,0 @@ query: {}, |
@@ -9,27 +9,11 @@ export type ArchivePermissionBody = { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
}; | ||
kind: "Assignment" | "Permission"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
body: { | ||
id: string; | ||
orgId: string; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
@@ -47,22 +31,7 @@ export type ArchivePermissionRequest = ArchivePermissionParams & { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
}; | ||
kind: "Assignment" | "Permission"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
body: { | ||
id: string; | ||
permissionId: string; | ||
identityId: string; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
permissionId: string; | ||
identityId: string; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
@@ -78,27 +47,11 @@ export type CreateAssignmentRequest = CreateAssignmentParams & { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
}; | ||
kind: "Assignment" | "Permission"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
body: { | ||
id: string; | ||
orgId: string; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
@@ -112,25 +65,3 @@ export type CreatePermissionRequest = { | ||
}; | ||
export type DeleteAssignmentResponse = { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
}; | ||
kind: "Assignment" | "Permission"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
body: { | ||
id: string; | ||
permissionId: string; | ||
identityId: string; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
}; | ||
export type DeleteAssignmentResponse = void | undefined; | ||
export type DeleteAssignmentRequest = DeleteAssignmentParams; | ||
@@ -142,3 +73,2 @@ export type GetPermissionParams = { | ||
id: string; | ||
orgId: string; | ||
name: string; | ||
@@ -177,3 +107,2 @@ operations: string[]; | ||
id: string; | ||
orgId: string; | ||
name: string; | ||
@@ -203,27 +132,11 @@ operations: string[]; | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
}; | ||
kind: "Assignment" | "Permission"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
body: { | ||
id: string; | ||
orgId: string; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
name: string; | ||
operations: string[]; | ||
resourceId?: (string | undefined) | null; | ||
status: "Active"; | ||
predicateIds?: string[] | undefined; | ||
isImmutable: boolean; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
isArchived: boolean; | ||
}; | ||
@@ -230,0 +143,0 @@ export type UpdatePermissionRequest = UpdatePermissionParams & { |
export type ArchivePolicyParams = { | ||
policyId: string; | ||
}; | ||
export type ArchivePolicyResponse = { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
export type ArchivePolicyResponse = ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
kind: "Policy"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
body: ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
filters?: { | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
}; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
@@ -139,6 +124,5 @@ export type ArchivePolicyRequest = ArchivePolicyParams; | ||
id: string; | ||
orgId: string; | ||
initiatorId: string; | ||
activityId: string; | ||
activityKind: string; | ||
activityKind: "Permissions:Assign" | "Permissions:Modify" | "Policies:Modify" | "Wallets:Sign"; | ||
activity: { | ||
@@ -172,7 +156,7 @@ [x: string]: unknown; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -195,7 +179,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -218,7 +202,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -241,7 +225,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -279,129 +263,114 @@ autoRejectTimeout?: number | undefined; | ||
}; | ||
export type CreatePolicyResponse = { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
export type CreatePolicyResponse = ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
kind: "Policy"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
body: ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
filters?: { | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
}; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
@@ -419,7 +388,7 @@ export type CreatePolicyRequest = { | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -442,7 +411,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -465,7 +434,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -488,7 +457,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -543,6 +512,5 @@ autoRejectTimeout?: number | undefined; | ||
id: string; | ||
orgId: string; | ||
initiatorId: string; | ||
activityId: string; | ||
activityKind: string; | ||
activityKind: "Permissions:Assign" | "Permissions:Modify" | "Policies:Modify" | "Wallets:Sign"; | ||
activity: { | ||
@@ -583,7 +551,7 @@ [x: string]: unknown; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -606,7 +574,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -629,7 +597,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -652,7 +620,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -705,7 +673,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -728,7 +696,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -751,7 +719,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -774,7 +742,7 @@ autoRejectTimeout?: number | undefined; | ||
quorum: number; | ||
approvers?: { | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
@@ -815,129 +783,114 @@ autoRejectTimeout?: number | undefined; | ||
}; | ||
export type UpdatePolicyResponse = { | ||
id: string; | ||
orgId: string; | ||
requester: { | ||
userId: string; | ||
tokenId: string; | ||
appId: string; | ||
export type UpdatePolicyResponse = ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
kind: "Policy"; | ||
operationKind: "Create" | "Update" | "Delete"; | ||
status: "Applied" | "Failed" | "Pending" | "Rejected"; | ||
entityId: string; | ||
body: ({ | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Assign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
filters?: { | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Permissions:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Policies:Modify"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
name: string; | ||
approvalGroups: { | ||
name?: string | undefined; | ||
quorum: number; | ||
approvers?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}[]; | ||
autoRejectTimeout?: number | undefined; | ||
activityKind: "Wallets:Sign"; | ||
rule: { | ||
kind: "AlwaysRequireApproval"; | ||
configuration: {}; | ||
} | { | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
kind: "TransactionAmountLimit"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
}; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
} | { | ||
kind: "TransactionAmountVelocity"; | ||
configuration: { | ||
limit: number; | ||
currency: "EUR" | "USD"; | ||
timeframe: number; | ||
}; | ||
} | { | ||
kind: "TransactionCountVelocity"; | ||
configuration: { | ||
limit: number; | ||
timeframe: number; | ||
}; | ||
}; | ||
dateCreated: Date; | ||
dateResolved: Date; | ||
filters?: { | ||
[x: string]: { | ||
[x: string]: string[]; | ||
}; | ||
} | undefined; | ||
}) & { | ||
id: string; | ||
status: "Active" | "Archived"; | ||
dateCreated?: string | undefined; | ||
dateUpdated?: string | undefined; | ||
}; | ||
@@ -944,0 +897,0 @@ export type UpdatePolicyRequest = UpdatePolicyParams & { |
@@ -88,3 +88,3 @@ export type BroadcastTransactionBody = { | ||
export type CreateWalletBody = { | ||
network: "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "ArbitrumGoerli" | "BaseGoerli" | "OptimismGoerli" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark"; | ||
network: "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "OptimismGoerli" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark"; | ||
name?: string | undefined; | ||
@@ -471,2 +471,3 @@ externalId?: string | undefined; | ||
contract?: string | undefined; | ||
tokenId?: string | undefined; | ||
symbol?: string | undefined; | ||
@@ -486,3 +487,3 @@ decimals: number; | ||
direction?: ("In" | "Out") | undefined; | ||
kind?: ("NativeTransfer" | "Erc20Transfer" | "Erc721Transfer" | "UtxoTransfer") | undefined; | ||
kind?: ("NativeTransfer" | "Erc20Transfer" | "Erc721Transfer" | "Trc10Transfer" | "Trc20Transfer" | "Trc721Transfer" | "UtxoTransfer") | undefined; | ||
contract?: string | undefined; | ||
@@ -630,2 +631,98 @@ }; | ||
}; | ||
kind: "Trc10Transfer"; | ||
tokenId: string; | ||
from: string; | ||
to: string; | ||
value: string; | ||
fee?: string | undefined; | ||
} | { | ||
walletId: string; | ||
direction: "In" | "Out"; | ||
network: "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA"; | ||
blockNumber: number; | ||
txHash: string; | ||
index?: string | undefined; | ||
timestamp: string; | ||
metadata: { | ||
asset: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
}; | ||
fee?: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
} | undefined; | ||
}; | ||
kind: "Trc20Transfer"; | ||
contract: string; | ||
from: string; | ||
to: string; | ||
value: string; | ||
fee?: string | undefined; | ||
} | { | ||
walletId: string; | ||
direction: "In" | "Out"; | ||
network: "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA"; | ||
blockNumber: number; | ||
txHash: string; | ||
index?: string | undefined; | ||
timestamp: string; | ||
metadata: { | ||
asset: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
}; | ||
fee?: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
} | undefined; | ||
}; | ||
kind: "Trc721Transfer"; | ||
contract: string; | ||
from: string; | ||
to: string; | ||
tokenId: string; | ||
fee?: string | undefined; | ||
} | { | ||
walletId: string; | ||
direction: "In" | "Out"; | ||
network: "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA"; | ||
blockNumber: number; | ||
txHash: string; | ||
index?: string | undefined; | ||
timestamp: string; | ||
metadata: { | ||
asset: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
}; | ||
fee?: { | ||
symbol?: string | undefined; | ||
decimals?: number | undefined; | ||
verified?: boolean | undefined; | ||
quotes?: { | ||
[x: string]: number; | ||
} | undefined; | ||
} | undefined; | ||
}; | ||
kind: "UtxoTransfer"; | ||
@@ -659,3 +756,3 @@ froms: string[]; | ||
export type ImportWalletBody = { | ||
network: "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "ArbitrumGoerli" | "BaseGoerli" | "OptimismGoerli" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark"; | ||
network: "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonMumbai" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "OptimismGoerli" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark"; | ||
name?: string | undefined; | ||
@@ -662,0 +759,0 @@ externalId?: string | undefined; |
{ | ||
"name": "@dfns/sdk", | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "buffer": "6.0.3", |
@@ -44,2 +44,14 @@ "use strict"; | ||
}; | ||
// raise a 202 response by policy execution as error | ||
const catchPolicyPending = (fetch) => { | ||
return async (resource, options) => { | ||
const response = await fetch(resource, options); | ||
if (response.status === dfnsError_1.PolicyPendingError.HTTP_ACCEPTED) { | ||
throw new dfnsError_1.PolicyPendingError(await response.json()); | ||
} | ||
else { | ||
return response; | ||
} | ||
}; | ||
}; | ||
const dfnsAuth = (fetch) => { | ||
@@ -94,3 +106,3 @@ return async (resource, options) => { | ||
}; | ||
exports.simpleFetch = fullUrl(jsonSerializer(dfnsAuth(errorHandler(cross_fetch_1.fetch)))); | ||
exports.userActionFetch = fullUrl(jsonSerializer(dfnsAuth(userAction(errorHandler(cross_fetch_1.fetch))))); | ||
exports.simpleFetch = fullUrl(jsonSerializer(dfnsAuth(catchPolicyPending(errorHandler(cross_fetch_1.fetch))))); | ||
exports.userActionFetch = fullUrl(jsonSerializer(dfnsAuth(userAction(catchPolicyPending(errorHandler(cross_fetch_1.fetch)))))); |
2404215
261
82215
6