@agoric/orchestration 0.2.0-u21.0.1 → 0.2.0-u22.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.
- package/package.json +39 -37
- package/src/axelar-types.d.ts +4 -3
- package/src/axelar-types.d.ts.map +1 -1
- package/src/axelar-types.js +4 -2
- package/src/chain-info.d.ts +1 -1
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +9 -4
- package/src/cosmos-api.d.ts +2 -2
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +2 -2
- package/src/examples/axelar-gmp-account-kit.d.ts +11 -0
- package/src/examples/axelar-gmp-account-kit.d.ts.map +1 -1
- package/src/examples/axelar-gmp-account-kit.js +23 -4
- package/src/examples/axelar-gmp.contract.d.ts.map +1 -1
- package/src/examples/axelar-gmp.contract.js +10 -5
- package/src/examples/axelar-gmp.flows.d.ts.map +1 -1
- package/src/examples/axelar-gmp.flows.js +10 -5
- package/src/examples/stake-bld.contract.d.ts +2 -2
- package/src/exos/chain-hub.d.ts +8 -0
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +16 -0
- package/src/exos/cosmos-interchain-service.d.ts +1 -0
- package/src/exos/cosmos-interchain-service.d.ts.map +1 -1
- package/src/exos/cosmos-interchain-service.js +1 -0
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +87 -36
- package/src/exos/local-orchestration-account.d.ts +6 -6
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +39 -35
- package/src/exos/orchestrator.d.ts +2 -2
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +1 -6
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/fixtures/query-flows.contract.d.ts +1 -1
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +1 -2
- package/src/stubs/viem-abi.d.ts +12 -0
- package/src/stubs/viem-abi.d.ts.map +1 -0
- package/src/stubs/viem-abi.ts +11 -0
- package/src/utils/agd-lib.d.ts +0 -1
- package/src/utils/agd-lib.d.ts.map +1 -1
- package/src/utils/agd-lib.js +9 -18
- package/src/utils/gmp.d.ts +2 -33
- package/src/utils/gmp.d.ts.map +1 -1
- package/src/utils/gmp.js +30 -24
- package/src/utils/packet.d.ts +9 -9
- package/src/utils/packet.d.ts.map +1 -1
- package/src/utils/packet.js +21 -15
- package/src/utils/start-helper.d.ts +1 -0
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/vendor/viem/_esm-YOAV66U4.js +5814 -0
- package/src/vendor/viem/ccip-AAQDZF3N.js +14 -0
- package/src/vendor/viem/chunk-4EF4K2MH.js +4082 -0
- package/src/vendor/viem/chunk-4VNS5WPM.js +42 -0
- package/src/vendor/viem/chunk-XN4LUOIH.js +253 -0
- package/src/vendor/viem/secp256k1-WHBDSQB2.js +1914 -0
- package/src/vendor/viem/viem-abi.d.ts +1 -0
- package/src/vendor/viem/viem-abi.js +12 -0
- package/tools/contract-tests.d.ts +31 -5
- package/tools/contract-tests.d.ts.map +1 -1
- package/tools/contract-tests.ts +39 -10
- package/tools/ibc-mocks.d.ts +35 -23
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +78 -59
- package/tsup.config.ts +26 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAwOA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;;GAUG;AAOH;;;;;;;;;;;GAoBE;AAYK,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAA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A8BU,6BAA6B,CAAC,QAAQ,CAAC;0BAvoC9B,cAAc;8BATsR,aAAa;qCAEzR,6CAA6C;kCAK7D,cAAc;4BAHpB,kBAAkB;8BAIX,aAAa;yBAP0B,aAAa;wCADuO,aAAa;qCAapR,iCAAiC;sCAAjC,iCAAiC;gCAbsO,aAAa;8BAW7S,sBAAsB;mCADjB,+CAA+C;yBAF/C,aAAa;+BAR8Q,aAAa;0BAGjT,kDAAkD;8CAHkP,aAAa;2CAAb,aAAa;uCAAb,aAAa;2CAAb,aAAa;4CAAb,aAAa;gCACjQ,aAAa;kCADuO,aAAa;mCAAb,aAAa;iCAEzR,6CAA6C"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/** @file Use-object for the owner of a staking account */
|
|
2
|
-
import { toRequestQueryJson } from '@agoric/cosmic-proto';
|
|
2
|
+
import { toRequestQueryJson, CodecHelper } from '@agoric/cosmic-proto';
|
|
3
3
|
import {
|
|
4
|
-
MsgDepositForBurn,
|
|
5
|
-
MsgDepositForBurnWithCaller,
|
|
4
|
+
MsgDepositForBurn as MsgDepositForBurnType,
|
|
5
|
+
MsgDepositForBurnWithCaller as MsgDepositForBurnWithCallerType,
|
|
6
6
|
} from '@agoric/cosmic-proto/circle/cctp/v1/tx.js';
|
|
7
7
|
import {
|
|
8
|
-
QueryAllBalancesRequest,
|
|
9
|
-
QueryAllBalancesResponse,
|
|
10
|
-
QueryBalanceRequest,
|
|
11
|
-
QueryBalanceResponse,
|
|
8
|
+
QueryAllBalancesRequest as QueryAllBalancesRequestType,
|
|
9
|
+
QueryAllBalancesResponse as QueryAllBalancesResponseType,
|
|
10
|
+
QueryBalanceRequest as QueryBalanceRequestType,
|
|
11
|
+
QueryBalanceResponse as QueryBalanceResponseType,
|
|
12
12
|
} from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js';
|
|
13
|
-
import { MsgSend } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/tx.js';
|
|
13
|
+
import { MsgSend as MsgSendType } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/tx.js';
|
|
14
14
|
import {
|
|
15
|
-
QueryDelegationRewardsRequest,
|
|
16
|
-
QueryDelegationRewardsResponse,
|
|
17
|
-
QueryDelegationTotalRewardsRequest,
|
|
18
|
-
QueryDelegationTotalRewardsResponse,
|
|
15
|
+
QueryDelegationRewardsRequest as QueryDelegationRewardsRequestType,
|
|
16
|
+
QueryDelegationRewardsResponse as QueryDelegationRewardsResponseType,
|
|
17
|
+
QueryDelegationTotalRewardsRequest as QueryDelegationTotalRewardsRequestType,
|
|
18
|
+
QueryDelegationTotalRewardsResponse as QueryDelegationTotalRewardsResponseType,
|
|
19
19
|
} from '@agoric/cosmic-proto/cosmos/distribution/v1beta1/query.js';
|
|
20
20
|
import {
|
|
21
|
-
MsgWithdrawDelegatorReward,
|
|
22
|
-
MsgWithdrawDelegatorRewardResponse,
|
|
21
|
+
MsgWithdrawDelegatorReward as MsgWithdrawDelegatorRewardType,
|
|
22
|
+
MsgWithdrawDelegatorRewardResponse as MsgWithdrawDelegatorRewardResponseType,
|
|
23
23
|
} from '@agoric/cosmic-proto/cosmos/distribution/v1beta1/tx.js';
|
|
24
24
|
import {
|
|
25
|
-
QueryDelegationRequest,
|
|
26
|
-
QueryDelegationResponse,
|
|
27
|
-
QueryDelegatorDelegationsRequest,
|
|
28
|
-
QueryDelegatorDelegationsResponse,
|
|
29
|
-
QueryDelegatorUnbondingDelegationsRequest,
|
|
30
|
-
QueryDelegatorUnbondingDelegationsResponse,
|
|
31
|
-
QueryRedelegationsRequest,
|
|
32
|
-
QueryRedelegationsResponse,
|
|
33
|
-
QueryUnbondingDelegationRequest,
|
|
34
|
-
QueryUnbondingDelegationResponse,
|
|
25
|
+
QueryDelegationRequest as QueryDelegationRequestType,
|
|
26
|
+
QueryDelegationResponse as QueryDelegationResponseType,
|
|
27
|
+
QueryDelegatorDelegationsRequest as QueryDelegatorDelegationsRequestType,
|
|
28
|
+
QueryDelegatorDelegationsResponse as QueryDelegatorDelegationsResponseType,
|
|
29
|
+
QueryDelegatorUnbondingDelegationsRequest as QueryDelegatorUnbondingDelegationsRequestType,
|
|
30
|
+
QueryDelegatorUnbondingDelegationsResponse as QueryDelegatorUnbondingDelegationsResponseType,
|
|
31
|
+
QueryRedelegationsRequest as QueryRedelegationsRequestType,
|
|
32
|
+
QueryRedelegationsResponse as QueryRedelegationsResponseType,
|
|
33
|
+
QueryUnbondingDelegationRequest as QueryUnbondingDelegationRequestType,
|
|
34
|
+
QueryUnbondingDelegationResponse as QueryUnbondingDelegationResponseType,
|
|
35
35
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/query.js';
|
|
36
36
|
import {
|
|
37
|
-
MsgBeginRedelegate,
|
|
38
|
-
MsgDelegate,
|
|
39
|
-
MsgUndelegate,
|
|
40
|
-
MsgUndelegateResponse,
|
|
37
|
+
MsgBeginRedelegate as MsgBeginRedelegateType,
|
|
38
|
+
MsgDelegate as MsgDelegateType,
|
|
39
|
+
MsgUndelegate as MsgUndelegateType,
|
|
40
|
+
MsgUndelegateResponse as MsgUndelegateResponseType,
|
|
41
41
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
|
|
42
|
-
import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
43
|
-
import { MsgTransfer } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
42
|
+
import { Any as AnyType } from '@agoric/cosmic-proto/google/protobuf/any.js';
|
|
43
|
+
import { MsgTransfer as MsgTransferType } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
44
44
|
import { makeTracer } from '@agoric/internal';
|
|
45
45
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
46
46
|
import { M } from '@agoric/vat-data';
|
|
@@ -70,6 +70,60 @@ import { orchestrationAccountMethods } from '../utils/orchestrationAccount.js';
|
|
|
70
70
|
import { makeTimestampHelper } from '../utils/time.js';
|
|
71
71
|
import { accountIdTo32Bytes, parseAccountId } from '../utils/address.js';
|
|
72
72
|
|
|
73
|
+
const MsgDepositForBurn = CodecHelper(MsgDepositForBurnType);
|
|
74
|
+
const MsgDepositForBurnWithCaller = CodecHelper(
|
|
75
|
+
MsgDepositForBurnWithCallerType,
|
|
76
|
+
);
|
|
77
|
+
const QueryAllBalancesRequest = CodecHelper(QueryAllBalancesRequestType);
|
|
78
|
+
const QueryAllBalancesResponse = CodecHelper(QueryAllBalancesResponseType);
|
|
79
|
+
const QueryBalanceRequest = CodecHelper(QueryBalanceRequestType);
|
|
80
|
+
const QueryBalanceResponse = CodecHelper(QueryBalanceResponseType);
|
|
81
|
+
const MsgSend = CodecHelper(MsgSendType);
|
|
82
|
+
const QueryDelegationRewardsRequest = CodecHelper(
|
|
83
|
+
QueryDelegationRewardsRequestType,
|
|
84
|
+
);
|
|
85
|
+
const QueryDelegationRewardsResponse = CodecHelper(
|
|
86
|
+
QueryDelegationRewardsResponseType,
|
|
87
|
+
);
|
|
88
|
+
const QueryDelegationTotalRewardsRequest = CodecHelper(
|
|
89
|
+
QueryDelegationTotalRewardsRequestType,
|
|
90
|
+
);
|
|
91
|
+
const QueryDelegationTotalRewardsResponse = CodecHelper(
|
|
92
|
+
QueryDelegationTotalRewardsResponseType,
|
|
93
|
+
);
|
|
94
|
+
const MsgWithdrawDelegatorReward = CodecHelper(MsgWithdrawDelegatorRewardType);
|
|
95
|
+
const MsgWithdrawDelegatorRewardResponse = CodecHelper(
|
|
96
|
+
MsgWithdrawDelegatorRewardResponseType,
|
|
97
|
+
);
|
|
98
|
+
const QueryDelegationRequest = CodecHelper(QueryDelegationRequestType);
|
|
99
|
+
const QueryDelegationResponse = CodecHelper(QueryDelegationResponseType);
|
|
100
|
+
const QueryDelegatorDelegationsRequest = CodecHelper(
|
|
101
|
+
QueryDelegatorDelegationsRequestType,
|
|
102
|
+
);
|
|
103
|
+
const QueryDelegatorDelegationsResponse = CodecHelper(
|
|
104
|
+
QueryDelegatorDelegationsResponseType,
|
|
105
|
+
);
|
|
106
|
+
const QueryDelegatorUnbondingDelegationsRequest = CodecHelper(
|
|
107
|
+
QueryDelegatorUnbondingDelegationsRequestType,
|
|
108
|
+
);
|
|
109
|
+
const QueryDelegatorUnbondingDelegationsResponse = CodecHelper(
|
|
110
|
+
QueryDelegatorUnbondingDelegationsResponseType,
|
|
111
|
+
);
|
|
112
|
+
const QueryRedelegationsRequest = CodecHelper(QueryRedelegationsRequestType);
|
|
113
|
+
const QueryRedelegationsResponse = CodecHelper(QueryRedelegationsResponseType);
|
|
114
|
+
const QueryUnbondingDelegationRequest = CodecHelper(
|
|
115
|
+
QueryUnbondingDelegationRequestType,
|
|
116
|
+
);
|
|
117
|
+
const QueryUnbondingDelegationResponse = CodecHelper(
|
|
118
|
+
QueryUnbondingDelegationResponseType,
|
|
119
|
+
);
|
|
120
|
+
const MsgBeginRedelegate = CodecHelper(MsgBeginRedelegateType);
|
|
121
|
+
const MsgDelegate = CodecHelper(MsgDelegateType);
|
|
122
|
+
const MsgUndelegate = CodecHelper(MsgUndelegateType);
|
|
123
|
+
const MsgUndelegateResponse = CodecHelper(MsgUndelegateResponseType);
|
|
124
|
+
const Any = CodecHelper(AnyType);
|
|
125
|
+
const MsgTransfer = CodecHelper(MsgTransferType);
|
|
126
|
+
|
|
73
127
|
/**
|
|
74
128
|
* @import {HostOf} from '@agoric/async-flow';
|
|
75
129
|
* @import {AmountArg, IcaAccount, CosmosChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, StakingAccountQueries, NobleMethods, OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse, CaipChainId, AccountIdArg} from '../types.js';
|
|
@@ -611,12 +665,9 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
611
665
|
token,
|
|
612
666
|
sender: this.state.chainAddress.value,
|
|
613
667
|
receiver: destination.value,
|
|
614
|
-
timeoutHeight: opts?.timeoutHeight
|
|
615
|
-
revisionHeight: 0n,
|
|
616
|
-
revisionNumber: 0n,
|
|
617
|
-
},
|
|
668
|
+
timeoutHeight: opts?.timeoutHeight,
|
|
618
669
|
timeoutTimestamp,
|
|
619
|
-
memo: opts?.memo
|
|
670
|
+
memo: opts?.memo,
|
|
620
671
|
}),
|
|
621
672
|
),
|
|
622
673
|
]);
|
|
@@ -1170,7 +1221,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
1170
1221
|
throw Fail`${q(chainId)} does not have "cctpDestinationDomain" set in ChainInfo`;
|
|
1171
1222
|
}
|
|
1172
1223
|
|
|
1173
|
-
/** @satisfies {
|
|
1224
|
+
/** @satisfies {MsgDepositForBurnType} */
|
|
1174
1225
|
const depositForBurn = {
|
|
1175
1226
|
amount: helper.amountToCoin(amount)?.amount,
|
|
1176
1227
|
from: chainAddress.value,
|
|
@@ -145,8 +145,8 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
145
145
|
denom: string;
|
|
146
146
|
value: bigint;
|
|
147
147
|
};
|
|
148
|
-
fromAccount:
|
|
149
|
-
toAccount:
|
|
148
|
+
fromAccount: string;
|
|
149
|
+
toAccount: string;
|
|
150
150
|
extra: Record<string, any>;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
@@ -157,8 +157,8 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
157
157
|
*/
|
|
158
158
|
onRejected(reason: unknown, naiveResult: Awaited<ReturnType<LocalAccountMethods["parseInboundTransfer"]>>): {
|
|
159
159
|
amount: DenomAmount;
|
|
160
|
-
fromAccount:
|
|
161
|
-
toAccount:
|
|
160
|
+
fromAccount: string;
|
|
161
|
+
toAccount: string;
|
|
162
162
|
extra: Record<string, any>;
|
|
163
163
|
};
|
|
164
164
|
};
|
|
@@ -203,8 +203,8 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
203
203
|
transfer(destination: AccountIdArg, amount: AmountArg, opts?: IBCMsgTransferOptions): Vow<any>;
|
|
204
204
|
parseInboundTransfer(packet: Record<string, any>): Vow<{
|
|
205
205
|
amount: DenomAmount;
|
|
206
|
-
fromAccount:
|
|
207
|
-
toAccount:
|
|
206
|
+
fromAccount: string;
|
|
207
|
+
toAccount: string;
|
|
208
208
|
extra: Record<string, any>;
|
|
209
209
|
}>;
|
|
210
210
|
transferSteps(amount: AmountArg, msg: import("@agoric/orchestration").TransferMsg): Vow<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAgIO,0DAVI,IAAI,qFAEZ;IAAgC,eAAe,EAAvC,eAAe;IACH,GAAG,EAAf,GAAG;IAC0B,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACS,QAAQ,EAAzB,QAAQ;IACmB,UAAU,EAArC,OAAO,UAAU,CAAC;IACD,QAAQ,EAAzB,QAAQ;CAClB;aAyFc,iBAAiB;aACjB,kBAAkB;;;;QAoBzB;;;WAGG;6BAFQ,SAAS,GACP,IAAI;;;QAOjB;;;WAGG;mCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;QAiCxB;;;WAGG;qCAFQ,MAAM,cACN,MAAM,CAAC,KAAK,CAAC;;;uBAmBJ,YAAY;oBAAU,SAAS;;;uBAa/B,kBAAkB;qBAAW,SAAS,EAAE;;;oBAc3C,SAAS;yBACJ,YAAY;mBAClB,qBAAqB;;;;;QAmCrC;;;;;;WAMG;8BALQ,CACV,SACA,UAAgB,+CAA+C,CAAC,CAC3D,CACF;;;QAcJ;;;;;;WAMG;sCALQ,MAAM,mBACN;YACN,IAAI,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC;YAClD,KAAK,EAAE,aAAa,C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AC;2CACtD,UAAU,CAAC,gCAAgC,CAAC;0BArzBnC,cAAc;qCADU,6CAA6C;yBAJ/C,aAAa;kCAQV,cAAc;4BAFrC,kBAAkB;8BAGX,aAAa;8BAIlB,gBAAgB;gCAfK,gCAAgC;8BAiBrD,uBAAuB;uCAjBF,gCAAgC;wCACwG,uBAAuB;+BAAvB,uBAAuB;0BAYxL,kDAAkD;yBAFzC,aAAa;qCADG,cAAc;kCAT0H,uBAAuB;2CAAvB,uBAAuB;+BAW7J,sBAAsB;8BAAtB,sBAAsB;mCAXgH,uBAAuB;iCAAvB,uBAAuB;6BAClK,aAAa;gCAUR,sBAAsB;4CAR/B,4DAA4D;yCAHmF,uBAAuB;iCAKhK,6CAA6C;iCAU9D,mBAAmB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @file Use-object for the owner of a localchain account */
|
|
2
|
-
import {
|
|
2
|
+
import { CodecHelper } from '@agoric/cosmic-proto';
|
|
3
3
|
import { AmountShape, PaymentShape } from '@agoric/ertp';
|
|
4
4
|
import { makeTracer } from '@agoric/internal';
|
|
5
5
|
import { Shape as NetworkShape } from '@agoric/network';
|
|
@@ -8,6 +8,17 @@ import { VowShape } from '@agoric/vow';
|
|
|
8
8
|
import { E } from '@endo/far';
|
|
9
9
|
import { Fail, q } from '@endo/errors';
|
|
10
10
|
|
|
11
|
+
import { MsgTransfer as MsgTransferType } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/tx.js';
|
|
12
|
+
import { QueryDenomHashRequest as QueryDenomHashRequestType } from '@agoric/cosmic-proto/ibc/applications/transfer/v1/query.js';
|
|
13
|
+
import {
|
|
14
|
+
QueryAllBalancesRequest as QueryAllBalancesRequestType,
|
|
15
|
+
QueryBalanceRequest as QueryBalanceRequestType,
|
|
16
|
+
} from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js';
|
|
17
|
+
import {
|
|
18
|
+
MsgDelegate as MsgDelegateType,
|
|
19
|
+
MsgUndelegate as MsgUndelegateType,
|
|
20
|
+
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
|
|
21
|
+
import { MsgSend as MsgSendType } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/tx.js';
|
|
11
22
|
import {
|
|
12
23
|
AmountArgShape,
|
|
13
24
|
AnyNatAmountsRecord,
|
|
@@ -25,6 +36,14 @@ import { prepareIBCTools } from './ibc-packet.js';
|
|
|
25
36
|
import { coerceCoin, coerceDenomAmount } from '../utils/amounts.js';
|
|
26
37
|
import { TransferRouteShape } from './chain-hub.js';
|
|
27
38
|
|
|
39
|
+
const MsgTransfer = CodecHelper(MsgTransferType);
|
|
40
|
+
const QueryDenomHashRequest = CodecHelper(QueryDenomHashRequestType);
|
|
41
|
+
const QueryAllBalancesRequest = CodecHelper(QueryAllBalancesRequestType);
|
|
42
|
+
const QueryBalanceRequest = CodecHelper(QueryBalanceRequestType);
|
|
43
|
+
const MsgDelegate = CodecHelper(MsgDelegateType);
|
|
44
|
+
const MsgUndelegate = CodecHelper(MsgUndelegateType);
|
|
45
|
+
const MsgSend = CodecHelper(MsgSendType);
|
|
46
|
+
|
|
28
47
|
/**
|
|
29
48
|
* @import {HostOf} from '@agoric/async-flow';
|
|
30
49
|
* @import {LocalChain, LocalChainAccount} from '@agoric/vats/src/localchain.js';
|
|
@@ -33,7 +52,7 @@ import { TransferRouteShape } from './chain-hub.js';
|
|
|
33
52
|
* @import {IBCEvent} from '@agoric/vats';
|
|
34
53
|
* @import {QueryDenomHashResponse} from '@agoric/cosmic-proto/ibc/applications/transfer/v1/query.js';
|
|
35
54
|
* @import {FungibleTokenPacketData} from '@agoric/cosmic-proto/ibc/applications/transfer/v2/packet.js';
|
|
36
|
-
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'
|
|
55
|
+
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
37
56
|
* @import {Zone} from '@agoric/zone';
|
|
38
57
|
* @import {Remote} from '@agoric/internal';
|
|
39
58
|
* @import {InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
@@ -387,19 +406,13 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
387
406
|
},
|
|
388
407
|
});
|
|
389
408
|
}
|
|
390
|
-
const transferMsg = typedJson(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
revisionNumber: 0n,
|
|
398
|
-
},
|
|
399
|
-
timeoutTimestamp,
|
|
400
|
-
memo: memo ?? '',
|
|
401
|
-
},
|
|
402
|
-
);
|
|
409
|
+
const transferMsg = MsgTransfer.typedJson({
|
|
410
|
+
...transferDetails,
|
|
411
|
+
sender: this.state.address.value,
|
|
412
|
+
timeoutHeight: opts?.timeoutHeight,
|
|
413
|
+
timeoutTimestamp,
|
|
414
|
+
memo,
|
|
415
|
+
});
|
|
403
416
|
|
|
404
417
|
const { holder } = this.facets;
|
|
405
418
|
const sender = makeIBCTransferSender(
|
|
@@ -580,7 +593,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
580
593
|
|
|
581
594
|
return watch(
|
|
582
595
|
E(localchain).query(
|
|
583
|
-
typedJson(
|
|
596
|
+
QueryBalanceRequest.typedJson({
|
|
584
597
|
address: this.state.address.value,
|
|
585
598
|
denom,
|
|
586
599
|
}),
|
|
@@ -593,7 +606,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
593
606
|
getBalances() {
|
|
594
607
|
return watch(
|
|
595
608
|
E(localchain).query(
|
|
596
|
-
typedJson(
|
|
609
|
+
QueryAllBalancesRequest.typedJson({
|
|
597
610
|
address: this.state.address.value,
|
|
598
611
|
}),
|
|
599
612
|
),
|
|
@@ -630,7 +643,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
630
643
|
|
|
631
644
|
return watch(
|
|
632
645
|
E(lca).executeTx([
|
|
633
|
-
typedJson(
|
|
646
|
+
MsgDelegate.typedJson({
|
|
634
647
|
amount,
|
|
635
648
|
validatorAddress,
|
|
636
649
|
delegatorAddress: this.state.address.value,
|
|
@@ -650,7 +663,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
650
663
|
const { account: lca } = this.state;
|
|
651
664
|
return watch(
|
|
652
665
|
E(lca).executeTx([
|
|
653
|
-
typedJson(
|
|
666
|
+
MsgUndelegate.typedJson({
|
|
654
667
|
amount,
|
|
655
668
|
validatorAddress,
|
|
656
669
|
delegatorAddress: this.state.address.value,
|
|
@@ -697,7 +710,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
697
710
|
const { helper } = this.facets;
|
|
698
711
|
return watch(
|
|
699
712
|
E(this.state.account).executeTx([
|
|
700
|
-
typedJson(
|
|
713
|
+
MsgSend.typedJson({
|
|
701
714
|
amount: [helper.amountToCoin(amount)],
|
|
702
715
|
toAddress: cosmosDest.value,
|
|
703
716
|
fromAddress: this.state.address.value,
|
|
@@ -718,7 +731,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
718
731
|
const { helper } = this.facets;
|
|
719
732
|
return watch(
|
|
720
733
|
E(this.state.account).executeTx([
|
|
721
|
-
typedJson(
|
|
734
|
+
MsgSend.typedJson({
|
|
722
735
|
amount: amounts.map(a => helper.amountToCoin(a)),
|
|
723
736
|
toAddress: toAccount.value,
|
|
724
737
|
fromAddress: this.state.address.value,
|
|
@@ -790,14 +803,6 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
790
803
|
amount,
|
|
791
804
|
} = ftPacketData;
|
|
792
805
|
|
|
793
|
-
// XXX don't verify it's a real Bech32 because that makes our tests
|
|
794
|
-
// less legible (preventing readable words on the address string)
|
|
795
|
-
/**
|
|
796
|
-
* @param {string} address
|
|
797
|
-
*/
|
|
798
|
-
const resolveBech32Address = address =>
|
|
799
|
-
chainHub.resolveAccountId(/** @type {Bech32Address} */ (address));
|
|
800
|
-
|
|
801
806
|
/**
|
|
802
807
|
* @param {Denom} localDenom
|
|
803
808
|
*/
|
|
@@ -807,8 +812,8 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
807
812
|
value: BigInt(amount),
|
|
808
813
|
denom: localDenom,
|
|
809
814
|
}),
|
|
810
|
-
fromAccount:
|
|
811
|
-
toAccount:
|
|
815
|
+
fromAccount: sender,
|
|
816
|
+
toAccount: receiver,
|
|
812
817
|
extra: {
|
|
813
818
|
...ftPacketData,
|
|
814
819
|
},
|
|
@@ -832,10 +837,9 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
832
837
|
// Find the local denom hash for the transferDenom, if there is one.
|
|
833
838
|
return watch(
|
|
834
839
|
E(localchain).query(
|
|
835
|
-
typedJson(
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
),
|
|
840
|
+
QueryDenomHashRequest.typedJson({
|
|
841
|
+
trace: denomOrTrace,
|
|
842
|
+
}),
|
|
839
843
|
),
|
|
840
844
|
this.facets.parseInboundTransferWatcher,
|
|
841
845
|
buildReturnValue(denomOrTrace),
|
|
@@ -11,7 +11,7 @@ export function prepareOrchestrator(zone: Zone, powers: {
|
|
|
11
11
|
vowTools: VowTools;
|
|
12
12
|
}): () => import("@endo/exo").Guarded<{
|
|
13
13
|
getChain(chainName: string): Vow<HostInterface<Chain<any> & object>>;
|
|
14
|
-
getDenomInfo(denom: string, srcChainName: "
|
|
14
|
+
getDenomInfo(denom: string, srcChainName: "solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon"): HostInterface<import("../orchestration-api.js").DenomInfo<"solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon", "solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon">>;
|
|
15
15
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
16
16
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
17
17
|
}>;
|
|
@@ -105,7 +105,7 @@ declare function prepareOrchestratorKit(zone: Zone, { chainHub, makeLocalChainFa
|
|
|
105
105
|
};
|
|
106
106
|
orchestrator: {
|
|
107
107
|
getChain(chainName: string): Vow<HostInterface<Chain<any> & object>>;
|
|
108
|
-
getDenomInfo(denom: string, srcChainName: "
|
|
108
|
+
getDenomInfo(denom: string, srcChainName: "solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon"): HostInterface<import("../orchestration-api.js").DenomInfo<"solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon", "solana" | "agoric" | "celestia" | "cosmoshub" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" | "umee" | "dydx" | "archway" | "axelar" | "evmos" | "haqq" | "kava" | "kujira" | "migaloo" | "nolus" | "persistence" | "pryzm" | "sei" | "shido" | "titan" | "beezee" | "carbon" | "coreum" | "crescent" | "doravota" | "dymension" | "empowerchain" | "injective" | "lava" | "nibiru" | "planq" | "provenance" | "quicksilver" | "sifchain" | "terra2" | "ethereum" | "avalanche" | "optimism" | "arbitrum" | "base" | "polygon">>;
|
|
109
109
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
110
110
|
asAmount: HostOf<Orchestrator["asAmount"]>;
|
|
111
111
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAuBA,0BAA0B;AAC1B;;;;GAIG;AAqJI,0CARI,IAAI,UACJ;IACN,QAAQ,EAAE,QAAQ,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;CACpB;;;IAfI,+CAA+C;cAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;GAoBlD;;;;;+BAMY,UAAU,CAClB,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC,cAAc,CAAC;0BAlLG,mBAAmB;8BACE,gBAAgB;0CAIrB,yBAAyB;2CACxB,0BAA0B;8BAHlC,aAAa;2BAIoC,aAAa;mCALtC,oBAAoB;yBAC5C,aAAa;kCAIoC,aAAa;4BALtC,oBAAoB;AAkB5E;;;;;;;;GAQG;AACH,8CARW,IAAI,0FACJ;IACN,QAAQ,EAAE,QAAQ,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;CACpB;IA4CE,2DAA2D;;QAEzD;;WAEG;qCADQ,gBAAgB,QAAQ,CAAC;;;;;;;;;;;;;;IAQtC;;;OAGG;;QAED;;;;;;WAMG;yEAFQ,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,QACzC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0DjB,+CAA+C;kBAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;;GAKlD;qCA1J2C,gBAAgB;+BAMqB,aAAa;uCAAb,aAAa"}
|
package/src/exos/orchestrator.js
CHANGED
|
@@ -12,12 +12,7 @@ import { DenomInfoShape, DenomAmountShape, DenomShape } from '../typeGuards.js';
|
|
|
12
12
|
* @import {ActualChainInfo, ChainHub} from './chain-hub.js';
|
|
13
13
|
* @import {AsyncFlowTools, HostInterface, HostOf} from '@agoric/async-flow';
|
|
14
14
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
15
|
-
* @import {
|
|
16
|
-
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
17
|
-
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
18
|
-
* @import {Remote} from '@agoric/internal';
|
|
19
|
-
* @import {PickFacet} from '@agoric/swingset-liveslots';
|
|
20
|
-
* @import {CosmosInterchainService} from './exo-interfaces.js';
|
|
15
|
+
* @import {MapStore, SetStore} from '@agoric/store';
|
|
21
16
|
* @import {MakeLocalChainFacade} from './local-chain-facade.js';
|
|
22
17
|
* @import {MakeRemoteChainFacade} from './remote-chain-facade.js';
|
|
23
18
|
* @import {Chain, ChainInfo, IBCConnectionInfo, KnownChains, Orchestrator} from '../types.js';
|
|
@@ -3,7 +3,7 @@ export function preparePacketTools(zone: import("@agoric/base-zone").Zone, vowTo
|
|
|
3
3
|
getBalance(brand: Brand<"nat">): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
4
4
|
deposit(payment: ERef<Payment<"nat">>, optAmountShape?: Pattern): import("@agoric/vow").PromiseVow<Amount<"nat">>;
|
|
5
5
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<Payment<"nat">>;
|
|
6
|
-
executeTx<MT extends import("@agoric/cosmic-proto").TypedJson[]>(messages: MT): PromiseVowOfTupleMappedToGenerics<
|
|
6
|
+
executeTx<MT extends import("@agoric/cosmic-proto").TypedJson[]>(messages: MT): PromiseVowOfTupleMappedToGenerics<ResponseToMany<MT>>;
|
|
7
7
|
monitorTransfers(tap: TargetApp): import("@agoric/vow").PromiseVow<TargetRegistration>;
|
|
8
8
|
}>) => import("@endo/exo").Guarded<{
|
|
9
9
|
/**
|
|
@@ -24,7 +24,7 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
24
24
|
}>;
|
|
25
25
|
export type QueryFlowsSF = typeof start;
|
|
26
26
|
import type { ZCF } from '@agoric/zoe';
|
|
27
|
-
import type { OrchestrationPowers } from '
|
|
27
|
+
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
28
28
|
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
29
29
|
import type { Denom } from '@agoric/orchestration';
|
|
30
30
|
import type { DenomDetail } from '@agoric/orchestration';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-flows.contract.d.ts","sourceRoot":"","sources":["query-flows.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query-flows.contract.d.ts","sourceRoot":"","sources":["query-flows.contract.js"],"names":[],"mappings":"AAkFA;gBA/DiB,UAAU;gBACV,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;gBAC/B,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;;GA6DgB;2BAGjE,OAAO,KAAK;yBA3EJ,aAAa;yCAGuB,0BAA0B;qCAD9B,uBAAuB;2BAAvB,uBAAuB;iCAAvB,uBAAuB"}
|
|
@@ -11,8 +11,7 @@ import * as flows from './query-flows.flows.js';
|
|
|
11
11
|
* @import {ZCF} from '@agoric/zoe';
|
|
12
12
|
* @import {Zone} from '@agoric/zone';
|
|
13
13
|
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
14
|
-
* @import {OrchestrationPowers} from '
|
|
15
|
-
* @import {OrchestrationTools} from '../utils/start-helper.js';
|
|
14
|
+
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
16
15
|
*/
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file bundling these functions results in something that
|
|
3
|
+
* depends on node APIs such as stream and crypto (viem/utils
|
|
4
|
+
* includes an http client etc.)
|
|
5
|
+
*
|
|
6
|
+
* So we use tsup to do dead code elimination, aka tree-shaking,
|
|
7
|
+
* while preserving type info.
|
|
8
|
+
*/
|
|
9
|
+
export { encodeFunctionData } from 'viem/utils';
|
|
10
|
+
export { decodeAbiParameters } from 'viem/utils';
|
|
11
|
+
export { encodeAbiParameters } from 'viem/utils';
|
|
12
|
+
//# sourceMappingURL=viem-abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viem-abi.d.ts","sourceRoot":"","sources":["viem-abi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file bundling these functions results in something that
|
|
3
|
+
* depends on node APIs such as stream and crypto (viem/utils
|
|
4
|
+
* includes an http client etc.)
|
|
5
|
+
*
|
|
6
|
+
* So we use tsup to do dead code elimination, aka tree-shaking,
|
|
7
|
+
* while preserving type info.
|
|
8
|
+
*/
|
|
9
|
+
export { encodeFunctionData } from 'viem/utils';
|
|
10
|
+
export { decodeAbiParameters } from 'viem/utils';
|
|
11
|
+
export { encodeAbiParameters } from 'viem/utils';
|
package/src/utils/agd-lib.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agd-lib.d.ts","sourceRoot":"","sources":["agd-lib.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agd-lib.d.ts","sourceRoot":"","sources":["agd-lib.js"],"names":[],"mappings":"AAkBO,+CAFI;IAAE,YAAY,EAAE,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAA;CAAE;;;QAmCzD;;;;;WAKG;uBAJQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IA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AAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;;;QAiBtC;;;;WAIG;0BADQ,MAAM,EAAE;;;QAuDjB;;;WAGG;oBAFQ,MAAM,YACN,MAAM;+BAzDR,MAAM,EAAE;QAmEjB,2BAA2B;uBAAf,MAAM;;IAKpB;;OAEG;qBADQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;sBAzEvB,MAAM,EAAE;;mBAvBR,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;IAoCtC;;;;;OAKG;iBAFQ,MAAM,EAAE,0BACR;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE;GA8DhC"}
|
package/src/utils/agd-lib.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import assert from 'node:assert';
|
|
2
|
+
import { toCLIOptions } from '@agoric/internal/src/cli-utils.js';
|
|
2
3
|
|
|
3
4
|
const { freeze } = Object;
|
|
4
5
|
|
|
5
6
|
const agdBinary = 'agd';
|
|
6
7
|
|
|
7
|
-
/**
|
|
8
|
-
* @param {Record<string, unknown>} record - e.g. { color: 'blue' }
|
|
9
|
-
* @returns {string[]} - e.g. ['--color', 'blue']
|
|
10
|
-
*/
|
|
11
|
-
export const flags = record => {
|
|
12
|
-
// TODO? support --yes with boolean?
|
|
13
|
-
|
|
14
|
-
/** @type {[string, string][]} */
|
|
15
|
-
// @ts-expect-error undefined is filtered out
|
|
16
|
-
const skipUndef = Object.entries(record).filter(([_k, v]) => v !== undefined);
|
|
17
|
-
return skipUndef.map(([k, v]) => [`--${k}`, v]).flat();
|
|
18
|
-
};
|
|
19
|
-
|
|
20
8
|
/**
|
|
21
9
|
* @callback ExecSync
|
|
22
10
|
* @param {string} file
|
|
@@ -37,7 +25,10 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
37
25
|
* }} opts
|
|
38
26
|
*/
|
|
39
27
|
const make = ({ home, keyringBackend, rpcAddrs } = {}) => {
|
|
40
|
-
const keyringArgs =
|
|
28
|
+
const keyringArgs = toCLIOptions({
|
|
29
|
+
home,
|
|
30
|
+
'keyring-backend': keyringBackend,
|
|
31
|
+
});
|
|
41
32
|
if (rpcAddrs) {
|
|
42
33
|
assert.equal(
|
|
43
34
|
rpcAddrs.length,
|
|
@@ -45,7 +36,7 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
45
36
|
'XXX rpcAddrs must contain only one entry',
|
|
46
37
|
);
|
|
47
38
|
}
|
|
48
|
-
const nodeArgs =
|
|
39
|
+
const nodeArgs = toCLIOptions({ node: rpcAddrs && rpcAddrs[0] });
|
|
49
40
|
|
|
50
41
|
/**
|
|
51
42
|
* @param {string[]} args
|
|
@@ -54,7 +45,7 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
54
45
|
const exec = (args, opts = { encoding: 'utf-8' }) =>
|
|
55
46
|
execFileSync(agdBinary, args, opts);
|
|
56
47
|
|
|
57
|
-
const outJson =
|
|
48
|
+
const outJson = toCLIOptions({ output: 'json' });
|
|
58
49
|
|
|
59
50
|
const ro = freeze({
|
|
60
51
|
status: async () => JSON.parse(exec([...nodeArgs, 'status'])),
|
|
@@ -110,8 +101,8 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
110
101
|
...txArgs,
|
|
111
102
|
...nodeArgs,
|
|
112
103
|
...keyringArgs,
|
|
113
|
-
...
|
|
114
|
-
...
|
|
104
|
+
...toCLIOptions({ 'chain-id': chainId, from }),
|
|
105
|
+
...toCLIOptions({
|
|
115
106
|
'broadcast-mode': 'block',
|
|
116
107
|
gas: 'auto',
|
|
117
108
|
'gas-adjustment': '1.4',
|