@agoric/orchestration 0.2.0-upgrade-20-dev-ef71cfd.0 → 0.2.0-upgrade-19-devnet-dev-5428c4d.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 +27 -29
- package/src/chain-capabilities.d.ts +12 -7
- package/src/chain-capabilities.d.ts.map +1 -1
- package/src/chain-capabilities.js +21 -46
- package/src/chain-info.d.ts +97 -839
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +12 -38
- package/src/cosmos-api.d.ts +13 -41
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +16 -52
- package/src/ethereum-api.d.ts +5 -6
- package/src/ethereum-api.d.ts.map +1 -1
- package/src/ethereum-api.ts +5 -7
- package/src/examples/auto-stake-it-tap-kit.d.ts +4 -4
- package/src/examples/auto-stake-it-tap-kit.d.ts.map +1 -1
- package/src/examples/auto-stake-it-tap-kit.js +8 -8
- package/src/examples/auto-stake-it.contract.d.ts +23 -5
- package/src/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +0 -1
- package/src/examples/basic-flows.contract.d.ts +13 -5
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +0 -1
- package/src/examples/send-anywhere.contract.d.ts +27 -7
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +12 -40
- package/src/examples/send-anywhere.flows.d.ts +3 -563
- package/src/examples/send-anywhere.flows.d.ts.map +1 -1
- package/src/examples/send-anywhere.flows.js +31 -112
- package/src/examples/stake-bld.contract.d.ts +7 -8
- package/src/examples/stake-bld.contract.d.ts.map +1 -1
- package/src/examples/stake-bld.contract.js +1 -3
- package/src/examples/stake-ica.contract.d.ts +13 -82
- package/src/examples/stake-ica.contract.d.ts.map +1 -1
- package/src/examples/stake-ica.contract.js +0 -1
- package/src/examples/staking-combinations.contract.d.ts +11 -3
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +4 -5
- package/src/examples/staking-combinations.flows.d.ts +2 -2
- package/src/examples/staking-combinations.flows.d.ts.map +1 -1
- package/src/examples/staking-combinations.flows.js +4 -4
- package/src/examples/swap.contract.d.ts +13 -4
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +2 -2
- package/src/examples/unbond.contract.d.ts +2 -2
- package/src/exos/README.md +0 -1
- package/src/exos/chain-hub-admin.d.ts +9 -9
- package/src/exos/chain-hub-admin.d.ts.map +1 -1
- package/src/exos/chain-hub-admin.js +17 -17
- package/src/exos/chain-hub.d.ts +17 -69
- package/src/exos/chain-hub.d.ts.map +1 -1
- package/src/exos/chain-hub.js +55 -289
- package/src/exos/cosmos-orchestration-account.d.ts +17 -86
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +26 -111
- package/src/exos/ibc-packet.d.ts +0 -1
- package/src/exos/ibc-packet.d.ts.map +1 -1
- package/src/exos/ibc-packet.js +1 -8
- package/src/exos/ica-account-kit.d.ts +4 -8
- package/src/exos/ica-account-kit.d.ts.map +1 -1
- package/src/exos/ica-account-kit.js +5 -8
- package/src/exos/local-chain-facade.d.ts +23 -3
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +3 -3
- package/src/exos/local-orchestration-account.d.ts +12 -16
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +8 -13
- package/src/exos/orchestrator.d.ts +15 -5
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +10 -9
- package/src/exos/packet-tools.d.ts +1 -1
- package/src/exos/packet-tools.d.ts.map +1 -1
- package/src/exos/packet-tools.js +12 -17
- package/src/exos/portfolio-holder-kit.d.ts +0 -1
- package/src/exos/portfolio-holder-kit.d.ts.map +1 -1
- package/src/exos/portfolio-holder-kit.js +0 -1
- package/src/exos/remote-chain-facade.d.ts +15 -5
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +13 -23
- package/src/facade.js +1 -1
- package/src/fetched-chain-info.d.ts +86 -676
- package/src/fetched-chain-info.js +41 -553
- package/src/fixtures/query-flows.contract.d.ts +4 -5
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +0 -1
- package/src/orchestration-api.d.ts +16 -73
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +19 -89
- package/src/proposals/start-send-anywhere.js +0 -4
- package/src/typeGuards.d.ts +4 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +13 -52
- package/src/types.d.ts +1 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +1 -2
- package/src/utils/address.d.ts +3 -13
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +5 -97
- package/src/utils/chain-hub-helper.d.ts +2 -2
- package/src/utils/chain-hub-helper.d.ts.map +1 -1
- package/src/utils/chain-hub-helper.js +5 -9
- package/src/utils/cosmos.d.ts +1 -1
- package/src/utils/cosmos.d.ts.map +1 -1
- package/src/utils/cosmos.js +2 -2
- package/src/utils/orchestrationAccount.js +5 -6
- package/src/utils/registry.d.ts +12 -2
- package/src/utils/registry.d.ts.map +1 -1
- package/src/utils/registry.js +2 -4
- package/src/utils/start-helper.d.ts +6 -20
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +2 -13
- package/src/utils/zoe-tools.d.ts +2 -2
- package/src/utils/zoe-tools.d.ts.map +1 -1
- package/src/utils/zoe-tools.js +2 -5
- package/tools/ibc-mocks.d.ts +5 -6
- package/tools/ibc-mocks.d.ts.map +1 -1
- package/tools/ibc-mocks.ts +4 -10
- package/tools/make-test-address.d.ts +1 -2
- package/tools/make-test-address.d.ts.map +1 -1
- package/tools/make-test-address.js +2 -6
- package/src/cctp-chain-info.d.ts +0 -65
- package/src/cctp-chain-info.d.ts.map +0 -1
- package/src/cctp-chain-info.js +0 -52
- package/src/utils/chain-info.d.ts +0 -5
- package/src/utils/chain-info.d.ts.map +0 -1
- package/src/utils/chain-info.js +0 -11
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { NonNullish } from '@agoric/internal';
|
|
2
|
-
import {
|
|
2
|
+
import { makeError, q } from '@endo/errors';
|
|
3
3
|
import { M, mustMatch } from '@endo/patterns';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @import {GuestInterface, GuestOf} from '@agoric/async-flow';
|
|
7
|
-
* @import {Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
8
|
-
* @import {Brand} from '@agoric/ertp';
|
|
9
7
|
* @import {Vow} from '@agoric/vow';
|
|
10
8
|
* @import {LocalOrchestrationAccountKit} from '../exos/local-orchestration-account.js';
|
|
11
9
|
* @import {ZoeTools} from '../utils/zoe-tools.js';
|
|
12
|
-
* @import {Orchestrator, OrchestrationFlow, LocalAccountMethods
|
|
13
|
-
* @import {AccountIdArg} from '../orchestration-api.ts';
|
|
10
|
+
* @import {Orchestrator, OrchestrationFlow, LocalAccountMethods} from '../types.js';
|
|
14
11
|
*/
|
|
15
12
|
|
|
16
13
|
const { entries } = Object;
|
|
@@ -18,53 +15,19 @@ const { entries } = Object;
|
|
|
18
15
|
// in guest file (the orchestration functions)
|
|
19
16
|
// the second argument is all the endowments provided
|
|
20
17
|
|
|
21
|
-
/**
|
|
22
|
-
* @satisfies {OrchestrationFlow}
|
|
23
|
-
* @param {Orchestrator} orch
|
|
24
|
-
*/
|
|
25
|
-
export const makeNobleAccount = async orch => {
|
|
26
|
-
const nobleChain = await orch.getChain('noble');
|
|
27
|
-
return nobleChain.makeAccount();
|
|
28
|
-
};
|
|
29
|
-
harden(makeNobleAccount);
|
|
30
|
-
|
|
31
|
-
const denomForBrand = async (orch, brand) => {
|
|
32
|
-
const agoric = await orch.getChain('agoric');
|
|
33
|
-
const assets = await agoric.getVBankAssetInfo();
|
|
34
|
-
const { denom } = NonNullish(
|
|
35
|
-
assets.find(a => a.brand === brand),
|
|
36
|
-
`${brand} not registered in ChainHub`,
|
|
37
|
-
);
|
|
38
|
-
return denom;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
18
|
/**
|
|
42
19
|
* @satisfies {OrchestrationFlow}
|
|
43
20
|
* @param {Orchestrator} orch
|
|
44
21
|
* @param {object} ctx
|
|
45
|
-
* @param {GuestInterface<ChainHub>} ctx.chainHub
|
|
46
22
|
* @param {Promise<GuestInterface<LocalOrchestrationAccountKit['holder']>>} ctx.sharedLocalAccountP
|
|
47
|
-
* @param {Promise<
|
|
48
|
-
* GuestInterface<
|
|
49
|
-
* import('../exos/cosmos-orchestration-account.js').CosmosOrchestrationAccountKit['holder']
|
|
50
|
-
* >
|
|
51
|
-
* >} ctx.nobleAccountP
|
|
52
23
|
* @param {GuestInterface<ZoeTools>} ctx.zoeTools
|
|
53
24
|
* @param {GuestOf<(msg: string) => Vow<void>>} ctx.log
|
|
54
|
-
* @param {Brand} ctx.USDC
|
|
55
25
|
* @param {ZCFSeat} seat
|
|
56
26
|
* @param {{ chainName: string; destAddr: string }} offerArgs
|
|
57
27
|
*/
|
|
58
28
|
export const sendIt = async (
|
|
59
29
|
orch,
|
|
60
|
-
{
|
|
61
|
-
chainHub,
|
|
62
|
-
sharedLocalAccountP,
|
|
63
|
-
log,
|
|
64
|
-
nobleAccountP,
|
|
65
|
-
USDC,
|
|
66
|
-
zoeTools: { localTransfer, withdrawToSeat },
|
|
67
|
-
},
|
|
30
|
+
{ sharedLocalAccountP, log, zoeTools: { localTransfer, withdrawToSeat } },
|
|
68
31
|
seat,
|
|
69
32
|
offerArgs,
|
|
70
33
|
) => {
|
|
@@ -74,89 +37,45 @@ export const sendIt = async (
|
|
|
74
37
|
const { give } = seat.getProposal();
|
|
75
38
|
const [[_kw, amt]] = entries(give);
|
|
76
39
|
void log(`sending {${amt.value}} from ${chainName} to ${destAddr}`);
|
|
77
|
-
const
|
|
40
|
+
const agoric = await orch.getChain('agoric');
|
|
41
|
+
const assets = await agoric.getVBankAssetInfo();
|
|
42
|
+
void log(`got info for denoms: ${assets.map(a => a.denom).join(', ')}`);
|
|
43
|
+
const { denom } = NonNullish(
|
|
44
|
+
assets.find(a => a.brand === amt.brand),
|
|
45
|
+
`${amt.brand} not registered in vbank`,
|
|
46
|
+
);
|
|
78
47
|
|
|
79
|
-
|
|
80
|
-
const info = await
|
|
48
|
+
const chain = await orch.getChain(chainName);
|
|
49
|
+
const info = await chain.getChainInfo();
|
|
50
|
+
const { chainId } = info;
|
|
51
|
+
assert(typeof chainId === 'string', 'bad chainId');
|
|
52
|
+
void log(`got info for chain: ${chainName} ${chainId}`);
|
|
81
53
|
|
|
82
54
|
/**
|
|
83
55
|
* @type {any} XXX methods returning vows
|
|
84
56
|
* https://github.com/Agoric/agoric-sdk/issues/9822
|
|
85
57
|
*/
|
|
86
58
|
const sharedLocalAccount = await sharedLocalAccountP;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
59
|
+
await localTransfer(seat, sharedLocalAccount, give);
|
|
60
|
+
|
|
61
|
+
void log(`completed transfer to localAccount`);
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
await sharedLocalAccount.transfer(
|
|
65
|
+
{
|
|
66
|
+
value: destAddr,
|
|
67
|
+
encoding: 'bech32',
|
|
68
|
+
chainId,
|
|
69
|
+
},
|
|
70
|
+
{ denom, value: amt.value },
|
|
71
|
+
);
|
|
72
|
+
void log(`completed transfer to ${destAddr}`);
|
|
73
|
+
} catch (e) {
|
|
94
74
|
await withdrawToSeat(sharedLocalAccount, seat, give);
|
|
95
75
|
const errorMsg = `IBC Transfer failed ${q(e)}`;
|
|
96
76
|
void log(`ERROR: ${errorMsg}`);
|
|
97
|
-
seat.
|
|
77
|
+
seat.exit(errorMsg);
|
|
98
78
|
throw makeError(errorMsg);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
if (info.namespace === 'cosmos') {
|
|
102
|
-
const { chainId } = info;
|
|
103
|
-
assert(typeof chainId === 'string', 'bad chainId');
|
|
104
|
-
|
|
105
|
-
const [_a, _o, connection] = await chainHub.getChainsAndConnection(
|
|
106
|
-
'agoric',
|
|
107
|
-
chainName,
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
connection.counterparty || Fail`No IBC connection to ${chainName}`;
|
|
111
|
-
|
|
112
|
-
void log(`got info for chain: ${chainName} ${chainId}`);
|
|
113
|
-
|
|
114
|
-
await localTransfer(seat, sharedLocalAccount, give);
|
|
115
|
-
void log(`completed transfer to localAccount`);
|
|
116
|
-
|
|
117
|
-
try {
|
|
118
|
-
await sharedLocalAccount.transfer(
|
|
119
|
-
{
|
|
120
|
-
value: destAddr,
|
|
121
|
-
encoding: 'bech32',
|
|
122
|
-
chainId,
|
|
123
|
-
},
|
|
124
|
-
{ denom, value: amt.value },
|
|
125
|
-
);
|
|
126
|
-
void log(`completed transfer to ${destAddr}`);
|
|
127
|
-
} catch (e) {
|
|
128
|
-
return recoverFailedTransfer(e);
|
|
129
|
-
}
|
|
130
|
-
} else if (amt.brand === USDC && 'cctpDestinationDomain' in info) {
|
|
131
|
-
const nobleAccount = await nobleAccountP;
|
|
132
|
-
const nobleAddr = nobleAccount.getAddress();
|
|
133
|
-
const denomAmt = { denom, value: amt.value };
|
|
134
|
-
try {
|
|
135
|
-
await sharedLocalAccount.transfer(nobleAddr, denomAmt);
|
|
136
|
-
} catch (e) {
|
|
137
|
-
return recoverFailedTransfer(e);
|
|
138
|
-
}
|
|
139
|
-
void log('assets are now on noble');
|
|
140
|
-
const destAccountId = /** @type {const} */ (
|
|
141
|
-
`${info.namespace}:${info.reference}:${destAddr}`
|
|
142
|
-
);
|
|
143
|
-
try {
|
|
144
|
-
await nobleAccount.depositForBurn(destAccountId, denomAmt);
|
|
145
|
-
} catch (e) {
|
|
146
|
-
try {
|
|
147
|
-
// transfer back to agoric contract account if depositForBurn is not accepted by noble chain
|
|
148
|
-
const lcaAddress = await sharedLocalAccount.getAddress();
|
|
149
|
-
await nobleAccount.transfer(lcaAddress, denomAmt);
|
|
150
|
-
} catch (err) {
|
|
151
|
-
const errorMsg = `IBC Transfer from Noble back to LocalAccount failed: ${q(err)}`;
|
|
152
|
-
void log(`🚨 contract upgrade required to recover funds: ${errorMsg}`);
|
|
153
|
-
seat.fail(errorMsg);
|
|
154
|
-
throw makeError(errorMsg);
|
|
155
|
-
}
|
|
156
|
-
return recoverFailedTransfer(e);
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
Fail`There is currently support only for IBC and USDC transfers`;
|
|
160
79
|
}
|
|
161
80
|
|
|
162
81
|
seat.exit();
|
|
@@ -9,7 +9,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
9
9
|
/**
|
|
10
10
|
* Invitation to make an account, initialized with the give's BLD
|
|
11
11
|
*/
|
|
12
|
-
makeStakeBldInvitation(): Promise<
|
|
12
|
+
makeStakeBldInvitation(): Promise<Invitation<import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>, undefined>>;
|
|
13
13
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
14
14
|
asContinuingOffer(): import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
|
|
15
15
|
getBalance(denom: import("../orchestration-api.js").DenomArg): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount>;
|
|
@@ -24,13 +24,13 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
24
24
|
}[]): import("@agoric/vow").Vow<{
|
|
25
25
|
'@type': string;
|
|
26
26
|
}[]>;
|
|
27
|
-
getAddress(): import("../orchestration-api.js").
|
|
28
|
-
send(toAccount: import("../orchestration-api.js").
|
|
29
|
-
sendAll(toAccount: import("../orchestration-api.js").
|
|
30
|
-
transfer(destination: import("../orchestration-api.js").
|
|
27
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
28
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
29
|
+
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void>;
|
|
30
|
+
transfer(destination: import("../orchestration-api.js").ChainAddress, amount: import("../orchestration-api.js").AmountArg, opts?: import("../cosmos-api.js").IBCMsgTransferOptions): import("@agoric/vow").Vow<any>;
|
|
31
31
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void>;
|
|
32
32
|
sendThenWaitForAck(packetSender: Remote<import("../exos/packet-tools.js").PacketSender>, opts?: import("../exos/packet-tools.js").PacketOptions | undefined): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<any>>;
|
|
33
|
-
matchFirstPacket(args_0?: import("@agoric/vow").EVow<Pattern>): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<{
|
|
33
|
+
matchFirstPacket(args_0?: import("@agoric/vow").EVow<globalThis.Pattern>): import("@agoric/async-flow").HostInterface<import("@agoric/vow").Vow<{
|
|
34
34
|
resolver: import("@agoric/vow").VowResolver<any>;
|
|
35
35
|
match: import("@agoric/vow").Vow<any>;
|
|
36
36
|
}>>;
|
|
@@ -39,10 +39,9 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
39
39
|
/**
|
|
40
40
|
* Invitation to make an account, without any funds
|
|
41
41
|
*/
|
|
42
|
-
makeAccountInvitationMaker(): Promise<
|
|
42
|
+
makeAccountInvitationMaker(): Promise<Invitation<import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>, undefined>>;
|
|
43
43
|
}>;
|
|
44
44
|
}>;
|
|
45
|
-
import type { ZCF } from '@agoric/zoe';
|
|
46
45
|
import type { NameHub } from '@agoric/vats';
|
|
47
46
|
import type { Remote } from '@agoric/internal';
|
|
48
47
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stake-bld.contract.d.ts","sourceRoot":"","sources":["stake-bld.contract.js"],"names":[],"mappings":"AAoCO,2BAVI,GAAG,eACH;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAsEvC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4BH;;WAEG;;;GAaR;6BApIyB,cAAc;4BACf,kBAAkB;gCAEd,gCAAgC;kCAD9B,cAAc"}
|
|
@@ -19,7 +19,6 @@ import { makeZoeTools } from '../utils/zoe-tools.js';
|
|
|
19
19
|
* @import {Remote} from '@agoric/internal';
|
|
20
20
|
* @import {TimerService} from '@agoric/time';
|
|
21
21
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
22
|
-
* @import {ZCF} from '@agoric/zoe';
|
|
23
22
|
*/
|
|
24
23
|
|
|
25
24
|
const trace = makeTracer('StakeBld');
|
|
@@ -113,8 +112,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
113
112
|
trace('makeStakeBldInvitation', give);
|
|
114
113
|
const { holder } = await makeLocalAccountKit();
|
|
115
114
|
/** @type {Record<string, Payment<'nat'>>} */
|
|
116
|
-
//
|
|
117
|
-
// @ts-ignore XXX PaymentPKeywordRecord, though after deeplyFulfilled it will be a PaymentKeywordRecord
|
|
115
|
+
// @ts-expect-error XXX PaymentPKeywordRecord throught deeplyFulfilled will be a PaymnentKeywordRecord
|
|
118
116
|
const { In } = await deeplyFulfilled(
|
|
119
117
|
withdrawFromSeat(zcf, seat, give),
|
|
120
118
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {Baggage} from '@agoric/vat-data';
|
|
3
3
|
* @import {Remote} from '@agoric/internal';
|
|
4
|
-
* @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
5
4
|
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
6
5
|
* @import {TimerService} from '@agoric/time';
|
|
7
6
|
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
@@ -10,11 +9,11 @@
|
|
|
10
9
|
/** @type {ContractMeta<typeof start>} */
|
|
11
10
|
export const meta: ContractMeta<typeof start>;
|
|
12
11
|
export const privateArgsShape: {
|
|
13
|
-
agoricNames: Pattern;
|
|
14
|
-
cosmosInterchainService: Pattern;
|
|
15
|
-
storageNode: Pattern;
|
|
16
|
-
marshaller: Pattern;
|
|
17
|
-
timer: Pattern;
|
|
12
|
+
agoricNames: globalThis.Pattern;
|
|
13
|
+
cosmosInterchainService: globalThis.Pattern;
|
|
14
|
+
storageNode: globalThis.Pattern;
|
|
15
|
+
marshaller: globalThis.Pattern;
|
|
16
|
+
timer: globalThis.Pattern;
|
|
18
17
|
} | undefined;
|
|
19
18
|
export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
20
19
|
agoricNames: Remote<NameHub>;
|
|
@@ -27,20 +26,20 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
27
26
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
28
27
|
asContinuingOffer(): import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<ResolvedContinuingOfferResult>>;
|
|
29
28
|
getPublicTopics(): import("@agoric/vow").Vow<import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
|
|
30
|
-
getAddress(): import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").
|
|
29
|
+
getAddress(): import("@agoric/async-flow").HostInterface<import("../orchestration-api.js").ChainAddress>;
|
|
31
30
|
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
32
31
|
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
33
32
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
34
33
|
getBalance(denom: import("../orchestration-api.js").DenomArg): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount>;
|
|
35
34
|
getBalances(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
36
|
-
send(toAccount: import("../orchestration-api.js").
|
|
37
|
-
sendAll(toAccount: import("../orchestration-api.js").
|
|
38
|
-
transfer(destination: import("../orchestration-api.js").
|
|
35
|
+
send(toAccount: import("../orchestration-api.js").ChainAddress, amount: import("../orchestration-api.js").AmountArg): import("@agoric/vow").Vow<void>;
|
|
36
|
+
sendAll(toAccount: import("../orchestration-api.js").ChainAddress, amounts: import("../orchestration-api.js").AmountArg[]): import("@agoric/vow").Vow<void>;
|
|
37
|
+
transfer(destination: import("../orchestration-api.js").ChainAddress, amount: import("../orchestration-api.js").AmountArg, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): import("@agoric/vow").Vow<void>;
|
|
39
38
|
transferSteps(amount: import("../orchestration-api.js").AmountArg, msg: import("../orchestration-api.js").TransferMsg): import("@agoric/vow").Vow<void>;
|
|
40
39
|
withdrawRewards(): import("@agoric/vow").Vow<import("../orchestration-api.js").DenomAmount[]>;
|
|
41
40
|
undelegate(delegations: {
|
|
42
41
|
amount: import("../orchestration-api.js").AmountArg;
|
|
43
|
-
delegator?: import("../orchestration-api.js").
|
|
42
|
+
delegator?: import("../orchestration-api.js").ChainAddress;
|
|
44
43
|
validator: import("../cosmos-api.js").CosmosValidatorAddress;
|
|
45
44
|
}[]): import("@agoric/vow").Vow<void>;
|
|
46
45
|
deactivate(): import("@agoric/vow").Vow<void>;
|
|
@@ -49,76 +48,12 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
49
48
|
getDelegations(): import("@agoric/vow").Vow<{
|
|
50
49
|
delegator: {
|
|
51
50
|
chainId: string;
|
|
52
|
-
value:
|
|
53
|
-
encoding: "bech32";
|
|
51
|
+
value: string;
|
|
52
|
+
encoding: "bech32" | "ethereum";
|
|
54
53
|
};
|
|
55
54
|
validator: {
|
|
56
55
|
chainId: string;
|
|
57
|
-
value: {
|
|
58
|
-
readonly [x: number]: string;
|
|
59
|
-
toString: () => string;
|
|
60
|
-
charAt: (pos: number) => string;
|
|
61
|
-
charCodeAt: (index: number) => number;
|
|
62
|
-
concat: (...args: string[]) => string;
|
|
63
|
-
indexOf: (searchString: string, position?: number | undefined) => number;
|
|
64
|
-
lastIndexOf: (searchString: string, position?: number | undefined) => number;
|
|
65
|
-
localeCompare: (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions | undefined) => number;
|
|
66
|
-
match: ((matcher: {
|
|
67
|
-
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
68
|
-
}) => null) | ((matcher: {
|
|
69
|
-
[Symbol.match](string: string): RegExpMatchArray | null;
|
|
70
|
-
}) => import("@agoric/async-flow").HostInterface<RegExpMatchArray>);
|
|
71
|
-
replace: (searchValue: {
|
|
72
|
-
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
|
|
73
|
-
}, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
74
|
-
search: (searcher: {
|
|
75
|
-
[Symbol.search](string: string): number;
|
|
76
|
-
}) => number;
|
|
77
|
-
slice: (start?: number | undefined, end?: number | undefined) => string;
|
|
78
|
-
split: (splitter: {
|
|
79
|
-
[Symbol.split](string: string, limit?: number): string[];
|
|
80
|
-
}, limit?: number | undefined) => string[];
|
|
81
|
-
substring: (start: number, end?: number | undefined) => string;
|
|
82
|
-
toLowerCase: () => string;
|
|
83
|
-
toLocaleLowerCase: (locales?: Intl.LocalesArgument) => string;
|
|
84
|
-
toUpperCase: () => string;
|
|
85
|
-
toLocaleUpperCase: (locales?: Intl.LocalesArgument) => string;
|
|
86
|
-
trim: () => string;
|
|
87
|
-
readonly length: number;
|
|
88
|
-
substr: (from: number, length?: number | undefined) => string;
|
|
89
|
-
valueOf: () => string;
|
|
90
|
-
codePointAt: ((pos: number) => undefined) | ((pos: number) => number);
|
|
91
|
-
includes: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
92
|
-
endsWith: ((searchString: string, endPosition?: number | undefined) => false) | ((searchString: string, endPosition?: number | undefined) => true);
|
|
93
|
-
normalize: (form?: string | undefined) => string;
|
|
94
|
-
repeat: (count: number) => string;
|
|
95
|
-
startsWith: ((searchString: string, position?: number | undefined) => false) | ((searchString: string, position?: number | undefined) => true);
|
|
96
|
-
anchor: (name: string) => string;
|
|
97
|
-
big: () => string;
|
|
98
|
-
blink: () => string;
|
|
99
|
-
bold: () => string;
|
|
100
|
-
fixed: () => string;
|
|
101
|
-
fontcolor: (color: string) => string;
|
|
102
|
-
fontsize: (size: string) => string;
|
|
103
|
-
italics: () => string;
|
|
104
|
-
link: (url: string) => string;
|
|
105
|
-
small: () => string;
|
|
106
|
-
strike: () => string;
|
|
107
|
-
sub: () => string;
|
|
108
|
-
sup: () => string;
|
|
109
|
-
padStart: (maxLength: number, fillString?: string | undefined) => string;
|
|
110
|
-
padEnd: (maxLength: number, fillString?: string | undefined) => string;
|
|
111
|
-
trimEnd: () => string;
|
|
112
|
-
trimStart: () => string;
|
|
113
|
-
trimLeft: () => string;
|
|
114
|
-
trimRight: () => string;
|
|
115
|
-
matchAll: (regexp: RegExp) => import("@agoric/async-flow").HostInterface<RegExpStringIterator<RegExpExecArray>>;
|
|
116
|
-
replaceAll: (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string;
|
|
117
|
-
at: ((index: number) => undefined) | ((index: number) => string);
|
|
118
|
-
isWellFormed: (() => false) | (() => true);
|
|
119
|
-
toWellFormed: () => string;
|
|
120
|
-
[Symbol.iterator]: () => import("@agoric/async-flow").HostInterface<StringIterator<string>>;
|
|
121
|
-
};
|
|
56
|
+
value: `${string}valoper${string}`;
|
|
122
57
|
encoding: "bech32";
|
|
123
58
|
};
|
|
124
59
|
amount: {
|
|
@@ -175,7 +110,6 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
175
110
|
typeUrl: string;
|
|
176
111
|
value: string;
|
|
177
112
|
}[], opts?: Partial<Omit<import("@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js").TxBody, "messages">> | undefined): import("@agoric/vow").Vow<string>;
|
|
178
|
-
depositForBurn(mintRecipient: `${string}:${string}:${string}`, amount: import("../orchestration-api.js").AmountArg, caller?: `${string}:${string}:${string}` | undefined): import("@agoric/vow").Vow<void>;
|
|
179
113
|
}>>;
|
|
180
114
|
makeAccountInvitationMaker(): Promise<Invitation<ResolvedContinuingOfferResult, undefined>>;
|
|
181
115
|
}>;
|
|
@@ -187,14 +121,11 @@ export type StakeIcaTerms = {
|
|
|
187
121
|
icqEnabled: boolean;
|
|
188
122
|
};
|
|
189
123
|
export type StakeIcaSF = typeof start;
|
|
190
|
-
import type { ContractMeta } from '@agoric/zoe';
|
|
191
|
-
import type { ZCF } from '@agoric/zoe';
|
|
192
124
|
import type { NameHub } from '@agoric/vats';
|
|
193
125
|
import type { Remote } from '@agoric/internal';
|
|
194
126
|
import type { CosmosInterchainService } from '../types.js';
|
|
195
127
|
import type { TimerService } from '@agoric/time';
|
|
196
128
|
import type { Baggage } from '@agoric/vat-data';
|
|
197
129
|
import type { ResolvedContinuingOfferResult } from '../utils/zoe-tools.js';
|
|
198
|
-
import type { Invitation } from '@agoric/zoe';
|
|
199
130
|
import type { IBCConnectionID } from '@agoric/vats';
|
|
200
131
|
//# sourceMappingURL=stake-ica.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA
|
|
1
|
+
{"version":3,"file":"stake-ica.contract.d.ts","sourceRoot":"","sources":["stake-ica.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AAEH;;;;;;cAAsD;AAuB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;IACN,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGjB;4BA1HY;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,eAAe,CAAC;IAClC,sBAAsB,EAAE,eAAe,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;CACrB;yBAwHU,OAAO,KAAK;6BAxJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
|
|
@@ -17,7 +17,6 @@ const trace = makeTracer('StakeIca');
|
|
|
17
17
|
/**
|
|
18
18
|
* @import {Baggage} from '@agoric/vat-data';
|
|
19
19
|
* @import {Remote} from '@agoric/internal';
|
|
20
|
-
* @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
21
20
|
* @import {IBCConnectionID, NameHub} from '@agoric/vats';
|
|
22
21
|
* @import {TimerService} from '@agoric/time';
|
|
23
22
|
* @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js';
|
|
@@ -7,11 +7,19 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
7
7
|
}>>;
|
|
8
8
|
}>;
|
|
9
9
|
creatorFacet: import("@endo/exo").Guarded<{
|
|
10
|
-
registerChain(chainName: string, chainInfo:
|
|
10
|
+
registerChain(chainName: string, chainInfo: Readonly<{
|
|
11
|
+
bech32Prefix?: string;
|
|
12
|
+
chainId: string;
|
|
13
|
+
connections?: Record<string, import("../cosmos-api.js").IBCConnectionInfo>;
|
|
14
|
+
icqEnabled?: boolean;
|
|
15
|
+
pfmEnabled?: boolean;
|
|
16
|
+
stakingTokens?: Readonly<Array<{
|
|
17
|
+
denom: string;
|
|
18
|
+
}>>;
|
|
19
|
+
icaEnabled?: boolean;
|
|
20
|
+
}>, connectionInfo: import("../cosmos-api.js").IBCConnectionInfo): Promise<void>;
|
|
11
21
|
registerAsset(denom: import("../orchestration-api.js").Denom, detail: import("../types.js").DenomDetail): Promise<void>;
|
|
12
22
|
}>;
|
|
13
23
|
}>;
|
|
14
|
-
import type { ZCF } from '@agoric/zoe';
|
|
15
24
|
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
16
|
-
import type { Invitation } from '@agoric/zoe';
|
|
17
25
|
//# sourceMappingURL=staking-combinations.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"AAiKA;gBA5HiB,UAAU;;;;;;;;;;;;;;;;;;;;;GA4HoD;yCA7IrB,0BAA0B"}
|
|
@@ -9,7 +9,7 @@ import { AmountShape } from '@agoric/ertp';
|
|
|
9
9
|
import { M } from '@endo/patterns';
|
|
10
10
|
import { prepareCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
11
11
|
import { CosmosOrchestrationInvitationMakersI } from '../exos/cosmos-orchestration-account.js';
|
|
12
|
-
import {
|
|
12
|
+
import { ChainAddressShape, DelegationShape } from '../typeGuards.js';
|
|
13
13
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
14
14
|
import * as flows from './staking-combinations.flows.js';
|
|
15
15
|
import * as sharedFlows from './shared.flows.js';
|
|
@@ -17,11 +17,10 @@ import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js';
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
20
|
-
* @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
21
20
|
* @import {Zone} from '@agoric/zone';
|
|
22
21
|
* @import {OrchestrationTools, OrchestrationPowers} from '../utils/start-helper.js';
|
|
23
22
|
* @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js';
|
|
24
|
-
* @import {AmountArg,
|
|
23
|
+
* @import {AmountArg, ChainAddress, CosmosValidatorAddress} from '../types.js';
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
26
|
const emptyOfferShape = harden({
|
|
@@ -53,7 +52,7 @@ const contract = async (
|
|
|
53
52
|
DepositAndDelegate: M.call().returns(M.promise()),
|
|
54
53
|
UndelegateAndTransfer: M.call(
|
|
55
54
|
M.arrayOf(DelegationShape),
|
|
56
|
-
|
|
55
|
+
ChainAddressShape,
|
|
57
56
|
).returns(M.promise()),
|
|
58
57
|
},
|
|
59
58
|
);
|
|
@@ -91,7 +90,7 @@ const contract = async (
|
|
|
91
90
|
},
|
|
92
91
|
/**
|
|
93
92
|
* @param {{ amount: AmountArg; validator: CosmosValidatorAddress }[]} delegations
|
|
94
|
-
* @param {
|
|
93
|
+
* @param {ChainAddress} destination
|
|
95
94
|
*/
|
|
96
95
|
UndelegateAndTransfer(delegations, destination) {
|
|
97
96
|
const { account } = this.state;
|
|
@@ -14,7 +14,7 @@ export function undelegateAndTransfer(orch: Orchestrator, ctx: object, account:
|
|
|
14
14
|
amount: AmountArg;
|
|
15
15
|
validator: CosmosValidatorAddress;
|
|
16
16
|
}[];
|
|
17
|
-
destination:
|
|
17
|
+
destination: ChainAddress;
|
|
18
18
|
}): Promise<void>;
|
|
19
19
|
import type { Orchestrator } from '../types.js';
|
|
20
20
|
import type { MakeCombineInvitationMakers } from '../exos/combine-invitation-makers.js';
|
|
@@ -27,5 +27,5 @@ import type { ZoeTools } from '../utils/zoe-tools.js';
|
|
|
27
27
|
import type { CosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
28
28
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
29
29
|
import type { AmountArg } from '../types.js';
|
|
30
|
-
import type {
|
|
30
|
+
import type { ChainAddress } from '../types.js';
|
|
31
31
|
//# sourceMappingURL=staking-combinations.flows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA4BO,kCATI,YAAY,OACZ;IACN,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAiBlD;AAeM,yCAVI,YAAY,+CAEpB;IAAsC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IAC6C,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAcM,4CATI,YAAY,OACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACN,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"staking-combinations.flows.d.ts","sourceRoot":"","sources":["staking-combinations.flows.js"],"names":[],"mappings":"AA4BO,kCATI,YAAY,OACZ;IACN,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,wBAAwB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,gBAAgB,CAAC;CAC9D,SACO,OAAO,iBACP;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAiBlD;AAeM,yCAVI,YAAY,+CAEpB;IAAsC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;IAC6C,mBAAmB,EAAxF,OAAO,CAAC,eAAe,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAtC,eAAe,QAAQ,CAAC;CAChC,WAAQ,eAAe,0BAA0B,CAAC,QAC1C,OAAO,aACP,sBAAsB,GACpB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAcM,4CATI,YAAY,OACZ,MAAM,WACN,eAAe,0BAA0B,CAAC,gCAC1C;IACN,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,SAAS,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EAAE,YAAY,CAAC;CAC3B,GACS,OAAO,CAAC,IAAI,CAAC,CAYzB;kCAlH6J,aAAa;iDAG7H,sCAAsC;sCAF1B,mCAAmC;mDAInC,uBAAuB;8BAL6E,aAAa;oCAD1I,oBAAoB;kDAGN,wCAAwC;8BAG7B,uBAAuB;gDADpC,yCAAyC;4CAJwE,aAAa;+BAAb,aAAa;kCAAb,aAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @import {GuestInterface} from '@agoric/async-flow';
|
|
3
|
-
* @import {Orchestrator, OrchestrationFlow, AmountArg, CosmosValidatorAddress,
|
|
3
|
+
* @import {Orchestrator, OrchestrationFlow, AmountArg, CosmosValidatorAddress, ChainAddress, LocalAccountMethods, OrchestrationAccountCommon, ChainHub} from '../types.js'
|
|
4
4
|
* @import {ContinuingOfferResult, InvitationMakers} from '@agoric/smart-wallet/src/types.js';
|
|
5
5
|
* @import {LocalOrchestrationAccountKit} from '../exos/local-orchestration-account.js';
|
|
6
6
|
* @import {MakeCombineInvitationMakers} from '../exos/combine-invitation-makers.js';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { mustMatch } from '@endo/patterns';
|
|
12
12
|
import { Fail, makeError, q } from '@endo/errors';
|
|
13
13
|
import { makeTracer } from '@agoric/internal';
|
|
14
|
-
import {
|
|
14
|
+
import { ChainAddressShape } from '../typeGuards.js';
|
|
15
15
|
|
|
16
16
|
const trace = makeTracer('StakingCombinationsFlows');
|
|
17
17
|
|
|
@@ -65,7 +65,7 @@ export const depositAndDelegate = async (
|
|
|
65
65
|
) => {
|
|
66
66
|
await null;
|
|
67
67
|
trace('depositAndDelegate', account, seat, validator);
|
|
68
|
-
mustMatch(validator,
|
|
68
|
+
mustMatch(validator, ChainAddressShape);
|
|
69
69
|
|
|
70
70
|
const { give } = seat.getProposal();
|
|
71
71
|
/**
|
|
@@ -100,7 +100,7 @@ harden(depositAndDelegate);
|
|
|
100
100
|
* @param {GuestInterface<CosmosOrchestrationAccount>} account
|
|
101
101
|
* @param {{
|
|
102
102
|
* delegations: { amount: AmountArg; validator: CosmosValidatorAddress }[];
|
|
103
|
-
* destination:
|
|
103
|
+
* destination: ChainAddress;
|
|
104
104
|
* }} offerArgs
|
|
105
105
|
* @returns {Promise<void>}
|
|
106
106
|
*/
|
|
@@ -14,20 +14,30 @@ export function makeNatAmountShape(brand: Brand, min?: NatValue): {
|
|
|
14
14
|
brand: globalThis.Brand;
|
|
15
15
|
value: import("@endo/patterns").Matcher;
|
|
16
16
|
};
|
|
17
|
-
export const start: (zcf:
|
|
17
|
+
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
|
|
18
18
|
agoricNames: Remote<NameHub>;
|
|
19
19
|
localchain: Remote<LocalChain>;
|
|
20
20
|
orchestrationService: Remote<CosmosInterchainService>;
|
|
21
21
|
storageNode: Remote<StorageNode>;
|
|
22
22
|
timerService: Remote<TimerService>;
|
|
23
23
|
marshaller: Marshaller;
|
|
24
|
-
chainInfo: Record<string,
|
|
24
|
+
chainInfo: Record<string, Readonly<{
|
|
25
|
+
bech32Prefix?: string;
|
|
26
|
+
chainId: string;
|
|
27
|
+
connections?: Record<string, import("@agoric/orchestration").IBCConnectionInfo>;
|
|
28
|
+
icqEnabled?: boolean;
|
|
29
|
+
pfmEnabled?: boolean;
|
|
30
|
+
stakingTokens?: Readonly<Array<{
|
|
31
|
+
denom: string;
|
|
32
|
+
}>>;
|
|
33
|
+
icaEnabled?: boolean;
|
|
34
|
+
}>>;
|
|
25
35
|
assetInfo: [Denom, DenomDetail & {
|
|
26
36
|
brandKey?: string;
|
|
27
37
|
}][];
|
|
28
38
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
29
39
|
publicFacet: import("@endo/exo").Guarded<{
|
|
30
|
-
makeSwapAndStakeInvitation(): Promise<
|
|
40
|
+
makeSwapAndStakeInvitation(): Promise<Invitation<import("@agoric/vow").Vow<void>, {
|
|
31
41
|
staked: Amount<"nat">;
|
|
32
42
|
validator: import("@agoric/orchestration").CosmosValidatorAddress;
|
|
33
43
|
}>>;
|
|
@@ -38,7 +48,6 @@ import type { Remote } from '@agoric/internal';
|
|
|
38
48
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
39
49
|
import type { CosmosInterchainService } from '../exos/exo-interfaces.js';
|
|
40
50
|
import type { TimerService } from '@agoric/time';
|
|
41
|
-
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
42
51
|
import type { Denom } from '@agoric/orchestration';
|
|
43
52
|
import type { DenomDetail } from '@agoric/orchestration';
|
|
44
53
|
//# sourceMappingURL=swap.contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAanC;AASK,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAkDtD;iBA1CkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,UAAU
|
|
1
|
+
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAanC;AASK,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAkDtD;iBA1CkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,UAAU;;;;;;;;;;;;eAEX,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;GAmCiB;6BA/ErD,cAAc;4BAFf,kBAAkB;gCADd,gCAAgC;6CAEnB,2BAA2B;kCAHtC,cAAc;2BAOS,uBAAuB;iCAAvB,uBAAuB"}
|
|
@@ -3,7 +3,7 @@ import { TimerServiceShape } from '@agoric/time';
|
|
|
3
3
|
import { M } from '@endo/patterns';
|
|
4
4
|
import { withOrchestration } from '../utils/start-helper.js';
|
|
5
5
|
import * as flows from './swap.flows.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CosmosChainInfoShape, DenomDetailShape } from '../typeGuards.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @import {TimerService} from '@agoric/time';
|
|
@@ -25,7 +25,7 @@ export const meta = {
|
|
|
25
25
|
storageNode: StorageNodeShape,
|
|
26
26
|
marshaller: M.remotable('marshaller'),
|
|
27
27
|
timerService: M.or(TimerServiceShape, null),
|
|
28
|
-
chainInfo: M.recordOf(M.string(),
|
|
28
|
+
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
|
|
29
29
|
assetInfo: M.arrayOf([M.string(), DenomDetailShape]),
|
|
30
30
|
},
|
|
31
31
|
upgradability: 'canUpgrade',
|