@totochain/client 0.1.0 → 0.2.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 +52 -28
- package/_cjs/accounts/substrateSigner.js +4 -1
- package/_cjs/actions/attestation/attest.d.cts +14 -9
- package/_cjs/actions/attestation/attest.js +6 -6
- package/_cjs/actions/attestation/index.d.cts +1 -1
- package/_cjs/actions/index.d.cts +1 -1
- package/_cjs/actions/index.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getItemsCount.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getOwner.js +1 -1
- package/_cjs/actions/puzzlePieces/getPendingWildcards.d.cts +8 -0
- package/_cjs/actions/puzzlePieces/getPendingWildcards.js +9 -0
- package/_cjs/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.cts +7 -0
- package/_cjs/actions/puzzlePieces/getTotalPuzzlePiecesMinted.js +8 -0
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.js +1 -1
- package/_cjs/actions/{fractionalNft → puzzlePieces}/index.d.cts +5 -5
- package/_cjs/actions/{fractionalNft → puzzlePieces}/index.js +5 -5
- package/_cjs/actions/puzzlePieces/types.d.cts +5 -0
- package/_cjs/actions/rewardPool/index.d.cts +0 -4
- package/_cjs/actions/rewardPool/index.js +1 -5
- package/_cjs/client/compatibility.d.cts +16 -0
- package/_cjs/client/compatibility.js +60 -0
- package/_cjs/client/createClient.d.cts +2 -0
- package/_cjs/client/createClient.js +11 -0
- package/_cjs/crypto/index.d.cts +0 -2
- package/_cjs/crypto/index.js +1 -4
- package/_cjs/did/didUri.d.cts +11 -0
- package/_cjs/did/didUri.js +14 -0
- package/_cjs/index.d.cts +7 -4
- package/_cjs/index.js +9 -4
- package/_cjs/plugins/index.d.cts +2 -2
- package/_cjs/plugins/index.js +3 -3
- package/_cjs/plugins/{fractionalNft.d.cts → puzzlePieces.d.cts} +7 -10
- package/_cjs/plugins/{fractionalNft.js → puzzlePieces.js} +6 -6
- package/_cjs/plugins/rewardPool.d.cts +0 -5
- package/_cjs/plugins/rewardPool.js +0 -2
- package/_cjs/rpc/call.js +17 -1
- package/_cjs/rpc/definitions.js +49 -65
- package/_cjs/rpc/types.js +8 -12
- package/_esm/accounts/substrateSigner.js +5 -2
- package/_esm/actions/attestation/attest.js +6 -6
- package/_esm/actions/index.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/getItemsCount.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/getOwner.js +1 -1
- package/_esm/actions/puzzlePieces/getPendingWildcards.js +6 -0
- package/_esm/actions/puzzlePieces/getTotalPuzzlePiecesMinted.js +5 -0
- package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.js +1 -1
- package/_esm/actions/{fractionalNft → puzzlePieces}/index.js +2 -2
- package/_esm/actions/rewardPool/index.js +0 -2
- package/_esm/client/compatibility.js +55 -0
- package/_esm/client/createClient.js +11 -0
- package/_esm/crypto/index.js +0 -1
- package/_esm/did/didUri.js +11 -0
- package/_esm/index.js +4 -2
- package/_esm/plugins/index.js +1 -1
- package/_esm/plugins/{fractionalNft.js → puzzlePieces.js} +5 -5
- package/_esm/plugins/rewardPool.js +1 -3
- package/_esm/rpc/call.js +17 -1
- package/_esm/rpc/definitions.js +49 -65
- package/_esm/rpc/types.js +8 -12
- package/_types/accounts/substrateSigner.d.ts.map +1 -1
- package/_types/actions/attestation/attest.d.ts +14 -9
- package/_types/actions/attestation/attest.d.ts.map +1 -1
- package/_types/actions/attestation/index.d.ts +1 -1
- package/_types/actions/attestation/index.d.ts.map +1 -1
- package/_types/actions/index.d.ts +1 -1
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/puzzlePieces/getCollectionsCount.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getItemsCount.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getOwner.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getPendingWildcards.d.ts +8 -0
- package/_types/actions/puzzlePieces/getPendingWildcards.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.ts +7 -0
- package/_types/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getWildcardCollectionId.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getWildcardDistributionMap.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/getWildcardThreshold.d.ts.map +1 -0
- package/_types/actions/{fractionalNft → puzzlePieces}/index.d.ts +5 -5
- package/_types/actions/puzzlePieces/index.d.ts.map +1 -0
- package/_types/actions/puzzlePieces/types.d.ts +5 -0
- package/_types/actions/puzzlePieces/types.d.ts.map +1 -0
- package/_types/actions/rewardPool/index.d.ts +0 -4
- package/_types/actions/rewardPool/index.d.ts.map +1 -1
- package/_types/client/compatibility.d.ts +16 -0
- package/_types/client/compatibility.d.ts.map +1 -0
- package/_types/client/createClient.d.ts +2 -0
- package/_types/client/createClient.d.ts.map +1 -1
- package/_types/crypto/index.d.ts +0 -2
- package/_types/crypto/index.d.ts.map +1 -1
- package/_types/did/didUri.d.ts +11 -0
- package/_types/did/didUri.d.ts.map +1 -0
- package/_types/index.d.ts +7 -4
- package/_types/index.d.ts.map +1 -1
- package/_types/plugins/index.d.ts +2 -2
- package/_types/plugins/index.d.ts.map +1 -1
- package/_types/plugins/{fractionalNft.d.ts → puzzlePieces.d.ts} +7 -10
- package/_types/plugins/puzzlePieces.d.ts.map +1 -0
- package/_types/plugins/rewardPool.d.ts +0 -5
- package/_types/plugins/rewardPool.d.ts.map +1 -1
- package/_types/rpc/call.d.ts.map +1 -1
- package/_types/rpc/definitions.d.ts.map +1 -1
- package/_types/rpc/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/_cjs/actions/fractionalNft/getNftInfo.d.cts +0 -9
- package/_cjs/actions/fractionalNft/getNftInfo.js +0 -12
- package/_cjs/actions/fractionalNft/getTotalFnftsMinted.d.cts +0 -7
- package/_cjs/actions/fractionalNft/getTotalFnftsMinted.js +0 -8
- package/_cjs/actions/fractionalNft/types.d.cts +0 -10
- package/_cjs/actions/rewardPool/getCollectionIds.d.cts +0 -7
- package/_cjs/actions/rewardPool/getCollectionIds.js +0 -8
- package/_cjs/actions/rewardPool/getItemIds.d.cts +0 -8
- package/_cjs/actions/rewardPool/getItemIds.js +0 -8
- package/_cjs/crypto/claimHash.d.cts +0 -23
- package/_cjs/crypto/claimHash.js +0 -38
- package/_esm/actions/fractionalNft/getNftInfo.js +0 -9
- package/_esm/actions/fractionalNft/getTotalFnftsMinted.js +0 -5
- package/_esm/actions/rewardPool/getCollectionIds.js +0 -5
- package/_esm/actions/rewardPool/getItemIds.js +0 -5
- package/_esm/crypto/claimHash.js +0 -34
- package/_types/actions/fractionalNft/getCollectionsCount.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getItemsCount.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getNftInfo.d.ts +0 -9
- package/_types/actions/fractionalNft/getNftInfo.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getOwner.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts +0 -7
- package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getWildcardCollectionId.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getWildcardDistributionMap.d.ts.map +0 -1
- package/_types/actions/fractionalNft/getWildcardThreshold.d.ts.map +0 -1
- package/_types/actions/fractionalNft/index.d.ts.map +0 -1
- package/_types/actions/fractionalNft/types.d.ts +0 -10
- package/_types/actions/fractionalNft/types.d.ts.map +0 -1
- package/_types/actions/rewardPool/getCollectionIds.d.ts +0 -7
- package/_types/actions/rewardPool/getCollectionIds.d.ts.map +0 -1
- package/_types/actions/rewardPool/getItemIds.d.ts +0 -8
- package/_types/actions/rewardPool/getItemIds.d.ts.map +0 -1
- package/_types/crypto/claimHash.d.ts +0 -23
- package/_types/crypto/claimHash.d.ts.map +0 -1
- package/_types/plugins/fractionalNft.d.ts.map +0 -1
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getItemsCount.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getOwner.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.d.cts +0 -0
- /package/_cjs/actions/{fractionalNft → puzzlePieces}/types.js +0 -0
- /package/_esm/actions/{fractionalNft → puzzlePieces}/types.js +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.d.ts +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getItemsCount.d.ts +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getOwner.d.ts +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.d.ts +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.d.ts +0 -0
- /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.cjs';
|
|
2
|
-
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
-
import type { NftInfo } from './types.cjs';
|
|
4
|
-
export interface GetNftInfoParameters {
|
|
5
|
-
collectionId: number;
|
|
6
|
-
at?: BlockHash;
|
|
7
|
-
}
|
|
8
|
-
export declare function getNftInfo(client: Client, { collectionId, at }: GetNftInfoParameters): Promise<NftInfo>;
|
|
9
|
-
//# sourceMappingURL=getNftInfo.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNftInfo = getNftInfo;
|
|
4
|
-
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
-
async function getNftInfo(client, { collectionId, at }) {
|
|
6
|
-
const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'nftInfo', collectionId, at);
|
|
7
|
-
const info = result.toJSON();
|
|
8
|
-
return {
|
|
9
|
-
address: (info.address ?? '0x'),
|
|
10
|
-
tokenId: BigInt(info.tokenId ?? info.token_id ?? 0),
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.cjs';
|
|
2
|
-
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
-
export interface GetTotalFnftsMintedParameters {
|
|
4
|
-
at?: BlockHash;
|
|
5
|
-
}
|
|
6
|
-
export declare function getTotalFnftsMinted(client: Client, { at }?: GetTotalFnftsMintedParameters): Promise<number | null>;
|
|
7
|
-
//# sourceMappingURL=getTotalFnftsMinted.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTotalFnftsMinted = getTotalFnftsMinted;
|
|
4
|
-
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
-
async function getTotalFnftsMinted(client, { at } = {}) {
|
|
6
|
-
const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'totalFnftsMinted', at);
|
|
7
|
-
return result.isSome ? result.unwrap().toNumber() : null;
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.cjs';
|
|
2
|
-
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
-
export interface GetCollectionIdsParameters {
|
|
4
|
-
at?: BlockHash;
|
|
5
|
-
}
|
|
6
|
-
export declare function getCollectionIds(client: Client, { at }?: GetCollectionIdsParameters): Promise<number[]>;
|
|
7
|
-
//# sourceMappingURL=getCollectionIds.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCollectionIds = getCollectionIds;
|
|
4
|
-
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
-
async function getCollectionIds(client, { at } = {}) {
|
|
6
|
-
const result = await (0, call_js_1.callRpc)(client, 'rewardPool', 'collectionIds', at);
|
|
7
|
-
return result.toJSON() ?? [];
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.cjs';
|
|
2
|
-
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
-
export interface GetItemIdsParameters {
|
|
4
|
-
collectionId: number;
|
|
5
|
-
at?: BlockHash;
|
|
6
|
-
}
|
|
7
|
-
export declare function getItemIds(client: Client, { collectionId, at }: GetItemIdsParameters): Promise<number[]>;
|
|
8
|
-
//# sourceMappingURL=getItemIds.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getItemIds = getItemIds;
|
|
4
|
-
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
-
async function getItemIds(client, { collectionId, at }) {
|
|
6
|
-
const result = await (0, call_js_1.callRpc)(client, 'rewardPool', 'itemIds', collectionId, at);
|
|
7
|
-
return result.toJSON() ?? [];
|
|
8
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '../types/index.cjs';
|
|
2
|
-
export type DidUri = `did:toto:${string}`;
|
|
3
|
-
export interface DeriveClaimHashParameters {
|
|
4
|
-
ctypeHash: Hash;
|
|
5
|
-
subject: DidUri;
|
|
6
|
-
contents: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
export declare function deriveClaimHash({ ctypeHash, subject, contents }: DeriveClaimHashParameters): Hash;
|
|
9
|
-
/**
|
|
10
|
-
* Renders an address as the DID URI the attestation flow uses as a claim-hash input.
|
|
11
|
-
*
|
|
12
|
-
* The address is passed through verbatim, case included. That looks like an oversight and is
|
|
13
|
-
* not: the DID string is part of the claim-hash preimage, and the issuer builds it from an
|
|
14
|
-
* EIP-55 checksummed address, so normalising the case here would derive a different hash than
|
|
15
|
-
* the one stored against an existing attestation and make it unfindable.
|
|
16
|
-
*
|
|
17
|
-
* Nothing on chain settles the question. `attestation.add` takes a typed H160 subject and an
|
|
18
|
-
* opaque claim hash; the DID string never reaches the runtime, and `pallet_did::did_uri` renders
|
|
19
|
-
* lowercase only to pin a format for tests. Casing is therefore whatever the issuer used, and
|
|
20
|
-
* matching it is this function's whole job.
|
|
21
|
-
*/
|
|
22
|
-
export declare function didUri(address: `0x${string}`): DidUri;
|
|
23
|
-
//# sourceMappingURL=claimHash.d.ts.map
|
package/_cjs/crypto/claimHash.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deriveClaimHash = deriveClaimHash;
|
|
4
|
-
exports.didUri = didUri;
|
|
5
|
-
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
6
|
-
const util_1 = require("@polkadot/util");
|
|
7
|
-
function deriveClaimHash({ ctypeHash, subject, contents }) {
|
|
8
|
-
const vocabulary = `toto:ctype:${ctypeHash}#`;
|
|
9
|
-
const expanded = { '@id': subject };
|
|
10
|
-
for (const [key, value] of Object.entries(contents)) {
|
|
11
|
-
expanded[vocabulary + key] = value;
|
|
12
|
-
}
|
|
13
|
-
const digests = Object.entries(expanded)
|
|
14
|
-
.map(([key, value]) => JSON.stringify({ [key]: value }))
|
|
15
|
-
.map((statement) => (0, util_crypto_1.blake2AsHex)((0, util_crypto_1.blake2AsHex)(statement, 256), 256))
|
|
16
|
-
.sort((a, b) => {
|
|
17
|
-
const left = BigInt(a);
|
|
18
|
-
const right = BigInt(b);
|
|
19
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
20
|
-
});
|
|
21
|
-
return (0, util_1.u8aToHex)((0, util_crypto_1.blake2AsU8a)((0, util_1.u8aConcat)(...digests.map((digest) => (0, util_1.hexToU8a)(digest))), 256));
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Renders an address as the DID URI the attestation flow uses as a claim-hash input.
|
|
25
|
-
*
|
|
26
|
-
* The address is passed through verbatim, case included. That looks like an oversight and is
|
|
27
|
-
* not: the DID string is part of the claim-hash preimage, and the issuer builds it from an
|
|
28
|
-
* EIP-55 checksummed address, so normalising the case here would derive a different hash than
|
|
29
|
-
* the one stored against an existing attestation and make it unfindable.
|
|
30
|
-
*
|
|
31
|
-
* Nothing on chain settles the question. `attestation.add` takes a typed H160 subject and an
|
|
32
|
-
* opaque claim hash; the DID string never reaches the runtime, and `pallet_did::did_uri` renders
|
|
33
|
-
* lowercase only to pin a format for tests. Casing is therefore whatever the issuer used, and
|
|
34
|
-
* matching it is this function's whole job.
|
|
35
|
-
*/
|
|
36
|
-
function didUri(address) {
|
|
37
|
-
return `did:toto:${address.slice(2)}`;
|
|
38
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { callRpc } from '../../rpc/call.js';
|
|
2
|
-
export async function getNftInfo(client, { collectionId, at }) {
|
|
3
|
-
const result = await callRpc(client, 'fractionalNft', 'nftInfo', collectionId, at);
|
|
4
|
-
const info = result.toJSON();
|
|
5
|
-
return {
|
|
6
|
-
address: (info.address ?? '0x'),
|
|
7
|
-
tokenId: BigInt(info.tokenId ?? info.token_id ?? 0),
|
|
8
|
-
};
|
|
9
|
-
}
|
package/_esm/crypto/claimHash.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { blake2AsHex, blake2AsU8a } from '@polkadot/util-crypto';
|
|
2
|
-
import { hexToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
|
3
|
-
export function deriveClaimHash({ ctypeHash, subject, contents }) {
|
|
4
|
-
const vocabulary = `toto:ctype:${ctypeHash}#`;
|
|
5
|
-
const expanded = { '@id': subject };
|
|
6
|
-
for (const [key, value] of Object.entries(contents)) {
|
|
7
|
-
expanded[vocabulary + key] = value;
|
|
8
|
-
}
|
|
9
|
-
const digests = Object.entries(expanded)
|
|
10
|
-
.map(([key, value]) => JSON.stringify({ [key]: value }))
|
|
11
|
-
.map((statement) => blake2AsHex(blake2AsHex(statement, 256), 256))
|
|
12
|
-
.sort((a, b) => {
|
|
13
|
-
const left = BigInt(a);
|
|
14
|
-
const right = BigInt(b);
|
|
15
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
16
|
-
});
|
|
17
|
-
return u8aToHex(blake2AsU8a(u8aConcat(...digests.map((digest) => hexToU8a(digest))), 256));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Renders an address as the DID URI the attestation flow uses as a claim-hash input.
|
|
21
|
-
*
|
|
22
|
-
* The address is passed through verbatim, case included. That looks like an oversight and is
|
|
23
|
-
* not: the DID string is part of the claim-hash preimage, and the issuer builds it from an
|
|
24
|
-
* EIP-55 checksummed address, so normalising the case here would derive a different hash than
|
|
25
|
-
* the one stored against an existing attestation and make it unfindable.
|
|
26
|
-
*
|
|
27
|
-
* Nothing on chain settles the question. `attestation.add` takes a typed H160 subject and an
|
|
28
|
-
* opaque claim hash; the DID string never reaches the runtime, and `pallet_did::did_uri` renders
|
|
29
|
-
* lowercase only to pin a format for tests. Casing is therefore whatever the issuer used, and
|
|
30
|
-
* matching it is this function's whole job.
|
|
31
|
-
*/
|
|
32
|
-
export function didUri(address) {
|
|
33
|
-
return `did:toto:${address.slice(2)}`;
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCollectionsCount.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getCollectionsCount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,6BAAkC,GACzC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getItemsCount.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getItemsCount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,uBAAuB,GAC5C,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.js';
|
|
2
|
-
import type { BlockHash } from '../../types/index.js';
|
|
3
|
-
import type { NftInfo } from './types.js';
|
|
4
|
-
export interface GetNftInfoParameters {
|
|
5
|
-
collectionId: number;
|
|
6
|
-
at?: BlockHash;
|
|
7
|
-
}
|
|
8
|
-
export declare function getNftInfo(client: Client, { collectionId, at }: GetNftInfoParameters): Promise<NftInfo>;
|
|
9
|
-
//# sourceMappingURL=getNftInfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNftInfo.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getNftInfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAW,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,oBAAoB,GACzC,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOwner.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getOwner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,EACd,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAC/C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAUzB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.js';
|
|
2
|
-
import type { BlockHash } from '../../types/index.js';
|
|
3
|
-
export interface GetTotalFnftsMintedParameters {
|
|
4
|
-
at?: BlockHash;
|
|
5
|
-
}
|
|
6
|
-
export declare function getTotalFnftsMinted(client: Client, { at }?: GetTotalFnftsMintedParameters): Promise<number | null>;
|
|
7
|
-
//# sourceMappingURL=getTotalFnftsMinted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTotalFnftsMinted.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getTotalFnftsMinted.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,6BAAkC,GACzC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getWildcardCollectionId.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getWildcardCollectionId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,iCAAiC;IAChD,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,iCAAsC,GAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getWildcardDistributionMap.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getWildcardDistributionMap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,WAAW,oCAAoC;IACnD,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,oCAAyC,GAChD,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAIjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getWildcardThreshold.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/getWildcardThreshold.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,8BAA8B;IAC7C,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,8BAAmC,GAC1C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACtF,YAAY,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AAC5F,YAAY,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/actions/fractionalNft/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.js';
|
|
2
|
-
import type { BlockHash } from '../../types/index.js';
|
|
3
|
-
export interface GetCollectionIdsParameters {
|
|
4
|
-
at?: BlockHash;
|
|
5
|
-
}
|
|
6
|
-
export declare function getCollectionIds(client: Client, { at }?: GetCollectionIdsParameters): Promise<number[]>;
|
|
7
|
-
//# sourceMappingURL=getCollectionIds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCollectionIds.d.ts","sourceRoot":"","sources":["../../../src/actions/rewardPool/getCollectionIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,0BAA0B;IACzC,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,GAAE,0BAA+B,GACtC,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../../client/types.js';
|
|
2
|
-
import type { BlockHash } from '../../types/index.js';
|
|
3
|
-
export interface GetItemIdsParameters {
|
|
4
|
-
collectionId: number;
|
|
5
|
-
at?: BlockHash;
|
|
6
|
-
}
|
|
7
|
-
export declare function getItemIds(client: Client, { collectionId, at }: GetItemIdsParameters): Promise<number[]>;
|
|
8
|
-
//# sourceMappingURL=getItemIds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getItemIds.d.ts","sourceRoot":"","sources":["../../../src/actions/rewardPool/getItemIds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,oBAAoB,GACzC,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '../types/index.js';
|
|
2
|
-
export type DidUri = `did:toto:${string}`;
|
|
3
|
-
export interface DeriveClaimHashParameters {
|
|
4
|
-
ctypeHash: Hash;
|
|
5
|
-
subject: DidUri;
|
|
6
|
-
contents: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
export declare function deriveClaimHash({ ctypeHash, subject, contents }: DeriveClaimHashParameters): Hash;
|
|
9
|
-
/**
|
|
10
|
-
* Renders an address as the DID URI the attestation flow uses as a claim-hash input.
|
|
11
|
-
*
|
|
12
|
-
* The address is passed through verbatim, case included. That looks like an oversight and is
|
|
13
|
-
* not: the DID string is part of the claim-hash preimage, and the issuer builds it from an
|
|
14
|
-
* EIP-55 checksummed address, so normalising the case here would derive a different hash than
|
|
15
|
-
* the one stored against an existing attestation and make it unfindable.
|
|
16
|
-
*
|
|
17
|
-
* Nothing on chain settles the question. `attestation.add` takes a typed H160 subject and an
|
|
18
|
-
* opaque claim hash; the DID string never reaches the runtime, and `pallet_did::did_uri` renders
|
|
19
|
-
* lowercase only to pin a format for tests. Casing is therefore whatever the issuer used, and
|
|
20
|
-
* matching it is this function's whole job.
|
|
21
|
-
*/
|
|
22
|
-
export declare function didUri(address: `0x${string}`): DidUri;
|
|
23
|
-
//# sourceMappingURL=claimHash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claimHash.d.ts","sourceRoot":"","sources":["../../src/crypto/claimHash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,MAAM,MAAM,GAAG,YAAY,MAAM,EAAE,CAAC;AAE1C,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAoBjG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAErD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fractionalNft.d.ts","sourceRoot":"","sources":["../../src/plugins/fractionalNft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAYvF,UAAU,EAAE;IACV,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE;QACb,oBAAoB,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACrD,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACxD,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACpE,mBAAmB,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACpD,mBAAmB,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,aAAa,CAAC,CAAC,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,EAAE,CAAC,EAAE,SAAS,CAAA;SAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5E,UAAU,CAAC,CAAC,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,EAAE,CAAC,EAAE,SAAS,CAAA;SAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1E,QAAQ,CAAC,CAAC,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,EAAE,CAAC,EAAE,SAAS,CAAA;SAAE,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;KAChG,CAAC;CACH;AAED,wBAAgB,mBAAmB,KACzB,QAAQ,MAAM,KAAG,uBAAuB,CAYjD"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|