@initia/initia.js 0.0.47 → 0.0.49
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/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.node.js +1 -1
- package/dist/bundle.node.js.map +1 -1
- package/dist/client/lcd/LCDClient.d.ts +3 -1
- package/dist/client/lcd/LCDClient.js +2 -0
- package/dist/client/lcd/LCDClient.js.map +1 -1
- package/dist/client/lcd/api/IbcNftAPI.d.ts +27 -0
- package/dist/client/lcd/api/IbcNftAPI.js +129 -0
- package/dist/client/lcd/api/IbcNftAPI.js.map +1 -0
- package/dist/client/lcd/api/IbcSftAPI.d.ts +27 -0
- package/dist/client/lcd/api/IbcSftAPI.js +129 -0
- package/dist/client/lcd/api/IbcSftAPI.js.map +1 -0
- package/dist/client/lcd/api/IbcTransferAPI.d.ts +1 -1
- package/dist/client/lcd/api/IbcTransferAPI.js +4 -3
- package/dist/client/lcd/api/IbcTransferAPI.js.map +1 -1
- package/dist/client/lcd/api/MoveAPI.d.ts +6 -2
- package/dist/client/lcd/api/MoveAPI.js +51 -11
- package/dist/client/lcd/api/MoveAPI.js.map +1 -1
- package/dist/client/lcd/api/index.d.ts +2 -0
- package/dist/client/lcd/api/index.js +2 -0
- package/dist/client/lcd/api/index.js.map +1 -1
- package/dist/core/Msg.d.ts +6 -4
- package/dist/core/Msg.js +20 -0
- package/dist/core/Msg.js.map +1 -1
- package/dist/core/authz/authorizations/Authorization.d.ts +4 -2
- package/dist/core/authz/authorizations/Authorization.js +10 -0
- package/dist/core/authz/authorizations/Authorization.js.map +1 -1
- package/dist/core/authz/authorizations/ExecuteAuthorization.d.ts +43 -0
- package/dist/core/authz/authorizations/ExecuteAuthorization.js +107 -0
- package/dist/core/authz/authorizations/ExecuteAuthorization.js.map +1 -0
- package/dist/core/authz/authorizations/PublishAuthorization.d.ts +22 -0
- package/dist/core/authz/authorizations/PublishAuthorization.js +65 -0
- package/dist/core/authz/authorizations/PublishAuthorization.js.map +1 -0
- package/dist/core/authz/authorizations/index.d.ts +2 -0
- package/dist/core/authz/authorizations/index.js +2 -0
- package/dist/core/authz/authorizations/index.js.map +1 -1
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.d.ts +28 -0
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.js +67 -0
- package/dist/core/ibc/applications/nft-transfer/ClassTrace.js.map +1 -0
- package/dist/core/ibc/applications/nft-transfer/NftClassTrace.d.ts +28 -0
- package/dist/core/ibc/applications/nft-transfer/NftClassTrace.js +67 -0
- package/dist/core/ibc/applications/nft-transfer/NftClassTrace.js.map +1 -0
- package/dist/core/ibc/applications/nft-transfer/NonFungibleTokenPacketData.d.ts +61 -0
- package/dist/core/ibc/applications/nft-transfer/NonFungibleTokenPacketData.js +108 -0
- package/dist/core/ibc/applications/nft-transfer/NonFungibleTokenPacketData.js.map +1 -0
- package/dist/core/ibc/applications/nft-transfer/index.d.ts +10 -0
- package/dist/core/ibc/applications/nft-transfer/index.js +20 -0
- package/dist/core/ibc/applications/nft-transfer/index.js.map +1 -0
- package/dist/core/ibc/applications/nft-transfer/msgs/MsgNftTransfer.d.ts +68 -0
- package/dist/core/ibc/applications/nft-transfer/msgs/MsgNftTransfer.js +139 -0
- package/dist/core/ibc/applications/nft-transfer/msgs/MsgNftTransfer.js.map +1 -0
- package/dist/core/ibc/applications/sft-transfer/SemiFungibleTokenPacketData.d.ts +63 -0
- package/dist/core/ibc/applications/sft-transfer/SemiFungibleTokenPacketData.js +111 -0
- package/dist/core/ibc/applications/sft-transfer/SemiFungibleTokenPacketData.js.map +1 -0
- package/dist/core/ibc/applications/sft-transfer/SftClassTrace.d.ts +28 -0
- package/dist/core/ibc/applications/sft-transfer/SftClassTrace.js +67 -0
- package/dist/core/ibc/applications/sft-transfer/SftClassTrace.js.map +1 -0
- package/dist/core/ibc/applications/sft-transfer/index.d.ts +10 -0
- package/dist/core/ibc/applications/sft-transfer/index.js +20 -0
- package/dist/core/ibc/applications/sft-transfer/index.js.map +1 -0
- package/dist/core/ibc/applications/sft-transfer/msgs/MsgSftTransfer.d.ts +72 -0
- package/dist/core/ibc/applications/sft-transfer/msgs/MsgSftTransfer.js +144 -0
- package/dist/core/ibc/applications/sft-transfer/msgs/MsgSftTransfer.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { NonFungibleTokenPacketData as NonFungibleTokenPacketData_pb } from '@initia/initia.proto/ibc/applications/nft_transfer/v1/packet';
|
|
2
|
+
import { JSONSerializable } from '../../../../util/json';
|
|
3
|
+
/**
|
|
4
|
+
* NonFungibleTokenPacketData defines a struct for the packet payload
|
|
5
|
+
* See NonFungibleTokenPacketData spec:
|
|
6
|
+
* https://github.com/cosmos/ibc/tree/main/spec/app/ics-721-nft-transfer
|
|
7
|
+
*/
|
|
8
|
+
export declare class NonFungibleTokenPacketData extends JSONSerializable<NonFungibleTokenPacketData.Amino, NonFungibleTokenPacketData.Data, NonFungibleTokenPacketData.Proto> {
|
|
9
|
+
class_id: string;
|
|
10
|
+
class_uri: string;
|
|
11
|
+
class_data: string;
|
|
12
|
+
token_ids: string[];
|
|
13
|
+
token_uris: string[];
|
|
14
|
+
token_data: string[];
|
|
15
|
+
sender: string;
|
|
16
|
+
receiver: string;
|
|
17
|
+
memo?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* @param class_id collection id == extension struct tag
|
|
20
|
+
* @param class_uri collection url
|
|
21
|
+
* @param class_data collection data
|
|
22
|
+
* @param token_ids nft token ids
|
|
23
|
+
* @param token_uris nft token uris
|
|
24
|
+
* @param token_data nft token data array
|
|
25
|
+
* @param sender sender of nft
|
|
26
|
+
* @param receiver receiver of nft
|
|
27
|
+
* @param memo optional memo field for future use
|
|
28
|
+
*/
|
|
29
|
+
constructor(class_id: string, class_uri: string, class_data: string, token_ids: string[], token_uris: string[], token_data: string[], sender: string, receiver: string, memo?: string | undefined);
|
|
30
|
+
static fromAmino(data: NonFungibleTokenPacketData.Amino): NonFungibleTokenPacketData;
|
|
31
|
+
toAmino(): NonFungibleTokenPacketData.Amino;
|
|
32
|
+
static fromData(data: NonFungibleTokenPacketData.Data): NonFungibleTokenPacketData;
|
|
33
|
+
toData(): NonFungibleTokenPacketData.Data;
|
|
34
|
+
static fromProto(proto: NonFungibleTokenPacketData.Proto): NonFungibleTokenPacketData;
|
|
35
|
+
toProto(): NonFungibleTokenPacketData.Proto;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace NonFungibleTokenPacketData {
|
|
38
|
+
interface Amino {
|
|
39
|
+
class_id: string;
|
|
40
|
+
class_uri: string;
|
|
41
|
+
class_data: string;
|
|
42
|
+
token_ids: string[];
|
|
43
|
+
token_uris: string[];
|
|
44
|
+
token_data: string[];
|
|
45
|
+
sender: string;
|
|
46
|
+
receiver: string;
|
|
47
|
+
memo?: string;
|
|
48
|
+
}
|
|
49
|
+
interface Data {
|
|
50
|
+
class_id: string;
|
|
51
|
+
class_uri: string;
|
|
52
|
+
class_data: string;
|
|
53
|
+
token_ids: string[];
|
|
54
|
+
token_uris: string[];
|
|
55
|
+
token_data: string[];
|
|
56
|
+
sender: string;
|
|
57
|
+
receiver: string;
|
|
58
|
+
memo?: string;
|
|
59
|
+
}
|
|
60
|
+
type Proto = NonFungibleTokenPacketData_pb;
|
|
61
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NonFungibleTokenPacketData = void 0;
|
|
19
|
+
var packet_1 = require("@initia/initia.proto/ibc/applications/nft_transfer/v1/packet");
|
|
20
|
+
var json_1 = require("../../../../util/json");
|
|
21
|
+
/**
|
|
22
|
+
* NonFungibleTokenPacketData defines a struct for the packet payload
|
|
23
|
+
* See NonFungibleTokenPacketData spec:
|
|
24
|
+
* https://github.com/cosmos/ibc/tree/main/spec/app/ics-721-nft-transfer
|
|
25
|
+
*/
|
|
26
|
+
var NonFungibleTokenPacketData = /** @class */ (function (_super) {
|
|
27
|
+
__extends(NonFungibleTokenPacketData, _super);
|
|
28
|
+
/**
|
|
29
|
+
* @param class_id collection id == extension struct tag
|
|
30
|
+
* @param class_uri collection url
|
|
31
|
+
* @param class_data collection data
|
|
32
|
+
* @param token_ids nft token ids
|
|
33
|
+
* @param token_uris nft token uris
|
|
34
|
+
* @param token_data nft token data array
|
|
35
|
+
* @param sender sender of nft
|
|
36
|
+
* @param receiver receiver of nft
|
|
37
|
+
* @param memo optional memo field for future use
|
|
38
|
+
*/
|
|
39
|
+
function NonFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_uris, token_data, sender, receiver, memo) {
|
|
40
|
+
var _this = _super.call(this) || this;
|
|
41
|
+
_this.class_id = class_id;
|
|
42
|
+
_this.class_uri = class_uri;
|
|
43
|
+
_this.class_data = class_data;
|
|
44
|
+
_this.token_ids = token_ids;
|
|
45
|
+
_this.token_uris = token_uris;
|
|
46
|
+
_this.token_data = token_data;
|
|
47
|
+
_this.sender = sender;
|
|
48
|
+
_this.receiver = receiver;
|
|
49
|
+
_this.memo = memo;
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
NonFungibleTokenPacketData.fromAmino = function (data) {
|
|
53
|
+
var class_id = data.class_id, class_uri = data.class_uri, class_data = data.class_data, token_ids = data.token_ids, token_uris = data.token_uris, token_data = data.token_data, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
54
|
+
return new NonFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_uris, token_data, sender, receiver, memo);
|
|
55
|
+
};
|
|
56
|
+
NonFungibleTokenPacketData.prototype.toAmino = function () {
|
|
57
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
58
|
+
return {
|
|
59
|
+
class_id: class_id,
|
|
60
|
+
class_uri: class_uri,
|
|
61
|
+
class_data: class_data,
|
|
62
|
+
token_ids: token_ids,
|
|
63
|
+
token_uris: token_uris,
|
|
64
|
+
token_data: token_data,
|
|
65
|
+
sender: sender,
|
|
66
|
+
receiver: receiver,
|
|
67
|
+
memo: memo,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
NonFungibleTokenPacketData.fromData = function (data) {
|
|
71
|
+
var class_id = data.class_id, class_uri = data.class_uri, class_data = data.class_data, token_ids = data.token_ids, token_uris = data.token_uris, token_data = data.token_data, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
72
|
+
return new NonFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_uris, token_data, sender, receiver, memo);
|
|
73
|
+
};
|
|
74
|
+
NonFungibleTokenPacketData.prototype.toData = function () {
|
|
75
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
76
|
+
return {
|
|
77
|
+
class_id: class_id,
|
|
78
|
+
class_uri: class_uri,
|
|
79
|
+
class_data: class_data,
|
|
80
|
+
token_ids: token_ids,
|
|
81
|
+
token_uris: token_uris,
|
|
82
|
+
token_data: token_data,
|
|
83
|
+
sender: sender,
|
|
84
|
+
receiver: receiver,
|
|
85
|
+
memo: memo,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
NonFungibleTokenPacketData.fromProto = function (proto) {
|
|
89
|
+
return new NonFungibleTokenPacketData(proto.classId, proto.classUri, proto.classData, proto.tokenIds, proto.tokenUris, proto.tokenData, proto.sender, proto.receiver, proto.memo);
|
|
90
|
+
};
|
|
91
|
+
NonFungibleTokenPacketData.prototype.toProto = function () {
|
|
92
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
93
|
+
return packet_1.NonFungibleTokenPacketData.fromPartial({
|
|
94
|
+
classId: class_id,
|
|
95
|
+
classUri: class_uri,
|
|
96
|
+
classData: class_data,
|
|
97
|
+
tokenIds: token_ids,
|
|
98
|
+
tokenUris: token_uris,
|
|
99
|
+
tokenData: token_data,
|
|
100
|
+
sender: sender,
|
|
101
|
+
receiver: receiver,
|
|
102
|
+
memo: memo,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
return NonFungibleTokenPacketData;
|
|
106
|
+
}(json_1.JSONSerializable));
|
|
107
|
+
exports.NonFungibleTokenPacketData = NonFungibleTokenPacketData;
|
|
108
|
+
//# sourceMappingURL=NonFungibleTokenPacketData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonFungibleTokenPacketData.js","sourceRoot":"","sources":["../../../../../src/core/ibc/applications/nft-transfer/NonFungibleTokenPacketData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uFAA2I;AA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,CAAC,IAAI,CACX,CAAC;IACJ,CAAC;IAEM,4CAAO,GAAd;QACQ,IAAA,KAUF,IAAI,EATN,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,IAAI,UACE,CAAC;QAET,OAAO,mCAA6B,CAAC,WAAW,CAAC;YAC/C,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,UAAU;YACrB,MAAM,QAAA;YACN,QAAQ,UAAA;YACR,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IACH,iCAAC;AAAD,CAAC,AAnLD,CAAgD,uBAAgB,GAmL/D;AAnLY,gEAA0B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MsgNftTransfer } from './msgs/MsgNftTransfer';
|
|
2
|
+
export * from './msgs/MsgNftTransfer';
|
|
3
|
+
export * from './NonFungibleTokenPacketData';
|
|
4
|
+
export * from './NftClassTrace';
|
|
5
|
+
export declare type IbcNftMsg = MsgNftTransfer;
|
|
6
|
+
export declare namespace IbcNftMsg {
|
|
7
|
+
type Data = MsgNftTransfer.Data;
|
|
8
|
+
type Amino = MsgNftTransfer.Amino;
|
|
9
|
+
type Proto = MsgNftTransfer.Proto;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./msgs/MsgNftTransfer"), exports);
|
|
18
|
+
__exportStar(require("./NonFungibleTokenPacketData"), exports);
|
|
19
|
+
__exportStar(require("./NftClassTrace"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/ibc/applications/nft-transfer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wDAAsC;AACtC,+DAA6C;AAC7C,kDAAgC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../../../util/json';
|
|
2
|
+
import { AccAddress } from '../../../../bech32';
|
|
3
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
4
|
+
import { MsgNftTransfer as MsgNftTransfer_pb } from '@initia/initia.proto/ibc/applications/nft_transfer/v1/tx';
|
|
5
|
+
import { Height } from '../../../core/client/Height';
|
|
6
|
+
/**
|
|
7
|
+
* A basic message for NFT transfer via IBC.
|
|
8
|
+
*/
|
|
9
|
+
export declare class MsgNftTransfer extends JSONSerializable<MsgNftTransfer.Amino, MsgNftTransfer.Data, MsgNftTransfer.Proto> {
|
|
10
|
+
source_port: string;
|
|
11
|
+
source_channel: string;
|
|
12
|
+
class_id: string;
|
|
13
|
+
token_ids: string[];
|
|
14
|
+
sender: AccAddress;
|
|
15
|
+
receiver: string;
|
|
16
|
+
timeout_height?: Height;
|
|
17
|
+
timeout_timestamp?: string;
|
|
18
|
+
memo?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @param source_port the port on which the packet will be sent
|
|
21
|
+
* @param source_channel the channel by which the packet will be sent
|
|
22
|
+
* @param class_id the struct tag of the extension
|
|
23
|
+
* @param token_ids the token ids of the NFT
|
|
24
|
+
* @param sender the sender address
|
|
25
|
+
* @param receiver the recipient address on the destination chain
|
|
26
|
+
* @param timeout_height Timeout height relative to the current block height. (0 to disable)
|
|
27
|
+
* @param timeout_timestamp Timeout timestamp (in nanoseconds) relative to the current block timestamp. (0 to disable)
|
|
28
|
+
* @param memo optional memo
|
|
29
|
+
*/
|
|
30
|
+
constructor(source_port: string, source_channel: string, class_id: string, token_ids: string[], sender: AccAddress, receiver: string, timeout_height: Height | undefined, timeout_timestamp: string | undefined, memo: string | undefined);
|
|
31
|
+
static fromAmino(data: MsgNftTransfer.Amino): MsgNftTransfer;
|
|
32
|
+
toAmino(): MsgNftTransfer.Amino;
|
|
33
|
+
static fromData(data: MsgNftTransfer.Data): MsgNftTransfer;
|
|
34
|
+
toData(): MsgNftTransfer.Data;
|
|
35
|
+
static fromProto(proto: MsgNftTransfer.Proto): MsgNftTransfer;
|
|
36
|
+
toProto(): MsgNftTransfer.Proto;
|
|
37
|
+
packAny(): Any;
|
|
38
|
+
static unpackAny(msgAny: Any): MsgNftTransfer;
|
|
39
|
+
}
|
|
40
|
+
export declare namespace MsgNftTransfer {
|
|
41
|
+
interface Amino {
|
|
42
|
+
type: 'ibc/MsgNftTransfer';
|
|
43
|
+
value: {
|
|
44
|
+
source_port: string;
|
|
45
|
+
source_channel: string;
|
|
46
|
+
class_id: string;
|
|
47
|
+
token_ids: string[];
|
|
48
|
+
sender: AccAddress;
|
|
49
|
+
receiver: string;
|
|
50
|
+
timeout_height: Height.Amino;
|
|
51
|
+
timeout_timestamp?: string;
|
|
52
|
+
memo?: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
interface Data {
|
|
56
|
+
'@type': '/ibc.applications.nft_transfer.v1.MsgNftTransfer';
|
|
57
|
+
source_port: string;
|
|
58
|
+
source_channel: string;
|
|
59
|
+
class_id: string;
|
|
60
|
+
token_ids: string[];
|
|
61
|
+
sender: AccAddress;
|
|
62
|
+
receiver: string;
|
|
63
|
+
timeout_height: Height.Data;
|
|
64
|
+
timeout_timestamp: string;
|
|
65
|
+
memo?: string;
|
|
66
|
+
}
|
|
67
|
+
type Proto = MsgNftTransfer_pb;
|
|
68
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.MsgNftTransfer = void 0;
|
|
22
|
+
var json_1 = require("../../../../../util/json");
|
|
23
|
+
var long_1 = __importDefault(require("long"));
|
|
24
|
+
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
25
|
+
var tx_1 = require("@initia/initia.proto/ibc/applications/nft_transfer/v1/tx");
|
|
26
|
+
var Height_1 = require("../../../core/client/Height");
|
|
27
|
+
/**
|
|
28
|
+
* A basic message for NFT transfer via IBC.
|
|
29
|
+
*/
|
|
30
|
+
var MsgNftTransfer = /** @class */ (function (_super) {
|
|
31
|
+
__extends(MsgNftTransfer, _super);
|
|
32
|
+
/**
|
|
33
|
+
* @param source_port the port on which the packet will be sent
|
|
34
|
+
* @param source_channel the channel by which the packet will be sent
|
|
35
|
+
* @param class_id the struct tag of the extension
|
|
36
|
+
* @param token_ids the token ids of the NFT
|
|
37
|
+
* @param sender the sender address
|
|
38
|
+
* @param receiver the recipient address on the destination chain
|
|
39
|
+
* @param timeout_height Timeout height relative to the current block height. (0 to disable)
|
|
40
|
+
* @param timeout_timestamp Timeout timestamp (in nanoseconds) relative to the current block timestamp. (0 to disable)
|
|
41
|
+
* @param memo optional memo
|
|
42
|
+
*/
|
|
43
|
+
function MsgNftTransfer(source_port, source_channel, class_id, token_ids, sender, receiver, timeout_height, timeout_timestamp, memo) {
|
|
44
|
+
var _this = _super.call(this) || this;
|
|
45
|
+
if (!timeout_height && !timeout_timestamp) {
|
|
46
|
+
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
47
|
+
}
|
|
48
|
+
_this.source_port = source_port;
|
|
49
|
+
_this.source_channel = source_channel;
|
|
50
|
+
_this.class_id = class_id;
|
|
51
|
+
_this.token_ids = token_ids;
|
|
52
|
+
_this.sender = sender;
|
|
53
|
+
_this.receiver = receiver;
|
|
54
|
+
_this.timeout_height = timeout_height;
|
|
55
|
+
_this.timeout_timestamp = timeout_timestamp;
|
|
56
|
+
_this.memo = memo;
|
|
57
|
+
return _this;
|
|
58
|
+
}
|
|
59
|
+
MsgNftTransfer.fromAmino = function (data) {
|
|
60
|
+
var _a = data.value, source_port = _a.source_port, source_channel = _a.source_channel, class_id = _a.class_id, token_ids = _a.token_ids, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
61
|
+
if (!timeout_height && !timeout_timestamp) {
|
|
62
|
+
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
63
|
+
}
|
|
64
|
+
return new MsgNftTransfer(source_port, source_channel, class_id, token_ids, sender, receiver, timeout_height ? Height_1.Height.fromAmino(timeout_height) : undefined, timeout_timestamp, memo);
|
|
65
|
+
};
|
|
66
|
+
MsgNftTransfer.prototype.toAmino = function () {
|
|
67
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, class_id = _a.class_id, token_ids = _a.token_ids, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
68
|
+
return {
|
|
69
|
+
type: 'ibc/MsgNftTransfer',
|
|
70
|
+
value: {
|
|
71
|
+
source_port: source_port,
|
|
72
|
+
source_channel: source_channel,
|
|
73
|
+
class_id: class_id,
|
|
74
|
+
token_ids: token_ids,
|
|
75
|
+
sender: sender,
|
|
76
|
+
receiver: receiver,
|
|
77
|
+
timeout_height: (timeout_height === null || timeout_height === void 0 ? void 0 : timeout_height.toAmino()) || {},
|
|
78
|
+
timeout_timestamp: timeout_timestamp,
|
|
79
|
+
memo: memo,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
MsgNftTransfer.fromData = function (data) {
|
|
84
|
+
var source_port = data.source_port, source_channel = data.source_channel, class_id = data.class_id, token_ids = data.token_ids, sender = data.sender, receiver = data.receiver, timeout_timestamp = data.timeout_timestamp, timeout_height = data.timeout_height, memo = data.memo;
|
|
85
|
+
if (!timeout_height && !timeout_timestamp) {
|
|
86
|
+
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
87
|
+
}
|
|
88
|
+
return new MsgNftTransfer(source_port, source_channel, class_id, token_ids, sender, receiver, timeout_height ? Height_1.Height.fromData(timeout_height) : undefined, timeout_timestamp === '0' ? undefined : timeout_timestamp, memo);
|
|
89
|
+
};
|
|
90
|
+
MsgNftTransfer.prototype.toData = function () {
|
|
91
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, class_id = _a.class_id, token_ids = _a.token_ids, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
92
|
+
return {
|
|
93
|
+
'@type': '/ibc.applications.nft_transfer.v1.MsgNftTransfer',
|
|
94
|
+
source_port: source_port,
|
|
95
|
+
source_channel: source_channel,
|
|
96
|
+
class_id: class_id,
|
|
97
|
+
token_ids: token_ids,
|
|
98
|
+
sender: sender,
|
|
99
|
+
receiver: receiver,
|
|
100
|
+
timeout_height: timeout_height
|
|
101
|
+
? timeout_height.toData()
|
|
102
|
+
: new Height_1.Height(0, 0).toData(),
|
|
103
|
+
timeout_timestamp: timeout_timestamp !== null && timeout_timestamp !== void 0 ? timeout_timestamp : '0',
|
|
104
|
+
memo: memo,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
MsgNftTransfer.fromProto = function (proto) {
|
|
108
|
+
if (!proto.timeoutHeight && proto.timeoutTimestamp.toNumber() == 0) {
|
|
109
|
+
throw 'both of timeout_height and timeout_timestamp are empty';
|
|
110
|
+
}
|
|
111
|
+
return new MsgNftTransfer(proto.sourcePort, proto.sourceChannel, proto.classId, proto.tokenIds, proto.sender, proto.receiver, proto.timeoutHeight ? Height_1.Height.fromProto(proto.timeoutHeight) : undefined, proto.timeoutTimestamp.toString(), proto.memo);
|
|
112
|
+
};
|
|
113
|
+
MsgNftTransfer.prototype.toProto = function () {
|
|
114
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, class_id = _a.class_id, token_ids = _a.token_ids, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
115
|
+
return tx_1.MsgNftTransfer.fromPartial({
|
|
116
|
+
sourcePort: source_port,
|
|
117
|
+
sourceChannel: source_channel,
|
|
118
|
+
classId: class_id,
|
|
119
|
+
tokenIds: token_ids,
|
|
120
|
+
sender: sender,
|
|
121
|
+
receiver: receiver,
|
|
122
|
+
timeoutHeight: timeout_height ? timeout_height.toProto() : undefined,
|
|
123
|
+
timeoutTimestamp: long_1.default.fromString(timeout_timestamp !== null && timeout_timestamp !== void 0 ? timeout_timestamp : '0'),
|
|
124
|
+
memo: memo,
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
MsgNftTransfer.prototype.packAny = function () {
|
|
128
|
+
return any_1.Any.fromPartial({
|
|
129
|
+
typeUrl: '/ibc.applications.nft_transfer.v1.MsgNftTransfer',
|
|
130
|
+
value: tx_1.MsgNftTransfer.encode(this.toProto()).finish(),
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
MsgNftTransfer.unpackAny = function (msgAny) {
|
|
134
|
+
return MsgNftTransfer.fromProto(tx_1.MsgNftTransfer.decode(msgAny.value));
|
|
135
|
+
};
|
|
136
|
+
return MsgNftTransfer;
|
|
137
|
+
}(json_1.JSONSerializable));
|
|
138
|
+
exports.MsgNftTransfer = MsgNftTransfer;
|
|
139
|
+
//# sourceMappingURL=MsgNftTransfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MsgNftTransfer.js","sourceRoot":"","sources":["../../../../../../src/core/ibc/applications/nft-transfer/msgs/MsgNftTransfer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4D;AAE5D,8CAAwB;AACxB,gEAA+D;AAC/D,+EAA+G;AAC/G,sDAAqD;AAErD;;GAEG;AACH;IAAoC,kCAInC;IAUC;;;;;;;;;;OAUG;IACH,wBACE,WAAmB,EACnB,cAAsB,EACtB,QAAgB,EAChB,SAAmB,EACnB,MAAkB,EAClB,QAAgB,EAChB,cAAkC,EAClC,iBAAqC,EACrC,IAAwB;QAT1B,YAWE,iBAAO,SAeR;QAbC,IAAI,CAAC,cAAc,IAAI,CAAC,iBAAiB,EAAE;YACzC,MAAM,4DA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B,MAAM,QAAA;YACN,QAAQ,UAAA;YACR,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;YACpE,gBAAgB,EAAE,cAAI,CAAC,UAAU,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,GAAG,CAAC;YAC3D,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAEM,gCAAO,GAAd;QACE,OAAO,SAAG,CAAC,WAAW,CAAC;YACrB,OAAO,EAAE,kDAAkD;YAC3D,KAAK,EAAE,mBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SACzD,CAAC,CAAC;IACL,CAAC;IAEa,wBAAS,GAAvB,UAAwB,MAAW;QACjC,OAAO,cAAc,CAAC,SAAS,CAAC,mBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IACH,qBAAC;AAAD,CAAC,AAhOD,CAAoC,uBAAgB,GAgOnD;AAhOY,wCAAc"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SemiFungibleTokenPacketData as SemiFungibleTokenPacketData_pb } from '@initia/initia.proto/ibc/applications/sft_transfer/v1/packet';
|
|
2
|
+
import { JSONSerializable } from '../../../../util/json';
|
|
3
|
+
/**
|
|
4
|
+
* SemiFungibleTokenPacketData defines a struct for the packet payload
|
|
5
|
+
*/
|
|
6
|
+
export declare class SemiFungibleTokenPacketData extends JSONSerializable<SemiFungibleTokenPacketData.Amino, SemiFungibleTokenPacketData.Data, SemiFungibleTokenPacketData.Proto> {
|
|
7
|
+
class_id: string;
|
|
8
|
+
class_uri: string;
|
|
9
|
+
class_data: string;
|
|
10
|
+
token_ids: string[];
|
|
11
|
+
token_amounts: string[];
|
|
12
|
+
token_uris: string[];
|
|
13
|
+
token_data: string[];
|
|
14
|
+
sender: string;
|
|
15
|
+
receiver: string;
|
|
16
|
+
memo?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* @param class_id collection id == extension struct tag
|
|
19
|
+
* @param class_uri collection url
|
|
20
|
+
* @param class_data collection data
|
|
21
|
+
* @param token_ids sft token ids
|
|
22
|
+
* @param token_amounts sft token amounts
|
|
23
|
+
* @param token_uris sft token uris
|
|
24
|
+
* @param token_data sft token data array
|
|
25
|
+
* @param sender sender of sft
|
|
26
|
+
* @param receiver receiver of sft
|
|
27
|
+
* @param memo optional memo field for future use
|
|
28
|
+
*/
|
|
29
|
+
constructor(class_id: string, class_uri: string, class_data: string, token_ids: string[], token_amounts: string[], token_uris: string[], token_data: string[], sender: string, receiver: string, memo?: string | undefined);
|
|
30
|
+
static fromAmino(data: SemiFungibleTokenPacketData.Amino): SemiFungibleTokenPacketData;
|
|
31
|
+
toAmino(): SemiFungibleTokenPacketData.Amino;
|
|
32
|
+
static fromData(data: SemiFungibleTokenPacketData.Data): SemiFungibleTokenPacketData;
|
|
33
|
+
toData(): SemiFungibleTokenPacketData.Data;
|
|
34
|
+
static fromProto(proto: SemiFungibleTokenPacketData.Proto): SemiFungibleTokenPacketData;
|
|
35
|
+
toProto(): SemiFungibleTokenPacketData.Proto;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace SemiFungibleTokenPacketData {
|
|
38
|
+
interface Amino {
|
|
39
|
+
class_id: string;
|
|
40
|
+
class_uri: string;
|
|
41
|
+
class_data: string;
|
|
42
|
+
token_ids: string[];
|
|
43
|
+
token_amounts: string[];
|
|
44
|
+
token_uris: string[];
|
|
45
|
+
token_data: string[];
|
|
46
|
+
sender: string;
|
|
47
|
+
receiver: string;
|
|
48
|
+
memo?: string;
|
|
49
|
+
}
|
|
50
|
+
interface Data {
|
|
51
|
+
class_id: string;
|
|
52
|
+
class_uri: string;
|
|
53
|
+
class_data: string;
|
|
54
|
+
token_ids: string[];
|
|
55
|
+
token_amounts: string[];
|
|
56
|
+
token_uris: string[];
|
|
57
|
+
token_data: string[];
|
|
58
|
+
sender: string;
|
|
59
|
+
receiver: string;
|
|
60
|
+
memo?: string;
|
|
61
|
+
}
|
|
62
|
+
type Proto = SemiFungibleTokenPacketData_pb;
|
|
63
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SemiFungibleTokenPacketData = void 0;
|
|
19
|
+
var packet_1 = require("@initia/initia.proto/ibc/applications/sft_transfer/v1/packet");
|
|
20
|
+
var json_1 = require("../../../../util/json");
|
|
21
|
+
/**
|
|
22
|
+
* SemiFungibleTokenPacketData defines a struct for the packet payload
|
|
23
|
+
*/
|
|
24
|
+
var SemiFungibleTokenPacketData = /** @class */ (function (_super) {
|
|
25
|
+
__extends(SemiFungibleTokenPacketData, _super);
|
|
26
|
+
/**
|
|
27
|
+
* @param class_id collection id == extension struct tag
|
|
28
|
+
* @param class_uri collection url
|
|
29
|
+
* @param class_data collection data
|
|
30
|
+
* @param token_ids sft token ids
|
|
31
|
+
* @param token_amounts sft token amounts
|
|
32
|
+
* @param token_uris sft token uris
|
|
33
|
+
* @param token_data sft token data array
|
|
34
|
+
* @param sender sender of sft
|
|
35
|
+
* @param receiver receiver of sft
|
|
36
|
+
* @param memo optional memo field for future use
|
|
37
|
+
*/
|
|
38
|
+
function SemiFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_amounts, token_uris, token_data, sender, receiver, memo) {
|
|
39
|
+
var _this = _super.call(this) || this;
|
|
40
|
+
_this.class_id = class_id;
|
|
41
|
+
_this.class_uri = class_uri;
|
|
42
|
+
_this.class_data = class_data;
|
|
43
|
+
_this.token_ids = token_ids;
|
|
44
|
+
_this.token_amounts = token_amounts;
|
|
45
|
+
_this.token_uris = token_uris;
|
|
46
|
+
_this.token_data = token_data;
|
|
47
|
+
_this.sender = sender;
|
|
48
|
+
_this.receiver = receiver;
|
|
49
|
+
_this.memo = memo;
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
SemiFungibleTokenPacketData.fromAmino = function (data) {
|
|
53
|
+
var class_id = data.class_id, class_uri = data.class_uri, class_data = data.class_data, token_ids = data.token_ids, token_amounts = data.token_amounts, token_uris = data.token_uris, token_data = data.token_data, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
54
|
+
return new SemiFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_amounts, token_uris, token_data, sender, receiver, memo);
|
|
55
|
+
};
|
|
56
|
+
SemiFungibleTokenPacketData.prototype.toAmino = function () {
|
|
57
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_amounts = _a.token_amounts, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
58
|
+
return {
|
|
59
|
+
class_id: class_id,
|
|
60
|
+
class_uri: class_uri,
|
|
61
|
+
class_data: class_data,
|
|
62
|
+
token_ids: token_ids,
|
|
63
|
+
token_amounts: token_amounts,
|
|
64
|
+
token_uris: token_uris,
|
|
65
|
+
token_data: token_data,
|
|
66
|
+
sender: sender,
|
|
67
|
+
receiver: receiver,
|
|
68
|
+
memo: memo,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
SemiFungibleTokenPacketData.fromData = function (data) {
|
|
72
|
+
var class_id = data.class_id, class_uri = data.class_uri, class_data = data.class_data, token_ids = data.token_ids, token_amounts = data.token_amounts, token_uris = data.token_uris, token_data = data.token_data, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
73
|
+
return new SemiFungibleTokenPacketData(class_id, class_uri, class_data, token_ids, token_amounts, token_uris, token_data, sender, receiver, memo);
|
|
74
|
+
};
|
|
75
|
+
SemiFungibleTokenPacketData.prototype.toData = function () {
|
|
76
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_amounts = _a.token_amounts, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
77
|
+
return {
|
|
78
|
+
class_id: class_id,
|
|
79
|
+
class_uri: class_uri,
|
|
80
|
+
class_data: class_data,
|
|
81
|
+
token_ids: token_ids,
|
|
82
|
+
token_amounts: token_amounts,
|
|
83
|
+
token_uris: token_uris,
|
|
84
|
+
token_data: token_data,
|
|
85
|
+
sender: sender,
|
|
86
|
+
receiver: receiver,
|
|
87
|
+
memo: memo,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
SemiFungibleTokenPacketData.fromProto = function (proto) {
|
|
91
|
+
return new SemiFungibleTokenPacketData(proto.classId, proto.classUri, proto.classData, proto.tokenIds, proto.tokenAmounts, proto.tokenUris, proto.tokenData, proto.sender, proto.receiver, proto.memo);
|
|
92
|
+
};
|
|
93
|
+
SemiFungibleTokenPacketData.prototype.toProto = function () {
|
|
94
|
+
var _a = this, class_id = _a.class_id, class_uri = _a.class_uri, class_data = _a.class_data, token_ids = _a.token_ids, token_amounts = _a.token_amounts, token_uris = _a.token_uris, token_data = _a.token_data, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
95
|
+
return packet_1.SemiFungibleTokenPacketData.fromPartial({
|
|
96
|
+
classId: class_id,
|
|
97
|
+
classUri: class_uri,
|
|
98
|
+
classData: class_data,
|
|
99
|
+
tokenIds: token_ids,
|
|
100
|
+
tokenAmounts: token_amounts,
|
|
101
|
+
tokenUris: token_uris,
|
|
102
|
+
tokenData: token_data,
|
|
103
|
+
sender: sender,
|
|
104
|
+
receiver: receiver,
|
|
105
|
+
memo: memo,
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
return SemiFungibleTokenPacketData;
|
|
109
|
+
}(json_1.JSONSerializable));
|
|
110
|
+
exports.SemiFungibleTokenPacketData = SemiFungibleTokenPacketData;
|
|
111
|
+
//# sourceMappingURL=SemiFungibleTokenPacketData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SemiFungibleTokenPacketData.js","sourceRoot":"","sources":["../../../../../src/core/ibc/applications/sft-transfer/SemiFungibleTokenPacketData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uFAA6I;AAC7I,8CAAyD;AAEzD;;GAEG;AACH;IAAiD,+CAIhD;IACC;;;;;;;;;;;OAWG;IACH,qCACS,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,SAAmB,EACnB,aAAuB,EACvB,UAAoB,EACpB,UAAoB,EACpB,MAAc,EACd,QAAgB,EAChB,IAAa;QAVtB,YAYE,iBAAO,SACR;QAZQ,cAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAS,GAAT,SAAS,CAAQ;QACjB,gBAAU,GAAV,UAAU,CAAQ;QAClB,eAAS,GAAT,SAAS,CAAU;QACnB,mBAAa,GAAb,aAAa,CAAU;QACvB,gBAAU,GAAV,UAAU,CAAU;QACpB,gBAAU,GAAV,UAAU,CAAU;QACpB,YAAM,GAAN,MAAM,CAAQ;QACd,cAAQ,GAAR,QAAQ,CAAQ;QAChB,UAAI,GAAJ,IAAI,CAAS;;IAGtB,CAAC;IAEa,qCAAS,GAAv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EAAE,UAAU;YACrB,QAAQ,EAAE,SAAS;YACnB,YAAY,EAAE,aAAa;YAC3B,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,UAAU;YACrB,MAAM,QAAA;YACN,QAAQ,UAAA;YACR,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IACH,kCAAC;AAAD,CAAC,AAhMD,CAAiD,uBAAgB,GAgMhE;AAhMY,kEAA2B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ClassTrace as SftClassTrace_pb } from '@initia/initia.proto/ibc/applications/sft_transfer/v1/types';
|
|
2
|
+
import { JSONSerializable } from '../../../../util/json';
|
|
3
|
+
export declare class SftClassTrace extends JSONSerializable<SftClassTrace.Amino, SftClassTrace.Data, SftClassTrace.Proto> {
|
|
4
|
+
path: string;
|
|
5
|
+
base_class_id: string;
|
|
6
|
+
/**
|
|
7
|
+
* @param path the chain of port/channel identifiers used for tracing the source of the semi fungible token
|
|
8
|
+
* @param base_class_id base class id of the relayed semi fungible token
|
|
9
|
+
*/
|
|
10
|
+
constructor(path: string, base_class_id: string);
|
|
11
|
+
static fromAmino(data: SftClassTrace.Amino): SftClassTrace;
|
|
12
|
+
toAmino(): SftClassTrace.Amino;
|
|
13
|
+
static fromData(data: SftClassTrace.Data): SftClassTrace;
|
|
14
|
+
toData(): SftClassTrace.Data;
|
|
15
|
+
static fromProto(proto: SftClassTrace.Proto): SftClassTrace;
|
|
16
|
+
toProto(): SftClassTrace.Proto;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace SftClassTrace {
|
|
19
|
+
interface Amino {
|
|
20
|
+
path: string;
|
|
21
|
+
base_class_id: string;
|
|
22
|
+
}
|
|
23
|
+
interface Data {
|
|
24
|
+
path: string;
|
|
25
|
+
base_class_id: string;
|
|
26
|
+
}
|
|
27
|
+
type Proto = SftClassTrace_pb;
|
|
28
|
+
}
|