kokio-sdk 2.0.0 → 3.0.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/README.md +21 -7
- package/dist/esm/abis/DeviceWallet.js +60 -59
- package/dist/esm/abis/ESIMWallet.js +263 -58
- package/dist/esm/abis/ESIMWalletFactory.js +2 -2
- package/dist/esm/abis/LazyWalletRegistry.js +68 -24
- package/dist/esm/abis/PaymentAdapter.js +861 -0
- package/dist/esm/abis/Registry.js +294 -18
- package/dist/esm/abis/RegistryHelper.js +101 -9
- package/dist/esm/abis/index.js +2 -1
- package/dist/esm/admin/config-admin.js +4 -0
- package/dist/esm/admin/interface/deviceWalletClass.js +3 -3
- package/dist/esm/admin/interface/eSIMWalletClass.js +6 -6
- package/dist/esm/admin/interface/lazyWalletRegistryClass.js +4 -1
- package/dist/esm/admin/interface/paymentAdapterClass.js +54 -0
- package/dist/esm/admin/interface/protocolAdminClass.js +6 -3
- package/dist/esm/admin/interface/registryClass.js +15 -6
- package/dist/esm/config.js +3 -0
- package/dist/esm/interface/deviceWalletClass.js +5 -5
- package/dist/esm/interface/eSIMWalletClass.js +10 -7
- package/dist/esm/interface/paymentAdapterClass.js +28 -0
- package/dist/esm/interface/registryClass.js +12 -3
- package/dist/esm/logic/admin/deviceWallet.eoa.js +3 -3
- package/dist/esm/logic/admin/deviceWalletFactory.eoa.js +6 -6
- package/dist/esm/logic/admin/eSIMWallet.eoa.js +14 -12
- package/dist/esm/logic/admin/eSIMWalletFactory.eoa.js +4 -4
- package/dist/esm/logic/admin/lazyWalletRegistry.eoa.js +7 -7
- package/dist/esm/logic/admin/paymentAdapter.eoa.js +123 -0
- package/dist/esm/logic/admin/protocolAdmin.eoa.js +34 -16
- package/dist/esm/logic/admin/reads/deviceWallet.reads.js +2 -2
- package/dist/esm/logic/admin/reads/eSIMWallet.reads.js +8 -7
- package/dist/esm/logic/admin/reads/lazyWalletRegistry.reads.js +19 -2
- package/dist/esm/logic/admin/reads/paymentAdapter.reads.js +106 -0
- package/dist/esm/logic/admin/reads/registry.reads.js +34 -6
- package/dist/esm/logic/admin/registry.eoa.js +44 -20
- package/dist/esm/logic/constants.js +17 -87
- package/dist/esm/logic/deviceWallet.js +11 -11
- package/dist/esm/logic/eSIMWallet.js +51 -22
- package/dist/esm/logic/errors.js +30 -1
- package/dist/esm/logic/paymentAdapter.js +116 -0
- package/dist/esm/logic/registry.js +50 -5
- package/dist/esm/types-export.js +1 -1
- package/dist/esm/types.js +11 -1
- package/dist/types/abis/DeviceWallet.d.ts +50 -49
- package/dist/types/abis/ESIMWallet.d.ts +215 -55
- package/dist/types/abis/ESIMWalletFactory.d.ts +2 -2
- package/dist/types/abis/LazyWalletRegistry.d.ts +58 -24
- package/dist/types/abis/PaymentAdapter.d.ts +661 -0
- package/dist/types/abis/Registry.d.ts +233 -18
- package/dist/types/abis/RegistryHelper.d.ts +83 -9
- package/dist/types/abis/index.d.ts +2 -1
- package/dist/types/admin/config-admin.d.ts +2 -0
- package/dist/types/admin/interface/deviceWalletClass.d.ts +1 -1
- package/dist/types/admin/interface/eSIMWalletClass.d.ts +3 -3
- package/dist/types/admin/interface/lazyWalletRegistryClass.d.ts +1 -0
- package/dist/types/admin/interface/paymentAdapterClass.d.ts +20 -0
- package/dist/types/admin/interface/protocolAdminClass.d.ts +2 -1
- package/dist/types/admin/interface/registryClass.d.ts +6 -2
- package/dist/types/config.d.ts +2 -0
- package/dist/types/interface/constantsClass.d.ts +2 -2
- package/dist/types/interface/deviceWalletClass.d.ts +2 -2
- package/dist/types/interface/eSIMWalletClass.d.ts +5 -4
- package/dist/types/interface/paymentAdapterClass.d.ts +13 -0
- package/dist/types/interface/registryClass.d.ts +5 -2
- package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +9 -6
- package/dist/types/logic/admin/paymentAdapter.eoa.d.ts +28 -0
- package/dist/types/logic/admin/protocolAdmin.eoa.d.ts +12 -2
- package/dist/types/logic/admin/reads/deviceWallet.reads.d.ts +1 -1
- package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +5 -4
- package/dist/types/logic/admin/reads/lazyWalletRegistry.reads.d.ts +7 -0
- package/dist/types/logic/admin/reads/paymentAdapter.reads.d.ts +30 -0
- package/dist/types/logic/admin/reads/registry.reads.d.ts +13 -5
- package/dist/types/logic/admin/registry.eoa.d.ts +18 -8
- package/dist/types/logic/constants.d.ts +5 -17
- package/dist/types/logic/deviceWallet.d.ts +7 -7
- package/dist/types/logic/eSIMWallet.d.ts +29 -15
- package/dist/types/logic/errors.d.ts +16 -1
- package/dist/types/logic/paymentAdapter.d.ts +40 -0
- package/dist/types/logic/registry.d.ts +20 -5
- package/dist/types/types-export.d.ts +2 -1
- package/dist/types/types.d.ts +20 -2
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { _registry, _settlementToken, _assets, _resolveAsset, _quote, _usedReferences, _upgradeManager } from "../../logic/admin/reads/paymentAdapter.reads.js";
|
|
2
|
+
import { _registerAsset, _updateAsset, _registerAssetCall, _updateAssetCall, _transferOwnershipCall, _upgradeCall, _acceptOwnership } from "../../logic/admin/paymentAdapter.eoa.js";
|
|
3
|
+
export class AdminPaymentAdapterSubPackage {
|
|
4
|
+
walletClient;
|
|
5
|
+
constructor(walletClient) {
|
|
6
|
+
this.walletClient = walletClient;
|
|
7
|
+
}
|
|
8
|
+
registry() {
|
|
9
|
+
return _registry(this.walletClient);
|
|
10
|
+
}
|
|
11
|
+
settlementToken() {
|
|
12
|
+
return _settlementToken(this.walletClient);
|
|
13
|
+
}
|
|
14
|
+
assets(symbol) {
|
|
15
|
+
return _assets(this.walletClient, symbol);
|
|
16
|
+
}
|
|
17
|
+
resolveAsset(symbol) {
|
|
18
|
+
return _resolveAsset(this.walletClient, symbol);
|
|
19
|
+
}
|
|
20
|
+
quote(symbol, priceUSDCents) {
|
|
21
|
+
return _quote(this.walletClient, symbol, priceUSDCents);
|
|
22
|
+
}
|
|
23
|
+
usedReferences(paymentReference) {
|
|
24
|
+
return _usedReferences(this.walletClient, paymentReference);
|
|
25
|
+
}
|
|
26
|
+
upgradeManager() {
|
|
27
|
+
return _upgradeManager(this.walletClient);
|
|
28
|
+
}
|
|
29
|
+
// Direct writes - only succeed if this wallet client is the owner. On the
|
|
30
|
+
// live deployment the owner is the ProtocolAdmin timelock, so these revert
|
|
31
|
+
// there; use the *Call builders below with `protocolAdmin.schedule` instead.
|
|
32
|
+
registerAsset(symbol, asset) {
|
|
33
|
+
return _registerAsset(this.walletClient, symbol, asset);
|
|
34
|
+
}
|
|
35
|
+
updateAsset(symbol, asset) {
|
|
36
|
+
return _updateAsset(this.walletClient, symbol, asset);
|
|
37
|
+
}
|
|
38
|
+
acceptOwnership() {
|
|
39
|
+
return _acceptOwnership(this.walletClient);
|
|
40
|
+
}
|
|
41
|
+
// Owner payloads - build an OwnerCall to hand to protocolAdmin.schedule.
|
|
42
|
+
registerAssetCall(symbol, asset) {
|
|
43
|
+
return _registerAssetCall(this.walletClient, symbol, asset);
|
|
44
|
+
}
|
|
45
|
+
updateAssetCall(symbol, asset) {
|
|
46
|
+
return _updateAssetCall(this.walletClient, symbol, asset);
|
|
47
|
+
}
|
|
48
|
+
transferOwnershipCall(newOwner) {
|
|
49
|
+
return _transferOwnershipCall(this.walletClient, newOwner);
|
|
50
|
+
}
|
|
51
|
+
upgradeCall(newImplementation, data) {
|
|
52
|
+
return _upgradeCall(this.walletClient, newImplementation, data);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _operationId, _operationIdBatch, _operationIdRaw, _operationIdBatchRaw, _schedule, _scheduleBatch, _scheduleRaw, _execute, _executeBatch, _executeRaw, _cancel, _unpauseInstantly, _revokeCancellersInstantly, _disableAdminInstantly, _acceptOwnershipBatch, _renounceRole, _grantRoleCall, _revokeRoleCall, _updateDelayCall, _disableAndNominateCall, _disableAdminCall, _enableAdminCall, _unpauseCall,
|
|
1
|
+
import { _operationId, _operationIdBatch, _operationIdRaw, _operationIdBatchRaw, _schedule, _scheduleBatch, _scheduleRaw, _execute, _executeBatch, _executeRaw, _cancel, _unpauseInstantly, _revokeCancellersInstantly, _disableAdminInstantly, _acceptOwnershipBatch, _renounceRole, _grantRoleCall, _revokeRoleCall, _updateDelayCall, _disableAndNominateCall, _disableAdminCall, _enableAdminCall, _unpauseCall, _setDefaultPriceCapUSDCentsCall, _setPaymentAdapterCall, } from "../../logic/admin/protocolAdmin.eoa.js";
|
|
2
2
|
import { _getMinDelay, _minDelayFloor, _getOperationState, _getTimestamp, _isOperation, _isOperationPending, _isOperationReady, _isOperationDone, _hasRole, _getRoleAdmin, _defaultAdminRole, _proposerRole, _cancellerRole, _executorRole, _guardianRole, } from "../../logic/admin/reads/protocolAdmin.reads.js";
|
|
3
3
|
/** Schedules operations. Needs an EOA holding `PROPOSER_ROLE`. */
|
|
4
4
|
export class ProtocolAdminProposerSubPackage {
|
|
@@ -129,8 +129,11 @@ export class AdminProtocolAdminSubPackage {
|
|
|
129
129
|
unpauseCall(target) {
|
|
130
130
|
return _unpauseCall(this.walletClient, target);
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
return
|
|
132
|
+
setDefaultPriceCapUSDCentsCall(cap, target) {
|
|
133
|
+
return _setDefaultPriceCapUSDCentsCall(this.walletClient, cap, target);
|
|
134
|
+
}
|
|
135
|
+
setPaymentAdapterCall(paymentAdapter, target) {
|
|
136
|
+
return _setPaymentAdapterCall(this.walletClient, paymentAdapter, target);
|
|
134
137
|
}
|
|
135
138
|
// Operation ids
|
|
136
139
|
operationId(call, opts) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _addOrUpdateLazyWalletRegistryAddress, _updateVaultAddress, _requestAdminUpdate, _disableAdmin, _enableAdmin, _acceptAdminUpdate, _assignESIMIdentifier, _pause, _unpause,
|
|
2
|
-
import { _owner, _eSIMWalletAdmin, _adminOfRecord, _adminDisabled, _newRequestedAdmin, _vault, _upgradeManager, _lazyWalletRegistry, _uniqueIdentifierToDeviceWallet, _deviceWalletToOwner, _registeredP256Keys, _isDeviceWalletValid, _isESIMWalletValid, _isESIMWalletOnStandby, _paused,
|
|
1
|
+
import { _addOrUpdateLazyWalletRegistryAddress, _updateVaultAddress, _requestAdminUpdate, _disableAdmin, _enableAdmin, _acceptAdminUpdate, _assignESIMIdentifier, _recordSettledPurchase, _pause, _unpause, _setDefaultPriceCapUSDCents, _acceptOwnership, _transferOwnershipCall, _upgradeCall, } from "../../logic/admin/registry.eoa.js";
|
|
2
|
+
import { _owner, _eSIMWalletAdmin, _adminOfRecord, _adminDisabled, _newRequestedAdmin, _vault, _upgradeManager, _lazyWalletRegistry, _uniqueIdentifierToDeviceWallet, _deviceWalletToOwner, _registeredP256Keys, _isDeviceWalletValid, _isESIMWalletValid, _isESIMWalletOnStandby, _paused, _defaultPriceCapUSDCents, _paymentAdapter, _usedPaymentReferences, _isDeviceIdentifierAlreadyUsed, _isESIMIdentifierClaimed, _eSIMWalletForIdentifier, _claimedESIMIdentifiers, _requireDeviceIdentifierNotReserved, _pendingOwner, _deviceWalletFactory, _eSIMWalletFactory, _entryPoint, _requireNotPaused, _proxiableUUID, _upgradeInterfaceVersion, } from "../../logic/admin/reads/registry.reads.js";
|
|
3
3
|
/** Thin EOA (owner) wrapper around `Registry`. */
|
|
4
4
|
export class AdminRegistrySubPackage {
|
|
5
5
|
walletClient;
|
|
@@ -24,6 +24,9 @@ export class AdminRegistrySubPackage {
|
|
|
24
24
|
acceptAdminUpdate() {
|
|
25
25
|
return _acceptAdminUpdate(this.walletClient);
|
|
26
26
|
}
|
|
27
|
+
recordSettledPurchase(eSIMWalletAddress, dataBundleDetail, asset, tokenAmount, paymentReference) {
|
|
28
|
+
return _recordSettledPurchase(this.walletClient, eSIMWalletAddress, dataBundleDetail, asset, tokenAmount, paymentReference);
|
|
29
|
+
}
|
|
27
30
|
assignESIMIdentifier(eSIMWalletAddress, eSIMUniqueIdentifier) {
|
|
28
31
|
return _assignESIMIdentifier(this.walletClient, eSIMWalletAddress, eSIMUniqueIdentifier);
|
|
29
32
|
}
|
|
@@ -33,8 +36,8 @@ export class AdminRegistrySubPackage {
|
|
|
33
36
|
unpause() {
|
|
34
37
|
return _unpause(this.walletClient);
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
return
|
|
39
|
+
setDefaultPriceCapUSDCents(cap) {
|
|
40
|
+
return _setDefaultPriceCapUSDCents(this.walletClient, cap);
|
|
38
41
|
}
|
|
39
42
|
acceptOwnership() {
|
|
40
43
|
return _acceptOwnership(this.walletClient);
|
|
@@ -92,8 +95,14 @@ export class AdminRegistrySubPackage {
|
|
|
92
95
|
paused() {
|
|
93
96
|
return _paused(this.walletClient);
|
|
94
97
|
}
|
|
95
|
-
|
|
96
|
-
return
|
|
98
|
+
defaultPriceCapUSDCents() {
|
|
99
|
+
return _defaultPriceCapUSDCents(this.walletClient);
|
|
100
|
+
}
|
|
101
|
+
paymentAdapter() {
|
|
102
|
+
return _paymentAdapter(this.walletClient);
|
|
103
|
+
}
|
|
104
|
+
usedPaymentReferences(scopedReference) {
|
|
105
|
+
return _usedPaymentReferences(this.walletClient, scopedReference);
|
|
97
106
|
}
|
|
98
107
|
isDeviceIdentifierAlreadyUsed(deviceUniqueIdentifier) {
|
|
99
108
|
return _isDeviceIdentifierAlreadyUsed(this.walletClient, deviceUniqueIdentifier);
|
package/dist/esm/config.js
CHANGED
|
@@ -6,6 +6,7 @@ import { RegistrySubPackage } from "./interface/registryClass.js";
|
|
|
6
6
|
import { DeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
|
|
7
7
|
import { ESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
|
|
8
8
|
import { ESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
|
|
9
|
+
import { PaymentAdapterSubPackage } from "./interface/paymentAdapterClass.js";
|
|
9
10
|
// Re-export the typed error surface so consumers can `instanceof KokioError`
|
|
10
11
|
// (or a specific subclass) and decode on-chain reverts without reaching into
|
|
11
12
|
// internal module paths.
|
|
@@ -27,6 +28,7 @@ export class Kokio {
|
|
|
27
28
|
deviceWallet;
|
|
28
29
|
eSIMWallet;
|
|
29
30
|
P256Verifier;
|
|
31
|
+
paymentAdapter;
|
|
30
32
|
constructor(viemWalletClient, credentialId, rpId, pimlicoAPIKey, gasPolicyId, smartAccountClient, deviceWalletAddress, eSIMWalletAddress) {
|
|
31
33
|
this.viemWalletClient = viemWalletClient;
|
|
32
34
|
this.credentialId = credentialId;
|
|
@@ -42,6 +44,7 @@ export class Kokio {
|
|
|
42
44
|
this.eSIMWalletFactory = smartAccountClient ? new ESIMWalletFactorySubPackage(viemWalletClient, smartAccountClient) : undefined;
|
|
43
45
|
this.registry = smartAccountClient ? new RegistrySubPackage(smartAccountClient) : undefined;
|
|
44
46
|
this.P256Verifier = smartAccountClient ? new P256VerifierSubPackage(smartAccountClient) : undefined;
|
|
47
|
+
this.paymentAdapter = smartAccountClient ? new PaymentAdapterSubPackage(smartAccountClient) : undefined;
|
|
45
48
|
this.deviceWallet = deviceWalletAddress && smartAccountClient ? new DeviceWalletSubPackage(viemWalletClient, smartAccountClient, deviceWalletAddress) : undefined;
|
|
46
49
|
this.eSIMWallet = eSIMWalletAddress && smartAccountClient ? new ESIMWalletSubPackage(smartAccountClient, eSIMWalletAddress) : undefined;
|
|
47
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _addDeposit, _addESIMWallet,
|
|
1
|
+
import { _addDeposit, _addESIMWallet, _canPullFunds, _deviceUniqueIdentifier, _entryPoint, _eSIMWalletFactory, _getDeposit, _getOwner, _getVaultAddress, _isValidESIMWallet, _isValidSignature, _registry, _removeESIMWallet, _sendUserOperation, _toggleAccessToFunds, _transferOwnership, _verifier, _withdrawDepositTo } from "../logic/deviceWallet.js";
|
|
2
2
|
export class DeviceWalletSubPackage {
|
|
3
3
|
smartAccountClient;
|
|
4
4
|
walletClient;
|
|
@@ -23,8 +23,8 @@ export class DeviceWalletSubPackage {
|
|
|
23
23
|
removeESIMWallet(eSIMWalletAddress, callBackETH) {
|
|
24
24
|
return _removeESIMWallet(this.smartAccountClient, this.address, eSIMWalletAddress, callBackETH);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
return
|
|
26
|
+
toggleAccessToFunds(eSIMWalletAddress, hasAccessToFunds) {
|
|
27
|
+
return _toggleAccessToFunds(this.smartAccountClient, this.address, eSIMWalletAddress, hasAccessToFunds);
|
|
28
28
|
}
|
|
29
29
|
transferOwnership(newOwner) {
|
|
30
30
|
return _transferOwnership(this.smartAccountClient, this.address, newOwner);
|
|
@@ -33,8 +33,8 @@ export class DeviceWalletSubPackage {
|
|
|
33
33
|
return _withdrawDepositTo(this.smartAccountClient, this.address, withdrawAddress, amount);
|
|
34
34
|
}
|
|
35
35
|
// Reads
|
|
36
|
-
|
|
37
|
-
return
|
|
36
|
+
canPullFunds(eSIMWalletAddress) {
|
|
37
|
+
return _canPullFunds(this.smartAccountClient, this.address, eSIMWalletAddress);
|
|
38
38
|
}
|
|
39
39
|
deviceUniqueIdentifier() {
|
|
40
40
|
return _deviceUniqueIdentifier(this.smartAccountClient, this.address);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _acceptOwnershipTransfer,
|
|
1
|
+
import { _acceptOwnershipTransfer, _buyDataBundleWithToken, _priceCapUSDCents, _deviceWallet, _owner, _requestTransferOwnership, _sendETHToDeviceWallet, _sendTokenToDeviceWallet, _setPriceCapUSDCents, _transactionHistory } from "../logic/eSIMWallet.js";
|
|
2
2
|
export class ESIMWalletSubPackage {
|
|
3
3
|
client;
|
|
4
4
|
address;
|
|
@@ -9,11 +9,11 @@ export class ESIMWalletSubPackage {
|
|
|
9
9
|
acceptOwnershipTransfer() {
|
|
10
10
|
return _acceptOwnershipTransfer(this.client, this.address);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
buyDataBundleWithToken(dataBundleDetails, asset, maxAmountIn, paymentReference) {
|
|
13
|
+
return _buyDataBundleWithToken(this.client, this.address, dataBundleDetails, asset, maxAmountIn, paymentReference);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
priceCapUSDCents() {
|
|
16
|
+
return _priceCapUSDCents(this.client, this.address);
|
|
17
17
|
}
|
|
18
18
|
deviceWallet() {
|
|
19
19
|
return _deviceWallet(this.client, this.address);
|
|
@@ -27,8 +27,11 @@ export class ESIMWalletSubPackage {
|
|
|
27
27
|
sendETHToDeviceWallet(amount) {
|
|
28
28
|
return _sendETHToDeviceWallet(this.client, this.address, amount);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
sendTokenToDeviceWallet(token, amount) {
|
|
31
|
+
return _sendTokenToDeviceWallet(this.client, this.address, token, amount);
|
|
32
|
+
}
|
|
33
|
+
setPriceCapUSDCents(cap) {
|
|
34
|
+
return _setPriceCapUSDCents(this.client, this.address, cap);
|
|
32
35
|
}
|
|
33
36
|
transactionHistory(index) {
|
|
34
37
|
return _transactionHistory(this.client, this.address, index);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { _registry, _settlementToken, _assets, _resolveAsset, _quote, _usedReferences, _upgradeManager } from "../logic/paymentAdapter.js";
|
|
2
|
+
export class PaymentAdapterSubPackage {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
registry() {
|
|
8
|
+
return _registry(this.client);
|
|
9
|
+
}
|
|
10
|
+
settlementToken() {
|
|
11
|
+
return _settlementToken(this.client);
|
|
12
|
+
}
|
|
13
|
+
assets(symbol) {
|
|
14
|
+
return _assets(this.client, symbol);
|
|
15
|
+
}
|
|
16
|
+
resolveAsset(symbol) {
|
|
17
|
+
return _resolveAsset(this.client, symbol);
|
|
18
|
+
}
|
|
19
|
+
quote(symbol, priceUSDCents) {
|
|
20
|
+
return _quote(this.client, symbol, priceUSDCents);
|
|
21
|
+
}
|
|
22
|
+
usedReferences(paymentReference) {
|
|
23
|
+
return _usedReferences(this.client, paymentReference);
|
|
24
|
+
}
|
|
25
|
+
upgradeManager() {
|
|
26
|
+
return _upgradeManager(this.client);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _bindESIMWallet, _toggleESIMWalletStandbyStatus, _isDeviceIdentifierAlreadyUsed, _paused, _requireNotPaused, _isESIMWalletValid, _isESIMWalletOnStandby, _isDeviceWalletValid, _uniqueIdentifierToDeviceWallet, _isESIMIdentifierClaimed, _eSIMWalletForIdentifier,
|
|
1
|
+
import { _bindESIMWallet, _toggleESIMWalletStandbyStatus, _isDeviceIdentifierAlreadyUsed, _paused, _requireNotPaused, _isESIMWalletValid, _isESIMWalletOnStandby, _isDeviceWalletValid, _uniqueIdentifierToDeviceWallet, _isESIMIdentifierClaimed, _eSIMWalletForIdentifier, _defaultPriceCapUSDCents, _paymentAdapter, _usedPaymentReferences, _requireLazyHistoryCopied, _requireDeviceIdentifierNotReserved } from "../logic/registry.js";
|
|
2
2
|
export class RegistrySubPackage {
|
|
3
3
|
client;
|
|
4
4
|
constructor(client) {
|
|
@@ -38,8 +38,17 @@ export class RegistrySubPackage {
|
|
|
38
38
|
eSIMWalletForIdentifier(eSIMUniqueIdentifier) {
|
|
39
39
|
return _eSIMWalletForIdentifier(this.client, eSIMUniqueIdentifier);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
return
|
|
41
|
+
defaultPriceCapUSDCents() {
|
|
42
|
+
return _defaultPriceCapUSDCents(this.client);
|
|
43
|
+
}
|
|
44
|
+
paymentAdapter() {
|
|
45
|
+
return _paymentAdapter(this.client);
|
|
46
|
+
}
|
|
47
|
+
usedPaymentReferences(scopedReference) {
|
|
48
|
+
return _usedPaymentReferences(this.client, scopedReference);
|
|
49
|
+
}
|
|
50
|
+
requireLazyHistoryCopied(eSIMWallet) {
|
|
51
|
+
return _requireLazyHistoryCopied(this.client, eSIMWallet);
|
|
43
52
|
}
|
|
44
53
|
requireDeviceIdentifierNotReserved(deviceUniqueIdentifier) {
|
|
45
54
|
return _requireDeviceIdentifierNotReserved(this.client, deviceUniqueIdentifier);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _getChainSpecificConstants } from "../constants.js";
|
|
2
|
-
import { MissingEOAWalletError } from "../errors.js";
|
|
2
|
+
import { MissingEOAWalletError, writeContractOrThrow } from "../errors.js";
|
|
3
3
|
import { DeviceWallet } from "../../abis/index.js";
|
|
4
4
|
// Admin-EOA logic targeting a specific `DeviceWallet` instance (its address is
|
|
5
5
|
// passed in - there is no single factory address). `deployESIMWallet` is
|
|
@@ -19,7 +19,7 @@ export const _deployESIMWallet = async (client, deviceWalletAddress, salt) => {
|
|
|
19
19
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
20
20
|
if (!client.account)
|
|
21
21
|
throw new MissingEOAWalletError();
|
|
22
|
-
return client
|
|
22
|
+
return writeContractOrThrow(client, {
|
|
23
23
|
address: deviceWalletAddress,
|
|
24
24
|
chain: values.chain,
|
|
25
25
|
account: client.account.address,
|
|
@@ -41,7 +41,7 @@ export const _addDeposit = async (client, deviceWalletAddress, amount) => {
|
|
|
41
41
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
42
42
|
if (!client.account)
|
|
43
43
|
throw new MissingEOAWalletError();
|
|
44
|
-
return client
|
|
44
|
+
return writeContractOrThrow(client, {
|
|
45
45
|
address: deviceWalletAddress,
|
|
46
46
|
chain: values.chain,
|
|
47
47
|
account: client.account.address,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _getChainSpecificConstants } from "../constants.js";
|
|
2
|
-
import { MissingEOAWalletError } from "../errors.js";
|
|
2
|
+
import { MissingEOAWalletError, writeContractOrThrow } from "../errors.js";
|
|
3
3
|
import { DeviceWalletFactory } from "../../abis/index.js";
|
|
4
4
|
// Admin-EOA logic for `DeviceWalletFactory`.
|
|
5
5
|
//
|
|
@@ -24,7 +24,7 @@ export const _deployDeviceWalletForUsers = async (client, deviceUniqueIdentifier
|
|
|
24
24
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
25
25
|
if (!client.account)
|
|
26
26
|
throw new MissingEOAWalletError();
|
|
27
|
-
return client
|
|
27
|
+
return writeContractOrThrow(client, {
|
|
28
28
|
address: values.factoryAddresses.DEVICE_WALLET_FACTORY,
|
|
29
29
|
chain: values.chain,
|
|
30
30
|
account: client.account.address,
|
|
@@ -45,7 +45,7 @@ export const _postCreateAccount = async (client, deviceWallet, deviceUniqueIdent
|
|
|
45
45
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
46
46
|
if (!client.account)
|
|
47
47
|
throw new MissingEOAWalletError();
|
|
48
|
-
return client
|
|
48
|
+
return writeContractOrThrow(client, {
|
|
49
49
|
address: values.factoryAddresses.DEVICE_WALLET_FACTORY,
|
|
50
50
|
chain: values.chain,
|
|
51
51
|
account: client.account.address,
|
|
@@ -61,7 +61,7 @@ export const _addRegistryAddress = async (client, registryContractAddress) => {
|
|
|
61
61
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
62
62
|
if (!client.account)
|
|
63
63
|
throw new MissingEOAWalletError();
|
|
64
|
-
return client
|
|
64
|
+
return writeContractOrThrow(client, {
|
|
65
65
|
address: values.factoryAddresses.DEVICE_WALLET_FACTORY,
|
|
66
66
|
chain: values.chain,
|
|
67
67
|
account: client.account.address,
|
|
@@ -77,7 +77,7 @@ export const _updateDeviceWalletImplementation = async (client, newDeviceImpl) =
|
|
|
77
77
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
78
78
|
if (!client.account)
|
|
79
79
|
throw new MissingEOAWalletError();
|
|
80
|
-
return client
|
|
80
|
+
return writeContractOrThrow(client, {
|
|
81
81
|
address: values.factoryAddresses.DEVICE_WALLET_FACTORY,
|
|
82
82
|
chain: values.chain,
|
|
83
83
|
account: client.account.address,
|
|
@@ -143,7 +143,7 @@ export const _acceptOwnership = async (client) => {
|
|
|
143
143
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
144
144
|
if (!client.account)
|
|
145
145
|
throw new MissingEOAWalletError();
|
|
146
|
-
return client
|
|
146
|
+
return writeContractOrThrow(client, {
|
|
147
147
|
address: values.factoryAddresses.DEVICE_WALLET_FACTORY,
|
|
148
148
|
chain: values.chain,
|
|
149
149
|
account: client.account.address,
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { _getChainSpecificConstants } from "../constants.js";
|
|
2
|
-
import { MissingEOAWalletError } from "../errors.js";
|
|
2
|
+
import { MissingEOAWalletError, writeContractOrThrow } from "../errors.js";
|
|
3
3
|
import { ESIMWallet } from "../../abis/index.js";
|
|
4
4
|
// Admin-EOA logic targeting a specific `ESIMWallet` instance (address passed in).
|
|
5
|
-
// `
|
|
6
|
-
// call it directly.
|
|
5
|
+
// `buyDataBundleWithToken` is `onlyDeviceWalletOrESIMWalletAdmin`, so the admin
|
|
6
|
+
// EOA can call it directly.
|
|
7
7
|
/**
|
|
8
|
-
* Buy a data bundle
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Buy a data bundle in `asset`, an ERC-20 the payment adapter accepts.
|
|
9
|
+
* `onlyDeviceWalletOrESIMWalletAdmin`.
|
|
10
|
+
*
|
|
11
|
+
* `maxAmountIn` is the most of `asset` the buyer will spend, in its smallest
|
|
12
|
+
* unit - read it from `paymentAdapter.quote(asset, dataBundleDetails.priceUSDCents)`
|
|
13
|
+
* first. `paymentReference` ties this purchase to its offchain order and is
|
|
14
|
+
* spendable once per eSIM wallet.
|
|
12
15
|
*/
|
|
13
|
-
export const
|
|
16
|
+
export const _buyDataBundleWithToken = async (client, eSIMWalletAddress, dataBundleDetails, asset, maxAmountIn, paymentReference) => {
|
|
14
17
|
const chainID = await client.getChainId();
|
|
15
18
|
const rpcURL = client.transport.url;
|
|
16
19
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
17
20
|
if (!client.account)
|
|
18
21
|
throw new MissingEOAWalletError();
|
|
19
|
-
return client
|
|
22
|
+
return writeContractOrThrow(client, {
|
|
20
23
|
address: eSIMWalletAddress,
|
|
21
24
|
chain: values.chain,
|
|
22
25
|
account: client.account.address,
|
|
23
26
|
abi: ESIMWallet,
|
|
24
|
-
functionName: '
|
|
25
|
-
args: [dataBundleDetails]
|
|
26
|
-
value
|
|
27
|
+
functionName: 'buyDataBundleWithToken',
|
|
28
|
+
args: [dataBundleDetails, asset, maxAmountIn, paymentReference]
|
|
27
29
|
});
|
|
28
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _getChainSpecificConstants } from "../constants.js";
|
|
2
|
-
import { MissingEOAWalletError } from "../errors.js";
|
|
2
|
+
import { MissingEOAWalletError, writeContractOrThrow } from "../errors.js";
|
|
3
3
|
import { ESIMWalletFactory } from "../../abis/index.js";
|
|
4
4
|
// Admin-EOA logic for `ESIMWalletFactory`. Both functions are owner-gated
|
|
5
5
|
// (`addRegistryAddress` requires `msg.sender == owner()`, `updateESIMWalletImplementation`
|
|
@@ -19,7 +19,7 @@ export const _addRegistryAddress = async (client, registryContractAddress) => {
|
|
|
19
19
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
20
20
|
if (!client.account)
|
|
21
21
|
throw new MissingEOAWalletError();
|
|
22
|
-
return client
|
|
22
|
+
return writeContractOrThrow(client, {
|
|
23
23
|
address: values.factoryAddresses.ESIM_WALLET_FACTORY,
|
|
24
24
|
chain: values.chain,
|
|
25
25
|
account: client.account.address,
|
|
@@ -35,7 +35,7 @@ export const _updateESIMWalletImplementation = async (client, eSIMWalletImpl) =>
|
|
|
35
35
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
36
36
|
if (!client.account)
|
|
37
37
|
throw new MissingEOAWalletError();
|
|
38
|
-
return client
|
|
38
|
+
return writeContractOrThrow(client, {
|
|
39
39
|
address: values.factoryAddresses.ESIM_WALLET_FACTORY,
|
|
40
40
|
chain: values.chain,
|
|
41
41
|
account: client.account.address,
|
|
@@ -100,7 +100,7 @@ export const _acceptOwnership = async (client) => {
|
|
|
100
100
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
101
101
|
if (!client.account)
|
|
102
102
|
throw new MissingEOAWalletError();
|
|
103
|
-
return client
|
|
103
|
+
return writeContractOrThrow(client, {
|
|
104
104
|
address: values.factoryAddresses.ESIM_WALLET_FACTORY,
|
|
105
105
|
chain: values.chain,
|
|
106
106
|
account: client.account.address,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseError, ContractFunctionRevertedError, isAddressEqual, parseEventLogs, publicActions, } from "viem";
|
|
2
2
|
import { _getChainSpecificConstants } from "../constants.js";
|
|
3
|
-
import { BatchSizeOutOfRangeError, DepositOnResumeError, ESIMWalletNotLazyDeployedError, MissingBatchEventError, MissingEOAWalletError, StalledBatchError, } from "../errors.js";
|
|
3
|
+
import { BatchSizeOutOfRangeError, DepositOnResumeError, ESIMWalletNotLazyDeployedError, MissingBatchEventError, MissingEOAWalletError, StalledBatchError, writeContractOrThrow, } from "../errors.js";
|
|
4
4
|
import { LazyWalletRegistry, Registry } from "../../abis/index.js";
|
|
5
5
|
import { _eSIMWalletsDeployed, _lazyDeployedESIMWallet } from "./reads/lazyWalletRegistry.reads.js";
|
|
6
6
|
// Admin-EOA logic for `LazyWalletRegistry`. Every function here is
|
|
@@ -45,7 +45,7 @@ export const _batchPopulateHistory = async (client, deviceUniqueIdentifiers, eSI
|
|
|
45
45
|
const values = await _resolve(client);
|
|
46
46
|
if (!client.account)
|
|
47
47
|
throw new MissingEOAWalletError();
|
|
48
|
-
return client
|
|
48
|
+
return writeContractOrThrow(client, {
|
|
49
49
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
50
50
|
chain: values.chain,
|
|
51
51
|
account: client.account.address,
|
|
@@ -67,7 +67,7 @@ export const _deployLazyWalletAndSetESIMIdentifier = async (client, deviceOwnerP
|
|
|
67
67
|
const values = await _resolve(client);
|
|
68
68
|
if (!client.account)
|
|
69
69
|
throw new MissingEOAWalletError();
|
|
70
|
-
return client
|
|
70
|
+
return writeContractOrThrow(client, {
|
|
71
71
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
72
72
|
chain: values.chain,
|
|
73
73
|
account: client.account.address,
|
|
@@ -90,7 +90,7 @@ export const _deployMoreESIMWalletsForLazyDevice = async (client, deviceUniqueId
|
|
|
90
90
|
const values = await _resolve(client);
|
|
91
91
|
if (!client.account)
|
|
92
92
|
throw new MissingEOAWalletError();
|
|
93
|
-
return client
|
|
93
|
+
return writeContractOrThrow(client, {
|
|
94
94
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
95
95
|
chain: values.chain,
|
|
96
96
|
account: client.account.address,
|
|
@@ -110,7 +110,7 @@ export const _setHistoryForLazyWallet = async (client, eSIMIdentifier, maxEntrie
|
|
|
110
110
|
const values = await _resolve(client);
|
|
111
111
|
if (!client.account)
|
|
112
112
|
throw new MissingEOAWalletError();
|
|
113
|
-
return client
|
|
113
|
+
return writeContractOrThrow(client, {
|
|
114
114
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
115
115
|
chain: values.chain,
|
|
116
116
|
account: client.account.address,
|
|
@@ -124,7 +124,7 @@ export const _switchESIMIdentifierToNewDeviceIdentifier = async (client, eSIMIde
|
|
|
124
124
|
const values = await _resolve(client);
|
|
125
125
|
if (!client.account)
|
|
126
126
|
throw new MissingEOAWalletError();
|
|
127
|
-
return client
|
|
127
|
+
return writeContractOrThrow(client, {
|
|
128
128
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
129
129
|
chain: values.chain,
|
|
130
130
|
account: client.account.address,
|
|
@@ -362,7 +362,7 @@ export const _acceptOwnership = async (client) => {
|
|
|
362
362
|
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
363
363
|
if (!client.account)
|
|
364
364
|
throw new MissingEOAWalletError();
|
|
365
|
-
return client
|
|
365
|
+
return writeContractOrThrow(client, {
|
|
366
366
|
address: values.factoryAddresses.LAZY_WALLET_REGISTRY,
|
|
367
367
|
chain: values.chain,
|
|
368
368
|
account: client.account.address,
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { _getChainSpecificConstants } from "../constants.js";
|
|
2
|
+
import { MissingEOAWalletError, writeContractOrThrow } from "../errors.js";
|
|
3
|
+
import { PaymentAdapter } from "../../abis/index.js";
|
|
4
|
+
// Admin-EOA logic for `PaymentAdapter`. `registerAsset`/`updateAsset` are
|
|
5
|
+
// `onlyOwner`, so the `client` must carry the `upgradeManager` EOA.
|
|
6
|
+
//
|
|
7
|
+
// On the live deployment the owner is the `ProtocolAdmin` timelock, not an EOA,
|
|
8
|
+
// so either call sent directly reverts. Route them through
|
|
9
|
+
// `protocolAdmin.proposer.schedule` instead, via the payload builders below.
|
|
10
|
+
/** Add a currency the adapter has never seen. Reverts if `_symbol` is already registered. Owner only. */
|
|
11
|
+
export const _registerAsset = async (client, symbol, asset) => {
|
|
12
|
+
const chainID = await client.getChainId();
|
|
13
|
+
const rpcURL = client.transport.url;
|
|
14
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
15
|
+
if (!client.account)
|
|
16
|
+
throw new MissingEOAWalletError();
|
|
17
|
+
return writeContractOrThrow(client, {
|
|
18
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
19
|
+
chain: values.chain,
|
|
20
|
+
account: client.account.address,
|
|
21
|
+
abi: PaymentAdapter,
|
|
22
|
+
functionName: 'registerAsset',
|
|
23
|
+
args: [symbol, asset]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
/** Change a currency already in the table (its decimals, token, or allowed flag). Owner only. */
|
|
27
|
+
export const _updateAsset = async (client, symbol, asset) => {
|
|
28
|
+
const chainID = await client.getChainId();
|
|
29
|
+
const rpcURL = client.transport.url;
|
|
30
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
31
|
+
if (!client.account)
|
|
32
|
+
throw new MissingEOAWalletError();
|
|
33
|
+
return writeContractOrThrow(client, {
|
|
34
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
35
|
+
chain: values.chain,
|
|
36
|
+
account: client.account.address,
|
|
37
|
+
abi: PaymentAdapter,
|
|
38
|
+
functionName: 'updateAsset',
|
|
39
|
+
args: [symbol, asset]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Owner payloads - only reachable through schedule
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// All `onlyOwner`, and on the live deployment the owner is the timelock, so they
|
|
46
|
+
// exist as something to schedule rather than to send. Each returns the
|
|
47
|
+
// `OwnerCall` to hand to `protocolAdmin.schedule`.
|
|
48
|
+
/** Add or change a currency, scheduled through the timelock. Pass the result to `schedule`. */
|
|
49
|
+
export const _registerAssetCall = async (client, symbol, asset) => {
|
|
50
|
+
const chainID = await client.getChainId();
|
|
51
|
+
const rpcURL = client.transport.url;
|
|
52
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
53
|
+
return {
|
|
54
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
55
|
+
abi: PaymentAdapter,
|
|
56
|
+
functionName: 'registerAsset',
|
|
57
|
+
args: [symbol, asset],
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/** Change a currency already in the table, scheduled through the timelock. Pass the result to `schedule`. */
|
|
61
|
+
export const _updateAssetCall = async (client, symbol, asset) => {
|
|
62
|
+
const chainID = await client.getChainId();
|
|
63
|
+
const rpcURL = client.transport.url;
|
|
64
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
65
|
+
return {
|
|
66
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
67
|
+
abi: PaymentAdapter,
|
|
68
|
+
functionName: 'updateAsset',
|
|
69
|
+
args: [symbol, asset],
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Offer ownership to a new address. Pass the result to `schedule`.
|
|
74
|
+
*
|
|
75
|
+
* Ownable2Step, so the offer changes nothing until the named address calls
|
|
76
|
+
* `acceptOwnership`.
|
|
77
|
+
*/
|
|
78
|
+
export const _transferOwnershipCall = async (client, newOwner) => {
|
|
79
|
+
const chainID = await client.getChainId();
|
|
80
|
+
const rpcURL = client.transport.url;
|
|
81
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
82
|
+
return {
|
|
83
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
84
|
+
abi: PaymentAdapter,
|
|
85
|
+
functionName: 'transferOwnership',
|
|
86
|
+
args: [newOwner],
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
/** Point the adapter's proxy at a new implementation. Builds `upgradeToAndCall`. Pass the result to `schedule`. */
|
|
90
|
+
export const _upgradeCall = async (client, newImplementation, data = '0x') => {
|
|
91
|
+
const chainID = await client.getChainId();
|
|
92
|
+
const rpcURL = client.transport.url;
|
|
93
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
94
|
+
return {
|
|
95
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
96
|
+
abi: PaymentAdapter,
|
|
97
|
+
functionName: 'upgradeToAndCall',
|
|
98
|
+
args: [newImplementation, data],
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Take ownership after a `transferOwnership` named this client. `msg.sender`
|
|
103
|
+
* must equal `pendingOwner`, so the `client` is the incoming owner.
|
|
104
|
+
*
|
|
105
|
+
* Where the incoming owner is the timelock, use
|
|
106
|
+
* `protocolAdmin.acceptOwnershipBatch` instead, which accepts for every
|
|
107
|
+
* contract at once.
|
|
108
|
+
*/
|
|
109
|
+
export const _acceptOwnership = async (client) => {
|
|
110
|
+
const chainID = await client.getChainId();
|
|
111
|
+
const rpcURL = client.transport.url;
|
|
112
|
+
const values = _getChainSpecificConstants(chainID, rpcURL);
|
|
113
|
+
if (!client.account)
|
|
114
|
+
throw new MissingEOAWalletError();
|
|
115
|
+
return writeContractOrThrow(client, {
|
|
116
|
+
address: values.factoryAddresses.PAYMENT_ADAPTER,
|
|
117
|
+
chain: values.chain,
|
|
118
|
+
account: client.account.address,
|
|
119
|
+
abi: PaymentAdapter,
|
|
120
|
+
functionName: 'acceptOwnership',
|
|
121
|
+
args: []
|
|
122
|
+
});
|
|
123
|
+
};
|