Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Freeze Tenant via API #200

Open
wants to merge 228 commits into
base: support-freeze-tenant
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
fb55b05
added sort to transaction filter
Mar 10, 2022
d7649d8
add endpoint
yuval-fireblocks Mar 8, 2023
21d24a1
update type
yuval-fireblocks Mar 8, 2023
654ca6f
rename
yuval-fireblocks Mar 13, 2023
dc20447
add type
yuval-fireblocks Mar 14, 2023
1e7b1a3
lint
yuval-fireblocks Mar 14, 2023
8687173
update type
yuval-fireblocks Mar 14, 2023
8b63d44
renaming urt path
Yinon-Hever May 9, 2023
a6c0502
add staking sdk endpoints
Jun 15, 2023
fb308b4
add staking sdk endpoints
Jun 15, 2023
49dc2ee
add staking sdk endpoints
Jun 15, 2023
540ef81
add staking sdk endpoints
Jun 15, 2023
c282a8a
add staking sdk endpoints
Jun 18, 2023
5ac7d84
support users-groups crud
Jun 18, 2023
d5b8a62
support users-groups crud
Jun 18, 2023
65e8764
support users-groups crud
Jun 18, 2023
421c2da
support users-groups crud
Jun 19, 2023
262aa8e
support users-groups crud
Jul 25, 2023
6ac0b6a
Merge branch 'master' into support_users_groups_crud
Jul 25, 2023
6ea3d6a
Merge branch 'master' into support_users_groups_crud
Aug 7, 2023
fc6745d
Merge pull request #179 from fireblocks/support_users_groups_crud
sashalinder Aug 7, 2023
e73c859
release 5.4.0
invalid-email-address Aug 7, 2023
8c4a3bc
changed return type to pending instead of TokenLink (#188)
amimagid Aug 10, 2023
e863c0d
Add NCW types
amiryadid-fb Aug 17, 2023
8a73b3a
add NCW feature (#192)
amper-fb Aug 20, 2023
e6a5d42
clean types
amiryadid-fb Aug 22, 2023
7e60c39
fix: add NCW methods (#197)
amper-fb Aug 22, 2023
eb7dc74
release 5.5.0
invalid-email-address Aug 22, 2023
572d4c1
rename base url
yuval-fireblocks Aug 22, 2023
e105d26
rename var
yuval-fireblocks Aug 22, 2023
a68d733
Merge pull request #198 from fireblocks/rename-ncw-endpoint
tomervil Aug 23, 2023
ec2a97a
release 5.5.1
invalid-email-address Aug 23, 2023
5d487fe
added registry endpoint for uploading contracts (#190)
amimagid Aug 24, 2023
eed8aa5
release 5.6.0
invalid-email-address Aug 24, 2023
81c0e03
added getAddressesWithPaging
barakfireblocks Aug 29, 2023
44ec388
added AddressesWithPagingResponse
barakfireblocks Aug 29, 2023
48481b8
Add Smart Transfers user groups endpoints (#202)
dpetrovic-fb Aug 29, 2023
88f45b0
chainIds is optional
amiryadid-fb Aug 30, 2023
aa9c204
Merge branch 'master' into wallet-link-ncw-support
amiryadid-fb Aug 30, 2023
48e9ca1
Merge pull request #193 from fireblocks/wallet-link-ncw-support
aviba Aug 30, 2023
cadce92
added AddressesWithPagingResponse
barakfireblocks Aug 31, 2023
1dd9aff
feat: added list owned assets and ncw for NFTs
lazars14-f Sep 5, 2023
dfac9bd
refactor: TokenWithBalanceBase
lazars14-f Sep 5, 2023
8e0f88c
Merge pull request #206 from fireblocks/add-ncw-for-nfts
aviba Sep 5, 2023
05e104d
release 5.6.1
invalid-email-address Sep 5, 2023
7e4625a
added bulk functions
gadiguy Sep 11, 2023
0b55439
removed redundant files
gadiguy Sep 11, 2023
d12aab5
feat: adding tap endpoints (#207)
asafs932 Sep 11, 2023
1ed64f6
Change Collection and Token response (#205)
vsiskin Sep 12, 2023
ea9c931
Travel Rule Configuration and Policy routes (#187)
rade-fireblocks Sep 19, 2023
4eef662
release 5.7.0
invalid-email-address Sep 19, 2023
0d9b012
Merge pull request #185 from fireblocks/get-transactions-ascending
SCFireblocks Sep 26, 2023
ee6f756
contract-registry - adding endpoints (#210)
or109 Sep 28, 2023
608340a
release 5.8.0
invalid-email-address Oct 4, 2023
3fceb30
Merge remote-tracking branch 'origin/master' into staking-sdk
Oct 15, 2023
2b9080a
add staking sdk endpoints
Oct 15, 2023
1e7052e
feat: NCW supported assets (#215)
amper-fb Oct 17, 2023
fdc76e6
feat: added multi nft token status update endpoint (#214)
lazars14-f Oct 17, 2023
6f3f1d0
COR-31331: Add support paged exchange account endpoint (#213)
AmitShe Oct 17, 2023
b776ab3
release 5.9.0
invalid-email-address Oct 17, 2023
ff7c798
add staking sdk endpoints
Oct 22, 2023
7e38a54
Merge remote-tracking branch 'origin/master' into staking-sdk
Oct 22, 2023
165e16d
fix getChainInfo
Oct 25, 2023
3a529f8
separate sdk
Oct 25, 2023
ebc0cdc
getPaginatedAddresses
barakfireblocks Oct 30, 2023
5da3f11
Merge branch 'master' into COR-33565
barakfireblocks Oct 30, 2023
228ccf8
.
barakfireblocks Oct 30, 2023
6880ee9
fixed comments reviews
gadiguy Oct 31, 2023
fb93449
.
barakfireblocks Oct 31, 2023
bfb507f
.
barakfireblocks Oct 31, 2023
cbbe6bd
.
barakfireblocks Oct 31, 2023
1819b76
fix bug
barakfireblocks Oct 31, 2023
a9acf64
staking-sdk: integrate staking APIs for use with FireblocksSDK as req…
Oct 31, 2023
4ec37a7
no need for async
gadiguy Nov 1, 2023
1d942ea
Merge branch 'master' into FEAT-COR-23078-bulk-methods
gadiguy Nov 1, 2023
2ef6829
fixed merge error
gadiguy Nov 1, 2023
6a1fac1
staking-sdk: mr comments implemented, add execute action request dto …
Nov 1, 2023
59dfa20
staking-sdk: executeStakingAction type fix
Nov 1, 2023
0a69d5d
cr fix
barakfireblocks Nov 1, 2023
6d494d9
Merge pull request #216 from fireblocks/staking-sdk
aviba Nov 1, 2023
20a48ec
removed duplicates
gadiguy Nov 2, 2023
ed3127e
Merge pull request #209 from gadiguy/FEAT-COR-23078-bulk-methods
zoharsf Nov 2, 2023
69b57e3
Merge branch 'master' into get-asset-wallets
Nov 13, 2023
e23ee56
.
barakfireblocks Nov 14, 2023
51e22f5
Merge branch 'master' into COR-33565
barakfireblocks Nov 14, 2023
3ebd951
cr fix
barakfireblocks Nov 15, 2023
016eb1b
contract-service - adding endpoints (#221)
or109 Nov 15, 2023
92b75c0
cr fix
barakfireblocks Nov 15, 2023
ad35412
release 5.10.0
invalid-email-address Nov 15, 2023
951e7c2
staking-sdk: update staking sdk
Nov 15, 2023
fd2e8ba
Merge pull request #223 from fireblocks/Add-getPaginatedAddresses-method
ranmitel Nov 16, 2023
f60734c
Revert mistake in updateVaultAccount
gadiguy Nov 16, 2023
340fdaa
Merge pull request #224 from gadiguy/patch-1
zoharsf Nov 16, 2023
a966e59
Merge pull request #222 from fireblocks/staking-sdk
aviba Nov 16, 2023
dd72fe1
release 5.11.0
invalid-email-address Nov 19, 2023
d472b14
Add PeerType
amiryadid-fb Nov 23, 2023
6c5655f
Merge pull request #150 from fireblocks/get-asset-wallets
Tamirsh507 Nov 26, 2023
be920b4
Added sourceWalletId for NCW under TransactionFilter (#228)
yanlevi Nov 28, 2023
500e3d3
release 5.12.0
invalid-email-address Dec 3, 2023
cdbf57c
Bump semver from 5.7.1 to 5.7.2 (#182)
dependabot[bot] Dec 6, 2023
785d39f
feat: ncw latest backup (#225)
amper-fb Dec 7, 2023
917837a
Bump axios from 0.27.2 to 1.6.0 (#231)
dependabot[bot] Dec 7, 2023
e58a0e6
release 5.13.0
invalid-email-address Dec 7, 2023
ce6269a
User management (#189)
GrishaDev Dec 11, 2023
2fc2493
Exposing external aml endpoints for screening setting (#226)
rade-fireblocks Dec 11, 2023
0f19560
Fix empty querystring scenario (#235)
AlonFireblocks Dec 11, 2023
62b9c5f
release 5.14.0
invalid-email-address Dec 12, 2023
e61c7e1
Merge pull request #227 from fireblocks/there-is-no-way-to-create-a-t…
aviba Dec 14, 2023
d066a67
Support tenant's OTA configuration functionality (#237)
nitaiaharoni1 Dec 24, 2023
44d07df
release 5.15.0
invalid-email-address Dec 24, 2023
4c04a19
Rename management paths (#238)
GrishaDev Dec 26, 2023
1301430
release 5.15.1
invalid-email-address Dec 26, 2023
d28f90d
fix: add missing params (#241)
yuval-fireblocks Dec 31, 2023
9e86110
release 5.16.0
invalid-email-address Dec 31, 2023
4c1d3e1
Audit logs api (#240)
dean-ab Jan 7, 2024
88700f6
release 5.17.0
invalid-email-address Jan 8, 2024
d969e55
add missing amountUsd (#239)
dpetrovic-fb Jan 15, 2024
c965275
feat: Add request interceptor and httpsAgent options (#245)
amper-fb Jan 18, 2024
458f28f
release 5.18.0
invalid-email-address Jan 18, 2024
d57d3c4
update type of addressFormat to string | undefined (#243)
ankitshubham97 Jan 18, 2024
d77285b
Tokenization updated API (#247)
or109 Jan 25, 2024
33427f5
release 5.18.1
invalid-email-address Jan 26, 2024
0a34b3a
Renamed management routes (#248)
dean-ab Jan 28, 2024
ebb2125
Add spam changes to js sdk (#250)
vsiskin Jan 30, 2024
04635ea
release 5.19.0
invalid-email-address Jan 30, 2024
bbd3883
Add `errorDescription` to `TransactionResponse`
orenyomtov Jan 30, 2024
230c584
Merge pull request #251 from fireblocks/COR-47703-contract-errors
amimagid Jan 30, 2024
1ab69bc
release 5.20.0
invalid-email-address Jan 30, 2024
12241a5
staking-sdk: update staking sdk
Feb 12, 2024
d4ba951
staking-sdk: fix deleted import
Feb 12, 2024
da3c519
assetId (#256)
or109 Feb 14, 2024
3a76e9c
Merge pull request #254 from fireblocks/staking-sdk
yahavamar Feb 18, 2024
7265c6c
staking-sdk: fix PositionStatus missing statuses, StakeResponse respo…
Feb 25, 2024
da658cc
staking-sdk: mr comments
Feb 26, 2024
1b67531
Update README.md (#261)
dsahni Feb 28, 2024
ce07c3e
Merge pull request #260 from fireblocks/staking-sdk
yahavamar Feb 28, 2024
3699704
release 5.21.0
invalid-email-address Feb 29, 2024
33c4737
add createNewAsset function
vsiskin Mar 5, 2024
3b3880f
Add supported screening assets route (#259)
rade-fireblocks Mar 5, 2024
5b9cb18
update docs
vsiskin Mar 6, 2024
1ceecf5
add response interface, change function name
vsiskin Mar 12, 2024
5cdd968
use "" instead of ''
vsiskin Mar 12, 2024
195a6b6
Merge branch 'master' into add-create-new-asset-support
vsiskin Mar 12, 2024
1dbbb2e
Remove colon from supported screening URL (#265)
rade-fireblocks Mar 12, 2024
ff96db1
release 5.22.0
invalid-email-address Mar 12, 2024
78a5d8c
Tokenization - Add displayName (#262)
or109 Mar 14, 2024
cb2a19b
release 5.23.0
invalid-email-address Mar 14, 2024
9fb6db4
add wallet\device setup state EPs
yuval-fireblocks Mar 18, 2024
ba7c023
fix: lint and desc.
yuval-fireblocks Mar 20, 2024
ede50aa
Merge pull request #267 from fireblocks/ncw-device-setup
yuval-fireblocks Mar 24, 2024
cf545eb
COR-55933 - Add algorithm id to asset response
goweiss Mar 27, 2024
a581603
update RegisterAssetResponse
vsiskin Mar 28, 2024
3e97ca2
update RegisterAssetResponse, id -> legacyId
vsiskin Mar 28, 2024
bf4ed9d
update RegisterAssetResponse
vsiskin Apr 1, 2024
9568667
Merge pull request #264 from fireblocks/add-create-new-asset-support
aviba Apr 1, 2024
ac9fe07
release 5.24.0
invalid-email-address Apr 2, 2024
276ff74
add unspent input ep
yuval-fireblocks Apr 2, 2024
ac12750
fix type and response
yuval-fireblocks Apr 2, 2024
08235ce
Merge remote-tracking branch 'origin/master' into ncw-unspent-inputs
yuval-fireblocks Apr 2, 2024
60a92ee
Merge pull request #272 from fireblocks/ncw-unspent-inputs
yuval-fireblocks Apr 10, 2024
fa6878b
release 5.25.0
invalid-email-address Apr 10, 2024
2c0ca16
Tokenization api changes (#273)
or109 Apr 15, 2024
c2dd79c
release 5.25.1
invalid-email-address Apr 16, 2024
35befcb
Update Tokenization DTOs and deprecate unused route (#276)
phanigovindaraju May 28, 2024
86e41f1
logic
yuval-fireblocks May 29, 2024
dda8576
fix path
yuval-fireblocks May 29, 2024
39d1027
minor
yuval-fireblocks May 29, 2024
0ea53d4
release 5.26.0
invalid-email-address May 31, 2024
a791716
fix: type
yuval-fireblocks Jun 2, 2024
1dfc4ed
added getContractByAddress function
Jun 12, 2024
1cab716
added getContractByAddress function
Jun 12, 2024
b77007c
Merge pull request #279 from fireblocks/fetch-address-by-chain-and-tx…
amimagid Jun 13, 2024
b805f87
Merge pull request #271 from goweiss/COR-55933-Add-algorithm-id-to-as…
AlonFireblocks Jun 17, 2024
ef8fc61
release 5.27.0
invalid-email-address Jun 17, 2024
a725537
functions instead of abi
MMaaliFireblocks Jun 19, 2024
03da34e
Merge pull request #280 from brohamgoham/fix-wrong-path-contract-inte…
amimagid Jun 20, 2024
0c99c96
release 5.27.1
invalid-email-address Jun 20, 2024
bd5a7ab
Merge remote-tracking branch 'origin/master' into ncw-set-wallet-requ…
yuval-fireblocks Jun 20, 2024
a96f2d2
Merge pull request #278 from fireblocks/fix-get-wallet-devices
AlonFireblocks Jun 20, 2024
1de763e
Merge pull request #281 from fireblocks/ncw-set-wallet-required-algos
AlonFireblocks Jun 20, 2024
30c39f8
release 5.27.2
invalid-email-address Jun 23, 2024
c217af4
Add-rescan-txs
barakfireblocks Jun 27, 2024
f96bfb4
format
barakfireblocks Jun 27, 2024
43ce14d
Add Tokenization collections API endpoints
Jul 3, 2024
c5196f6
Add Tokenization collections API endpoints
Jul 3, 2024
2c9d14c
mintCollectionToken
Jul 3, 2024
86d64f1
BurnCollectionTokenRequest
Jul 3, 2024
e9809ec
BurnCollectionTokenRequest
Jul 3, 2024
8ea5d19
change
Jul 9, 2024
22e75b3
change
Jul 9, 2024
d7fa49a
mint burn
Jul 11, 2024
d700b4d
LinkedCollectionMetadataDto
Jul 15, 2024
3a4eb5b
Mint NFT
Jul 15, 2024
21d51d5
Merge pull request #285 from fireblocks/add-collections-api
amimagid Jul 15, 2024
1c369e8
release 5.28.0
invalid-email-address Jul 15, 2024
36b3d90
[OC-4662] Tokenization Collection API - Changed token metadata object…
trongvnau Jul 29, 2024
3aec731
release 5.28.1
invalid-email-address Jul 30, 2024
8203128
removed unnecessary field from BurnCollectionTokenRequest (#289)
trongvnau Aug 1, 2024
99972c4
Add link contract routes (#287)
phanigovindaraju Aug 5, 2024
bd52273
add set asset price api (#277)
vsiskin Aug 7, 2024
2f94d0f
release 5.29.0
invalid-email-address Aug 13, 2024
b82555a
rescanTxs
barakfireblocks Aug 20, 2024
c5cb5af
Merge branch 'master' into Add-rescan-txs
barakfireblocks Aug 20, 2024
24f4d2b
beta
barakfireblocks Aug 22, 2024
107d769
Merge pull request #283 from fireblocks/Add-rescan-txs
barakfireblocks Aug 25, 2024
76910d0
Fix issue with add abi (#291)
phanigovindaraju Aug 28, 2024
18e589d
add maxTotalFee tx-request param (#290)
yuval-fireblocks Sep 9, 2024
0c240cd
Update publish-npm.yml
YoavBZ Sep 10, 2024
7fc1307
Update publish-npm.yml
YoavBZ Sep 10, 2024
000b21f
release 5.31.2
invalid-email-address Sep 10, 2024
7564fa7
[OC-5077] Updated fetch-abi to fetch_abi (#293)
trongvnau Sep 11, 2024
6ed5f18
define get/set methods for vasp to vault assign
skfb Oct 7, 2024
0e419e6
inline documentation
skfb Oct 9, 2024
6ba6b01
inline documentation, precise response
skfb Oct 9, 2024
698b806
remove null type from vaspDid return value
skfb Oct 9, 2024
2f8cec2
inline documentation, precise request
skfb Oct 9, 2024
86e5b70
v1 prefix to endpoints
skfb Oct 10, 2024
9baa06a
OC-5460 - Add externalId in WriteCallFunctionDto && OC-5461 - Add SDK…
mlyberopoulos Oct 24, 2024
6a8aaa0
Merge pull request #296 from fireblocks/SPT-2123-get/set-vasp-assigne…
skfb Oct 28, 2024
dd6a1e3
release 5.32.0
invalid-email-address Oct 28, 2024
4526504
change ethNetwork from number to string
yuval-fireblocks Oct 30, 2024
21c5ee5
Merge pull request #299 from fireblocks/fix-asset-response
yuval-fireblocks Nov 3, 2024
095a798
add useGasless option (#300)
m-awais-ahmad Nov 3, 2024
f66c313
fix: package.json & package-lock.json to reduce vulnerabilities (#304)
dolevmiz1 Nov 6, 2024
bbda1d1
fix: upgrade jsonwebtoken from 9.0.0 to 9.0.2 (#303)
dolevmiz1 Nov 6, 2024
ca69fff
fix: upgrade axios from 1.6.0 to 1.7.7 (#301)
dolevmiz1 Nov 6, 2024
6745bcf
release 5.33.0
invalid-email-address Nov 6, 2024
8dad09a
support fallback function in abi (#306)
m-awais-ahmad Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

#### [v5.5.1](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.5.0...v5.5.1)

> 23 August 2023

- Rename NCW base path [`#198`](https://github.com/fireblocks/fireblocks-sdk-js/pull/198)

#### [v5.5.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.4.0...v5.5.0)

> 22 August 2023

- fix: add NCW methods [`#197`](https://github.com/fireblocks/fireblocks-sdk-js/pull/197)
- add NCW feature [`#192`](https://github.com/fireblocks/fireblocks-sdk-js/pull/192)
- changed return type to pending instead of TokenLink [`#188`](https://github.com/fireblocks/fireblocks-sdk-js/pull/188)

#### [v5.4.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.3.1...v5.4.0)

> 7 August 2023

- Support users groups crud [`#179`](https://github.com/fireblocks/fireblocks-sdk-js/pull/179)

#### [v5.3.1](https://github.com/fireblocks/fireblocks-sdk-js/compare/v5.3.0...v5.3.1)

> 2 August 2023
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fireblocks-sdk",
"version": "5.3.1",
"version": "5.5.1",
"main": "dist/src/fireblocks-sdk.js",
"types": "dist/src/fireblocks-sdk.d.ts",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export class ApiClient {
if (idempotencyKey) {
headers["Idempotency-Key"] = idempotencyKey;
}

const ncwWalletId = requestOptions?.ncw?.walletId;
if (ncwWalletId) {
headers["X-End-User-Wallet-Id"] = ncwWalletId;
}

const response = await this.axiosInstance.post<T>(path, body, {headers});
return response.data;
}
Expand Down
75 changes: 72 additions & 3 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {
SettlementRequest,
SettlementResponse,
GetNFTsFilter,
PeerType,
PublicKeyInformation,
DropTransactionResponse,
TokenLink,
Expand All @@ -91,9 +92,12 @@ import {
SmartTransfersTicketTermPayload,
SmartTransfersTicketTermFundPayload,
SmartTransfersTicketTermResponse,
UsersGroup, PendingTokenLinkDto,
} from "./types";
import { AxiosProxyConfig, AxiosResponse } from "axios";
import { PIIEncryption } from "./pii-client";
import { NcwApiClient } from "./ncw-api-client";
import { NcwSdk } from "./ncw-sdk";

export * from "./types";

Expand Down Expand Up @@ -132,6 +136,8 @@ export class FireblocksSDK {
private readonly authProvider: IAuthProvider;
private readonly apiBaseUrl: string;
private readonly apiClient: ApiClient;
private readonly apiNcw: NcwApiClient;

private piiClient: PIIEncryption;

/**
Expand All @@ -154,6 +160,18 @@ export class FireblocksSDK {
if (sdkOptions?.travelRuleOptions) {
this.piiClient = new PIIEncryption(sdkOptions.travelRuleOptions);
}

this.apiNcw = new NcwApiClient(this.apiClient);
}

/**
* NCW API Namespace
*
* @readonly
* @type {NcwSdk}
*/
public get NCW(): NcwSdk {
return this.apiNcw;
}

/**
Expand Down Expand Up @@ -797,11 +815,18 @@ export class FireblocksSDK {
* Creates a new transaction with the specified options
*/
public async createTransaction(transactionArguments: TransactionArguments, requestOptions?: RequestOptions, travelRuleEncryptionOptions?: TravelRuleEncryptionOptions): Promise<CreateTransactionResponse> {
const opts = { ...requestOptions };

if (transactionArguments?.travelRuleMessage) {
transactionArguments = await this.piiClient.hybridEncode(transactionArguments, travelRuleEncryptionOptions);
}

return await this.apiClient.issuePostRequest("/v1/transactions", transactionArguments, requestOptions);
if (transactionArguments.source?.type === PeerType.END_USER_WALLET && !opts.ncw?.walletId) {
const { walletId } = transactionArguments.source;
opts.ncw = { ...opts.ncw, walletId };
}

return await this.apiClient.issuePostRequest("/v1/transactions", transactionArguments, opts);
}

/**
Expand Down Expand Up @@ -1123,6 +1148,50 @@ export class FireblocksSDK {
return await this.apiClient.issueGetRequest("/v1/users");
}

/**
* Gets all Users Groups for your tenant
*/
public async getUsersGroups(): Promise<UsersGroup[]> {
return await this.apiClient.issueGetRequest("/v1/users_groups");
}

/**
* Gets a Users Group by ID
* @param id The ID of the User
*/
public async getUsersGroup(id: string): Promise<UsersGroup> {
return await this.apiClient.issueGetRequest(`/v1/users_groups/${id}`);
}

/**
* Creates a new Users Group
* @param name The name of the Users Group
* @param memberIds The members of the Users Group
*/
public async createUserGroup(groupName: string, memberIds?: string[]): Promise<UsersGroup> {
const body = { groupName, memberIds };
return await this.apiClient.issuePostRequest("/v1/users_groups", body);
}

/**
* Updates a Users Group
* @param id The ID of the Users Group
* @param name The name of the Users Group
* @param memberIds The members of the Users Group
*/
public async updateUserGroup(id: string, groupName?: string, memberIds?: string[]): Promise<UsersGroup> {
const body = { groupName, memberIds };
return await this.apiClient.issuePutRequest(`/v1/users_groups/${id}`, body);
}

/**
* Deletes a Users Group
* @param id The ID of the Users Group
*/
public async deleteUserGroup(id: string): Promise<void> {
return await this.apiClient.issueDeleteRequest(`/v1/users_groups/${id}`);
}

/**
* Get off exchange accounts
*/
Expand Down Expand Up @@ -1450,8 +1519,8 @@ export class FireblocksSDK {
* Issue a new token and link it to the tenant
* @param request
*/
public async issueNewToken(request: IssueTokenRequest): Promise<TokenLink> {
return await this.apiClient.issuePostRequest(`/v1/tokenization/tokens/`, request);
public async issueNewToken(request: IssueTokenRequest): Promise<PendingTokenLinkDto> {
return await this.apiClient.issuePostRequest(`/v1/tokenization/tokens`, request);
}

/**
Expand Down
135 changes: 135 additions & 0 deletions src/ncw-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import { ApiClient } from "./api-client";
import {
AssetResponse,
Web3PagedResponse,
NCW,
} from "./types";
import { NcwSdk } from "./ncw-sdk";

export class NcwApiClient implements NcwSdk {
private readonly NCW_BASE_PATH = "/v1/ncw/wallets";

constructor(private readonly apiClient: ApiClient) { }

public async createWallet(): Promise<{ walletId: string; enabled: boolean; }> {
return await this.apiClient.issuePostRequest(
`${this.NCW_BASE_PATH}`,
{});
}

public async getWallet(walletId: string): Promise<{ walletId: string; enabled: boolean; }> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}`);
}

public async enableWallet(walletId: string, enabled: boolean): Promise<void> {
return await this.apiClient.issuePutRequest(
`${this.NCW_BASE_PATH}/${walletId}/enable`,
{ enabled });
}

public async getWalletDevices(walletId: string): Promise<NCW.Device> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/devices/`);
}

public async enableWalletDevice(walletId: string, deviceId: string, enabled: boolean): Promise<void> {
return await this.apiClient.issuePutRequest(
`${this.NCW_BASE_PATH}/${walletId}/devices/${deviceId}/enable`,
{ enabled });
}

public async invokeWalletRpc(walletId: string, deviceId: string, payload: string): Promise<{ result: string; } | { error: { message: string; code?: number; }; }> {
return await this.apiClient.issuePostRequest(
`${this.NCW_BASE_PATH}/${walletId}/devices/${deviceId}/invoke`,
{ payload });
}

public async createWalletAccount(walletId: string): Promise<{
walletId: string;
accountId: number;
}> {
return await this.apiClient.issuePostRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts`,
{});
}

public async getWallets({ pageCursor, pageSize, sort, order }: NCW.GetWalletsPayload = {}): Promise<Web3PagedResponse<NCW.WalletInfo>> {
const params = new URLSearchParams({
...(pageCursor && { pageCursor }),
...(pageSize && { pageSize: pageSize.toString() }),
...(sort && { sort }),
...(order && { order }),
});

return await this.apiClient.issueGetRequest(`${this.NCW_BASE_PATH}?${params.toString()}`);
}

public async getWalletAccounts(walletId: string, { pageCursor, pageSize, sort, order }: NCW.GetWalletsPayload = {}): Promise<Web3PagedResponse<{
walletId: string;
accountId: number;
}>> {
const params = new URLSearchParams({
...(pageCursor && { pageCursor }),
...(pageSize && { pageSize: pageSize.toString() }),
...(sort && { sort }),
...(order && { order }),
});

return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts?${params.toString()}`);
}

public async getWalletAccount(walletId: string, accountId: number): Promise<{
walletId: string;
accountId: number;
}> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}`);
}

public async getWalletAssets(walletId: string, accountId: number, { pageCursor, pageSize, sort, order }: NCW.GetWalletAssetsPayload = {}): Promise<Web3PagedResponse<NCW.WalletAssetResponse>> {
const params = new URLSearchParams({
...(pageCursor && { pageCursor }),
...(pageSize && { pageSize: pageSize.toString() }),
...(sort && { sort }),
...(order && { order }),
});

return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets?${params.toString()}`);
}

public async getWalletAsset(walletId: string, accountId: number, assetId: string): Promise<NCW.WalletAssetResponse> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}`);
}

public async activateWalletAsset(walletId: string, accountId: number, assetId: string): Promise<NCW.WalletAssetAddress> {
return await this.apiClient.issuePostRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}`, {});
}

public async getWalletAssetAddresses(walletId: string, accountId: number, assetId: string, { pageCursor, pageSize, sort, order }: NCW.GetWalletAddressesPayload = {}): Promise<Web3PagedResponse<NCW.WalletAssetAddress>> {
const params = new URLSearchParams({
...(pageCursor && { pageCursor }),
...(pageSize && { pageSize: pageSize.toString() }),
...(sort && { sort }),
...(order && { order }),
});

return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}/addresses?${params.toString()}`);
}

public async getWalletAssetBalance(walletId: string, accountId: number, assetId: string): Promise<AssetResponse> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}/balance`);
}

public async refreshWalletAssetBalance(walletId: string, accountId: number, assetId: string): Promise<AssetResponse> {
return await this.apiClient.issuePutRequest(
`${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}/balance`,
{});
}
}
Loading
Loading