@nevermined-io/core-kit 0.0.16 → 0.0.17-rc0
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/dist/Instantiable.abstract.d.ts +0 -1
- package/dist/Instantiable.abstract.js +0 -1
- package/dist/artifacts/generated.d.ts +0 -1
- package/dist/contracts/AccessManager.d.ts +0 -1
- package/dist/contracts/AssetRegistry.d.ts +1 -2
- package/dist/contracts/AssetRegistry.js +1 -1
- package/dist/contracts/ContractBase.d.ts +0 -1
- package/dist/contracts/ContractBase.js +0 -3
- package/dist/contracts/ContractsApi.d.ts +0 -1
- package/dist/contracts/ContractsApi.js +0 -43
- package/dist/contracts/FiatPaymentTemplate.d.ts +0 -1
- package/dist/contracts/FiatSettlementCondition.d.ts +0 -1
- package/dist/contracts/FixedPaymentTemplate.d.ts +0 -1
- package/dist/contracts/FixedPaymentTemplate.js +6 -3
- package/dist/contracts/NFT1155Base.d.ts +0 -1
- package/dist/contracts/NFT1155Credits.d.ts +0 -1
- package/dist/contracts/NFT1155ExpirableCredits.d.ts +0 -1
- package/dist/contracts/NVMConfig.d.ts +0 -1
- package/dist/contracts/ProtocolStandardFees.d.ts +1 -2
- package/dist/contracts/Roles.d.ts +0 -1
- package/dist/contracts/index.d.ts +0 -1
- package/dist/errors/NeverminedErrors.d.ts +0 -1
- package/dist/errors/index.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -7
- package/dist/models/AgentAccessToken.d.ts +0 -1
- package/dist/models/AgentAccessToken.js +0 -22
- package/dist/models/Logger.d.ts +0 -1
- package/dist/models/NeverminedOptions.d.ts +0 -1
- package/dist/models/NeverminedOptions.js +6 -26
- package/dist/models/NvmApiKey.d.ts +0 -1
- package/dist/models/NvmApiKey.js +6 -36
- package/dist/models/Transactions.d.ts +0 -1
- package/dist/models/index.d.ts +0 -1
- package/dist/nevermined/DID.d.ts +0 -1
- package/dist/nevermined/DID.js +0 -4
- package/dist/nevermined/Nevermined.d.ts +0 -1
- package/dist/nevermined/Nevermined.js +0 -21
- package/dist/nevermined/api/PaymentsApi.d.ts +1 -2
- package/dist/nevermined/api/PaymentsApi.js +1 -1
- package/dist/nevermined/api/ServicesApi.d.ts +0 -1
- package/dist/nevermined/api/ServicesApi.js +0 -12
- package/dist/nevermined/api/UtilsApi.d.ts +0 -1
- package/dist/nevermined/api/UtilsApi.js +0 -12
- package/dist/nevermined/index.d.ts +0 -1
- package/dist/nevermined/utils/AgentUtils.d.ts +1 -2
- package/dist/nevermined/utils/BlockchainViemUtils.d.ts +0 -1
- package/dist/nevermined/utils/JwtUtils.d.ts +1 -2
- package/dist/nevermined/utils/JwtUtils.js +1 -5
- package/dist/nevermined/utils/SignatureUtils.d.ts +1 -2
- package/dist/nevermined/utils/WebServiceConnector.d.ts +0 -1
- package/dist/nevermined/utils/WebServiceConnector.js +0 -2
- package/dist/nevermined/utils/ZeroDevPolicies.d.ts +0 -1
- package/dist/nevermined/utils/index.d.ts +0 -1
- package/dist/services/Api.d.ts +0 -1
- package/dist/services/MetadataService.d.ts +1 -2
- package/dist/services/MetadataService.js +1 -1
- package/dist/services/Profiles.d.ts +1 -2
- package/dist/services/index.d.ts +0 -1
- package/dist/utils/ConversionTypeHelpers.d.ts +0 -1
- package/dist/utils/Network.d.ts +0 -1
- package/dist/utils/helpers.d.ts +1 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/vendor/commons/index.d.ts +4 -0
- package/dist/vendor/commons/index.js +4 -0
- package/dist/vendor/commons/lib/constants/AssetConstants.d.ts +3 -0
- package/dist/vendor/commons/lib/constants/AssetConstants.js +3 -0
- package/dist/vendor/commons/lib/constants/index.d.ts +2 -0
- package/dist/vendor/commons/lib/constants/index.js +1 -0
- package/dist/vendor/commons/lib/ddo/DDO.d.ts +39 -0
- package/dist/vendor/commons/lib/ddo/DDO.js +95 -0
- package/dist/vendor/commons/lib/ddo/index.d.ts +1 -0
- package/dist/vendor/commons/lib/ddo/index.js +1 -0
- package/dist/vendor/commons/lib/types/ContractsTypes.d.ts +98 -0
- package/dist/vendor/commons/lib/types/ContractsTypes.js +36 -0
- package/dist/vendor/commons/lib/types/DDOTypes.d.ts +113 -0
- package/dist/vendor/commons/lib/types/DDOTypes.js +14 -0
- package/dist/vendor/commons/lib/types/GeneralTypes.d.ts +19 -0
- package/dist/vendor/commons/lib/types/GeneralTypes.js +1 -0
- package/dist/vendor/commons/lib/types/MetadataTypes.d.ts +120 -0
- package/dist/vendor/commons/lib/types/MetadataTypes.js +57 -0
- package/dist/vendor/commons/lib/types/TranscoderTypes.d.ts +27 -0
- package/dist/vendor/commons/lib/types/TranscoderTypes.js +30 -0
- package/dist/vendor/commons/lib/types/index.d.ts +6 -0
- package/dist/vendor/commons/lib/types/index.js +6 -0
- package/dist/vendor/commons/lib/types/types.d.ts +202 -0
- package/dist/vendor/commons/lib/types/types.js +140 -0
- package/package.json +20 -1
- package/dist/Instantiable.abstract.d.ts.map +0 -1
- package/dist/artifacts/generated.d.ts.map +0 -1
- package/dist/contracts/AccessManager.d.ts.map +0 -1
- package/dist/contracts/AssetRegistry.d.ts.map +0 -1
- package/dist/contracts/ContractBase.d.ts.map +0 -1
- package/dist/contracts/ContractsApi.d.ts.map +0 -1
- package/dist/contracts/FiatPaymentTemplate.d.ts.map +0 -1
- package/dist/contracts/FiatSettlementCondition.d.ts.map +0 -1
- package/dist/contracts/FixedPaymentTemplate.d.ts.map +0 -1
- package/dist/contracts/NFT1155Base.d.ts.map +0 -1
- package/dist/contracts/NFT1155Credits.d.ts.map +0 -1
- package/dist/contracts/NFT1155ExpirableCredits.d.ts.map +0 -1
- package/dist/contracts/NVMConfig.d.ts.map +0 -1
- package/dist/contracts/ProtocolStandardFees.d.ts.map +0 -1
- package/dist/contracts/Roles.d.ts.map +0 -1
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/errors/NeverminedErrors.d.ts.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/models/AgentAccessToken.d.ts.map +0 -1
- package/dist/models/Logger.d.ts.map +0 -1
- package/dist/models/NeverminedOptions.d.ts.map +0 -1
- package/dist/models/NvmApiKey.d.ts.map +0 -1
- package/dist/models/Transactions.d.ts.map +0 -1
- package/dist/models/index.d.ts.map +0 -1
- package/dist/nevermined/DID.d.ts.map +0 -1
- package/dist/nevermined/Nevermined.d.ts.map +0 -1
- package/dist/nevermined/api/PaymentsApi.d.ts.map +0 -1
- package/dist/nevermined/api/ServicesApi.d.ts.map +0 -1
- package/dist/nevermined/api/UtilsApi.d.ts.map +0 -1
- package/dist/nevermined/index.d.ts.map +0 -1
- package/dist/nevermined/utils/AgentUtils.d.ts.map +0 -1
- package/dist/nevermined/utils/BlockchainViemUtils.d.ts.map +0 -1
- package/dist/nevermined/utils/JwtUtils.d.ts.map +0 -1
- package/dist/nevermined/utils/SignatureUtils.d.ts.map +0 -1
- package/dist/nevermined/utils/WebServiceConnector.d.ts.map +0 -1
- package/dist/nevermined/utils/ZeroDevPolicies.d.ts.map +0 -1
- package/dist/nevermined/utils/index.d.ts.map +0 -1
- package/dist/services/Api.d.ts.map +0 -1
- package/dist/services/MetadataService.d.ts.map +0 -1
- package/dist/services/Profiles.d.ts.map +0 -1
- package/dist/services/index.d.ts.map +0 -1
- package/dist/utils/ConversionTypeHelpers.d.ts.map +0 -1
- package/dist/utils/Network.d.ts.map +0 -1
- package/dist/utils/helpers.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
|
@@ -30585,4 +30585,3 @@ export declare const uupsUpgradeableAbi: readonly [{
|
|
|
30585
30585
|
}];
|
|
30586
30586
|
readonly name: "UUPSUnsupportedProxiableUUID";
|
|
30587
30587
|
}];
|
|
30588
|
-
//# sourceMappingURL=generated.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreditsConfig, CreditsType, DIDAsset, Plan, PriceConfig } from "../vendor/commons";
|
|
2
2
|
import { Account, Address, Hex, TransactionReceipt } from 'viem';
|
|
3
3
|
import { SmartAccount, UserOperationReceipt } from 'viem/account-abstraction';
|
|
4
4
|
import { InstantiableConfig } from '../Instantiable.abstract.js';
|
|
@@ -66,4 +66,3 @@ export declare class AssetRegistry extends ContractBase {
|
|
|
66
66
|
areNeverminedFeesIncluded(priceConfig: PriceConfig): Promise<boolean>;
|
|
67
67
|
addFeesToPaymentsDistribution(priceConfig: PriceConfig, creditsConfig: CreditsConfig): Promise<[bigint[], string[]]>;
|
|
68
68
|
}
|
|
69
|
-
//# sourceMappingURL=AssetRegistry.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreditsType } from "../vendor/commons";
|
|
2
2
|
import { isAddress } from 'viem';
|
|
3
3
|
import { assetsRegistryConfig, nft1155CreditsAddress, nft1155ExpirableCreditsAddress, oneTimeCreatorHookAddress, protocolStandardFeesAddress, } from '../artifacts/generated.js';
|
|
4
4
|
import { AssetNotFound, PlanNotFound } from '../errors/NeverminedErrors.js';
|
|
@@ -5,9 +5,6 @@ import { Instantiable } from '../Instantiable.abstract.js';
|
|
|
5
5
|
import { getInputsOfFunctionFormatted, getTransactionReceipt } from '../nevermined/index.js';
|
|
6
6
|
import { getChain } from '../utils/Network.js';
|
|
7
7
|
export class ContractBase extends Instantiable {
|
|
8
|
-
contractName;
|
|
9
|
-
contract;
|
|
10
|
-
address;
|
|
11
8
|
constructor(contractName, address) {
|
|
12
9
|
super();
|
|
13
10
|
this.contractName = contractName;
|
|
@@ -20,47 +20,4 @@ export class ContractsApi extends Instantiable {
|
|
|
20
20
|
this.fiatPaymentTemplate = await (await import('./FiatPaymentTemplate.js')).FiatPaymentTemplate.getInstance(this.instanceConfig);
|
|
21
21
|
this.protocolStandardFees = await (await import('./ProtocolStandardFees.js')).ProtocolStandardFees.getInstance(this.instanceConfig);
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Access Manager smart contract instance.
|
|
25
|
-
*/
|
|
26
|
-
accessManager;
|
|
27
|
-
/**
|
|
28
|
-
* Nevermined Config smart contract instance.
|
|
29
|
-
*/
|
|
30
|
-
nvmConfig;
|
|
31
|
-
/**
|
|
32
|
-
* Asset registry smart contract instance.
|
|
33
|
-
*/
|
|
34
|
-
assetRegistry;
|
|
35
|
-
/**
|
|
36
|
-
* NFT1155Credits smart contract instance.
|
|
37
|
-
* Manages non-expirable credits using the ERC-1155 standard.
|
|
38
|
-
* Allows minting, burning and balance checking of credits.
|
|
39
|
-
*/
|
|
40
|
-
nft1155Credits;
|
|
41
|
-
/**
|
|
42
|
-
* NFT1155ExpirableCredits smart contract instance.
|
|
43
|
-
* Manages expirable credits using the ERC-1155 standard.
|
|
44
|
-
* Similar to NFT1155Credits but with an additional expiration mechanism.
|
|
45
|
-
* Credits minted through this contract will expire after a specified duration.
|
|
46
|
-
*/
|
|
47
|
-
nft1155ExpirableCredits;
|
|
48
|
-
/**
|
|
49
|
-
* FixedPaymentTemplate smart contract instance.
|
|
50
|
-
* Handles fixed payment agreements between parties.
|
|
51
|
-
* Used for creating and managing payment agreements with predefined terms.
|
|
52
|
-
*/
|
|
53
|
-
fixedPaymentTemplate;
|
|
54
|
-
/**
|
|
55
|
-
* FiatPaymentTemplate smart contract instance.
|
|
56
|
-
* Handles fiat payment agreements between parties (i.e Stripe).
|
|
57
|
-
* Used for creating and managing payment agreements with predefined terms.
|
|
58
|
-
*/
|
|
59
|
-
fiatPaymentTemplate;
|
|
60
|
-
/**
|
|
61
|
-
* ProtocolStandardFees smart contract instance.
|
|
62
|
-
* It provides methods to calculate fees based on total amounts, price configurations, and credits configurations.
|
|
63
|
-
* This is the default fee controller for the protocol.
|
|
64
|
-
*/
|
|
65
|
-
protocolStandardFees;
|
|
66
23
|
}
|
|
@@ -7,4 +7,3 @@ export declare class FiatPaymentTemplate extends ContractBase {
|
|
|
7
7
|
static getInstance(config: InstantiableConfig): Promise<FiatPaymentTemplate>;
|
|
8
8
|
createAgreement(planId: bigint, creditsReceiver: Address, owner: Account | SmartAccount, txParams?: TxParameters): Promise<import("viem").TransactionReceipt | import("viem/account-abstraction").UserOperationReceipt>;
|
|
9
9
|
}
|
|
10
|
-
//# sourceMappingURL=FiatPaymentTemplate.d.ts.map
|
|
@@ -8,4 +8,3 @@ export declare class FiatSettlementCondition extends ContractBase {
|
|
|
8
8
|
getFiatSettlementRole(): Promise<bigint>;
|
|
9
9
|
createAgreement(planId: bigint, planReceiver: Address, owner: Account | SmartAccount, txParams?: TxParameters): Promise<import("viem").TransactionReceipt | import("viem/account-abstraction").UserOperationReceipt>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=FiatSettlementCondition.d.ts.map
|
|
@@ -10,4 +10,3 @@ export declare class FixedPaymentTemplate extends ContractBase {
|
|
|
10
10
|
approveERC20(totalAmount: bigint, tokenAddress: Address, owner: Account | SmartAccount, txParams?: TxParameters): Promise<import("viem").TransactionReceipt | undefined>;
|
|
11
11
|
createAgreementWithApprovals(planId: bigint, totalAmount: bigint, tokenAddress: Address, owner: Account | SmartAccount, txParams?: TxParameters): Promise<import("viem").TransactionReceipt | undefined>;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=FixedPaymentTemplate.d.ts.map
|
|
@@ -3,9 +3,12 @@ import { fixedPaymentTemplateConfig, lockPaymentConditionAddress, paymentsVaultA
|
|
|
3
3
|
import { generateZeroXId } from '../utils/helpers.js';
|
|
4
4
|
import { ContractBase } from './ContractBase.js';
|
|
5
5
|
export class FixedPaymentTemplate extends ContractBase {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.TOKEN_APPROVE_ABI = parseAbi([
|
|
9
|
+
'function approve(address spender, uint256 amount) external returns (bool)',
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
9
12
|
static async getInstance(config) {
|
|
10
13
|
const fixedPaymentTemplate = new FixedPaymentTemplate('FixedPaymentTemplate', fixedPaymentTemplateConfig.address);
|
|
11
14
|
await fixedPaymentTemplate.init(config, fixedPaymentTemplateConfig);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { InstantiableConfig } from '../Instantiable.abstract.js';
|
|
2
2
|
import { ContractBase } from './ContractBase.js';
|
|
3
|
-
import {
|
|
3
|
+
import { CreditsConfig, PriceConfig } from "../vendor/commons";
|
|
4
4
|
export declare class ProtocolStandardFees extends ContractBase {
|
|
5
5
|
static getInstance(config: InstantiableConfig): Promise<ProtocolStandardFees>;
|
|
6
6
|
calculateFee(totalAmount: bigint, priceConfig: PriceConfig, creditsConfig: CreditsConfig): Promise<any>;
|
|
7
7
|
getFeeRates(): Promise<any>;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=ProtocolStandardFees.d.ts.map
|
|
@@ -10,4 +10,3 @@ export declare const FIAT_SETTLEMENT_ROLE = 3860893312041324254n;
|
|
|
10
10
|
export declare const CREDITS_BURNER_ROLE = 16934877136143260882n;
|
|
11
11
|
export declare const CREDITS_TRANSFER_ROLE = 11914029060103770296n;
|
|
12
12
|
export declare const NVM_INFRA_ADMIN_ROLE = 7924818820658164977n;
|
|
13
|
-
//# sourceMappingURL=Roles.d.ts.map
|
package/dist/errors/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./contracts/index";
|
|
2
|
+
export * from "./models/index";
|
|
3
|
+
export * from "./nevermined/index";
|
|
4
|
+
export * from "./nevermined/Nevermined";
|
|
5
|
+
export * from "./errors/index";
|
|
6
|
+
export * from "./Instantiable.abstract";
|
|
7
7
|
// Utils
|
|
8
|
-
export * from
|
|
8
|
+
export * from "./utils/index";
|
|
@@ -3,28 +3,6 @@ import { getChecksumAddress } from '../nevermined/utils/BlockchainViemUtils.js';
|
|
|
3
3
|
import { EthSignJWT } from '../nevermined/utils/JwtUtils.js';
|
|
4
4
|
import { SignatureUtils } from '../nevermined/utils/SignatureUtils.js';
|
|
5
5
|
export class AgentAccessToken {
|
|
6
|
-
/**
|
|
7
|
-
* The version of the access token
|
|
8
|
-
*/
|
|
9
|
-
ver;
|
|
10
|
-
/**
|
|
11
|
-
* The authorization token used to query the agent.
|
|
12
|
-
* This token is validated by the agent or proxy to ensure the request is authorized
|
|
13
|
-
* {@see {@link AgentAuthTokenParams}}
|
|
14
|
-
*/
|
|
15
|
-
authToken;
|
|
16
|
-
/**
|
|
17
|
-
* The proof generated by the subscriber (sub) to prove the request to query the agent
|
|
18
|
-
* {@see {@link JWTRedemptionProofParams}
|
|
19
|
-
*/
|
|
20
|
-
proof;
|
|
21
|
-
iss;
|
|
22
|
-
sub;
|
|
23
|
-
aud;
|
|
24
|
-
exp;
|
|
25
|
-
iat;
|
|
26
|
-
_signatureUtils;
|
|
27
|
-
_issuerAccount;
|
|
28
6
|
constructor(signatureUtils, issuerAccount) {
|
|
29
7
|
this.ver = '1';
|
|
30
8
|
this._signatureUtils = signatureUtils;
|
package/dist/models/Logger.d.ts
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
export class NeverminedOptions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
web3ProviderUri;
|
|
9
|
-
/**
|
|
10
|
-
* The Nevermined App URL.
|
|
11
|
-
*/
|
|
12
|
-
appUrl;
|
|
13
|
-
backendUrl;
|
|
14
|
-
agentsProxy;
|
|
15
|
-
/**
|
|
16
|
-
* Log level.
|
|
17
|
-
*/
|
|
18
|
-
logLevel = 'info';
|
|
19
|
-
accounts;
|
|
20
|
-
/**
|
|
21
|
-
* ZeroDev project id
|
|
22
|
-
*/
|
|
23
|
-
zeroDevProjectId;
|
|
24
|
-
/**
|
|
25
|
-
* Contracts version
|
|
26
|
-
*/
|
|
27
|
-
contractsVersion;
|
|
2
|
+
constructor() {
|
|
3
|
+
/**
|
|
4
|
+
* Log level.
|
|
5
|
+
*/
|
|
6
|
+
this.logLevel = 'info';
|
|
7
|
+
}
|
|
28
8
|
}
|
package/dist/models/NvmApiKey.js
CHANGED
|
@@ -5,42 +5,12 @@ import { EthSignJWT } from '../nevermined/utils/JwtUtils.js';
|
|
|
5
5
|
import { SignatureUtils } from '../nevermined/utils/SignatureUtils.js';
|
|
6
6
|
import { decryptMessage, encryptMessage, urlSafeBase64Decode } from '../utils/helpers.js';
|
|
7
7
|
export class NvmApiKey {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
aud;
|
|
16
|
-
/**
|
|
17
|
-
* The public address of the account the key is issued for.
|
|
18
|
-
*/
|
|
19
|
-
sub;
|
|
20
|
-
/**
|
|
21
|
-
* The version of the key
|
|
22
|
-
*/
|
|
23
|
-
ver = 'v1';
|
|
24
|
-
/**
|
|
25
|
-
* The ZeroDev session key
|
|
26
|
-
*/
|
|
27
|
-
zsk;
|
|
28
|
-
/**
|
|
29
|
-
* The Marketplace auth token
|
|
30
|
-
*/
|
|
31
|
-
// nvt?: string
|
|
32
|
-
/**
|
|
33
|
-
* JWT Expiration Time
|
|
34
|
-
*
|
|
35
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
|
|
36
|
-
*/
|
|
37
|
-
exp;
|
|
38
|
-
/**
|
|
39
|
-
* JWT Issued At
|
|
40
|
-
*
|
|
41
|
-
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
|
|
42
|
-
*/
|
|
43
|
-
iat;
|
|
8
|
+
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* The version of the key
|
|
11
|
+
*/
|
|
12
|
+
this.ver = 'v1';
|
|
13
|
+
}
|
|
44
14
|
/**
|
|
45
15
|
* It generates a new serialized and encrypted NvmApiKey including the ZeroDev session key and the Marketplace auth token.
|
|
46
16
|
* The string representing this key can be used to authenticate against the Nevermined API.
|
package/dist/models/index.d.ts
CHANGED
package/dist/nevermined/DID.d.ts
CHANGED
package/dist/nevermined/DID.js
CHANGED
|
@@ -45,27 +45,6 @@ export class Nevermined extends Instantiable {
|
|
|
45
45
|
}
|
|
46
46
|
return instance;
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* ContractsApi instance.
|
|
50
|
-
*/
|
|
51
|
-
contracts;
|
|
52
|
-
/**
|
|
53
|
-
* SearchApi API
|
|
54
|
-
*/
|
|
55
|
-
services;
|
|
56
|
-
/**
|
|
57
|
-
* Utils submodule
|
|
58
|
-
*/
|
|
59
|
-
utils;
|
|
60
|
-
payments;
|
|
61
|
-
/**
|
|
62
|
-
* Web3 Clients
|
|
63
|
-
*/
|
|
64
|
-
// public web3: Web3Clients
|
|
65
|
-
/**
|
|
66
|
-
* If contracts are initialized
|
|
67
|
-
*/
|
|
68
|
-
contractsInitialized;
|
|
69
48
|
constructor() {
|
|
70
49
|
super();
|
|
71
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, Address } from 'viem';
|
|
2
2
|
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract.js';
|
|
3
3
|
import { SmartAccount } from 'viem/account-abstraction';
|
|
4
|
-
import {
|
|
4
|
+
import { OrderResult, Plan } from "../../vendor/commons";
|
|
5
5
|
export declare class PaymentsApi extends Instantiable {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new PaymentsApi
|
|
@@ -19,4 +19,3 @@ export declare class PaymentsApi extends Instantiable {
|
|
|
19
19
|
orderFiatPayment(planId: bigint, planReceiver: Address, from: Account | SmartAccount): Promise<OrderResult>;
|
|
20
20
|
orderCryptoPayment(planId: bigint, plan: Plan, from: Account | SmartAccount): Promise<OrderResult>;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=PaymentsApi.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAddress, parseAbi, zeroAddress } from 'viem';
|
|
2
2
|
import { Instantiable } from '../../Instantiable.abstract.js';
|
|
3
|
-
import {
|
|
3
|
+
import { PlanTransactionPaymentType } from "../../vendor/commons";
|
|
4
4
|
import { NotEnoughBalance } from '../../errors/NeverminedErrors.js';
|
|
5
5
|
const TOKEN_BALANCE_ABI = parseAbi(['function balanceOf(address) view returns (uint256)']);
|
|
6
6
|
const GET_FEE_RATES_ABI = parseAbi([
|
|
@@ -6,18 +6,6 @@ import { Profiles } from '../../services/Profiles.js';
|
|
|
6
6
|
* Utils internal submodule of Nevermined.
|
|
7
7
|
*/
|
|
8
8
|
export class ServicesApi extends Instantiable {
|
|
9
|
-
/**
|
|
10
|
-
* Nevermined Node Service
|
|
11
|
-
*/
|
|
12
|
-
api;
|
|
13
|
-
/**
|
|
14
|
-
* Marketplace instance.
|
|
15
|
-
*/
|
|
16
|
-
metadata;
|
|
17
|
-
/**
|
|
18
|
-
* Profiles instance
|
|
19
|
-
*/
|
|
20
|
-
profiles;
|
|
21
9
|
/**
|
|
22
10
|
* Creates a new ServicesApi
|
|
23
11
|
* @param config - Configuration of the Nevermined instance
|
|
@@ -6,18 +6,6 @@ import { WebServiceConnector } from '../utils/WebServiceConnector.js';
|
|
|
6
6
|
* Nevermined Utils API
|
|
7
7
|
*/
|
|
8
8
|
export class UtilsApi extends Instantiable {
|
|
9
|
-
/**
|
|
10
|
-
* Fetch utils.
|
|
11
|
-
*/
|
|
12
|
-
fetch;
|
|
13
|
-
/**
|
|
14
|
-
* Jwt utils.
|
|
15
|
-
*/
|
|
16
|
-
jwt;
|
|
17
|
-
/**
|
|
18
|
-
* Signature utils.
|
|
19
|
-
*/
|
|
20
|
-
signature;
|
|
21
9
|
/**
|
|
22
10
|
* Creates a new AssetsApi
|
|
23
11
|
* @param config - Configuration of the Nevermined instance
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiEndpoint } from "../../vendor/commons";
|
|
2
2
|
export declare function isEndpointRequestedIncluded(requestEndpoint: string, requestedHTTPVerb: string, agentEndpoints: ApiEndpoint[], agentOpenEndpoints?: string[]): {
|
|
3
3
|
matches: boolean;
|
|
4
4
|
urlMatching?: URL;
|
|
5
5
|
verbMatching?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function areUrlsEqualIgnoringQuery(url1: URL, url2: URL): boolean;
|
|
8
|
-
//# sourceMappingURL=AgentUtils.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Eip712Data } from "../../vendor/commons";
|
|
2
2
|
import { type JWSHeaderParameters, SignJWT } from 'jose';
|
|
3
3
|
import { type Account } from 'viem';
|
|
4
4
|
import { SmartAccount } from 'viem/account-abstraction';
|
|
@@ -24,4 +24,3 @@ export declare class JwtUtils extends Instantiable {
|
|
|
24
24
|
static createCompressedJwt(token: string): string;
|
|
25
25
|
static decompressJwt(compressedJwt: string): string;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=JwtUtils.d.ts.map
|
|
@@ -6,7 +6,6 @@ import { urlSafeBase64Decode, urlSafeBase64Encode } from '../../utils/helpers.js
|
|
|
6
6
|
import { getChecksumAddress } from './BlockchainViemUtils.js';
|
|
7
7
|
import { SignatureUtils } from './SignatureUtils.js';
|
|
8
8
|
export class EthSignJWT extends SignJWT {
|
|
9
|
-
protectedHeader;
|
|
10
9
|
setProtectedHeader(protectedHeader) {
|
|
11
10
|
this.protectedHeader = protectedHeader;
|
|
12
11
|
return this;
|
|
@@ -82,10 +81,6 @@ export class EthSignJWT extends SignJWT {
|
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
export class JwtUtils extends Instantiable {
|
|
85
|
-
static CLIENT_ASSERTION_TYPE = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
|
|
86
|
-
// BASE_AUD = '/api/v1/node/services'
|
|
87
|
-
tokenCache;
|
|
88
|
-
signatureUtils;
|
|
89
84
|
constructor(config) {
|
|
90
85
|
super();
|
|
91
86
|
this.setInstanceConfig(config);
|
|
@@ -159,3 +154,4 @@ export class JwtUtils extends Instantiable {
|
|
|
159
154
|
return new TextDecoder().decode(decompressed);
|
|
160
155
|
}
|
|
161
156
|
}
|
|
157
|
+
JwtUtils.CLIENT_ASSERTION_TYPE = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Account, type Hash } from 'viem';
|
|
2
2
|
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TypedDataDomain, TypedDataTypes } from "../../vendor/commons";
|
|
4
4
|
import { SmartAccount } from 'viem/account-abstraction';
|
|
5
5
|
export declare class SignatureUtils extends Instantiable {
|
|
6
6
|
constructor(config: InstantiableConfig);
|
|
@@ -11,4 +11,3 @@ export declare class SignatureUtils extends Instantiable {
|
|
|
11
11
|
static recoverSignerAddress(message: string, signature: string): Promise<string>;
|
|
12
12
|
static hash(seed: string): string;
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=SignatureUtils.d.ts.map
|
|
@@ -16,4 +16,3 @@ export declare const getBurnNFTPolicy: () => import("@zerodev/permissions").Poli
|
|
|
16
16
|
export declare const getRegisterPolicy: () => import("@zerodev/permissions").Policy;
|
|
17
17
|
export declare const buildPolicy: (permissions: string[], contractAddress: `0x${string}`) => import("@zerodev/permissions").Policy;
|
|
18
18
|
export declare const getAllContractsPolicy: (contractAddress: `0x${string}`) => import("@zerodev/permissions").Policy;
|
|
19
|
-
//# sourceMappingURL=ZeroDevPolicies.d.ts.map
|
package/dist/services/Api.d.ts
CHANGED