Comparing version 0.6.2-rc.1 to 0.6.2-rc.2
@@ -147,3 +147,3 @@ export type CreateDepositBody = { | ||
name?: string | undefined; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp"; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp" | "CoinbasePrime"; | ||
readConfiguration: { | ||
@@ -165,3 +165,3 @@ publicApiKey: string; | ||
name?: string | undefined; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp"; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp" | "CoinbasePrime"; | ||
dateCreated: string; | ||
@@ -329,3 +329,3 @@ }; | ||
name?: string | undefined; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp"; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp" | "CoinbasePrime"; | ||
dateCreated: string; | ||
@@ -413,3 +413,3 @@ }; | ||
name?: string | undefined; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp"; | ||
kind: "Binance" | "Kraken" | "CoinbaseApp" | "CoinbasePrime"; | ||
dateCreated: string; | ||
@@ -416,0 +416,0 @@ }[]; |
@@ -39,3 +39,3 @@ export type ArchivePermissionBody = { | ||
name: string; | ||
operations: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[]; | ||
operations: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Stakes:Update" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[]; | ||
}; | ||
@@ -182,3 +182,3 @@ export type CreatePermissionResponse = { | ||
name?: string | undefined; | ||
operations?: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined; | ||
operations?: ("Auth:Action:Sign" | "Auth:Apps:Create" | "Auth:Apps:Read" | "Auth:Apps:Update" | "Auth:Creds:Create" | "Auth:Creds:Read" | "Auth:Creds:Update" | "Auth:Creds:Code:Create" | "Auth:Types:Application" | "Auth:Types:Employee" | "Auth:Types:EndUser" | "Auth:Types:Pat" | "Auth:Types:ServiceAccount" | "Auth:Users:Create" | "Auth:Users:Delegate" | "Auth:Users:Read" | "Auth:Users:Update" | "Exchanges:Create" | "Exchanges:Read" | "Exchanges:Delete" | "Exchanges:Deposits:Create" | "Exchanges:Withdrawals:Create" | "Orgs:Read" | "Orgs:Update" | "Orgs:Settings:Read" | "Orgs:Settings:Update" | "PermissionAssignments:Create" | "PermissionAssignments:Read" | "PermissionAssignments:Revoke" | "PermissionPredicates:Archive" | "PermissionPredicates:Create" | "PermissionPredicates:Read" | "PermissionPredicates:Update" | "Permissions:Archive" | "Permissions:Create" | "Permissions:Read" | "Permissions:Update" | "Policies:Archive" | "Policies:Create" | "Policies:Read" | "Policies:Update" | "Policies:Approvals:Read" | "Policies:Approvals:Approve" | "Signers:ListSigners" | "Stakes:Create" | "Stakes:Read" | "Stakes:Update" | "Wallets:BroadcastTransaction" | "Wallets:Create" | "Wallets:Delegate" | "Wallets:Export" | "Wallets:GenerateSignature" | "Wallets:Import" | "Wallets:Read" | "Wallets:ReadSignature" | "Wallets:ReadTransaction" | "Wallets:ReadTransfer" | "Wallets:TransferAsset" | "Wallets:Update" | "Wallets:Tags:Add" | "Wallets:Tags:Delete" | "Webhooks:Create" | "Webhooks:Read" | "Webhooks:Update" | "Webhooks:Delete" | "Webhooks:Ping" | "Webhooks:Events:Read")[] | undefined; | ||
}; | ||
@@ -185,0 +185,0 @@ export type UpdatePermissionParams = { |
@@ -7,4 +7,5 @@ import { DfnsApiClientOptions } from '../../types/generic'; | ||
createStake(request: T.CreateStakeRequest): Promise<T.CreateStakeResponse>; | ||
createStakeAction(request: T.CreateStakeActionRequest): Promise<T.CreateStakeActionResponse>; | ||
listStakeActions(request?: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>; | ||
listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>; | ||
listStakeTransactions(request?: T.ListStakeTransactionsRequest): Promise<T.ListStakeTransactionsResponse>; | ||
} |
@@ -23,5 +23,17 @@ "use strict"; | ||
} | ||
async listStakes(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes', { | ||
async createStakeAction(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', { | ||
path: request ?? {}, | ||
query: {}, | ||
}); | ||
const response = await (0, userActionFetch_1.userActionFetch)(path, { | ||
method: 'POST', | ||
body: request.body, | ||
apiOptions: this.apiOptions, | ||
}); | ||
return response.json(); | ||
} | ||
async listStakeActions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', { | ||
path: request ?? {}, | ||
query: request?.query ?? {}, | ||
@@ -35,4 +47,4 @@ }); | ||
} | ||
async listStakeTransactions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/transactions', { | ||
async listStakes(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes', { | ||
path: request ?? {}, | ||
@@ -39,0 +51,0 @@ query: request?.query ?? {}, |
@@ -9,4 +9,6 @@ import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi'; | ||
createStakeComplete(request: T.CreateStakeRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateStakeResponse>; | ||
createStakeActionInit(request: T.CreateStakeActionRequest): Promise<UserActionChallengeResponse>; | ||
createStakeActionComplete(request: T.CreateStakeActionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateStakeActionResponse>; | ||
listStakeActions(request?: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>; | ||
listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>; | ||
listStakeTransactions(request?: T.ListStakeTransactionsRequest): Promise<T.ListStakeTransactionsResponse>; | ||
} |
@@ -38,5 +38,32 @@ "use strict"; | ||
} | ||
async listStakes(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes', { | ||
async createStakeActionInit(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', { | ||
path: request ?? {}, | ||
query: {}, | ||
}); | ||
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({ | ||
userActionHttpMethod: 'POST', | ||
userActionHttpPath: path, | ||
userActionPayload: JSON.stringify(request.body), | ||
userActionServerKind: 'Api', | ||
}, this.apiOptions); | ||
return challenge; | ||
} | ||
async createStakeActionComplete(request, signedChallenge) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', { | ||
path: request ?? {}, | ||
query: {}, | ||
}); | ||
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions); | ||
const response = await (0, fetch_1.simpleFetch)(path, { | ||
method: 'POST', | ||
body: request.body, | ||
headers: { 'x-dfns-useraction': userAction }, | ||
apiOptions: this.apiOptions, | ||
}); | ||
return response.json(); | ||
} | ||
async listStakeActions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', { | ||
path: request ?? {}, | ||
query: request?.query ?? {}, | ||
@@ -50,4 +77,4 @@ }); | ||
} | ||
async listStakeTransactions(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/transactions', { | ||
async listStakes(request) { | ||
const path = (0, url_1.buildPathAndQuery)('/staking/stakes', { | ||
path: request ?? {}, | ||
@@ -54,0 +81,0 @@ query: request?.query ?? {}, |
export type CreateStakeBody = { | ||
kind: "Native"; | ||
amount: string; | ||
priority?: ("Slow" | "Standard" | "Fast") | undefined; | ||
createDestinationAccount?: boolean | undefined; | ||
externalId?: string | undefined; | ||
walletId: string; | ||
@@ -19,3 +16,3 @@ provider: "Figment"; | ||
protocol: "Babylon"; | ||
status: "Active"; | ||
status: "Active" | "Withdrawn"; | ||
requester: { | ||
@@ -29,5 +26,2 @@ userId: string; | ||
amount: string; | ||
priority?: ("Slow" | "Standard" | "Fast") | undefined; | ||
createDestinationAccount?: boolean | undefined; | ||
externalId?: string | undefined; | ||
walletId: string; | ||
@@ -40,7 +34,7 @@ provider: "Figment"; | ||
}; | ||
stakeTransaction: { | ||
stakeAction: { | ||
id: string; | ||
stakeId: string; | ||
transactionId?: string | undefined; | ||
kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "Withdraw"; | ||
kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "StakeWithdrawal"; | ||
requester: { | ||
@@ -51,8 +45,5 @@ userId: string; | ||
}; | ||
requestBody: { | ||
requestBody: ({ | ||
kind: "Native"; | ||
amount: string; | ||
priority?: ("Slow" | "Standard" | "Fast") | undefined; | ||
createDestinationAccount?: boolean | undefined; | ||
externalId?: string | undefined; | ||
walletId: string; | ||
@@ -62,2 +53,5 @@ provider: "Figment"; | ||
duration: number; | ||
}) | { | ||
protocol: "Babylon"; | ||
kind: "StakeWithdrawal"; | ||
}; | ||
@@ -70,8 +64,8 @@ dateCreated: string; | ||
}; | ||
export type ListStakesQuery = { | ||
limit?: number | undefined; | ||
paginationToken?: string | undefined; | ||
export type CreateStakeActionBody = { | ||
protocol: "Babylon"; | ||
kind: "StakeWithdrawal"; | ||
}; | ||
export type ListStakesResponse = { | ||
items: { | ||
export type CreateStakeActionResponse = { | ||
stake: { | ||
id: string; | ||
@@ -82,3 +76,3 @@ provider: "Figment"; | ||
protocol: "Babylon"; | ||
status: "Active"; | ||
status: "Active" | "Withdrawn"; | ||
requester: { | ||
@@ -92,5 +86,2 @@ userId: string; | ||
amount: string; | ||
priority?: ("Slow" | "Standard" | "Fast") | undefined; | ||
createDestinationAccount?: boolean | undefined; | ||
externalId?: string | undefined; | ||
walletId: string; | ||
@@ -102,13 +93,35 @@ provider: "Figment"; | ||
dateCreated: string; | ||
}[]; | ||
nextPageToken?: string | undefined; | ||
}; | ||
stakeAction: { | ||
id: string; | ||
stakeId: string; | ||
transactionId?: string | undefined; | ||
kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "StakeWithdrawal"; | ||
requester: { | ||
userId: string; | ||
tokenId?: string | undefined; | ||
appId?: string | undefined; | ||
}; | ||
requestBody: ({ | ||
kind: "Native"; | ||
amount: string; | ||
walletId: string; | ||
provider: "Figment"; | ||
protocol: "Babylon"; | ||
duration: number; | ||
}) | { | ||
protocol: "Babylon"; | ||
kind: "StakeWithdrawal"; | ||
}; | ||
dateCreated: string; | ||
}; | ||
}; | ||
export type ListStakesRequest = { | ||
query?: ListStakesQuery; | ||
export type CreateStakeActionRequest = { | ||
body: CreateStakeActionBody; | ||
}; | ||
export type ListStakeTransactionsQuery = { | ||
export type ListStakeActionsQuery = { | ||
limit?: number | undefined; | ||
paginationToken?: string | undefined; | ||
}; | ||
export type ListStakeTransactionsResponse = { | ||
export type ListStakeActionsResponse = { | ||
items: { | ||
@@ -118,3 +131,3 @@ id: string; | ||
transactionId?: string | undefined; | ||
kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "Withdraw"; | ||
kind: "Stake" | "Unbond" | "UnbondWithdrawal" | "StakeWithdrawal"; | ||
requester: { | ||
@@ -125,8 +138,40 @@ userId: string; | ||
}; | ||
requestBody: ({ | ||
kind: "Native"; | ||
amount: string; | ||
walletId: string; | ||
provider: "Figment"; | ||
protocol: "Babylon"; | ||
duration: number; | ||
}) | { | ||
protocol: "Babylon"; | ||
kind: "StakeWithdrawal"; | ||
}; | ||
dateCreated: string; | ||
}[]; | ||
nextPageToken?: string | undefined; | ||
}; | ||
export type ListStakeActionsRequest = { | ||
query?: ListStakeActionsQuery; | ||
}; | ||
export type ListStakesQuery = { | ||
limit?: number | undefined; | ||
paginationToken?: string | undefined; | ||
}; | ||
export type ListStakesResponse = { | ||
items: { | ||
id: string; | ||
provider: "Figment"; | ||
providerStakeId: string; | ||
walletId: string; | ||
protocol: "Babylon"; | ||
status: "Active" | "Withdrawn"; | ||
requester: { | ||
userId: string; | ||
tokenId?: string | undefined; | ||
appId?: string | undefined; | ||
}; | ||
requestBody: { | ||
kind: "Native"; | ||
amount: string; | ||
priority?: ("Slow" | "Standard" | "Fast") | undefined; | ||
createDestinationAccount?: boolean | undefined; | ||
externalId?: string | undefined; | ||
walletId: string; | ||
@@ -141,4 +186,4 @@ provider: "Figment"; | ||
}; | ||
export type ListStakeTransactionsRequest = { | ||
query?: ListStakeTransactionsQuery; | ||
export type ListStakesRequest = { | ||
query?: ListStakesQuery; | ||
}; |
{ | ||
"name": "@dfns/sdk", | ||
"version": "0.6.2-rc.1", | ||
"version": "0.6.2-rc.2", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "buffer": "6.0.3", |
Sorry, the diff of this file is too big to display
624393
15478