@bithomp/xrpl-api 3.2.9 → 3.2.10

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 (69) hide show
  1. package/lib/ledger/transaction.js +6 -0
  2. package/lib/parse/ledger/destination.d.ts +2 -0
  3. package/lib/parse/ledger/destination.js +12 -0
  4. package/lib/parse/ledger/regular-key.d.ts +2 -0
  5. package/lib/parse/ledger/regular-key.js +14 -0
  6. package/lib/parse/ledger/signers.d.ts +2 -0
  7. package/lib/parse/ledger/signers.js +12 -0
  8. package/lib/parse/ledger/source.d.ts +3 -0
  9. package/lib/parse/ledger/source.js +28 -0
  10. package/lib/parse/specification/account-delete.js +8 -11
  11. package/lib/parse/specification/amm-bid.js +6 -6
  12. package/lib/parse/specification/amm-clawback.js +6 -5
  13. package/lib/parse/specification/amm-create.js +6 -6
  14. package/lib/parse/specification/amm-delete.js +6 -6
  15. package/lib/parse/specification/amm-deposit.js +6 -6
  16. package/lib/parse/specification/amm-vote.js +6 -6
  17. package/lib/parse/specification/amm-withdraw.js +6 -6
  18. package/lib/parse/specification/check-cancel.js +6 -0
  19. package/lib/parse/specification/check-cash.js +6 -0
  20. package/lib/parse/specification/check-create.js +8 -11
  21. package/lib/parse/specification/clawback.js +6 -6
  22. package/lib/parse/specification/deposit-preauth.js +6 -0
  23. package/lib/parse/specification/did-delete.js +6 -6
  24. package/lib/parse/specification/did-set.js +6 -6
  25. package/lib/parse/specification/escrow-cancel.js +6 -5
  26. package/lib/parse/specification/escrow-create.js +8 -10
  27. package/lib/parse/specification/escrow-finish.js +6 -5
  28. package/lib/parse/specification/fee-update.js +2 -0
  29. package/lib/parse/specification/genesis-mint.js +2 -0
  30. package/lib/parse/specification/import.js +6 -5
  31. package/lib/parse/specification/invoke.js +8 -10
  32. package/lib/parse/specification/mptoken-authorize.js +6 -6
  33. package/lib/parse/specification/mptoken-issuance-create.js +6 -6
  34. package/lib/parse/specification/mptoken-issuance-destroy.js +6 -6
  35. package/lib/parse/specification/mptoken-issuance-set.js +6 -6
  36. package/lib/parse/specification/nftoken-accept-offer.js +6 -5
  37. package/lib/parse/specification/nftoken-burn.js +6 -5
  38. package/lib/parse/specification/nftoken-cancel-offer.js +6 -5
  39. package/lib/parse/specification/nftoken-create-offer.js +8 -10
  40. package/lib/parse/specification/nftoken-mint.js +8 -10
  41. package/lib/parse/specification/offer-cancel.js +8 -5
  42. package/lib/parse/specification/offer-create.js +8 -5
  43. package/lib/parse/specification/oracle-delete.js +6 -6
  44. package/lib/parse/specification/oracle-set.js +6 -6
  45. package/lib/parse/specification/payment-channel-claim.js +6 -0
  46. package/lib/parse/specification/payment-channel-create.js +8 -11
  47. package/lib/parse/specification/payment-channel-fund.js +6 -0
  48. package/lib/parse/specification/payment.js +8 -15
  49. package/lib/parse/specification/remit.js +8 -11
  50. package/lib/parse/specification/settings.js +6 -0
  51. package/lib/parse/specification/ticket-create.js +6 -0
  52. package/lib/parse/specification/trustline.js +6 -0
  53. package/lib/parse/specification/unl-report.js +2 -7
  54. package/lib/parse/specification/unrecognized.js +6 -6
  55. package/lib/parse/specification/uritoken-burn.js +6 -0
  56. package/lib/parse/specification/uritoken-buy.js +6 -0
  57. package/lib/parse/specification/uritoken-cancel-sell-offer.js +6 -0
  58. package/lib/parse/specification/uritoken-create-sell-offer.js +8 -10
  59. package/lib/parse/specification/uritoken-mint.js +8 -10
  60. package/lib/types/account.d.ts +5 -2
  61. package/lib/types/escrows.d.ts +0 -5
  62. package/lib/types/import.d.ts +0 -2
  63. package/lib/types/invoke.d.ts +2 -3
  64. package/lib/types/payments.d.ts +2 -2
  65. package/lib/types/remits.d.ts +0 -3
  66. package/lib/types/signers.d.ts +16 -0
  67. package/lib/types/specification.d.ts +4 -1
  68. package/lib/types/unl_reports.d.ts +0 -2
  69. package/package.json +2 -2
@@ -37,21 +37,19 @@ const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
39
  const memos_1 = require("../ledger/memos");
40
- const account_1 = require("../ledger/account");
40
+ const signers_1 = require("../ledger/signers");
41
+ const regular_key_1 = require("../ledger/regular-key");
42
+ const source_1 = require("../ledger/source");
43
+ const destination_1 = require("../ledger/destination");
41
44
  function parseNFTokenBurn(tx) {
42
45
  assert.ok(tx.TransactionType === "URITokenCreateSellOffer");
43
- const source = (0, common_1.removeUndefined)({
44
- address: (0, account_1.parseAccount)(tx.Account),
45
- tag: tx.SourceTag,
46
- });
47
- const destination = (0, common_1.removeUndefined)({
48
- address: tx.Destination,
49
- });
50
46
  return (0, common_1.removeUndefined)({
51
47
  uritokenID: tx.URITokenID,
52
48
  amount: tx.Amount,
53
- source: Object.keys(source).length > 0 ? source : undefined,
54
- destination: Object.keys(destination).length > 0 ? destination : undefined,
49
+ source: (0, source_1.parseSource)(tx),
50
+ destination: (0, destination_1.parseDestination)(tx),
51
+ signers: (0, signers_1.parseSigners)(tx),
52
+ signer: (0, regular_key_1.parseSignerRegularKey)(tx),
55
53
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
56
54
  memos: (0, memos_1.parseMemos)(tx),
57
55
  });
@@ -41,23 +41,21 @@ const common_1 = require("../../common");
41
41
  const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
42
42
  const emit_details_1 = require("../ledger/emit_details");
43
43
  const memos_1 = require("../ledger/memos");
44
- const account_1 = require("../ledger/account");
44
+ const signers_1 = require("../ledger/signers");
45
+ const regular_key_1 = require("../ledger/regular-key");
46
+ const source_1 = require("../ledger/source");
47
+ const destination_1 = require("../ledger/destination");
45
48
  function parseNFTokenMint(tx) {
46
49
  assert.ok(tx.TransactionType === "URITokenMint");
47
- const source = (0, common_1.removeUndefined)({
48
- address: (0, account_1.parseAccount)(tx.Account),
49
- tag: tx.SourceTag,
50
- });
51
- const destination = (0, common_1.removeUndefined)({
52
- address: tx.Destination,
53
- });
54
50
  return (0, common_1.removeUndefined)({
55
51
  uri: tx.URI,
56
52
  flags: (0, uritoken_flags_1.default)(tx.Flags),
57
53
  digest: tx.Digest,
58
54
  amount: tx.Amount,
59
- source: Object.keys(source).length > 0 ? source : undefined,
60
- destination: Object.keys(destination).length > 0 ? destination : undefined,
55
+ source: (0, source_1.parseSource)(tx),
56
+ destination: (0, destination_1.parseDestination)(tx),
57
+ signers: (0, signers_1.parseSigners)(tx),
58
+ signer: (0, regular_key_1.parseSignerRegularKey)(tx),
61
59
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
62
60
  memos: (0, memos_1.parseMemos)(tx),
63
61
  });
@@ -1,18 +1,21 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
2
+ import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
3
3
  export type FormattedAccountDeleteSpecification = {
4
4
  source?: FormattedSourceAddress;
5
5
  destination?: FormattedDestinationAddress;
6
6
  } & FormattedBaseSpecification;
7
7
  export type FormattedSourceAddress = {
8
8
  address: string;
9
- maxAmount?: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
9
+ maxAmount?: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
10
10
  tag?: number;
11
11
  };
12
12
  export type FormattedDestinationAddress = {
13
13
  address: string;
14
14
  tag?: number;
15
15
  };
16
+ export type FormattedSignerRegularKey = {
17
+ address: string;
18
+ };
16
19
  export type FormattedAccountInfoData = {
17
20
  sequence: number;
18
21
  xrpBalance: string;
@@ -1,21 +1,16 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
2
  import { Amount } from "./amounts";
3
- import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
4
3
  export type FormattedEscrowCancelSpecification = {
5
- source: FormattedSourceAddress;
6
4
  owner: string;
7
5
  escrowSequence: number;
8
6
  } & FormattedBaseSpecification;
9
7
  export type FormattedEscrowCreateSpecification = {
10
8
  amount?: Amount;
11
- source: FormattedSourceAddress;
12
- destination: FormattedDestinationAddress;
13
9
  condition: string;
14
10
  allowCancelAfter?: string;
15
11
  allowExecuteAfter?: string;
16
12
  } & FormattedBaseSpecification;
17
13
  export type FormattedEscrowFinishSpecification = {
18
- source: FormattedSourceAddress;
19
14
  owner: string;
20
15
  escrowSequence: number;
21
16
  condition?: string;
@@ -1,5 +1,4 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedSourceAddress } from "./account";
3
2
  import { FormattedSpecification } from "../parse/transaction";
4
3
  import { Outcome } from "./outcome";
5
4
  export type FormattedImportBlobSpecification = {
@@ -18,6 +17,5 @@ export type FormattedImportBlobSpecification = {
18
17
  };
19
18
  };
20
19
  export type FormattedImportSpecification = {
21
- source: FormattedSourceAddress;
22
20
  blob: FormattedImportBlobSpecification | string;
23
21
  } & FormattedBaseSpecification;
@@ -1,6 +1,5 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
2
+ import { FormattedDestinationAddress } from "./account";
3
3
  export type FormattedInvokeSpecification = {
4
- source: FormattedSourceAddress;
5
- destination: FormattedDestinationAddress;
4
+ destination?: FormattedDestinationAddress;
6
5
  } & FormattedBaseSpecification;
@@ -1,8 +1,8 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
2
  import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
3
3
  export type FormattedPaymentSpecification = {
4
- source: FormattedSourceAddress;
5
- destination: FormattedDestinationAddress;
4
+ source?: FormattedSourceAddress;
5
+ destination?: FormattedDestinationAddress;
6
6
  invoiceID?: string;
7
7
  paths?: string;
8
8
  allowPartialPayment?: boolean;
@@ -1,10 +1,7 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedDestinationAddress, FormattedSourceAddress } from "./account";
3
2
  import { Amount } from "./amounts";
4
3
  import { URITokenFlagsKeysInterface } from "./uritokens";
5
4
  export type FormattedRemitsSpecification = {
6
- source: FormattedSourceAddress;
7
- destination: FormattedDestinationAddress;
8
5
  amounts?: Amount[];
9
6
  uritokenIDs?: string[];
10
7
  uritokenMint?: {
@@ -4,3 +4,19 @@ export interface SignerEntry {
4
4
  SignerWeight: number;
5
5
  };
6
6
  }
7
+ export interface FormattedSigner {
8
+ address: string;
9
+ weight: number;
10
+ }
11
+ export interface TransactionSigner {
12
+ Signer: {
13
+ SigningPubKey: string;
14
+ TxnSignature: string;
15
+ Account?: string;
16
+ };
17
+ }
18
+ export interface FormattedTransactionSigner {
19
+ address: string;
20
+ signingPubKey?: string;
21
+ txnSignature?: string;
22
+ }
@@ -1,8 +1,11 @@
1
- import { FormattedSourceAddress } from "./account";
1
+ import { FormattedSourceAddress, FormattedSignerRegularKey } from "./account";
2
2
  import { FormattedEmitDetails } from "./emit_details";
3
3
  import { FormattedMemo } from "./memos";
4
+ import { FormattedTransactionSigner } from "./signers";
4
5
  export type FormattedBaseSpecification = {
5
6
  source?: FormattedSourceAddress;
7
+ signers?: FormattedTransactionSigner[];
8
+ signer?: FormattedSignerRegularKey;
6
9
  emittedDetails?: FormattedEmitDetails;
7
10
  memos?: FormattedMemo[];
8
11
  };
@@ -1,7 +1,5 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedSourceAddress } from "./account";
3
2
  export type FormattedUNLReportSpecification = {
4
- source: FormattedSourceAddress;
5
3
  activeValidator?: string;
6
4
  importVLKey?: string;
7
5
  } & FormattedBaseSpecification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.2.9",
3
+ "version": "3.2.10",
4
4
  "description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
44
44
  "lint": "eslint",
45
45
  "prepare": "npm run build",
46
- "-prepublishOnly": "npm test && npm run lint",
46
+ "prepublishOnly": "npm test && npm run lint",
47
47
  "preversion": "npm run lint",
48
48
  "version": "npm run format && git add -A src",
49
49
  "postversion": "git push && git push --tags"