@okxweb3/coin-xrp 1.0.0-beta.0 → 1.0.0-beta.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.
- package/dist/common.d.ts +26 -26
- package/dist/common.js +19 -26
- package/dist/common.js.map +1 -1
- package/package.json +2 -2
package/dist/common.d.ts
CHANGED
|
@@ -16,36 +16,36 @@ export type XrpParam = {
|
|
|
16
16
|
data: any;
|
|
17
17
|
};
|
|
18
18
|
export type XrpBasePram = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
account: Account;
|
|
20
|
+
fee: string;
|
|
21
|
+
sequence: number;
|
|
22
|
+
accountTxnID?: string;
|
|
23
|
+
flags?: number | GlobalFlags;
|
|
24
|
+
lastLedgerSequence: number;
|
|
25
|
+
memos?: Memo[];
|
|
26
|
+
signers?: Signer[];
|
|
27
|
+
sourceTag?: number;
|
|
28
|
+
signingPubKey?: string;
|
|
29
|
+
ticketSequence?: number;
|
|
30
|
+
txnSignature?: string;
|
|
31
|
+
networkID?: number;
|
|
32
32
|
};
|
|
33
33
|
export type PaymentTxParam = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
amount: Amount | MPTAmount;
|
|
35
|
+
destination: Account;
|
|
36
|
+
destinationTag?: number;
|
|
37
|
+
invoiceID?: string;
|
|
38
|
+
paths?: Path[];
|
|
39
|
+
sendMax?: Amount | MPTAmount;
|
|
40
|
+
deliverMin?: Amount | MPTAmount;
|
|
41
|
+
credentialIDs?: string[];
|
|
42
|
+
flags?: number | PaymentFlagsInterface;
|
|
43
43
|
};
|
|
44
44
|
export type TrustSetParam = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
limitAmount: IssuedCurrencyAmount;
|
|
46
|
+
qualityIn?: number;
|
|
47
|
+
qualityOut?: number;
|
|
48
|
+
flags?: number;
|
|
49
49
|
};
|
|
50
50
|
export type SignMessageRequest = {
|
|
51
51
|
messageId: string;
|
package/dist/common.js
CHANGED
|
@@ -14,28 +14,21 @@ function convertTxParam(xrpParam, account) {
|
|
|
14
14
|
switch (xrpParam.type) {
|
|
15
15
|
case "transfer": {
|
|
16
16
|
const txP = xrpParam.data;
|
|
17
|
-
let amount;
|
|
18
|
-
if (typeof txP.Amount == "string") {
|
|
19
|
-
amount = (0, xrpl_1.xrpToDrops)(txP.Amount);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
amount = txP.Amount;
|
|
23
|
-
}
|
|
24
17
|
const tx = {
|
|
25
18
|
TransactionType: 'Payment',
|
|
26
19
|
Account: account,
|
|
27
|
-
Amount: amount,
|
|
28
|
-
Destination: txP.
|
|
29
|
-
Sequence: baseParm.
|
|
30
|
-
Fee: baseParm.
|
|
31
|
-
LastLedgerSequence: baseParm.
|
|
32
|
-
DestinationTag: txP.
|
|
33
|
-
InvoiceID: txP.
|
|
34
|
-
Paths: txP.
|
|
35
|
-
SendMax: txP.
|
|
36
|
-
DeliverMin: txP.
|
|
37
|
-
CredentialIDs: txP.
|
|
38
|
-
Flags: txP.
|
|
20
|
+
Amount: txP.amount,
|
|
21
|
+
Destination: txP.destination,
|
|
22
|
+
Sequence: baseParm.sequence,
|
|
23
|
+
Fee: baseParm.fee,
|
|
24
|
+
LastLedgerSequence: baseParm.lastLedgerSequence,
|
|
25
|
+
DestinationTag: txP.destinationTag,
|
|
26
|
+
InvoiceID: txP.invoiceID,
|
|
27
|
+
Paths: txP.paths,
|
|
28
|
+
SendMax: txP.sendMax,
|
|
29
|
+
DeliverMin: txP.deliverMin,
|
|
30
|
+
CredentialIDs: txP.credentialIDs,
|
|
31
|
+
Flags: txP.flags,
|
|
39
32
|
};
|
|
40
33
|
return tx;
|
|
41
34
|
}
|
|
@@ -44,13 +37,13 @@ function convertTxParam(xrpParam, account) {
|
|
|
44
37
|
const tx = {
|
|
45
38
|
TransactionType: 'TrustSet',
|
|
46
39
|
Account: account,
|
|
47
|
-
Sequence: baseParm.
|
|
48
|
-
Fee: baseParm.
|
|
49
|
-
LastLedgerSequence: baseParm.
|
|
50
|
-
LimitAmount: txP.
|
|
51
|
-
QualityIn: txP.
|
|
52
|
-
QualityOut: txP.
|
|
53
|
-
Flags: txP.
|
|
40
|
+
Sequence: baseParm.sequence,
|
|
41
|
+
Fee: baseParm.fee,
|
|
42
|
+
LastLedgerSequence: baseParm.lastLedgerSequence,
|
|
43
|
+
LimitAmount: txP.limitAmount,
|
|
44
|
+
QualityIn: txP.qualityIn,
|
|
45
|
+
QualityOut: txP.qualityOut,
|
|
46
|
+
Flags: txP.flags,
|
|
54
47
|
};
|
|
55
48
|
return tx;
|
|
56
49
|
}
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;AAAA,kDAA0E;AAC1E,oDAAmD;AACnD,+
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;AAAA,kDAA0E;AAC1E,oDAAmD;AACnD,+BAAsC;AAKtC,mCAAwC;AAsExC,SAAgB,gBAAgB,CAAC,IAAY;IACzC,OAAO,uBAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AACzC,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAC,QAAkB,EAAE,OAAe;IAC9D,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAA;IAC9B,QAAQ,QAAQ,CAAC,IAAI,EAAE;QACnB,KAAK,UAAU,CAAC,CAAC;YACb,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAsB,CA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AAA;IACpD,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;IACxD,IAAI,GAAG,CAAC,OAAO,EAAE;QACb,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;KAC/D;IACD,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC5D,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,OAAO,iBAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AAXD,gDAWC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okxweb3/coin-xrp",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "An XRP SDK for building Web3 wallets and applications.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "^4.6.2"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@okxweb3/coin-base": "
|
|
48
|
+
"@okxweb3/coin-base": "1.1.4-beta.0",
|
|
49
49
|
"@okxweb3/crypto-lib": "^1.0.10",
|
|
50
50
|
"ripple-keypairs": "2.0.0",
|
|
51
51
|
"xrpl": "4.2.5"
|