Skip to content

Commit

Permalink
Merge pull request #193 from fireblocks/wallet-link-ncw-support
Browse files Browse the repository at this point in the history
  • Loading branch information
aviba authored Aug 30, 2023
2 parents 48481b8 + aa9c204 commit 48e9ca1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import {
UsersGroup,
ContractUploadRequest,
ContractTemplateDto,
PendingTokenLinkDto,
PendingTokenLinkDto, Web3ConnectionFeeLevel,
} from "./types";
import { AxiosProxyConfig, AxiosResponse } from "axios";
import { PIIEncryption } from "./pii-client";
Expand Down Expand Up @@ -1347,7 +1347,7 @@ export class FireblocksSDK {

return await this.apiClient.issuePostRequest(path, payload, requestOptions);
}

/**
* Approve or Reject the initiated connection
* @param type The type of the connection
Expand Down
45 changes: 26 additions & 19 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1215,16 +1215,27 @@ export interface FeePayerConfiguration {
feePayerAccountId: string;
}

export interface CreateWeb3ConnectionPayload {
vaultAccountId: number;
export interface BaseWeb3ConnectionPayload {
feeLevel: Web3ConnectionFeeLevel;
}
export interface WorkspaceWalletIdentifier {
vaultAccountId: number;
}

export interface NonCustodialWalletIdentifier {
ncwId: string;
ncwAccountId: number;
}

export interface CreateWalletConnectPayload extends CreateWeb3ConnectionPayload {
export interface WalletConnectConnectionPayload {
uri: string;
chainIds: string[];
chainIds?: string[];
}

export type CreateWeb3ConnectionPayload = (WorkspaceWalletIdentifier | NonCustodialWalletIdentifier) & BaseWeb3ConnectionPayload;

export type CreateWalletConnectPayload = CreateWeb3ConnectionPayload & WalletConnectConnectionPayload;

export interface GetWeb3ConnectionsPayload {
pageCursor?: string;
pageSize?: number;
Expand All @@ -1235,33 +1246,29 @@ export interface GetWeb3ConnectionsPayload {

export interface CreateWeb3ConnectionResponse {
id: string;
sessionMetadata: {
appIcon?: string,
appId?: string,
appName?: string,
appUrl?: string,
appDescription?: string
};
sessionMetadata: SessionMetadata;
}

export interface SessionMetadata {
appUrl: string;
appIcon?: string;
appId?: string;
appName?: string;
appUrl?: string;
appDescription?: string;
}
}

export interface Session {
id: string;
vaultAccountId: number;
chainIds?: string[];
vaultAccountId?: number;
ncwId?: string;
ncwAccountId?: number;
chainIds: string[];
feeLevel: Web3ConnectionFeeLevel;
creationDate: string;
connectionType: Web3ConnectionType;
connectionMethod?: Web3ConnectionMethod;
sessionMetadata?: SessionMetadata;
}
connectionMethod: Web3ConnectionMethod;
sessionMetadata: SessionMetadata;
}

export enum TimePeriod {
DAY = "DAY",
WEEK = "WEEK"
Expand Down

0 comments on commit 48e9ca1

Please sign in to comment.