@agoric/orchestration 0.1.1-dev-989aa19.0 → 0.1.1-dev-9274bc7.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 +18 -16
- package/src/chain-info.js +1 -1
- package/src/examples/stakeBld.contract.d.ts +10 -20
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +4 -2
- package/src/examples/stakeIca.contract.d.ts +9 -9
- package/src/examples/stakeIca.contract.d.ts.map +1 -1
- package/src/examples/stakeIca.contract.js +4 -1
- package/src/exos/chain-account-kit.d.ts +10 -1
- package/src/exos/chain-account-kit.d.ts.map +1 -1
- package/src/exos/chain-account-kit.js +35 -13
- package/src/exos/chain-hub.d.ts +2392 -0
- package/src/{utils/chainHub.d.ts.map → exos/chain-hub.d.ts.map} +1 -1
- package/src/{utils/chainHub.js → exos/chain-hub.js} +69 -9
- package/src/exos/cosmos-orchestration-account.d.ts +50 -15
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +113 -57
- package/src/exos/icq-connection-kit.d.ts +10 -1
- package/src/exos/icq-connection-kit.d.ts.map +1 -1
- package/src/exos/icq-connection-kit.js +27 -11
- package/src/exos/local-chain-facade.d.ts +46 -9
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +1 -1
- package/src/exos/local-orchestration-account.d.ts +115 -2343
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +185 -56
- package/src/exos/orchestrator.d.ts +9 -2313
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/orchestrator.js +1 -1
- package/src/exos/remote-chain-facade.d.ts +6 -6
- package/src/facade.d.ts +48 -11
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +2 -2
- package/src/proposals/orchestration-proposal.d.ts +36 -6
- package/src/proposals/orchestration-proposal.js +1 -1
- package/src/proposals/start-stakeAtom.d.ts +9 -9
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +5 -6
- package/src/proposals/start-stakeBld.d.ts +10 -20
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.d.ts +9 -9
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.js +5 -6
- package/src/service.d.ts +92 -9
- package/src/service.d.ts.map +1 -1
- package/src/service.js +143 -66
- package/src/utils/start-helper.d.ts +8 -2320
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +5 -2
- package/src/utils/time.d.ts +2 -0
- package/src/utils/time.d.ts.map +1 -1
- package/src/utils/time.js +2 -0
- package/src/vat-orchestration.d.ts +36 -6
- package/src/vat-orchestration.d.ts.map +1 -1
- package/src/vat-orchestration.js +3 -0
- package/src/utils/chainHub.d.ts +0 -2404
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-9274bc7.0+9274bc7",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"prepack": "tsc --build tsconfig.build.json",
|
|
15
15
|
"postpack": "git clean -f '*.d.ts*'",
|
|
16
16
|
"test": "ava",
|
|
17
|
+
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
|
|
17
18
|
"test:xs": "exit 0",
|
|
18
19
|
"lint": "run-s --continue-on-error lint:*",
|
|
19
20
|
"lint:types": "tsc",
|
|
@@ -32,20 +33,20 @@
|
|
|
32
33
|
},
|
|
33
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@agoric/assert": "0.6.1-dev-
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/assert": "0.6.1-dev-9274bc7.0+9274bc7",
|
|
37
|
+
"@agoric/async-flow": "0.1.1-dev-9274bc7.0+9274bc7",
|
|
38
|
+
"@agoric/cosmic-proto": "0.4.1-dev-9274bc7.0+9274bc7",
|
|
39
|
+
"@agoric/ertp": "0.16.3-dev-9274bc7.0+9274bc7",
|
|
40
|
+
"@agoric/internal": "0.3.3-dev-9274bc7.0+9274bc7",
|
|
41
|
+
"@agoric/network": "0.1.1-dev-9274bc7.0+9274bc7",
|
|
42
|
+
"@agoric/notifier": "0.6.3-dev-9274bc7.0+9274bc7",
|
|
43
|
+
"@agoric/store": "0.9.3-dev-9274bc7.0+9274bc7",
|
|
44
|
+
"@agoric/time": "0.3.3-dev-9274bc7.0+9274bc7",
|
|
45
|
+
"@agoric/vat-data": "0.5.3-dev-9274bc7.0+9274bc7",
|
|
46
|
+
"@agoric/vats": "0.15.2-dev-9274bc7.0+9274bc7",
|
|
47
|
+
"@agoric/vow": "0.1.1-dev-9274bc7.0+9274bc7",
|
|
48
|
+
"@agoric/zoe": "0.26.3-dev-9274bc7.0+9274bc7",
|
|
49
|
+
"@agoric/zone": "0.2.3-dev-9274bc7.0+9274bc7",
|
|
49
50
|
"@endo/base64": "^1.0.5",
|
|
50
51
|
"@endo/far": "^1.1.2",
|
|
51
52
|
"@endo/marshal": "^1.5.0",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
58
59
|
"@endo/ses-ava": "^1.2.2",
|
|
59
60
|
"ava": "^5.3.1",
|
|
61
|
+
"c8": "^9.1.0",
|
|
60
62
|
"prettier": "^3.3.2"
|
|
61
63
|
},
|
|
62
64
|
"ava": {
|
|
@@ -88,5 +90,5 @@
|
|
|
88
90
|
"typeCoverage": {
|
|
89
91
|
"atLeast": 97.1
|
|
90
92
|
},
|
|
91
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "9274bc7a0e566b78128be2b59b5f244c7f8414e6"
|
|
92
94
|
}
|
package/src/chain-info.js
CHANGED
|
@@ -40,10 +40,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
43
|
-
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<
|
|
44
|
-
|
|
45
|
-
}>, undefined>>;
|
|
46
|
-
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<void, undefined>>;
|
|
43
|
+
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Record<unknown, unknown>, undefined>>;
|
|
44
|
+
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<void | import("@agoric/time").TimestampRecord | import("@agoric/vow").Vow<void | import("@agoric/time").TimestampRecord>, undefined>>;
|
|
47
45
|
CloseAccount(): never;
|
|
48
46
|
}>;
|
|
49
47
|
account: import("@endo/exo").Guarded<{
|
|
@@ -56,10 +54,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
56
54
|
storagePath: Promise<string>;
|
|
57
55
|
};
|
|
58
56
|
};
|
|
59
|
-
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<
|
|
60
|
-
|
|
61
|
-
}>>;
|
|
62
|
-
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
57
|
+
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Record<unknown, unknown>>;
|
|
58
|
+
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): import("@agoric/vow").PromiseVow<void | import("@agoric/time").TimestampRecord>;
|
|
63
59
|
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
64
60
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
65
61
|
executeTx<MT extends {
|
|
@@ -81,10 +77,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
81
77
|
storagePath: Promise<string>;
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
|
-
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<
|
|
85
|
-
|
|
86
|
-
}>>;
|
|
87
|
-
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
80
|
+
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Record<unknown, unknown>>;
|
|
81
|
+
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): import("@agoric/vow").PromiseVow<void | import("@agoric/time").TimestampRecord>;
|
|
88
82
|
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
89
83
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
90
84
|
executeTx<MT extends {
|
|
@@ -107,10 +101,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
107
101
|
};
|
|
108
102
|
};
|
|
109
103
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
110
|
-
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<
|
|
111
|
-
|
|
112
|
-
}>, undefined>>;
|
|
113
|
-
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<void, undefined>>;
|
|
104
|
+
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<Record<unknown, unknown>, undefined>>;
|
|
105
|
+
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<void | import("@agoric/time").TimestampRecord | import("@agoric/vow").Vow<void | import("@agoric/time").TimestampRecord>, undefined>>;
|
|
114
106
|
CloseAccount(): never;
|
|
115
107
|
}>;
|
|
116
108
|
account: import("@endo/exo").Guarded<{
|
|
@@ -123,10 +115,8 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
123
115
|
storagePath: Promise<string>;
|
|
124
116
|
};
|
|
125
117
|
};
|
|
126
|
-
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<
|
|
127
|
-
|
|
128
|
-
}>>;
|
|
129
|
-
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
118
|
+
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Record<unknown, unknown>>;
|
|
119
|
+
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): import("@agoric/vow").PromiseVow<void | import("@agoric/time").TimestampRecord>;
|
|
130
120
|
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
131
121
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
132
122
|
executeTx<MT extends {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAmCO,2BAVI,GAAG;;;;;
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAmCO,2BAVI,GAAG;;;;;8BAyEA,MAAA,KAAI,CAAC;6BAqBX,QAAA,KAAI,CAAC,mBAA6B,OAAO;6BAe+K,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;gBAzGhjJ,UAAU;iBACT,WAAW;;YAGlB,OAAO,kBAAkB,EAAE,OAAO;;QAiDvC;;WAEG;;;;;;;;;;+DAkD8hC,OAAO,KAAK,CAAC;iEAAid,OAAO,KAAK,CAAC;;;;kCAAz/B,QAAS;;;;;;;;;+DAAmwL,OAAO,KAAK,CAAC;iEAAksB,OAAO,KAAK,CAAC;;iCAAjyN,OAAO,KAAK,CAAC;;;+BAA6rB,EAAE;;;;sCAA46B,SAAU,OAAM,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;QApB92D;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBR;6BArHyB,cAAc;4BACf,kBAAkB;kCACZ,cAAc"}
|
|
@@ -6,12 +6,12 @@ import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/record
|
|
|
6
6
|
import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
|
|
7
7
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
8
8
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
9
|
-
import { V } from '@agoric/vow/vat.js';
|
|
9
|
+
import { prepareVowTools, V } from '@agoric/vow/vat.js';
|
|
10
10
|
import { E } from '@endo/far';
|
|
11
11
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
12
12
|
import { M } from '@endo/patterns';
|
|
13
13
|
import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js';
|
|
14
|
-
import { makeChainHub } from '../
|
|
14
|
+
import { makeChainHub } from '../exos/chain-hub.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @import {NameHub} from '@agoric/vats';
|
|
@@ -40,12 +40,14 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
40
40
|
baggage,
|
|
41
41
|
privateArgs.marshaller,
|
|
42
42
|
);
|
|
43
|
+
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
43
44
|
|
|
44
45
|
const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
|
|
45
46
|
zone,
|
|
46
47
|
makeRecorderKit,
|
|
47
48
|
zcf,
|
|
48
49
|
privateArgs.timerService,
|
|
50
|
+
vowTools,
|
|
49
51
|
makeChainHub(privateArgs.agoricNames),
|
|
50
52
|
);
|
|
51
53
|
|
|
@@ -36,10 +36,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
39
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<
|
|
40
|
-
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<
|
|
39
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<undefined, undefined>>;
|
|
40
|
+
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<undefined, undefined>>;
|
|
41
41
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
42
|
-
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<
|
|
42
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<undefined, undefined>>;
|
|
43
43
|
CloseAccount(): never;
|
|
44
44
|
TransferAccount(): never;
|
|
45
45
|
}>;
|
|
@@ -53,17 +53,17 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
56
|
-
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<
|
|
56
|
+
delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<undefined>;
|
|
57
57
|
deposit(payment: any): Promise<void>;
|
|
58
58
|
getBalances(): Promise<never>;
|
|
59
|
-
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<
|
|
59
|
+
redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<undefined>;
|
|
60
60
|
withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
|
|
61
61
|
getBalance(denom: import("../orchestration-api.js").DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
62
62
|
send(toAccount: any, amount: any): never;
|
|
63
63
|
transfer(amount: any, msg: any): never;
|
|
64
64
|
transferSteps(amount: any, msg: any): never;
|
|
65
65
|
withdrawRewards(): never;
|
|
66
|
-
undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<
|
|
66
|
+
undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<undefined>;
|
|
67
67
|
}>>;
|
|
68
68
|
makeAccountInvitationMaker(): Promise<Invitation<{
|
|
69
69
|
publicSubscribers: {
|
|
@@ -74,10 +74,10 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
invitationMakers: import("@endo/exo").Guarded<{
|
|
77
|
-
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<
|
|
78
|
-
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<
|
|
77
|
+
Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<undefined, undefined>>;
|
|
78
|
+
Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<undefined, undefined>>;
|
|
79
79
|
WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
|
|
80
|
-
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<
|
|
80
|
+
Undelegate(delegations: Omit<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation, "delegatorAddress">[]): Promise<Invitation<undefined, undefined>>;
|
|
81
81
|
CloseAccount(): never;
|
|
82
82
|
TransferAccount(): never;
|
|
83
83
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC;;;;;;;;;iBAGX,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC;;;;;;;;;iBAGX,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqF1B;;aAlGa,MAAM;;;eAGJ,MAAM;gBACL,OAAO;;yBAgGV,OAAO,KAAK;kCA5HK,cAAc;6BAFnB,kBAAkB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { makeTracer, StorageNodeShape } from '@agoric/internal';
|
|
4
4
|
import { TimerServiceShape } from '@agoric/time';
|
|
5
|
-
import { V as E } from '@agoric/vow/vat.js';
|
|
5
|
+
import { V as E, prepareVowTools } from '@agoric/vow/vat.js';
|
|
6
6
|
import {
|
|
7
7
|
prepareRecorderKitMakers,
|
|
8
8
|
provideAll,
|
|
@@ -76,9 +76,12 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
76
76
|
|
|
77
77
|
const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
|
|
78
78
|
|
|
79
|
+
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
80
|
+
|
|
79
81
|
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
|
|
80
82
|
zone,
|
|
81
83
|
makeRecorderKit,
|
|
84
|
+
vowTools,
|
|
82
85
|
zcf,
|
|
83
86
|
);
|
|
84
87
|
|
|
@@ -10,7 +10,16 @@ export const ChainAccountI: import("@endo/patterns").InterfaceGuard<{
|
|
|
10
10
|
close: import("@endo/patterns").MethodGuard;
|
|
11
11
|
getPurse: import("@endo/patterns").MethodGuard;
|
|
12
12
|
}>;
|
|
13
|
-
export function prepareChainAccountKit(zone: Zone
|
|
13
|
+
export function prepareChainAccountKit(zone: Zone, { watch, when }: {
|
|
14
|
+
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
15
|
+
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("@agoric/vow").Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
|
|
16
|
+
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
|
|
17
|
+
allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
|
|
18
|
+
}): (chainId: string, port: Port, requestedRemoteAddress: string) => import("@endo/exo").GuardedKit<{
|
|
19
|
+
parseTxPacketWatcher: {
|
|
20
|
+
/** @param {string} ack */
|
|
21
|
+
onFulfilled(ack: string): string;
|
|
22
|
+
};
|
|
14
23
|
account: {
|
|
15
24
|
/** @returns {ChainAddress} */
|
|
16
25
|
getAddress(): ChainAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-account-kit.d.ts","sourceRoot":"","sources":["chain-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"chain-account-kit.d.ts","sourceRoot":"","sources":["chain-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAkBI;wFA9CI,CAAC;;;oBAUR,SAAS;;;QAiEL,0BAA0B;yBAAd,MAAM;;;QAMlB,8BAA8B;;;;;;;;QAiC9B;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAgB5B,+BAA+B;;QAW/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;GAyBR;qCA/KW,0BAA0B;;aAoB1B,MAAM;;;;4BAIS,MAAM;;;;8BAyJrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BA7L5C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;4BAFnB,8CAA8C;gCAHpC,iBAAiB;4BACjB,aAAa"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { NonNullish } from '@agoric/assert';
|
|
3
3
|
import { PurseShape } from '@agoric/ertp';
|
|
4
4
|
import { makeTracer } from '@agoric/internal';
|
|
5
|
-
import {
|
|
5
|
+
import { E } from '@endo/far';
|
|
6
6
|
import { M } from '@endo/patterns';
|
|
7
7
|
import {
|
|
8
8
|
ChainAddressShape,
|
|
@@ -15,7 +15,7 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* @import {Zone} from '@agoric/base-zone';
|
|
17
17
|
* @import {Connection, Port} from '@agoric/network';
|
|
18
|
-
* @import {Remote} from '@agoric/vow';
|
|
18
|
+
* @import {Remote, VowTools} from '@agoric/vow';
|
|
19
19
|
* @import {AnyJson} from '@agoric/cosmic-proto';
|
|
20
20
|
* @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
21
21
|
* @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
@@ -55,11 +55,22 @@ export const ChainAccountI = M.interface('ChainAccount', {
|
|
|
55
55
|
* }} State
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* @param {Zone} zone
|
|
60
|
+
* @param {VowTools} vowTools
|
|
61
|
+
*/
|
|
62
|
+
export const prepareChainAccountKit = (zone, { watch, when }) =>
|
|
60
63
|
zone.exoClassKit(
|
|
61
64
|
'ChainAccountKit',
|
|
62
|
-
{
|
|
65
|
+
{
|
|
66
|
+
account: ChainAccountI,
|
|
67
|
+
connectionHandler: ConnectionHandlerI,
|
|
68
|
+
parseTxPacketWatcher: M.interface('ParseTxPacketWatcher', {
|
|
69
|
+
onFulfilled: M.call(M.string())
|
|
70
|
+
.optional(M.arrayOf(M.undefined())) // does not need watcherContext
|
|
71
|
+
.returns(M.string()),
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
63
74
|
/**
|
|
64
75
|
* @param {string} chainId
|
|
65
76
|
* @param {Port} port
|
|
@@ -76,6 +87,12 @@ export const prepareChainAccountKit = zone =>
|
|
|
76
87
|
localAddress: undefined,
|
|
77
88
|
}),
|
|
78
89
|
{
|
|
90
|
+
parseTxPacketWatcher: {
|
|
91
|
+
/** @param {string} ack */
|
|
92
|
+
onFulfilled(ack) {
|
|
93
|
+
return parseTxPacket(ack);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
79
96
|
account: {
|
|
80
97
|
/** @returns {ChainAddress} */
|
|
81
98
|
getAddress() {
|
|
@@ -120,23 +137,28 @@ export const prepareChainAccountKit = zone =>
|
|
|
120
137
|
* decoded using the corresponding `Msg*Response` object.
|
|
121
138
|
* @throws {Error} if packet fails to send or an error is returned
|
|
122
139
|
*/
|
|
123
|
-
executeEncodedTx(msgs, opts) {
|
|
140
|
+
async executeEncodedTx(msgs, opts) {
|
|
124
141
|
const { connection } = this.state;
|
|
142
|
+
// TODO #9281 do not throw synchronously when returning a promise; return a rejected Vow
|
|
143
|
+
/// see https://github.com/Agoric/agoric-sdk/pull/9454#discussion_r1626898694
|
|
125
144
|
if (!connection) throw Fail`connection not available`;
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
return when(
|
|
146
|
+
watch(
|
|
147
|
+
E(connection).send(makeTxPacket(msgs, opts)),
|
|
148
|
+
this.facets.parseTxPacketWatcher,
|
|
149
|
+
),
|
|
130
150
|
);
|
|
131
151
|
},
|
|
132
152
|
/** Close the remote account */
|
|
133
153
|
async close() {
|
|
134
|
-
|
|
154
|
+
/// TODO #9192 what should the behavior be here? and `onClose`?
|
|
135
155
|
// - retrieve assets?
|
|
136
156
|
// - revoke the port?
|
|
137
157
|
const { connection } = this.state;
|
|
158
|
+
// TODO #9281 do not throw synchronously when returning a promise; return a rejected Vow
|
|
159
|
+
/// see https://github.com/Agoric/agoric-sdk/pull/9454#discussion_r1626898694
|
|
138
160
|
if (!connection) throw Fail`connection not available`;
|
|
139
|
-
|
|
161
|
+
return when(watch(E(connection).close()));
|
|
140
162
|
},
|
|
141
163
|
/**
|
|
142
164
|
* get Purse for a brand to .withdraw() a Payment from the account
|
|
@@ -169,7 +191,7 @@ export const prepareChainAccountKit = zone =>
|
|
|
169
191
|
},
|
|
170
192
|
async onClose(_connection, reason) {
|
|
171
193
|
trace(`ICA Channel closed. Reason: ${reason}`);
|
|
172
|
-
// FIXME handle connection closing
|
|
194
|
+
// FIXME handle connection closing https://github.com/Agoric/agoric-sdk/issues/9192
|
|
173
195
|
// XXX is there a scenario where a connection will unexpectedly close? _I think yes_
|
|
174
196
|
},
|
|
175
197
|
async onReceive(connection, bytes) {
|