@affluent-org/sdk 0.0.8 → 0.0.9
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.
|
@@ -3,9 +3,9 @@ import { MessageHash } from "../utils/external-message-hash";
|
|
|
3
3
|
import { ToncenterTraceRaw } from "../utils/toncenter/type";
|
|
4
4
|
import { ToncenterV3Client } from "../utils/pending-tracker/v3-client";
|
|
5
5
|
export type Step = {
|
|
6
|
-
from: Address;
|
|
7
|
-
to: Address;
|
|
8
6
|
op?: number;
|
|
7
|
+
from?: Address;
|
|
8
|
+
to: Address;
|
|
9
9
|
description?: string;
|
|
10
10
|
};
|
|
11
11
|
export declare function findStepTx(trace: ToncenterTraceRaw, step: Step): import("../utils/toncenter/type").ToncenterTransactionRaw | undefined;
|
|
@@ -12,12 +12,12 @@ const jetton_wallet_1 = require("../contracts/jetton/jetton-wallet");
|
|
|
12
12
|
const jetton_wallet_2 = require("../contracts/wton/jetton-wallet");
|
|
13
13
|
function findStepTx(trace, step) {
|
|
14
14
|
return Object.values(trace.transactions).find(tx => {
|
|
15
|
-
if (tx.in_msg)
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
15
|
+
if (!tx.in_msg)
|
|
16
|
+
return false;
|
|
17
|
+
const opMatch = step.op === undefined || Number(tx.in_msg.opcode) === step.op;
|
|
18
|
+
const fromMatch = step.from === undefined || (tx.in_msg.source && step.from.equals(core_1.Address.parse(tx.in_msg.source)));
|
|
19
|
+
const toMatch = step.to.equals(core_1.Address.parse(tx.in_msg.destination));
|
|
20
|
+
return opMatch && fromMatch && toMatch;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function getOpAndQueryId(body) {
|
|
@@ -55,7 +55,7 @@ async function createSupplyMsg(ctx, sender, params, value) {
|
|
|
55
55
|
opts,
|
|
56
56
|
input: {
|
|
57
57
|
to: vaultWTONWallet.address,
|
|
58
|
-
value: value ?? jetton_wallet_2.WTONWallet.Gas.ExternalTransfer,
|
|
58
|
+
value: value ?? jetton_wallet_2.WTONWallet.Gas.ExternalTransfer + opts.amount + opts.forwardTonAmount,
|
|
59
59
|
body: vaultWTONWallet.createExternalTransferBody(opts),
|
|
60
60
|
},
|
|
61
61
|
};
|
|
@@ -70,15 +70,16 @@ class ShareVaultWithdrawTracer extends trace_action_1.TracerBase {
|
|
|
70
70
|
minter: addresses.vault,
|
|
71
71
|
description: "Burning Vault Tokens",
|
|
72
72
|
}),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
sourceWallet: addresses.vaultAssetWallet,
|
|
76
|
-
actorWallet: addresses.actorAssetWallet,
|
|
77
|
-
actor: addresses.actor,
|
|
78
|
-
description: "Receiving Asset",
|
|
79
|
-
}),
|
|
73
|
+
// from omitted: could come from vault or pool
|
|
74
|
+
{ to: addresses.actorAssetWallet, description: "Receiving Asset" },
|
|
80
75
|
];
|
|
81
|
-
|
|
76
|
+
const failStep = {
|
|
77
|
+
op: jetton_wallet_1.JettonWallet.Op.InternalTransfer,
|
|
78
|
+
from: addresses.vault,
|
|
79
|
+
to: addresses.actorVaultWallet,
|
|
80
|
+
description: "Refunding Vault Tokens",
|
|
81
|
+
};
|
|
82
|
+
super(toncenterClient, extHash, type, queryId, steps, failStep);
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
exports.ShareVaultWithdrawTracer = ShareVaultWithdrawTracer;
|
|
@@ -95,8 +95,8 @@ class StrategyVaultWithdrawTracer extends trace_action_1.TracerBase {
|
|
|
95
95
|
];
|
|
96
96
|
const failStep = {
|
|
97
97
|
op: jetton_wallet_1.JettonWallet.Op.InternalTransfer,
|
|
98
|
-
from: addresses.
|
|
99
|
-
to: addresses.
|
|
98
|
+
from: addresses.vault,
|
|
99
|
+
to: addresses.actorVaultWallet,
|
|
100
100
|
description: "Refunding Withdraw Asset",
|
|
101
101
|
};
|
|
102
102
|
super(toncenterClient, extHash, type, queryId, steps, failStep);
|