@cardano-sdk/projection 0.7.3 → 0.8.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/dist/cjs/operators/Mappers/certificates/index.d.ts +1 -0
- package/dist/cjs/operators/Mappers/certificates/index.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/certificates/index.js +1 -0
- package/dist/cjs/operators/Mappers/certificates/index.js.map +1 -1
- package/dist/cjs/operators/Mappers/certificates/withStakeKeyRegistrations.d.ts +12 -0
- package/dist/cjs/operators/Mappers/certificates/withStakeKeyRegistrations.d.ts.map +1 -0
- package/dist/cjs/operators/Mappers/certificates/withStakeKeyRegistrations.js +21 -0
- package/dist/cjs/operators/Mappers/certificates/withStakeKeyRegistrations.js.map +1 -0
- package/dist/cjs/operators/Mappers/index.d.ts +4 -0
- package/dist/cjs/operators/Mappers/index.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/index.js +4 -0
- package/dist/cjs/operators/Mappers/index.js.map +1 -1
- package/dist/cjs/operators/Mappers/util.d.ts +2 -1
- package/dist/cjs/operators/Mappers/util.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/util.js +9 -7
- package/dist/cjs/operators/Mappers/util.js.map +1 -1
- package/dist/cjs/operators/Mappers/withAddresses.d.ts +14 -0
- package/dist/cjs/operators/Mappers/withAddresses.d.ts.map +1 -0
- package/dist/cjs/operators/Mappers/withAddresses.js +50 -0
- package/dist/cjs/operators/Mappers/withAddresses.js.map +1 -0
- package/dist/cjs/operators/Mappers/withCIP67.d.ts +18 -0
- package/dist/cjs/operators/Mappers/withCIP67.d.ts.map +1 -0
- package/dist/cjs/operators/Mappers/withCIP67.js +35 -0
- package/dist/cjs/operators/Mappers/withCIP67.js.map +1 -0
- package/dist/cjs/operators/Mappers/withHandleMetadata.d.ts +22 -0
- package/dist/cjs/operators/Mappers/withHandleMetadata.d.ts.map +1 -0
- package/dist/cjs/operators/Mappers/withHandleMetadata.js +62 -0
- package/dist/cjs/operators/Mappers/withHandleMetadata.js.map +1 -0
- package/dist/cjs/operators/Mappers/withHandles.d.ts +8 -6
- package/dist/cjs/operators/Mappers/withHandles.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/withHandles.js +40 -42
- package/dist/cjs/operators/Mappers/withHandles.js.map +1 -1
- package/dist/cjs/operators/Mappers/withMint.d.ts +2 -0
- package/dist/cjs/operators/Mappers/withMint.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/withMint.js +4 -2
- package/dist/cjs/operators/Mappers/withMint.js.map +1 -1
- package/dist/cjs/operators/Mappers/withNftMetadata.d.ts +17 -0
- package/dist/cjs/operators/Mappers/withNftMetadata.d.ts.map +1 -0
- package/dist/cjs/operators/Mappers/withNftMetadata.js +38 -0
- package/dist/cjs/operators/Mappers/withNftMetadata.js.map +1 -0
- package/dist/cjs/operators/Mappers/withUtxo.d.ts +2 -1
- package/dist/cjs/operators/Mappers/withUtxo.d.ts.map +1 -1
- package/dist/cjs/operators/Mappers/withUtxo.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/operators/Mappers/certificates/index.d.ts +1 -0
- package/dist/esm/operators/Mappers/certificates/index.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/certificates/index.js +1 -0
- package/dist/esm/operators/Mappers/certificates/index.js.map +1 -1
- package/dist/esm/operators/Mappers/certificates/withStakeKeyRegistrations.d.ts +12 -0
- package/dist/esm/operators/Mappers/certificates/withStakeKeyRegistrations.d.ts.map +1 -0
- package/dist/esm/operators/Mappers/certificates/withStakeKeyRegistrations.js +18 -0
- package/dist/esm/operators/Mappers/certificates/withStakeKeyRegistrations.js.map +1 -0
- package/dist/esm/operators/Mappers/index.d.ts +4 -0
- package/dist/esm/operators/Mappers/index.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/index.js +4 -0
- package/dist/esm/operators/Mappers/index.js.map +1 -1
- package/dist/esm/operators/Mappers/util.d.ts +2 -1
- package/dist/esm/operators/Mappers/util.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/util.js +7 -5
- package/dist/esm/operators/Mappers/util.js.map +1 -1
- package/dist/esm/operators/Mappers/withAddresses.d.ts +14 -0
- package/dist/esm/operators/Mappers/withAddresses.d.ts.map +1 -0
- package/dist/esm/operators/Mappers/withAddresses.js +44 -0
- package/dist/esm/operators/Mappers/withAddresses.js.map +1 -0
- package/dist/esm/operators/Mappers/withCIP67.d.ts +18 -0
- package/dist/esm/operators/Mappers/withCIP67.d.ts.map +1 -0
- package/dist/esm/operators/Mappers/withCIP67.js +29 -0
- package/dist/esm/operators/Mappers/withCIP67.js.map +1 -0
- package/dist/esm/operators/Mappers/withHandleMetadata.d.ts +22 -0
- package/dist/esm/operators/Mappers/withHandleMetadata.d.ts.map +1 -0
- package/dist/esm/operators/Mappers/withHandleMetadata.js +58 -0
- package/dist/esm/operators/Mappers/withHandleMetadata.js.map +1 -0
- package/dist/esm/operators/Mappers/withHandles.d.ts +8 -6
- package/dist/esm/operators/Mappers/withHandles.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/withHandles.js +41 -43
- package/dist/esm/operators/Mappers/withHandles.js.map +1 -1
- package/dist/esm/operators/Mappers/withMint.d.ts +2 -0
- package/dist/esm/operators/Mappers/withMint.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/withMint.js +4 -2
- package/dist/esm/operators/Mappers/withMint.js.map +1 -1
- package/dist/esm/operators/Mappers/withNftMetadata.d.ts +17 -0
- package/dist/esm/operators/Mappers/withNftMetadata.d.ts.map +1 -0
- package/dist/esm/operators/Mappers/withNftMetadata.js +31 -0
- package/dist/esm/operators/Mappers/withNftMetadata.js.map +1 -0
- package/dist/esm/operators/Mappers/withUtxo.d.ts +2 -1
- package/dist/esm/operators/Mappers/withUtxo.d.ts.map +1 -1
- package/dist/esm/operators/Mappers/withUtxo.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC"}
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./withCertificates"), exports);
|
|
18
18
|
__exportStar(require("./withStakeKeys"), exports);
|
|
19
19
|
__exportStar(require("./withStakePools"), exports);
|
|
20
|
+
__exportStar(require("./withStakeKeyRegistrations"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kDAAgC;AAChC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kDAAgC;AAChC,mDAAiC;AACjC,8DAA4C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
2
|
+
import { Ed25519KeyHashHex } from '@cardano-sdk/crypto';
|
|
3
|
+
import { WithCertificates } from './withCertificates';
|
|
4
|
+
export interface StakeKeyRegistration {
|
|
5
|
+
pointer: Cardano.Pointer;
|
|
6
|
+
stakeKeyHash: Ed25519KeyHashHex;
|
|
7
|
+
}
|
|
8
|
+
export interface WithStakeKeyRegistrations {
|
|
9
|
+
stakeKeyRegistrations: StakeKeyRegistration[];
|
|
10
|
+
}
|
|
11
|
+
export declare const withStakeKeyRegistrations: <SourceExtraRollForwardPropsIn extends WithCertificates, SourceExtraRollBackwardPropsIn extends WithCertificates & import("../../..").WithBlock>() => import("../../..").ExtChainSyncOperator<SourceExtraRollForwardPropsIn, SourceExtraRollBackwardPropsIn, WithStakeKeyRegistrations, WithStakeKeyRegistrations>;
|
|
12
|
+
//# sourceMappingURL=withStakeKeyRegistrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withStakeKeyRegistrations.d.ts","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/withStakeKeyRegistrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,yBAAyB;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;CAC/C;AAKD,eAAO,MAAM,yBAAyB,oTAerC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withStakeKeyRegistrations = void 0;
|
|
4
|
+
const core_1 = require("@cardano-sdk/core");
|
|
5
|
+
const util_1 = require("@cardano-sdk/util");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
exports.withStakeKeyRegistrations = (0, utils_1.unifiedProjectorOperator)((evt) => ({
|
|
8
|
+
...evt,
|
|
9
|
+
stakeKeyRegistrations: evt.certificates
|
|
10
|
+
.map(({ pointer, certificate }) => {
|
|
11
|
+
if (certificate.__typename === core_1.Cardano.CertificateType.StakeKeyRegistration) {
|
|
12
|
+
return {
|
|
13
|
+
pointer,
|
|
14
|
+
stakeKeyHash: certificate.stakeKeyHash
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
})
|
|
19
|
+
.filter(util_1.isNotNil)
|
|
20
|
+
}));
|
|
21
|
+
//# sourceMappingURL=withStakeKeyRegistrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withStakeKeyRegistrations.js","sourceRoot":"","sources":["../../../../../src/operators/Mappers/certificates/withStakeKeyRegistrations.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAG5C,4CAA6C;AAC7C,uCAAuD;AAc1C,QAAA,yBAAyB,GAAG,IAAA,gCAAwB,EAC/D,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACR,GAAG,GAAG;IACN,qBAAqB,EAAE,GAAG,CAAC,YAAY;SACpC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAA+B,EAAE;QAC7D,IAAI,WAAW,CAAC,UAAU,KAAK,cAAO,CAAC,eAAe,CAAC,oBAAoB,EAAE;YAC3E,OAAO;gBACL,OAAO;gBACP,YAAY,EAAE,WAAW,CAAC,YAAY;aACvC,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;SACD,MAAM,CAAC,eAAQ,CAAC;CACpB,CAAC,CACH,CAAC"}
|
|
@@ -2,4 +2,8 @@ export * from './certificates';
|
|
|
2
2
|
export * from './withUtxo';
|
|
3
3
|
export * from './withMint';
|
|
4
4
|
export * from './withHandles';
|
|
5
|
+
export * from './withHandleMetadata';
|
|
6
|
+
export * from './withNftMetadata';
|
|
7
|
+
export * from './withCIP67';
|
|
8
|
+
export * from './withAddresses';
|
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -18,4 +18,8 @@ __exportStar(require("./certificates"), exports);
|
|
|
18
18
|
__exportStar(require("./withUtxo"), exports);
|
|
19
19
|
__exportStar(require("./withMint"), exports);
|
|
20
20
|
__exportStar(require("./withHandles"), exports);
|
|
21
|
+
__exportStar(require("./withHandleMetadata"), exports);
|
|
22
|
+
__exportStar(require("./withNftMetadata"), exports);
|
|
23
|
+
__exportStar(require("./withCIP67"), exports);
|
|
24
|
+
__exportStar(require("./withAddresses"), exports);
|
|
21
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,8CAA4B;AAC5B,kDAAgC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Cardano, Handle } from '@cardano-sdk/core';
|
|
1
2
|
export declare const computeCompactTxId: (blockHeight: number, txIndex: number) => number;
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const assetNameToUTF8Handle: (assetName: Cardano.AssetName) => Handle;
|
|
3
4
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3D,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,WAAW,MAAM,WAAoC,CAAC;AAE5G,eAAO,MAAM,qBAAqB,cAAe,QAAQ,SAAS,KAAG,MAIpE,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.assetNameToUTF8Handle = exports.computeCompactTxId = void 0;
|
|
4
|
+
const core_1 = require("@cardano-sdk/core");
|
|
5
|
+
const util_1 = require("@cardano-sdk/util");
|
|
5
6
|
const computeCompactTxId = (blockHeight, txIndex) => blockHeight * 100000 + txIndex;
|
|
6
7
|
exports.computeCompactTxId = computeCompactTxId;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const assetNameToUTF8Handle = (assetName) => {
|
|
9
|
+
const handle = core_1.Cardano.AssetName.toUTF8(assetName);
|
|
10
|
+
if (!core_1.Asset.util.isValidHandle(handle))
|
|
11
|
+
throw new util_1.InvalidStringError(`Invalid handle ${handle}`);
|
|
12
|
+
return handle;
|
|
11
13
|
};
|
|
12
|
-
exports.
|
|
14
|
+
exports.assetNameToUTF8Handle = assetNameToUTF8Handle;
|
|
13
15
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/util.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/util.ts"],"names":[],"mappings":";;;AAAA,4CAA2D;AAC3D,4CAAuD;AAMhD,MAAM,kBAAkB,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,EAAE,CAAC,WAAW,GAAG,MAAO,GAAG,OAAO,CAAC;AAA/F,QAAA,kBAAkB,sBAA6E;AAErG,MAAM,qBAAqB,GAAG,CAAC,SAA4B,EAAU,EAAE;IAC5E,MAAM,MAAM,GAAG,cAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACnD,IAAI,CAAC,YAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,yBAAkB,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;IAChG,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
2
|
+
import { Hash28ByteBase16 } from '@cardano-sdk/crypto';
|
|
3
|
+
import { WithUtxo } from './withUtxo';
|
|
4
|
+
export interface Address {
|
|
5
|
+
address: Cardano.PaymentAddress;
|
|
6
|
+
type: Cardano.AddressType;
|
|
7
|
+
paymentCredentialHash?: Hash28ByteBase16;
|
|
8
|
+
stakeCredential?: Hash28ByteBase16 | Cardano.Pointer;
|
|
9
|
+
}
|
|
10
|
+
export interface WithAddresses {
|
|
11
|
+
addresses: Address[];
|
|
12
|
+
}
|
|
13
|
+
export declare const withAddresses: <SourceExtraRollForwardPropsIn extends WithUtxo, SourceExtraRollBackwardPropsIn extends WithUtxo & import("../..").WithBlock>() => import("../..").ExtChainSyncOperator<SourceExtraRollForwardPropsIn, SourceExtraRollBackwardPropsIn, WithAddresses, WithAddresses>;
|
|
14
|
+
//# sourceMappingURL=withAddresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withAddresses.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC;IAI1B,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IAKzC,eAAe,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CACtD;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,EAAE,CAAC;CACtB;AAKD,eAAO,MAAM,aAAa,sQAuCvB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.withAddresses = void 0;
|
|
7
|
+
const core_1 = require("@cardano-sdk/core");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
10
|
+
exports.withAddresses = (0, utils_1.unifiedProjectorOperator)((evt) => ({
|
|
11
|
+
...evt,
|
|
12
|
+
addresses: (0, uniq_1.default)(evt.utxo.produced.map(([_, txOut]) => txOut.address)).map((address) => {
|
|
13
|
+
const parsed = core_1.Cardano.Address.fromString(address);
|
|
14
|
+
let paymentCredentialHash;
|
|
15
|
+
let stakeCredentialHash;
|
|
16
|
+
let pointer;
|
|
17
|
+
const type = parsed.getType();
|
|
18
|
+
switch (type) {
|
|
19
|
+
case core_1.Cardano.AddressType.BasePaymentKeyStakeKey:
|
|
20
|
+
case core_1.Cardano.AddressType.BasePaymentKeyStakeScript:
|
|
21
|
+
case core_1.Cardano.AddressType.BasePaymentScriptStakeKey:
|
|
22
|
+
case core_1.Cardano.AddressType.BasePaymentScriptStakeScript: {
|
|
23
|
+
const baseAddress = parsed.asBase();
|
|
24
|
+
paymentCredentialHash = baseAddress.getPaymentCredential().hash;
|
|
25
|
+
stakeCredentialHash = baseAddress.getStakeCredential().hash;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case core_1.Cardano.AddressType.EnterpriseKey:
|
|
29
|
+
case core_1.Cardano.AddressType.EnterpriseScript: {
|
|
30
|
+
const enterpriseAddress = parsed.asEnterprise();
|
|
31
|
+
paymentCredentialHash = enterpriseAddress.getPaymentCredential().hash;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case core_1.Cardano.AddressType.PointerKey:
|
|
35
|
+
case core_1.Cardano.AddressType.PointerScript: {
|
|
36
|
+
const pointerAddress = parsed.asPointer();
|
|
37
|
+
paymentCredentialHash = pointerAddress.getPaymentCredential().hash;
|
|
38
|
+
pointer = pointerAddress.getStakePointer();
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
address,
|
|
44
|
+
paymentCredentialHash,
|
|
45
|
+
stakeCredential: stakeCredentialHash || pointer,
|
|
46
|
+
type
|
|
47
|
+
};
|
|
48
|
+
})
|
|
49
|
+
}));
|
|
50
|
+
//# sourceMappingURL=withAddresses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withAddresses.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withAddresses.ts"],"names":[],"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E,CAAC,IAAI,CAAC;gBACtE,MAAM;aACP;YACD,KAAK,cAAO,CAAC,WAAW,CAAC,UAAU,CAAC;YACpC,KAAK,cAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;gBACtC,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,EAAG,CAAC;gBAC3C,qBAAqB,GAAG,cAAc,CAAC,oBAAoB,EAAE,CAAC,IAAI,CAAC;gBACnE,OAAO,GAAG,cAAc,CAAC,eAAe,EAAE,CAAC;gBAC3C,MAAM;aACP;SACF;QACD,OAAO;YACL,OAAO;YACP,qBAAqB;YACrB,eAAe,EAAE,mBAAmB,IAAI,OAAO;YAC/C,IAAI;SACL,CAAC;IACJ,CAAC,CAAC;CACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Asset, Cardano } from '@cardano-sdk/core';
|
|
2
|
+
import { ProducedUtxo, WithUtxo } from './withUtxo';
|
|
3
|
+
export interface CIP67Asset {
|
|
4
|
+
assetId: Cardano.AssetId;
|
|
5
|
+
policyId: Cardano.PolicyId;
|
|
6
|
+
assetName: Cardano.AssetName;
|
|
7
|
+
decoded: Asset.DecodedAssetName;
|
|
8
|
+
utxo: ProducedUtxo;
|
|
9
|
+
}
|
|
10
|
+
export interface CIP67Assets {
|
|
11
|
+
byLabel: Partial<Record<Asset.AssetNameLabel, CIP67Asset[]>>;
|
|
12
|
+
byAssetId: Partial<Record<Cardano.AssetId, CIP67Asset>>;
|
|
13
|
+
}
|
|
14
|
+
export interface WithCIP67 {
|
|
15
|
+
cip67: CIP67Assets;
|
|
16
|
+
}
|
|
17
|
+
export declare const withCIP67: <SourceExtraRollForwardPropsIn extends WithUtxo, SourceExtraRollBackwardPropsIn extends WithUtxo & import("../..").WithBlock>() => import("../..").ExtChainSyncOperator<SourceExtraRollForwardPropsIn, SourceExtraRollBackwardPropsIn, WithCIP67, WithCIP67>;
|
|
18
|
+
//# sourceMappingURL=withCIP67.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withCIP67.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withCIP67.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC;IAChC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAC7D,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,8PAwBpB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.withCIP67 = void 0;
|
|
7
|
+
const core_1 = require("@cardano-sdk/core");
|
|
8
|
+
const util_1 = require("@cardano-sdk/util");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const groupBy_1 = __importDefault(require("lodash/groupBy"));
|
|
11
|
+
exports.withCIP67 = (0, utils_1.unifiedProjectorOperator)((evt) => {
|
|
12
|
+
const cip67Assets = evt.utxo.produced
|
|
13
|
+
.flatMap((utxo) => [...(utxo[1].value.assets?.keys() || [])].map((assetId) => {
|
|
14
|
+
const assetName = core_1.Cardano.AssetId.getAssetName(assetId);
|
|
15
|
+
const decoded = core_1.Asset.AssetNameLabel.decode(assetName);
|
|
16
|
+
if (!decoded)
|
|
17
|
+
return null;
|
|
18
|
+
return {
|
|
19
|
+
assetId,
|
|
20
|
+
assetName,
|
|
21
|
+
decoded,
|
|
22
|
+
policyId: core_1.Cardano.AssetId.getPolicyId(assetId),
|
|
23
|
+
utxo
|
|
24
|
+
};
|
|
25
|
+
}))
|
|
26
|
+
.filter(util_1.isNotNil);
|
|
27
|
+
return {
|
|
28
|
+
...evt,
|
|
29
|
+
cip67: {
|
|
30
|
+
byAssetId: Object.fromEntries(cip67Assets.map((asset) => [asset.assetId, asset])),
|
|
31
|
+
byLabel: (0, groupBy_1.default)(cip67Assets, (e) => e.decoded.label)
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=withCIP67.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withCIP67.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withCIP67.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmD;AAEnD,4CAA6C;AAC7C,oCAAoD;AACpD,6DAAqC;AAmBxB,QAAA,SAAS,GAAG,IAAA,gCAAwB,EAAsB,CAAC,GAAG,EAAE,EAAE;IAC7E,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ;SAClC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAChB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAqB,EAAE;QAC3E,MAAM,SAAS,GAAG,cAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,YAAK,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO;YACL,OAAO;YACP,SAAS;YACT,OAAO;YACP,QAAQ,EAAE,cAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;YAC9C,IAAI;SACL,CAAC;IACJ,CAAC,CAAC,CACH;SACA,MAAM,CAAC,eAAQ,CAAC,CAAC;IACpB,OAAO;QACL,GAAG,GAAG;QACN,KAAK,EAAE;YACL,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACjF,OAAO,EAAE,IAAA,iBAAO,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;SACtD;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Asset, Handle } from '@cardano-sdk/core';
|
|
2
|
+
import { WithCIP67 } from './withCIP67';
|
|
3
|
+
import { FilterByPolicyIds } from './types';
|
|
4
|
+
import { Logger } from 'ts-log';
|
|
5
|
+
import { ProducedUtxo } from './withUtxo';
|
|
6
|
+
import { WithNftMetadata } from './withNftMetadata';
|
|
7
|
+
import { ProjectionOperator } from '../../types';
|
|
8
|
+
interface PersonalizedProperties {
|
|
9
|
+
profilePicImage?: Asset.Uri;
|
|
10
|
+
backgroundImage?: Asset.Uri;
|
|
11
|
+
txOut?: ProducedUtxo;
|
|
12
|
+
}
|
|
13
|
+
export interface HandleMetadata extends PersonalizedProperties {
|
|
14
|
+
handle: Handle;
|
|
15
|
+
og?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface WithHandleMetadata {
|
|
18
|
+
handleMetadata: HandleMetadata[];
|
|
19
|
+
}
|
|
20
|
+
export declare const withHandleMetadata: <PropsIn extends WithNftMetadata & WithCIP67>({ policyIds }: FilterByPolicyIds, logger: Logger) => ProjectionOperator<PropsIn, WithHandleMetadata>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=withHandleMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withHandleMetadata.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandleMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAwB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD,UAAU,sBAAsB;IAC9B,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;IAC5B,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;IAC5B,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,cAAc,EAAE,CAAC;CAClC;AA8DD,eAAO,MAAM,kBAAkB,+DAEZ,iBAAiB,UACxB,MAAM,oDAQb,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withHandleMetadata = void 0;
|
|
4
|
+
const core_1 = require("@cardano-sdk/core");
|
|
5
|
+
const util_1 = require("./util");
|
|
6
|
+
const util_2 = require("@cardano-sdk/util");
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const isOgHandle = (metadata) => {
|
|
9
|
+
if (!metadata)
|
|
10
|
+
return false;
|
|
11
|
+
const core = metadata.otherProperties?.get('core');
|
|
12
|
+
if (core instanceof Map) {
|
|
13
|
+
return !!core.get('og');
|
|
14
|
+
}
|
|
15
|
+
return !!metadata.otherProperties?.get('og');
|
|
16
|
+
};
|
|
17
|
+
const toUri = (data, logger) => {
|
|
18
|
+
if (typeof data === 'string' && data.length > 0) {
|
|
19
|
+
try {
|
|
20
|
+
return core_1.Asset.Uri(data);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
logger.warn('Invalid uri', data);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const getPersonalizedProperties = (extra, logger) => {
|
|
28
|
+
if (!extra)
|
|
29
|
+
return;
|
|
30
|
+
if (!core_1.Cardano.util.isPlutusMap(extra)) {
|
|
31
|
+
logger.warn('Cannot parse handle personalized properties: expected PlutusMap, got', extra);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const asRecord = core_1.Cardano.util.tryConvertPlutusMapToUtf8Record(extra, logger);
|
|
35
|
+
return {
|
|
36
|
+
backgroundImage: toUri(asRecord.bg_image, logger),
|
|
37
|
+
profilePicImage: toUri(asRecord.pfp_image, logger)
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const getHandleMetadata = (allNftMetadata, policyIds, cip67Assets, logger) => allNftMetadata
|
|
41
|
+
?.filter(({ userTokenAssetId }) => policyIds.some((policyId) => userTokenAssetId.startsWith(policyId)))
|
|
42
|
+
.map(({ nftMetadata, userTokenAssetId, referenceTokenAssetId, extra }) => {
|
|
43
|
+
const cip67Asset = referenceTokenAssetId && cip67Assets.byAssetId[referenceTokenAssetId];
|
|
44
|
+
const handle = cip67Asset
|
|
45
|
+
? (0, util_1.assetNameToUTF8Handle)(cip67Asset.decoded.content)
|
|
46
|
+
: (0, util_1.assetNameToUTF8Handle)(core_1.Cardano.AssetId.getAssetName(userTokenAssetId));
|
|
47
|
+
if (!handle)
|
|
48
|
+
return;
|
|
49
|
+
return {
|
|
50
|
+
handle,
|
|
51
|
+
og: isOgHandle(nftMetadata),
|
|
52
|
+
...getPersonalizedProperties(extra, logger),
|
|
53
|
+
txOut: cip67Asset?.utxo
|
|
54
|
+
};
|
|
55
|
+
})
|
|
56
|
+
.filter(util_2.isNotNil);
|
|
57
|
+
const withHandleMetadata = ({ policyIds }, logger) => (evt$) => evt$.pipe((0, rxjs_1.map)((evt) => ({
|
|
58
|
+
...evt,
|
|
59
|
+
handleMetadata: getHandleMetadata(evt.nftMetadata, policyIds, evt.cip67, logger)
|
|
60
|
+
})));
|
|
61
|
+
exports.withHandleMetadata = withHandleMetadata;
|
|
62
|
+
//# sourceMappingURL=withHandleMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withHandleMetadata.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandleMetadata.ts"],"names":[],"mappings":";;;AAAA,4CAA2D;AAO3D,iCAA+C;AAC/C,4CAA6C;AAC7C,+BAA2B;AAoB3B,MAAM,UAAU,GAAG,CAAC,QAAuC,EAAE,EAAE;IAC7D,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnD,IAAI,IAAI,YAAY,GAAG,EAAE;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACzB;IAED,OAAO,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC;A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,qBAAqB,IAAI,WAAW,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACzF,MAAM,MAAM,GAAG,UAAU;QACvB,CAAC,CAAC,IAAA,4BAAqB,EAAC,UAAW,CAAC,OAAO,CAAC,OAAO,CAAC;QACpD,CAAC,CAAC,IAAA,4BAAqB,EAAC,cAAO,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,OAAO;QACL,MAAM;QACN,EAAE,EAAE,UAAU,CAAC,WAAW,CAAC;QAC3B,GAAG,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC;QAC3C,KAAK,EAAE,UAAU,EAAE,IAAI;KACxB,CAAC;AACJ,CAAC,CAAC;KACD,MAAM,CAAC,eAAQ,CAAC,CAAC;AAEf,MAAM,kBAAkB,GAC7B,CACE,EAAE,SAAS,EAAqB,EAChC,MAAc,EACmC,EAAE,CACrD,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,CACP,IAAA,UAAG,EAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACZ,GAAG,GAAG;IACN,cAAc,EAAE,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;CACjF,CAAC,CAAC,CACJ,CAAC;AAXO,QAAA,kBAAkB,sBAWzB"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Cardano } from '@cardano-sdk/core';
|
|
1
|
+
import { Cardano, Handle } from '@cardano-sdk/core';
|
|
2
|
+
import { WithCIP67 } from './withCIP67';
|
|
2
3
|
import { FilterByPolicyIds } from './types';
|
|
4
|
+
import { Logger } from 'ts-log';
|
|
3
5
|
import { ProjectionOperator } from '../../types';
|
|
4
|
-
export interface
|
|
5
|
-
handle:
|
|
6
|
+
export interface HandleOwnership {
|
|
7
|
+
handle: Handle;
|
|
6
8
|
latestOwnerAddress: Cardano.PaymentAddress | null;
|
|
7
9
|
assetId: Cardano.AssetId;
|
|
8
10
|
policyId: Cardano.PolicyId;
|
|
9
|
-
datum?: Cardano.
|
|
11
|
+
datum?: Cardano.PlutusData;
|
|
10
12
|
}
|
|
11
13
|
export interface WithHandles {
|
|
12
|
-
handles:
|
|
14
|
+
handles: HandleOwnership[];
|
|
13
15
|
}
|
|
14
|
-
export declare const withHandles: <PropsIn>({ policyIds }: FilterByPolicyIds) => ProjectionOperator<PropsIn, WithHandles>;
|
|
16
|
+
export declare const withHandles: <PropsIn extends WithCIP67>({ policyIds }: FilterByPolicyIds, logger: Logger) => ProjectionOperator<PropsIn, WithHandles>;
|
|
15
17
|
//# sourceMappingURL=withHandles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withHandles.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"withHandles.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAA2B,SAAS,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IAQf,kBAAkB,EAAE,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AA8ED,eAAO,MAAM,WAAW,6CAEL,iBAAiB,UACxB,MAAM,6CAkBb,CAAC"}
|
|
@@ -2,73 +2,71 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withHandles = void 0;
|
|
4
4
|
const core_1 = require("@cardano-sdk/core");
|
|
5
|
-
const ts_custom_error_1 = require("ts-custom-error");
|
|
6
5
|
const util_1 = require("./util");
|
|
7
6
|
const rxjs_1 = require("rxjs");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const assetIdToUTF8Handle = (assetId, cip67Asset) => {
|
|
8
|
+
if (cip67Asset) {
|
|
9
|
+
if (cip67Asset.decoded.label === core_1.Asset.AssetNameLabelNum.UserNFT) {
|
|
10
|
+
return core_1.Cardano.AssetName.toUTF8(cip67Asset.decoded.content);
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (0, util_1.assetNameToUTF8Handle)(core_1.Cardano.AssetId.getAssetName(assetId));
|
|
15
|
+
};
|
|
16
|
+
const tryCreateHandleOwnership = (assetId, policyIds, cip67Assets, logger, txOut) => {
|
|
17
|
+
const policyId = core_1.Cardano.AssetId.getPolicyId(assetId);
|
|
18
|
+
if (!policyIds.includes(policyId))
|
|
19
|
+
return;
|
|
20
|
+
try {
|
|
21
|
+
const cip67Asset = cip67Assets.byAssetId[assetId];
|
|
22
|
+
const handle = assetIdToUTF8Handle(assetId, cip67Asset);
|
|
23
|
+
if (handle) {
|
|
24
|
+
return {
|
|
25
|
+
assetId,
|
|
26
|
+
datum: txOut?.datum,
|
|
27
|
+
handle,
|
|
28
|
+
latestOwnerAddress: txOut?.address || null,
|
|
29
|
+
policyId
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger.error(error);
|
|
12
35
|
}
|
|
13
|
-
}
|
|
14
|
-
const mapHandleToData = (assetId, data) => {
|
|
15
|
-
const handle = handleFromAssetId(assetId);
|
|
16
|
-
if (!core_1.Asset.util.isValidHandle(handle))
|
|
17
|
-
throw new HandleParsingError(handle);
|
|
18
|
-
const { datum, address, policyId } = data;
|
|
19
|
-
return {
|
|
20
|
-
assetId,
|
|
21
|
-
datum,
|
|
22
|
-
handle,
|
|
23
|
-
latestOwnerAddress: address || null,
|
|
24
|
-
policyId
|
|
25
|
-
};
|
|
26
36
|
};
|
|
27
|
-
const getOutputHandles = (outputs, policyIds) => {
|
|
37
|
+
const getOutputHandles = (outputs, policyIds, cip67Assets, logger) => {
|
|
28
38
|
const handles = {};
|
|
29
|
-
for (const
|
|
30
|
-
if (!value.assets)
|
|
39
|
+
for (const txOut of outputs) {
|
|
40
|
+
if (!txOut.value.assets)
|
|
31
41
|
continue;
|
|
32
|
-
for (const [assetId] of value.assets.entries()) {
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
continue;
|
|
36
|
-
try {
|
|
37
|
-
const handleData = mapHandleToData(assetId, { address, datum, policyId });
|
|
42
|
+
for (const [assetId] of txOut.value.assets.entries()) {
|
|
43
|
+
const handleData = tryCreateHandleOwnership(assetId, policyIds, cip67Assets, logger, txOut);
|
|
44
|
+
if (handleData) {
|
|
38
45
|
handles[handleData.handle] = handleData;
|
|
39
46
|
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
(0, util_1.logError)(error);
|
|
42
|
-
}
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
return handles;
|
|
46
50
|
};
|
|
47
|
-
const getBurnedHandles = (mint, policyIds) => {
|
|
51
|
+
const getBurnedHandles = (mint, policyIds, cip67Assets, logger) => {
|
|
48
52
|
if (!mint)
|
|
49
53
|
return;
|
|
50
54
|
const handles = {};
|
|
51
55
|
for (const [assetId, quantity] of mint.entries()) {
|
|
52
56
|
if (quantity < 0n) {
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
continue;
|
|
56
|
-
try {
|
|
57
|
-
const handleData = mapHandleToData(assetId, { policyId });
|
|
57
|
+
const handleData = tryCreateHandleOwnership(assetId, policyIds, cip67Assets, logger);
|
|
58
|
+
if (handleData) {
|
|
58
59
|
handles[handleData.handle] = handleData;
|
|
59
60
|
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
(0, util_1.logError)(error);
|
|
62
|
-
}
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
return handles;
|
|
66
64
|
};
|
|
67
|
-
const withHandles = ({ policyIds }) => (evt$) => evt$.pipe((0, rxjs_1.map)((evt) => {
|
|
65
|
+
const withHandles = ({ policyIds }, logger) => (evt$) => evt$.pipe((0, rxjs_1.map)((evt) => {
|
|
68
66
|
const handleMap = evt.block.body.reduce((handles, { body: { outputs, mint } }) => ({
|
|
69
67
|
...handles,
|
|
70
|
-
...getOutputHandles(outputs, policyIds),
|
|
71
|
-
...getBurnedHandles(mint, policyIds)
|
|
68
|
+
...getOutputHandles(outputs, policyIds, evt.cip67, logger),
|
|
69
|
+
...getBurnedHandles(mint, policyIds, evt.cip67, logger)
|
|
72
70
|
}), {});
|
|
73
71
|
return {
|
|
74
72
|
...evt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withHandles.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandles.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"withHandles.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withHandles.ts"],"names":[],"mappings":";;;AAAA,4CAA2D;AAK3D,iCAA+C;AAC/C,+BAA2B;AAqB3B,MAAM,mBAAmB,GAAG,CAAC,OAAwB,EAAE,UAAkC,EAAE,EAAE;IAC3F,IAAI,UAAU,EAAE;QACd,IAAI,UAAU,CAAC,OAAO,CAAC,KAAK,KAAK,YAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE;YAChE,OAAO,cAAO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,EAAE,SAAS,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;KACxD,CAAC,EACF,EAAqC,CACtC,CAAC;IACF,OAAO;QACL,GAAG,GAAG;QACN,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACvC,CAAC;AACJ,CAAC,CAAC,CACH,CAAC;AArBO,QAAA,WAAW,eAqBlB"}
|
|
@@ -4,8 +4,10 @@ import { ProjectionOperator } from '../../types';
|
|
|
4
4
|
export interface Mint {
|
|
5
5
|
assetId: Cardano.AssetId;
|
|
6
6
|
policyId: Cardano.PolicyId;
|
|
7
|
+
assetName: Cardano.AssetName;
|
|
7
8
|
quantity: bigint;
|
|
8
9
|
compactTxId: number;
|
|
10
|
+
txMetadata?: Cardano.TxMetadata;
|
|
9
11
|
}
|
|
10
12
|
export interface WithMint {
|
|
11
13
|
mint: Mint[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMint.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withMint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"withMint.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withMint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;CACjC;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,EAAE,CAAC;CACd;AAED,eAAO,MAAM,QAAQ,uPAclB,CAAC;AAEJ,eAAO,MAAM,qBAAqB,4CACU,iBAAiB,oCAOxD,CAAC"}
|
|
@@ -7,11 +7,13 @@ const rxjs_1 = require("rxjs");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
exports.withMint = (0, utils_1.unifiedProjectorOperator)((evt) => ({
|
|
9
9
|
...evt,
|
|
10
|
-
mint: evt.block.body.flatMap(({ body: { mint } }, txIndex) => [...(mint?.entries() || [])].map(([assetId, quantity]) => ({
|
|
10
|
+
mint: evt.block.body.flatMap(({ body: { mint }, auxiliaryData }, txIndex) => [...(mint?.entries() || [])].map(([assetId, quantity]) => ({
|
|
11
11
|
assetId,
|
|
12
|
+
assetName: core_1.Cardano.AssetId.getAssetName(assetId),
|
|
12
13
|
compactTxId: (0, util_1.computeCompactTxId)(evt.block.header.blockNo, txIndex),
|
|
13
14
|
policyId: core_1.Cardano.AssetId.getPolicyId(assetId),
|
|
14
|
-
quantity
|
|
15
|
+
quantity,
|
|
16
|
+
txMetadata: auxiliaryData?.blob
|
|
15
17
|
})))
|
|
16
18
|
}));
|
|
17
19
|
const filterMintByPolicyIds = ({ policyIds }) => (evt$) => evt$.pipe((0, rxjs_1.map)((evt) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withMint.js","sourceRoot":"","sources":["../../../../src/operators/Mappers/withMint.ts"],"names":[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Q,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC,CAAC,CACJ,CAAC;AARO,QAAA,qBAAqB,yBAQ5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Asset, Cardano } from '@cardano-sdk/core';
|
|
2
|
+
import { ProjectionOperator } from '../../types';
|
|
3
|
+
import { WithCIP67 } from './withCIP67';
|
|
4
|
+
import { WithLogger } from '@cardano-sdk/util';
|
|
5
|
+
import { WithMint } from './withMint';
|
|
6
|
+
import { WithUtxo } from './withUtxo';
|
|
7
|
+
export interface ProjectedNftMetadata {
|
|
8
|
+
userTokenAssetId: Cardano.AssetId;
|
|
9
|
+
nftMetadata: Asset.NftMetadata;
|
|
10
|
+
referenceTokenAssetId?: Cardano.AssetId;
|
|
11
|
+
extra?: Cardano.PlutusData;
|
|
12
|
+
}
|
|
13
|
+
export interface WithNftMetadata {
|
|
14
|
+
nftMetadata: ProjectedNftMetadata[];
|
|
15
|
+
}
|
|
16
|
+
export declare const withNftMetadata: <PropsIn extends WithMint & WithUtxo & WithCIP67>({ logger }: WithLogger) => ProjectionOperator<PropsIn, WithNftMetadata>;
|
|
17
|
+
//# sourceMappingURL=withNftMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withNftMetadata.d.ts","sourceRoot":"","sources":["../../../../src/operators/Mappers/withNftMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAY,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC;IAClC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;IAI/B,qBAAqB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IAIxC,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AA8BD,eAAO,MAAM,eAAe,gEAGvB,UAAU,iDAUV,CAAC"}
|