@dfns/sdk 0.4.3 → 0.5.0

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 (102) 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 +15 -0
  12. package/generated/wallets/types.d.ts +105 -18
  13. package/package.json +1 -1
  14. package/store.d.ts +3 -32
  15. package/codegen/Assets/AssetsClient.d.ts +0 -13
  16. package/codegen/Assets/AssetsClient.js +0 -93
  17. package/codegen/Assets/DelegatedAssetsClient.d.ts +0 -16
  18. package/codegen/Assets/DelegatedAssetsClient.js +0 -124
  19. package/codegen/Assets/index.d.ts +0 -3
  20. package/codegen/Assets/index.js +0 -19
  21. package/codegen/Assets/types.d.ts +0 -37
  22. package/codegen/Assets/types.js +0 -2
  23. package/codegen/Auth/AuthClient.d.ts +0 -50
  24. package/codegen/Auth/AuthClient.js +0 -518
  25. package/codegen/Auth/DelegatedAuthClient.d.ts +0 -78
  26. package/codegen/Auth/DelegatedAuthClient.js +0 -936
  27. package/codegen/Auth/index.d.ts +0 -3
  28. package/codegen/Auth/index.js +0 -19
  29. package/codegen/Auth/types.d.ts +0 -177
  30. package/codegen/Auth/types.js +0 -2
  31. package/codegen/Callbacks/CallbacksClient.d.ts +0 -12
  32. package/codegen/Callbacks/CallbacksClient.js +0 -78
  33. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +0 -15
  34. package/codegen/Callbacks/DelegatedCallbacksClient.js +0 -110
  35. package/codegen/Callbacks/index.d.ts +0 -3
  36. package/codegen/Callbacks/index.js +0 -19
  37. package/codegen/Callbacks/types.d.ts +0 -23
  38. package/codegen/Callbacks/types.js +0 -2
  39. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +0 -21
  40. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +0 -189
  41. package/codegen/PublicKeys/PublicKeysClient.d.ts +0 -16
  42. package/codegen/PublicKeys/PublicKeysClient.js +0 -128
  43. package/codegen/PublicKeys/index.d.ts +0 -3
  44. package/codegen/PublicKeys/index.js +0 -19
  45. package/codegen/PublicKeys/types.d.ts +0 -51
  46. package/codegen/PublicKeys/types.js +0 -2
  47. package/codegen/Wallets/DelegatedWalletsClient.d.ts +0 -32
  48. package/codegen/Wallets/DelegatedWalletsClient.js +0 -325
  49. package/codegen/Wallets/WalletsClient.d.ts +0 -24
  50. package/codegen/Wallets/WalletsClient.js +0 -219
  51. package/codegen/Wallets/index.d.ts +0 -3
  52. package/codegen/Wallets/index.js +0 -19
  53. package/codegen/Wallets/types.d.ts +0 -101
  54. package/codegen/Wallets/types.js +0 -2
  55. package/codegen/datamodel/Assets/errors.d.ts +0 -11
  56. package/codegen/datamodel/Assets/errors.js +0 -17
  57. package/codegen/datamodel/Assets/index.d.ts +0 -3
  58. package/codegen/datamodel/Assets/index.js +0 -19
  59. package/codegen/datamodel/Assets/responses.d.ts +0 -47
  60. package/codegen/datamodel/Assets/responses.js +0 -2
  61. package/codegen/datamodel/Assets/types.d.ts +0 -219
  62. package/codegen/datamodel/Assets/types.js +0 -75
  63. package/codegen/datamodel/Auth/errors.d.ts +0 -0
  64. package/codegen/datamodel/Auth/errors.js +0 -1
  65. package/codegen/datamodel/Auth/index.d.ts +0 -2
  66. package/codegen/datamodel/Auth/index.js +0 -18
  67. package/codegen/datamodel/Auth/responses.d.ts +0 -358
  68. package/codegen/datamodel/Auth/responses.js +0 -2
  69. package/codegen/datamodel/Auth/types.d.ts +0 -933
  70. package/codegen/datamodel/Auth/types.js +0 -149
  71. package/codegen/datamodel/Callbacks/errors.d.ts +0 -0
  72. package/codegen/datamodel/Callbacks/errors.js +0 -1
  73. package/codegen/datamodel/Callbacks/index.d.ts +0 -2
  74. package/codegen/datamodel/Callbacks/index.js +0 -18
  75. package/codegen/datamodel/Callbacks/responses.d.ts +0 -36
  76. package/codegen/datamodel/Callbacks/responses.js +0 -2
  77. package/codegen/datamodel/Callbacks/types.d.ts +0 -43
  78. package/codegen/datamodel/Callbacks/types.js +0 -39
  79. package/codegen/datamodel/Foundations/errors.d.ts +0 -131
  80. package/codegen/datamodel/Foundations/errors.js +0 -182
  81. package/codegen/datamodel/Foundations/index.d.ts +0 -2
  82. package/codegen/datamodel/Foundations/index.js +0 -18
  83. package/codegen/datamodel/Foundations/responses.d.ts +0 -0
  84. package/codegen/datamodel/Foundations/responses.js +0 -1
  85. package/codegen/datamodel/Foundations/types.d.ts +0 -9795
  86. package/codegen/datamodel/Foundations/types.js +0 -57763
  87. package/codegen/datamodel/PublicKeys/errors.d.ts +0 -0
  88. package/codegen/datamodel/PublicKeys/errors.js +0 -1
  89. package/codegen/datamodel/PublicKeys/index.d.ts +0 -2
  90. package/codegen/datamodel/PublicKeys/index.js +0 -18
  91. package/codegen/datamodel/PublicKeys/responses.d.ts +0 -56
  92. package/codegen/datamodel/PublicKeys/responses.js +0 -2
  93. package/codegen/datamodel/PublicKeys/types.d.ts +0 -223
  94. package/codegen/datamodel/PublicKeys/types.js +0 -59
  95. package/codegen/datamodel/Wallets/errors.d.ts +0 -0
  96. package/codegen/datamodel/Wallets/errors.js +0 -1
  97. package/codegen/datamodel/Wallets/index.d.ts +0 -2
  98. package/codegen/datamodel/Wallets/index.js +0 -18
  99. package/codegen/datamodel/Wallets/responses.d.ts +0 -92
  100. package/codegen/datamodel/Wallets/responses.js +0 -2
  101. package/codegen/datamodel/Wallets/types.d.ts +0 -790
  102. 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;
@@ -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,18 +906,22 @@ 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
927
  curve: "secp256k1";
@@ -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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfns/sdk",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
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';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./AssetsClient"), exports);
18
- __exportStar(require("./DelegatedAssetsClient"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,37 +0,0 @@
1
- import * as Assets from '../datamodel/Assets';
2
- export type InitiatePaymentRequest = {
3
- assetAccountId: string;
4
- body: Assets.CreatePaymentInput;
5
- };
6
- export type InitiatePaymentResponse = Assets.Payment;
7
- export type GetPaymentByIdRequest = {
8
- assetAccountId: string;
9
- paymentId: string;
10
- };
11
- export type GetPaymentByIdResponse = Assets.Payment;
12
- export type ListPaymentsRequest = {
13
- assetAccountId: string;
14
- };
15
- export type ListPaymentsResponse = {
16
- items: Assets.Payment[];
17
- };
18
- export type CreateAssetAccountRequest = {
19
- body: Assets.CreateAssetAccountInput;
20
- };
21
- export type CreateAssetAccountResponse = Assets.AssetAccount;
22
- export type GetAssetAccountByIdRequest = {
23
- assetAccountId: string;
24
- };
25
- export type GetAssetAccountByIdResponse = Assets.AssetAccount;
26
- export type ListAssetAccountsRequest = {
27
- query?: {
28
- status?: Assets.AssetAccountStatus;
29
- };
30
- };
31
- export type ListAssetAccountsResponse = {
32
- items: Assets.AssetAccount[];
33
- };
34
- export type GetAssetAccountBalanceByIdRequest = {
35
- assetAccountId: string;
36
- };
37
- export type GetAssetAccountBalanceByIdResponse = Assets.AssetAccountBalance;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,50 +0,0 @@
1
- import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
- import * as T from './types';
3
- export declare class AuthClient {
4
- private apiOptions;
5
- constructor(apiOptions: DfnsApiClientOptions);
6
- createDelegatedUserRegistration(request: T.CreateDelegatedUserRegistrationRequest): Promise<T.CreateDelegatedUserRegistrationResponse>;
7
- createUserRegistration(request: T.CreateUserRegistrationRequest): Promise<T.CreateUserRegistrationResponse>;
8
- createDelegatedUserLogin(request: T.CreateDelegatedUserLoginRequest): Promise<T.CreateDelegatedUserLoginResponse>;
9
- createUserActionSignatureChallenge(request: T.CreateUserActionSignatureChallengeRequest): Promise<T.CreateUserActionSignatureChallengeResponse>;
10
- createUserActionSignature(request: T.CreateUserActionSignatureRequest): Promise<T.CreateUserActionSignatureResponse>;
11
- createUserCredentialChallenge(request: T.CreateUserCredentialChallengeRequest): Promise<T.CreateUserCredentialChallengeResponse>;
12
- createUserCredential(request: T.CreateUserCredentialRequest): Promise<T.CreateUserCredentialResponse>;
13
- activateCredential(request: T.ActivateCredentialRequest): Promise<T.ActivateCredentialResponse>;
14
- deactivateCredential(request: T.DeactivateCredentialRequest): Promise<T.DeactivateCredentialResponse>;
15
- listUserCredentials(): Promise<T.ListUserCredentialsResponse>;
16
- createUserActionSignatureFromCode(request: T.CreateUserActionSignatureFromCodeRequest): Promise<T.CreateUserActionSignatureFromCodeResponse>;
17
- createCodeUserActionSignatureChallenge(request: T.CreateCodeUserActionSignatureChallengeRequest): Promise<T.CreateCodeUserActionSignatureChallengeResponse>;
18
- createCodeUserActionSignature(request: T.CreateCodeUserActionSignatureRequest): Promise<T.CreateCodeUserActionSignatureResponse>;
19
- listPersonalAccessTokens(): Promise<T.ListPersonalAccessTokensResponse>;
20
- createPersonalAccessToken(request: T.CreatePersonalAccessTokenRequest): Promise<T.CreatePersonalAccessTokenResponse>;
21
- getPersonalAccessTokens(request: T.GetPersonalAccessTokensRequest): Promise<T.GetPersonalAccessTokensResponse>;
22
- updatePersonalAccessToken(request: T.UpdatePersonalAccessTokenRequest): Promise<T.UpdatePersonalAccessTokenResponse>;
23
- archivePersonalAccessToken(request: T.ArchivePersonalAccessTokenRequest): Promise<T.ArchivePersonalAccessTokenResponse>;
24
- activatePersonalAccessToken(request: T.ActivatePersonalAccessTokenRequest): Promise<T.ActivatePersonalAccessTokenResponse>;
25
- deactivatePersonalAccessToken(request: T.DeactivatePersonalAccessTokenRequest): Promise<T.DeactivatePersonalAccessTokenResponse>;
26
- listServiceAccounts(): Promise<T.ListServiceAccountsResponse>;
27
- createServiceAccount(request: T.CreateServiceAccountRequest): Promise<T.CreateServiceAccountResponse>;
28
- getServiceAccount(request: T.GetServiceAccountRequest): Promise<T.GetServiceAccountResponse>;
29
- updateServiceAccount(request: T.UpdateServiceAccountRequest): Promise<T.UpdateServiceAccountResponse>;
30
- archiveServiceAccount(request: T.ArchiveServiceAccountRequest): Promise<T.ArchiveServiceAccountResponse>;
31
- activateServiceAccount(request: T.ActivateServiceAccountRequest): Promise<T.ActivateServiceAccountResponse>;
32
- deactivateServiceAccount(request: T.DeactivateServiceAccountRequest): Promise<T.DeactivateServiceAccountResponse>;
33
- listUsers(): Promise<T.ListUsersResponse>;
34
- createUser(request: T.CreateUserRequest): Promise<T.CreateUserResponse>;
35
- getUser(request: T.GetUserRequest): Promise<T.GetUserResponse>;
36
- updateUser(request: T.UpdateUserRequest): Promise<T.UpdateUserResponse>;
37
- archiveUser(request: T.ArchiveUserRequest): Promise<T.ArchiveUserResponse>;
38
- activateUser(request: T.ActivateUserRequest): Promise<T.ActivateUserResponse>;
39
- deactivateUser(request: T.DeactivateUserRequest): Promise<T.DeactivateUserResponse>;
40
- listApplications(): Promise<T.ListApplicationsResponse>;
41
- createApplication(request: T.CreateApplicationRequest): Promise<T.CreateApplicationResponse>;
42
- getApplication(request: T.GetApplicationRequest): Promise<T.GetApplicationResponse>;
43
- updateApplication(request: T.UpdateApplicationRequest): Promise<T.UpdateApplicationResponse>;
44
- archiveApplication(request: T.ArchiveApplicationRequest): Promise<T.ArchiveApplicationResponse>;
45
- activateApplication(request: T.ActivateApplicationRequest): Promise<T.ActivateApplicationResponse>;
46
- deactivateApplication(request: T.DeactivateApplicationRequest): Promise<T.DeactivateApplicationResponse>;
47
- createUserRecovery(request: T.CreateUserRecoveryRequest): Promise<T.CreateUserRecoveryResponse>;
48
- restartDelegatedUserRegistration(request: T.RestartDelegatedUserRegistrationRequest): Promise<T.RestartDelegatedUserRegistrationResponse>;
49
- createDelegatedUserRecovery(request: T.CreateDelegatedUserRecoveryRequest): Promise<T.CreateDelegatedUserRecoveryResponse>;
50
- }