@dfns/sdk 0.4.3 → 0.5.2-rc.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.
Files changed (103) hide show
  1. package/dfnsApiClient.d.ts +0 -6
  2. package/dfnsApiClient.js +0 -12
  3. package/dfnsDelegatedApiClient.d.ts +0 -6
  4. package/dfnsDelegatedApiClient.js +0 -12
  5. package/generated/auth/client.d.ts +2 -0
  6. package/generated/auth/client.js +24 -0
  7. package/generated/auth/delegatedClient.d.ts +2 -0
  8. package/generated/auth/delegatedClient.js +24 -0
  9. package/generated/auth/types.d.ts +66 -12
  10. package/generated/permissions/types.d.ts +2 -2
  11. package/generated/policies/types.d.ts +2329 -526
  12. package/generated/wallets/types.d.ts +111 -24
  13. package/generated/webhooks/types.d.ts +9 -9
  14. package/package.json +1 -1
  15. package/store.d.ts +3 -32
  16. package/codegen/Assets/AssetsClient.d.ts +0 -13
  17. package/codegen/Assets/AssetsClient.js +0 -93
  18. package/codegen/Assets/DelegatedAssetsClient.d.ts +0 -16
  19. package/codegen/Assets/DelegatedAssetsClient.js +0 -124
  20. package/codegen/Assets/index.d.ts +0 -3
  21. package/codegen/Assets/index.js +0 -19
  22. package/codegen/Assets/types.d.ts +0 -37
  23. package/codegen/Assets/types.js +0 -2
  24. package/codegen/Auth/AuthClient.d.ts +0 -50
  25. package/codegen/Auth/AuthClient.js +0 -518
  26. package/codegen/Auth/DelegatedAuthClient.d.ts +0 -78
  27. package/codegen/Auth/DelegatedAuthClient.js +0 -936
  28. package/codegen/Auth/index.d.ts +0 -3
  29. package/codegen/Auth/index.js +0 -19
  30. package/codegen/Auth/types.d.ts +0 -177
  31. package/codegen/Auth/types.js +0 -2
  32. package/codegen/Callbacks/CallbacksClient.d.ts +0 -12
  33. package/codegen/Callbacks/CallbacksClient.js +0 -78
  34. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +0 -15
  35. package/codegen/Callbacks/DelegatedCallbacksClient.js +0 -110
  36. package/codegen/Callbacks/index.d.ts +0 -3
  37. package/codegen/Callbacks/index.js +0 -19
  38. package/codegen/Callbacks/types.d.ts +0 -23
  39. package/codegen/Callbacks/types.js +0 -2
  40. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +0 -21
  41. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +0 -189
  42. package/codegen/PublicKeys/PublicKeysClient.d.ts +0 -16
  43. package/codegen/PublicKeys/PublicKeysClient.js +0 -128
  44. package/codegen/PublicKeys/index.d.ts +0 -3
  45. package/codegen/PublicKeys/index.js +0 -19
  46. package/codegen/PublicKeys/types.d.ts +0 -51
  47. package/codegen/PublicKeys/types.js +0 -2
  48. package/codegen/Wallets/DelegatedWalletsClient.d.ts +0 -32
  49. package/codegen/Wallets/DelegatedWalletsClient.js +0 -325
  50. package/codegen/Wallets/WalletsClient.d.ts +0 -24
  51. package/codegen/Wallets/WalletsClient.js +0 -219
  52. package/codegen/Wallets/index.d.ts +0 -3
  53. package/codegen/Wallets/index.js +0 -19
  54. package/codegen/Wallets/types.d.ts +0 -101
  55. package/codegen/Wallets/types.js +0 -2
  56. package/codegen/datamodel/Assets/errors.d.ts +0 -11
  57. package/codegen/datamodel/Assets/errors.js +0 -17
  58. package/codegen/datamodel/Assets/index.d.ts +0 -3
  59. package/codegen/datamodel/Assets/index.js +0 -19
  60. package/codegen/datamodel/Assets/responses.d.ts +0 -47
  61. package/codegen/datamodel/Assets/responses.js +0 -2
  62. package/codegen/datamodel/Assets/types.d.ts +0 -219
  63. package/codegen/datamodel/Assets/types.js +0 -75
  64. package/codegen/datamodel/Auth/errors.d.ts +0 -0
  65. package/codegen/datamodel/Auth/errors.js +0 -1
  66. package/codegen/datamodel/Auth/index.d.ts +0 -2
  67. package/codegen/datamodel/Auth/index.js +0 -18
  68. package/codegen/datamodel/Auth/responses.d.ts +0 -358
  69. package/codegen/datamodel/Auth/responses.js +0 -2
  70. package/codegen/datamodel/Auth/types.d.ts +0 -933
  71. package/codegen/datamodel/Auth/types.js +0 -149
  72. package/codegen/datamodel/Callbacks/errors.d.ts +0 -0
  73. package/codegen/datamodel/Callbacks/errors.js +0 -1
  74. package/codegen/datamodel/Callbacks/index.d.ts +0 -2
  75. package/codegen/datamodel/Callbacks/index.js +0 -18
  76. package/codegen/datamodel/Callbacks/responses.d.ts +0 -36
  77. package/codegen/datamodel/Callbacks/responses.js +0 -2
  78. package/codegen/datamodel/Callbacks/types.d.ts +0 -43
  79. package/codegen/datamodel/Callbacks/types.js +0 -39
  80. package/codegen/datamodel/Foundations/errors.d.ts +0 -131
  81. package/codegen/datamodel/Foundations/errors.js +0 -182
  82. package/codegen/datamodel/Foundations/index.d.ts +0 -2
  83. package/codegen/datamodel/Foundations/index.js +0 -18
  84. package/codegen/datamodel/Foundations/responses.d.ts +0 -0
  85. package/codegen/datamodel/Foundations/responses.js +0 -1
  86. package/codegen/datamodel/Foundations/types.d.ts +0 -9795
  87. package/codegen/datamodel/Foundations/types.js +0 -57763
  88. package/codegen/datamodel/PublicKeys/errors.d.ts +0 -0
  89. package/codegen/datamodel/PublicKeys/errors.js +0 -1
  90. package/codegen/datamodel/PublicKeys/index.d.ts +0 -2
  91. package/codegen/datamodel/PublicKeys/index.js +0 -18
  92. package/codegen/datamodel/PublicKeys/responses.d.ts +0 -56
  93. package/codegen/datamodel/PublicKeys/responses.js +0 -2
  94. package/codegen/datamodel/PublicKeys/types.d.ts +0 -223
  95. package/codegen/datamodel/PublicKeys/types.js +0 -59
  96. package/codegen/datamodel/Wallets/errors.d.ts +0 -0
  97. package/codegen/datamodel/Wallets/errors.js +0 -1
  98. package/codegen/datamodel/Wallets/index.d.ts +0 -2
  99. package/codegen/datamodel/Wallets/index.js +0 -18
  100. package/codegen/datamodel/Wallets/responses.d.ts +0 -92
  101. package/codegen/datamodel/Wallets/responses.js +0 -2
  102. package/codegen/datamodel/Wallets/types.d.ts +0 -790
  103. package/codegen/datamodel/Wallets/types.js +0 -293
@@ -86,7 +86,7 @@ export type BroadcastTransactionRequest = BroadcastTransactionParams & {
86
86
  body: BroadcastTransactionBody;
87
87
  };
88
88
  export type CreateWalletBody = {
89
- network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Stellar" | "StellarTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
89
+ network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
90
90
  name?: string | undefined;
91
91
  delegateTo?: string | undefined;
92
92
  delayDelegation?: boolean | undefined;
@@ -131,8 +131,8 @@ export type DelegateWalletRequest = DelegateWalletParams & {
131
131
  export type ExportWalletBody = {
132
132
  encryptionKey: string;
133
133
  supportedSchemes: {
134
- protocol: "CGGMP21";
135
- curve: "secp256k1";
134
+ protocol: "CGGMP21" | "BINANCE_EDDSA" | "FROST" | "FROST_BITCOIN";
135
+ curve: "ed25519" | "secp256k1" | "stark";
136
136
  }[];
137
137
  };
138
138
  export type ExportWalletParams = {
@@ -142,8 +142,8 @@ export type ExportWalletResponse = {
142
142
  publicKey: string;
143
143
  /** The TSS threshold of the wallet private signing key shares */
144
144
  minSigners: number;
145
- protocol: "CGGMP21";
146
- curve: "secp256k1";
145
+ protocol: "CGGMP21" | "BINANCE_EDDSA" | "FROST" | "FROST_BITCOIN";
146
+ curve: "ed25519" | "secp256k1" | "stark";
147
147
  /** Keyshares of the exported wallet. They are encrypted with the provided encryption key. The exported private key is re-constructed from these keyshares. */
148
148
  encryptedKeyShares: {
149
149
  /** Base64-encoded ID of the signer exported the encrypted keyshare */
@@ -436,6 +436,11 @@ export type GetTransferResponse = {
436
436
  to: string;
437
437
  amount: string;
438
438
  memo?: string | undefined;
439
+ } | {
440
+ kind: "Spl" | "Spl2022";
441
+ to: string;
442
+ amount: string;
443
+ mint: string;
439
444
  };
440
445
  metadata: {
441
446
  asset: {
@@ -487,18 +492,49 @@ export type GetWalletAssetsParams = {
487
492
  export type GetWalletAssetsResponse = {
488
493
  walletId: string;
489
494
  network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Cardano" | "CardanoPreprod" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polkadot" | "Westend" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA";
490
- assets: {
491
- kind: "Native" | "Asa" | "Erc20" | "Erc721" | "Sep41" | "Trc10" | "Trc20" | "Trc721";
492
- assetId?: string | undefined;
493
- contract?: string | undefined;
494
- tokenId?: string | undefined;
495
- issuer?: string | undefined;
496
- assetCode?: string | undefined;
495
+ assets: ({
496
+ kind: "Native";
497
497
  symbol?: string | undefined;
498
498
  decimals: number;
499
499
  verified?: boolean | undefined;
500
500
  balance: string;
501
- }[];
501
+ } | {
502
+ kind: "Asa";
503
+ assetId: string;
504
+ symbol?: string | undefined;
505
+ decimals: number;
506
+ verified?: boolean | undefined;
507
+ balance: string;
508
+ } | {
509
+ kind: "Erc20" | "Trc20";
510
+ contract: string;
511
+ symbol?: string | undefined;
512
+ decimals: number;
513
+ verified?: boolean | undefined;
514
+ balance: string;
515
+ } | {
516
+ kind: "Sep41";
517
+ issuer: string;
518
+ assetCode: string;
519
+ symbol?: string | undefined;
520
+ decimals: number;
521
+ verified?: boolean | undefined;
522
+ balance: string;
523
+ } | {
524
+ kind: "Trc10";
525
+ tokenId: string;
526
+ symbol?: string | undefined;
527
+ decimals: number;
528
+ verified?: boolean | undefined;
529
+ balance: string;
530
+ } | {
531
+ kind: "Spl" | "Spl2022";
532
+ mint: string;
533
+ symbol?: string | undefined;
534
+ decimals: number;
535
+ verified?: boolean | undefined;
536
+ balance: string;
537
+ })[];
502
538
  };
503
539
  export type GetWalletAssetsRequest = GetWalletAssetsParams;
504
540
  export type GetWalletHistoryParams = {
@@ -508,7 +544,7 @@ export type GetWalletHistoryQuery = {
508
544
  limit?: string | undefined;
509
545
  paginationToken?: string | undefined;
510
546
  direction?: ("In" | "Out") | undefined;
511
- kind?: ("NativeTransfer" | "AsaTransfer" | "Erc20Transfer" | "Erc721Transfer" | "Trc10Transfer" | "Trc20Transfer" | "Trc721Transfer" | "Sep41Transfer" | "UtxoTransfer") | undefined;
547
+ kind?: ("NativeTransfer" | "AsaTransfer" | "Erc20Transfer" | "Erc721Transfer" | "Trc10Transfer" | "Trc20Transfer" | "Trc721Transfer" | "Sep41Transfer" | "SplTransfer" | "Spl2022Transfer" | "UtxoTransfer") | undefined;
512
548
  contract?: string | undefined;
513
549
  };
514
550
  export type GetWalletHistoryResponse = {
@@ -699,6 +735,38 @@ export type GetWalletHistoryResponse = {
699
735
  memo?: string | undefined;
700
736
  liquidityPool?: string | undefined;
701
737
  balanceId?: string | undefined;
738
+ } | {
739
+ walletId: string;
740
+ direction: "In" | "Out";
741
+ network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Cardano" | "CardanoPreprod" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polkadot" | "Westend" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA";
742
+ blockNumber: number;
743
+ txHash: string;
744
+ index?: string | undefined;
745
+ timestamp: string;
746
+ metadata: {
747
+ asset: {
748
+ symbol?: string | undefined;
749
+ decimals?: number | undefined;
750
+ verified?: boolean | undefined;
751
+ quotes?: {
752
+ [x: string]: number;
753
+ } | undefined;
754
+ };
755
+ fee?: {
756
+ symbol?: string | undefined;
757
+ decimals?: number | undefined;
758
+ verified?: boolean | undefined;
759
+ quotes?: {
760
+ [x: string]: number;
761
+ } | undefined;
762
+ } | undefined;
763
+ };
764
+ kind: "SplTransfer" | "Spl2022Transfer";
765
+ from?: string | undefined;
766
+ to?: string | undefined;
767
+ mint: string;
768
+ value: string;
769
+ fee?: string | undefined;
702
770
  } | {
703
771
  walletId: string;
704
772
  direction: "In" | "Out";
@@ -838,22 +906,26 @@ export type GetWalletNftsParams = {
838
906
  export type GetWalletNftsResponse = {
839
907
  walletId: string;
840
908
  network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Cardano" | "CardanoPreprod" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Polkadot" | "Westend" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tezos" | "TezosGhostnet" | "Tron" | "TronNile" | "XrpLedger" | "XrpLedgerTestnet" | "KeyECDSA" | "KeyECDSAStark" | "KeyEdDSA";
841
- nfts: {
842
- kind: "Native" | "Asa" | "Erc20" | "Erc721" | "Sep41" | "Trc10" | "Trc20" | "Trc721";
843
- contract?: string | undefined;
909
+ nfts: ({
910
+ kind: "Asa";
911
+ assetId: string;
844
912
  symbol?: string | undefined;
845
- verified?: boolean | undefined;
846
- tokenIds: string[];
847
- count: number;
848
- }[];
913
+ tokenUri?: string | undefined;
914
+ } | {
915
+ kind: "Erc721" | "Trc721";
916
+ contract: string;
917
+ tokenId: string;
918
+ symbol?: string | undefined;
919
+ tokenUri?: string | undefined;
920
+ })[];
849
921
  };
850
922
  export type GetWalletNftsRequest = GetWalletNftsParams;
851
923
  export type ImportWalletBody = {
852
- network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Stellar" | "StellarTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Solana" | "SolanaDevnet" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
924
+ network: "Algorand" | "AlgorandTestnet" | "ArbitrumOne" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseSepolia" | "Bitcoin" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "FantomOpera" | "FantomTestnet" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismSepolia" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Tron" | "TronNile" | "ArbitrumGoerli" | "BaseGoerli" | "Cardano" | "CardanoPreprod" | "Kusama" | "OptimismGoerli" | "Polkadot" | "Westend" | "Tezos" | "TezosGhostnet" | "XrpLedger" | "XrpLedgerTestnet" | "KeyEdDSA" | "KeyECDSA" | "KeyECDSAStark";
853
925
  name?: string | undefined;
854
926
  externalId?: string | undefined;
855
- curve: "secp256k1";
856
- protocol: "CGGMP21";
927
+ curve: "ed25519" | "secp256k1" | "stark";
928
+ protocol: "CGGMP21" | "BINANCE_EDDSA" | "FROST" | "FROST_BITCOIN";
857
929
  minSigners: number;
858
930
  encryptedKeyShares: {
859
931
  signerId: string;
@@ -1086,6 +1158,11 @@ export type ListTransfersResponse = {
1086
1158
  to: string;
1087
1159
  amount: string;
1088
1160
  memo?: string | undefined;
1161
+ } | {
1162
+ kind: "Spl" | "Spl2022";
1163
+ to: string;
1164
+ amount: string;
1165
+ mint: string;
1089
1166
  };
1090
1167
  metadata: {
1091
1168
  asset: {
@@ -1196,6 +1273,11 @@ export type TransferAssetBody = {
1196
1273
  to: string;
1197
1274
  amount: string;
1198
1275
  memo?: string | undefined;
1276
+ } | {
1277
+ kind: "Spl" | "Spl2022";
1278
+ to: string;
1279
+ amount: string;
1280
+ mint: string;
1199
1281
  };
1200
1282
  export type TransferAssetParams = {
1201
1283
  walletId: string;
@@ -1254,6 +1336,11 @@ export type TransferAssetResponse = {
1254
1336
  to: string;
1255
1337
  amount: string;
1256
1338
  memo?: string | undefined;
1339
+ } | {
1340
+ kind: "Spl" | "Spl2022";
1341
+ to: string;
1342
+ amount: string;
1343
+ mint: string;
1257
1344
  };
1258
1345
  metadata: {
1259
1346
  asset: {
@@ -3,7 +3,7 @@ export type CreateWebhookBody = {
3
3
  /** Webhook status */
4
4
  status?: ("Enabled" | "Disabled") | undefined;
5
5
  description?: string | undefined;
6
- events: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
6
+ events: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
7
7
  };
8
8
  export type CreateWebhookResponse = {
9
9
  /** Webhook ID */
@@ -11,7 +11,7 @@ export type CreateWebhookResponse = {
11
11
  /** Webhook url */
12
12
  url: string;
13
13
  /** All events this webhook is subscribed to. */
14
- events: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
14
+ events: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
15
15
  /** Webhook status */
16
16
  status: "Enabled" | "Disabled";
17
17
  /** Short description this webhook's purpose */
@@ -42,7 +42,7 @@ export type GetWebhookResponse = {
42
42
  /** Webhook url */
43
43
  url: string;
44
44
  /** All events this webhook is subscribed to. */
45
- events: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
45
+ events: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
46
46
  /** Webhook status */
47
47
  status: "Enabled" | "Disabled";
48
48
  /** Short description this webhook's purpose */
@@ -63,7 +63,7 @@ export type GetWebhookEventResponse = {
63
63
  /** ISO date string when event was raised */
64
64
  date: string;
65
65
  /** Webhook event */
66
- kind: "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified";
66
+ kind: "policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified";
67
67
  data: {
68
68
  [x: string]: any;
69
69
  };
@@ -79,7 +79,7 @@ export type ListWebhookEventsParams = {
79
79
  webhookId: string;
80
80
  };
81
81
  export type ListWebhookEventsQuery = {
82
- kind?: ("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | undefined;
82
+ kind?: ("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | undefined;
83
83
  deliveryFailed?: ("true" | "false") | undefined;
84
84
  limit?: number | undefined;
85
85
  paginationToken?: string | undefined;
@@ -91,7 +91,7 @@ export type ListWebhookEventsResponse = {
91
91
  /** ISO date string when event was raised */
92
92
  date: string;
93
93
  /** Webhook event */
94
- kind: "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified";
94
+ kind: "policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified";
95
95
  data: {
96
96
  [x: string]: any;
97
97
  };
@@ -118,7 +118,7 @@ export type ListWebhooksResponse = {
118
118
  /** Webhook url */
119
119
  url: string;
120
120
  /** All events this webhook is subscribed to. */
121
- events: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
121
+ events: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
122
122
  /** Webhook status */
123
123
  status: "Enabled" | "Disabled";
124
124
  /** Short description this webhook's purpose */
@@ -144,7 +144,7 @@ export type PingWebhookRequest = PingWebhookParams;
144
144
  export type UpdateWebhookBody = {
145
145
  url?: string | undefined;
146
146
  description?: (string | undefined) | undefined;
147
- events?: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[] | undefined;
147
+ events?: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[] | undefined;
148
148
  /** Webhook status */
149
149
  status?: (("Enabled" | "Disabled") | undefined) | undefined;
150
150
  };
@@ -157,7 +157,7 @@ export type UpdateWebhookResponse = {
157
157
  /** Webhook url */
158
158
  url: string;
159
159
  /** All events this webhook is subscribed to. */
160
- events: (("policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
160
+ events: (("policy.triggered" | "policy.approval.pending" | "policy.approval.resolved" | "wallet.blockchainevent.detected" | "wallet.created" | "wallet.delegated" | "wallet.exported" | "wallet.signature.failed" | "wallet.signature.rejected" | "wallet.signature.requested" | "wallet.signature.signed" | "wallet.transaction.broadcasted" | "wallet.transaction.confirmed" | "wallet.transaction.failed" | "wallet.transaction.rejected" | "wallet.transaction.requested" | "wallet.transfer.broadcasted" | "wallet.transfer.confirmed" | "wallet.transfer.failed" | "wallet.transfer.rejected" | "wallet.transfer.requested" | "wallet.tags.modified") | "*")[];
161
161
  /** Webhook status */
162
162
  status: "Enabled" | "Disabled";
163
163
  /** Short description this webhook's purpose */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfns/sdk",
3
- "version": "0.4.3",
3
+ "version": "0.5.2-rc.1",
4
4
  "dependencies": {
5
5
  "buffer": "6.0.3",
6
6
  "cross-fetch": "3.1.6",
package/store.d.ts CHANGED
@@ -1,37 +1,8 @@
1
- import { AllowCredential, CredentialKind, UserVerificationRequirement } from './signer';
1
+ import { CreateCredentialChallengeResponse, CreateRegistrationChallengeResponse } from './generated/auth/types';
2
2
  export type AuthenticatorAttachment = 'platform' | 'cross-platform';
3
3
  export type ResidentKeyRequirement = 'required' | 'preferred' | 'discouraged';
4
4
  export type AttestationConveyancePreference = 'none' | 'indirect' | 'direct' | 'enterprise';
5
- export type UserRegistrationChallenge = {
6
- temporaryAuthenticationToken: string;
7
- rp: {
8
- id: string;
9
- name: string;
10
- };
11
- user: {
12
- id: string;
13
- name: string;
14
- displayName: string;
15
- };
16
- supportedCredentialKinds: {
17
- firstFactor: CredentialKind[];
18
- secondFactor: CredentialKind[];
19
- };
20
- otpUrl: string;
21
- challenge: string;
22
- authenticatorSelection: {
23
- authenticatorAttachment?: AuthenticatorAttachment;
24
- requireResidentKey: boolean;
25
- residentKey: ResidentKeyRequirement;
26
- userVerification: UserVerificationRequirement;
27
- };
28
- attestation: AttestationConveyancePreference;
29
- pubKeyCredParams: {
30
- type: 'public-key';
31
- alg: number;
32
- }[];
33
- excludeCredentials: AllowCredential[];
34
- };
5
+ export type UserRegistrationChallenge = CreateRegistrationChallengeResponse;
35
6
  export type KeyAttestation = {
36
7
  credentialKind: 'Key';
37
8
  credentialInfo: {
@@ -74,5 +45,5 @@ export type RecoveryKeyAttestation = {
74
45
  export type RecoveryFactorAttestation = RecoveryKeyAttestation;
75
46
  export type CredentialAttestation = KeyAttestation | Fido2Attestation | PasswordAttestation | TotpAttestation | RecoveryKeyAttestation;
76
47
  export interface CredentialStore<T extends CredentialAttestation = FirstFactorAttestation> {
77
- create(challenge: UserRegistrationChallenge): Promise<T>;
48
+ create(challenge: CreateRegistrationChallengeResponse | CreateCredentialChallengeResponse): Promise<T>;
78
49
  }
@@ -1,13 +0,0 @@
1
- import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
- import * as T from './types';
3
- export declare class AssetsClient {
4
- private apiOptions;
5
- constructor(apiOptions: DfnsApiClientOptions);
6
- initiatePayment(request: T.InitiatePaymentRequest): Promise<T.InitiatePaymentResponse>;
7
- getPaymentById(request: T.GetPaymentByIdRequest): Promise<T.GetPaymentByIdResponse>;
8
- listPayments(request: T.ListPaymentsRequest): Promise<T.ListPaymentsResponse>;
9
- createAssetAccount(request: T.CreateAssetAccountRequest): Promise<T.CreateAssetAccountResponse>;
10
- getAssetAccountById(request: T.GetAssetAccountByIdRequest): Promise<T.GetAssetAccountByIdResponse>;
11
- listAssetAccounts(request: T.ListAssetAccountsRequest): Promise<T.ListAssetAccountsResponse>;
12
- getAssetAccountBalanceById(request: T.GetAssetAccountBalanceByIdRequest): Promise<T.GetAssetAccountBalanceByIdResponse>;
13
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssetsClient = void 0;
4
- const fetch_1 = require("../../utils/fetch");
5
- const url_1 = require("../../utils/url");
6
- class AssetsClient {
7
- constructor(apiOptions) {
8
- this.apiOptions = apiOptions;
9
- }
10
- async initiatePayment(request) {
11
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
12
- path: { assetAccountId: request.assetAccountId },
13
- query: {},
14
- });
15
- const response = await (0, fetch_1.userActionFetch)(path, {
16
- method: 'POST',
17
- body: request.body,
18
- apiOptions: this.apiOptions,
19
- });
20
- return response.json();
21
- }
22
- async getPaymentById(request) {
23
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments/:paymentId', {
24
- path: {
25
- assetAccountId: request.assetAccountId,
26
- paymentId: request.paymentId,
27
- },
28
- query: {},
29
- });
30
- const response = await (0, fetch_1.simpleFetch)(path, {
31
- method: 'GET',
32
- apiOptions: this.apiOptions,
33
- });
34
- return response.json();
35
- }
36
- async listPayments(request) {
37
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
38
- path: { assetAccountId: request.assetAccountId },
39
- query: {},
40
- });
41
- const response = await (0, fetch_1.simpleFetch)(path, {
42
- method: 'GET',
43
- apiOptions: this.apiOptions,
44
- });
45
- return response.json();
46
- }
47
- async createAssetAccount(request) {
48
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
49
- path: {},
50
- query: {},
51
- });
52
- const response = await (0, fetch_1.userActionFetch)(path, {
53
- method: 'POST',
54
- body: request.body,
55
- apiOptions: this.apiOptions,
56
- });
57
- return response.json();
58
- }
59
- async getAssetAccountById(request) {
60
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId', {
61
- path: { assetAccountId: request.assetAccountId },
62
- query: {},
63
- });
64
- const response = await (0, fetch_1.simpleFetch)(path, {
65
- method: 'GET',
66
- apiOptions: this.apiOptions,
67
- });
68
- return response.json();
69
- }
70
- async listAssetAccounts(request) {
71
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
72
- path: {},
73
- query: request.query ?? {},
74
- });
75
- const response = await (0, fetch_1.simpleFetch)(path, {
76
- method: 'GET',
77
- apiOptions: this.apiOptions,
78
- });
79
- return response.json();
80
- }
81
- async getAssetAccountBalanceById(request) {
82
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/balance', {
83
- path: { assetAccountId: request.assetAccountId },
84
- query: {},
85
- });
86
- const response = await (0, fetch_1.simpleFetch)(path, {
87
- method: 'GET',
88
- apiOptions: this.apiOptions,
89
- });
90
- return response.json();
91
- }
92
- }
93
- exports.AssetsClient = AssetsClient;
@@ -1,16 +0,0 @@
1
- import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
2
- import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
3
- import * as T from './types';
4
- export declare class DelegatedAssetsClient {
5
- private apiOptions;
6
- constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
- initiatePaymentInit(request: T.InitiatePaymentRequest): Promise<UserActionChallengeResponse>;
8
- initiatePaymentComplete(request: T.InitiatePaymentRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.InitiatePaymentResponse>;
9
- getPaymentById(request: T.GetPaymentByIdRequest): Promise<T.GetPaymentByIdResponse>;
10
- listPayments(request: T.ListPaymentsRequest): Promise<T.ListPaymentsResponse>;
11
- createAssetAccountInit(request: T.CreateAssetAccountRequest): Promise<UserActionChallengeResponse>;
12
- createAssetAccountComplete(request: T.CreateAssetAccountRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateAssetAccountResponse>;
13
- getAssetAccountById(request: T.GetAssetAccountByIdRequest): Promise<T.GetAssetAccountByIdResponse>;
14
- listAssetAccounts(request: T.ListAssetAccountsRequest): Promise<T.ListAssetAccountsResponse>;
15
- getAssetAccountBalanceById(request: T.GetAssetAccountBalanceByIdRequest): Promise<T.GetAssetAccountBalanceByIdResponse>;
16
- }
@@ -1,124 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DelegatedAssetsClient = void 0;
4
- const baseAuthApi_1 = require("../../baseAuthApi");
5
- const fetch_1 = require("../../utils/fetch");
6
- const url_1 = require("../../utils/url");
7
- class DelegatedAssetsClient {
8
- constructor(apiOptions) {
9
- this.apiOptions = apiOptions;
10
- }
11
- async initiatePaymentInit(request) {
12
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
13
- path: { assetAccountId: request.assetAccountId },
14
- query: {},
15
- });
16
- const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
- userActionHttpMethod: 'POST',
18
- userActionHttpPath: path,
19
- userActionPayload: JSON.stringify(request.body),
20
- userActionServerKind: 'Api',
21
- }, this.apiOptions);
22
- return challenge;
23
- }
24
- async initiatePaymentComplete(request, signedChallenge) {
25
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
26
- path: { assetAccountId: request.assetAccountId },
27
- query: {},
28
- });
29
- const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
30
- const response = await (0, fetch_1.simpleFetch)(path, {
31
- method: 'POST',
32
- body: request.body,
33
- headers: { 'x-dfns-useraction': userAction },
34
- apiOptions: this.apiOptions,
35
- });
36
- return response.json();
37
- }
38
- async getPaymentById(request) {
39
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments/:paymentId', {
40
- path: {
41
- assetAccountId: request.assetAccountId,
42
- paymentId: request.paymentId,
43
- },
44
- query: {},
45
- });
46
- const response = await (0, fetch_1.simpleFetch)(path, {
47
- method: 'GET',
48
- apiOptions: this.apiOptions,
49
- });
50
- return response.json();
51
- }
52
- async listPayments(request) {
53
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/payments', {
54
- path: { assetAccountId: request.assetAccountId },
55
- query: {},
56
- });
57
- const response = await (0, fetch_1.simpleFetch)(path, {
58
- method: 'GET',
59
- apiOptions: this.apiOptions,
60
- });
61
- return response.json();
62
- }
63
- async createAssetAccountInit(request) {
64
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
65
- path: {},
66
- query: {},
67
- });
68
- const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
69
- userActionHttpMethod: 'POST',
70
- userActionHttpPath: path,
71
- userActionPayload: JSON.stringify(request.body),
72
- userActionServerKind: 'Api',
73
- }, this.apiOptions);
74
- return challenge;
75
- }
76
- async createAssetAccountComplete(request, signedChallenge) {
77
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
78
- path: {},
79
- query: {},
80
- });
81
- const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
82
- const response = await (0, fetch_1.simpleFetch)(path, {
83
- method: 'POST',
84
- body: request.body,
85
- headers: { 'x-dfns-useraction': userAction },
86
- apiOptions: this.apiOptions,
87
- });
88
- return response.json();
89
- }
90
- async getAssetAccountById(request) {
91
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId', {
92
- path: { assetAccountId: request.assetAccountId },
93
- query: {},
94
- });
95
- const response = await (0, fetch_1.simpleFetch)(path, {
96
- method: 'GET',
97
- apiOptions: this.apiOptions,
98
- });
99
- return response.json();
100
- }
101
- async listAssetAccounts(request) {
102
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts', {
103
- path: {},
104
- query: request.query ?? {},
105
- });
106
- const response = await (0, fetch_1.simpleFetch)(path, {
107
- method: 'GET',
108
- apiOptions: this.apiOptions,
109
- });
110
- return response.json();
111
- }
112
- async getAssetAccountBalanceById(request) {
113
- const path = (0, url_1.buildPathAndQuery)('/assets/asset-accounts/:assetAccountId/balance', {
114
- path: { assetAccountId: request.assetAccountId },
115
- query: {},
116
- });
117
- const response = await (0, fetch_1.simpleFetch)(path, {
118
- method: 'GET',
119
- apiOptions: this.apiOptions,
120
- });
121
- return response.json();
122
- }
123
- }
124
- exports.DelegatedAssetsClient = DelegatedAssetsClient;
@@ -1,3 +0,0 @@
1
- export * from './AssetsClient';
2
- export * from './DelegatedAssetsClient';
3
- export * from './types';