@actioncodes/protocol 1.2.0 → 1.2.2
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/LICENSE +1 -1
- package/dist/actioncode.d.ts +1 -0
- package/dist/actioncode.d.ts.map +1 -1
- package/dist/actioncode.js +16 -0
- package/dist/adapters/base.d.ts.map +1 -1
- package/dist/adapters/base.js +13 -0
- package/dist/adapters/solana/index.d.ts.map +1 -1
- package/dist/adapters/solana/index.js +13 -0
- package/dist/adapters/solana/solana.d.ts.map +1 -1
- package/dist/adapters/solana/solana.js +13 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +13 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +13 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +13 -0
- package/docs/actioncode/classes/ActionCode.md +42 -24
- package/docs/actioncode/interfaces/ActionCodeFields.md +11 -11
- package/docs/actioncode/interfaces/ActionCodeMetadata.md +3 -3
- package/docs/actioncode/interfaces/ActionCodeTransaction.md +7 -7
- package/docs/actioncode/type-aliases/ActionCodeStatus.md +1 -1
- package/docs/adapters/base/classes/BaseChainAdapter.md +14 -14
- package/docs/adapters/solana/solana/classes/SolanaAdapter.md +16 -16
- package/docs/adapters/solana/solana/type-aliases/SolanaTransaction.md +1 -1
- package/docs/codegen/classes/CodeGenerator.md +14 -14
- package/docs/constants/type-aliases/SupportedChain.md +1 -1
- package/docs/constants/variables/CODE_LENGTH.md +1 -1
- package/docs/constants/variables/CODE_TTL.md +1 -1
- package/docs/constants/variables/MAX_PREFIX_LENGTH.md +1 -1
- package/docs/constants/variables/MIN_PREFIX_LENGTH.md +1 -1
- package/docs/constants/variables/PROTOCOL_CODE_PREFIX.md +1 -1
- package/docs/constants/variables/PROTOCOL_PREFIX.md +1 -1
- package/docs/constants/variables/PROTOCOL_VERSION.md +1 -1
- package/docs/constants/variables/SUPPORTED_CHAINS.md +1 -1
- package/docs/meta/classes/ProtocolMetaParser.md +6 -6
- package/docs/meta/interfaces/ProtocolMetaV1.md +7 -7
- package/docs/protocol/classes/ActionCodesProtocol.md +22 -22
- package/docs/protocol/interfaces/ProtocolConfig.md +7 -7
- package/package.json +1 -1
package/LICENSE
CHANGED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright 2025 Trana, Inc.
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
package/dist/actioncode.d.ts
CHANGED
@@ -32,6 +32,7 @@ export declare class ActionCode {
|
|
32
32
|
static fromEncoded(encoded: string): ActionCode;
|
33
33
|
get encoded(): string;
|
34
34
|
isValid(protocol: ActionCodesProtocol): boolean;
|
35
|
+
updateStatus(status: ActionCodeStatus): void;
|
35
36
|
get json(): ActionCodeFields;
|
36
37
|
/**
|
37
38
|
* Get remaining time in milliseconds until expiration
|
package/dist/actioncode.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"actioncode.d.ts","sourceRoot":"","sources":["../src/actioncode.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"actioncode.d.ts","sourceRoot":"","sources":["../src/actioncode.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1F,MAAM,WAAW,kBAAkB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,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I,gBAAgB,CAE7B;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEnD;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC,GAAG,SAAS,CAEvD;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAE5C;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACH,IAAI,aAAa,IAAI,MAAM,CAO1B;IAED;;;OAGG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAchC;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,UAAU,IAAI,aAAa,GAAG,WAAW,CAE5C;CACJ"}
|
package/dist/actioncode.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.ActionCode = void 0;
|
4
17
|
const codegen_1 = require("./codegen");
|
@@ -30,6 +43,9 @@ class ActionCode {
|
|
30
43
|
const isCodeValid = codegen_1.CodeGenerator.validateCode(this.fields.code, this.fields.pubkey, this.fields.timestamp, this.fields.prefix);
|
31
44
|
return isSignatureValid && isCodeValid;
|
32
45
|
}
|
46
|
+
updateStatus(status) {
|
47
|
+
this.fields.status = status;
|
48
|
+
}
|
33
49
|
get json() {
|
34
50
|
return this.fields;
|
35
51
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/adapters/base.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/adapters/base.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC;;;GAGG;AACH,8BAAsB,gBAAgB,CAAC,CAAC,GAAG,GAAG;IAC1C,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG;IAE9C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,cAAc,GAAG,IAAI;IAEjD;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM;IAEvE;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO;IAEjF;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAE3D;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,cAAc,GAAE,MAAkB,GAAG,OAAO;IA8B1F;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IAErF;;;;;;OAMG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAA6B,GAAG,MAAM;IAIvG;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAE7D;;;;;;;;OAQG;IACH,QAAQ,CAAC,mBAAmB,CACxB,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,GACT,OAAO,CAAC,UAAU,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,0BAA0B,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO;IAE7E,QAAQ,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAClG"}
|
package/dist/adapters/base.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.BaseChainAdapter = void 0;
|
4
17
|
const constants_1 = require("../constants");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/solana/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/solana/index.ts"],"names":[],"mappings":"AAcA,cAAc,UAAU,CAAC"}
|
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
16
|
if (k2 === undefined) k2 = k;
|
4
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/adapters/solana/solana.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/adapters/solana/solana.ts"],"names":[],"mappings":"AAcA,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EAGpB,OAAO,EACP,4BAA4B,EAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAsB,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,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G;IACH,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAI7D;;;;;OAKG;IACG,mBAAmB,CACrB,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,CAAC;IA4CtB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,EAAE,4BAA4B,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO;IAwH7F;;;;;;OAMG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAYzF"}
|
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
16
|
if (k2 === undefined) k2 = k;
|
4
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
package/dist/codegen.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAiBA,qBAAa,aAAa;IACtB,MAAM,CAAC,cAAc,SAAY;IACjC,MAAM,CAAC,WAAW,SAAe;IACjC,MAAM,CAAC,iBAAiB,SAAqB;IAC7C,MAAM,CAAC,iBAAiB,SAAqB;IAE7C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAM9C;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAoChD;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAkChD;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAQ9C;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CACf,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAA6B,EACrC,SAAS,GAAE,MAAmB,GAC/B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;IAiCxD;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CACjB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAA6B,EACrC,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM;IAQT;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAA6B,GACtC,MAAM;IAIT;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAA6B,GACtC,OAAO;IAgBV;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAGtD"}
|
package/dist/codegen.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.CodeGenerator = void 0;
|
4
17
|
const js_sha256_1 = require("js-sha256");
|
package/dist/constants.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,QAAQ,QAAgB,CAAC;AACtC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,qBAAsB,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/constants.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.SUPPORTED_CHAINS = exports.MAX_PREFIX_LENGTH = exports.MIN_PREFIX_LENGTH = exports.PROTOCOL_CODE_PREFIX = exports.CODE_TTL = exports.CODE_LENGTH = exports.PROTOCOL_PREFIX = exports.PROTOCOL_VERSION = void 0;
|
4
17
|
exports.PROTOCOL_VERSION = "1";
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAG3B,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
16
|
if (k2 === undefined) k2 = k;
|
4
17
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
package/dist/meta.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAqF;IAE3H;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAuBvD;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAU9C;;;;;;;;OAQG;IACH,MAAM,CAAC,aAAa,CAClB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAkB,EAC1B,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc;IAajB;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAKtE;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;CAO/E"}
|
package/dist/meta.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.ProtocolMetaParser = void 0;
|
4
17
|
const codegen_1 = require("./codegen");
|
package/dist/protocol.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAeA,OAAO,EAAsB,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,UAAU,EAA2C,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAA8D,cAAc,EAA2C,MAAM,aAAa,CAAC;AAElJ;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA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O,CAAC,cAAc,CAAC,GAAG,mBAAmB;CAGhF;AAGD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACxF,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/protocol.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Copyright 2025 Trana, Inc.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
16
|
exports.SUPPORTED_CHAINS = exports.ActionCodesProtocol = void 0;
|
4
17
|
const codegen_1 = require("./codegen");
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Class: ActionCode
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:35](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:35](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L35)
|
10
10
|
|
11
11
|
## Constructors
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:35](https://github.com/otaprotocol/actioncodes/blob/d
|
|
14
14
|
|
15
15
|
> **new ActionCode**(`fields`): `ActionCode`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:36](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:36](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L36)
|
18
18
|
|
19
19
|
#### Parameters
|
20
20
|
|
@@ -34,7 +34,7 @@ Defined in: [actioncode.ts:36](https://github.com/otaprotocol/actioncodes/blob/d
|
|
34
34
|
|
35
35
|
> **get** **chain**(): `string`
|
36
36
|
|
37
|
-
Defined in: [actioncode.ts:
|
37
|
+
Defined in: [actioncode.ts:102](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L102)
|
38
38
|
|
39
39
|
Get the target chain for this action code
|
40
40
|
|
@@ -52,7 +52,7 @@ Chain identifier (e.g., "solana", "evm")
|
|
52
52
|
|
53
53
|
> **get** **code**(): `string`
|
54
54
|
|
55
|
-
Defined in: [actioncode.ts:
|
55
|
+
Defined in: [actioncode.ts:118](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L118)
|
56
56
|
|
57
57
|
Get the action code string
|
58
58
|
|
@@ -70,7 +70,7 @@ The 8-character action code
|
|
70
70
|
|
71
71
|
> **get** **codeHash**(): `string`
|
72
72
|
|
73
|
-
Defined in: [actioncode.ts:
|
73
|
+
Defined in: [actioncode.ts:224](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L224)
|
74
74
|
|
75
75
|
Get the code hash for this action code
|
76
76
|
it is also used in the protocol meta as the code id
|
@@ -89,7 +89,7 @@ Code hash string
|
|
89
89
|
|
90
90
|
> **get** **description**(): `undefined` \| `string`
|
91
91
|
|
92
|
-
Defined in: [actioncode.ts:
|
92
|
+
Defined in: [actioncode.ts:158](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L158)
|
93
93
|
|
94
94
|
Get a human-readable description of the action
|
95
95
|
|
@@ -107,7 +107,7 @@ Description string or undefined
|
|
107
107
|
|
108
108
|
> **get** **displayString**(): `string`
|
109
109
|
|
110
|
-
Defined in: [actioncode.ts:
|
110
|
+
Defined in: [actioncode.ts:190](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L190)
|
111
111
|
|
112
112
|
Get a human-readable display string for the action code
|
113
113
|
|
@@ -125,7 +125,7 @@ Formatted display string
|
|
125
125
|
|
126
126
|
> **get** **encoded**(): `string`
|
127
127
|
|
128
|
-
Defined in: [actioncode.ts:50](https://github.com/otaprotocol/actioncodes/blob/
|
128
|
+
Defined in: [actioncode.ts:50](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L50)
|
129
129
|
|
130
130
|
##### Returns
|
131
131
|
|
@@ -139,7 +139,7 @@ Defined in: [actioncode.ts:50](https://github.com/otaprotocol/actioncodes/blob/d
|
|
139
139
|
|
140
140
|
> **get** **expired**(): `boolean`
|
141
141
|
|
142
|
-
Defined in: [actioncode.ts:
|
142
|
+
Defined in: [actioncode.ts:94](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L94)
|
143
143
|
|
144
144
|
Check if the action code has expired
|
145
145
|
|
@@ -157,7 +157,7 @@ True if the code has expired
|
|
157
157
|
|
158
158
|
> **get** **intentType**(): `"transaction"` \| `"sign-only"`
|
159
159
|
|
160
|
-
Defined in: [actioncode.ts:
|
160
|
+
Defined in: [actioncode.ts:228](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L228)
|
161
161
|
|
162
162
|
##### Returns
|
163
163
|
|
@@ -171,7 +171,7 @@ Defined in: [actioncode.ts:224](https://github.com/otaprotocol/actioncodes/blob/
|
|
171
171
|
|
172
172
|
> **get** **json**(): [`ActionCodeFields`](../interfaces/ActionCodeFields.md)
|
173
173
|
|
174
|
-
Defined in: [actioncode.ts:
|
174
|
+
Defined in: [actioncode.ts:75](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L75)
|
175
175
|
|
176
176
|
##### Returns
|
177
177
|
|
@@ -185,7 +185,7 @@ Defined in: [actioncode.ts:71](https://github.com/otaprotocol/actioncodes/blob/d
|
|
185
185
|
|
186
186
|
> **get** **metadata**(): `undefined` \| [`ActionCodeMetadata`](../interfaces/ActionCodeMetadata.md)
|
187
187
|
|
188
|
-
Defined in: [actioncode.ts:
|
188
|
+
Defined in: [actioncode.ts:150](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L150)
|
189
189
|
|
190
190
|
Get metadata associated with this action code
|
191
191
|
|
@@ -203,7 +203,7 @@ Metadata object or undefined
|
|
203
203
|
|
204
204
|
> **get** **params**(): `undefined` \| `Record`\<`string`, `any`\>
|
205
205
|
|
206
|
-
Defined in: [actioncode.ts:
|
206
|
+
Defined in: [actioncode.ts:166](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L166)
|
207
207
|
|
208
208
|
Get parameters associated with this action
|
209
209
|
|
@@ -221,7 +221,7 @@ Parameters object or undefined
|
|
221
221
|
|
222
222
|
> **get** **prefix**(): `string`
|
223
223
|
|
224
|
-
Defined in: [actioncode.ts:
|
224
|
+
Defined in: [actioncode.ts:126](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L126)
|
225
225
|
|
226
226
|
Get the prefix used for this action code
|
227
227
|
|
@@ -239,7 +239,7 @@ Normalized prefix
|
|
239
239
|
|
240
240
|
> **get** **pubkey**(): `string`
|
241
241
|
|
242
|
-
Defined in: [actioncode.ts:
|
242
|
+
Defined in: [actioncode.ts:134](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L134)
|
243
243
|
|
244
244
|
Get the user's public key
|
245
245
|
|
@@ -257,7 +257,7 @@ User's public key
|
|
257
257
|
|
258
258
|
> **get** **remainingTime**(): `number`
|
259
259
|
|
260
|
-
Defined in: [actioncode.ts:
|
260
|
+
Defined in: [actioncode.ts:85](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L85)
|
261
261
|
|
262
262
|
Get remaining time in milliseconds until expiration
|
263
263
|
|
@@ -275,7 +275,7 @@ Remaining time in milliseconds, or 0 if expired
|
|
275
275
|
|
276
276
|
> **get** **remainingTimeString**(): `string`
|
277
277
|
|
278
|
-
Defined in: [actioncode.ts:
|
278
|
+
Defined in: [actioncode.ts:203](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L203)
|
279
279
|
|
280
280
|
Get a formatted time string showing remaining time
|
281
281
|
|
@@ -293,7 +293,7 @@ Human-readable time string (e.g., "1m 30s remaining")
|
|
293
293
|
|
294
294
|
> **get** **signature**(): `string`
|
295
295
|
|
296
|
-
Defined in: [actioncode.ts:
|
296
|
+
Defined in: [actioncode.ts:182](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L182)
|
297
297
|
|
298
298
|
Get the user's signature
|
299
299
|
|
@@ -311,7 +311,7 @@ User's signature string
|
|
311
311
|
|
312
312
|
> **get** **status**(): [`ActionCodeStatus`](../type-aliases/ActionCodeStatus.md)
|
313
313
|
|
314
|
-
Defined in: [actioncode.ts:
|
314
|
+
Defined in: [actioncode.ts:110](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L110)
|
315
315
|
|
316
316
|
Get the current status of the action code
|
317
317
|
|
@@ -329,7 +329,7 @@ Current status
|
|
329
329
|
|
330
330
|
> **get** **timestamp**(): `number`
|
331
331
|
|
332
|
-
Defined in: [actioncode.ts:
|
332
|
+
Defined in: [actioncode.ts:174](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L174)
|
333
333
|
|
334
334
|
Get the timestamp when the code was generated
|
335
335
|
|
@@ -347,7 +347,7 @@ Timestamp in milliseconds
|
|
347
347
|
|
348
348
|
> **get** **transaction**(): `undefined` \| [`ActionCodeTransaction`](../interfaces/ActionCodeTransaction.md)
|
349
349
|
|
350
|
-
Defined in: [actioncode.ts:
|
350
|
+
Defined in: [actioncode.ts:142](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L142)
|
351
351
|
|
352
352
|
Get the transaction data (chain-specific)
|
353
353
|
|
@@ -363,7 +363,7 @@ Transaction data or undefined
|
|
363
363
|
|
364
364
|
> **isValid**(`protocol`): `boolean`
|
365
365
|
|
366
|
-
Defined in: [actioncode.ts:54](https://github.com/otaprotocol/actioncodes/blob/
|
366
|
+
Defined in: [actioncode.ts:54](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L54)
|
367
367
|
|
368
368
|
#### Parameters
|
369
369
|
|
@@ -377,11 +377,29 @@ Defined in: [actioncode.ts:54](https://github.com/otaprotocol/actioncodes/blob/d
|
|
377
377
|
|
378
378
|
***
|
379
379
|
|
380
|
+
### updateStatus()
|
381
|
+
|
382
|
+
> **updateStatus**(`status`): `void`
|
383
|
+
|
384
|
+
Defined in: [actioncode.ts:71](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L71)
|
385
|
+
|
386
|
+
#### Parameters
|
387
|
+
|
388
|
+
##### status
|
389
|
+
|
390
|
+
[`ActionCodeStatus`](../type-aliases/ActionCodeStatus.md)
|
391
|
+
|
392
|
+
#### Returns
|
393
|
+
|
394
|
+
`void`
|
395
|
+
|
396
|
+
***
|
397
|
+
|
380
398
|
### fromEncoded()
|
381
399
|
|
382
400
|
> `static` **fromEncoded**(`encoded`): `ActionCode`
|
383
401
|
|
384
|
-
Defined in: [actioncode.ts:45](https://github.com/otaprotocol/actioncodes/blob/
|
402
|
+
Defined in: [actioncode.ts:45](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L45)
|
385
403
|
|
386
404
|
#### Parameters
|
387
405
|
|
@@ -399,7 +417,7 @@ Defined in: [actioncode.ts:45](https://github.com/otaprotocol/actioncodes/blob/d
|
|
399
417
|
|
400
418
|
> `static` **fromPayload**(`input`): `ActionCode`
|
401
419
|
|
402
|
-
Defined in: [actioncode.ts:38](https://github.com/otaprotocol/actioncodes/blob/
|
420
|
+
Defined in: [actioncode.ts:38](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L38)
|
403
421
|
|
404
422
|
#### Parameters
|
405
423
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ActionCodeFields
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L22)
|
10
10
|
|
11
11
|
## Properties
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/d
|
|
14
14
|
|
15
15
|
> **chain**: `"solana"`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L28)
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -22,7 +22,7 @@ Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/d
|
|
22
22
|
|
23
23
|
> **code**: `string`
|
24
24
|
|
25
|
-
Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/
|
25
|
+
Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L23)
|
26
26
|
|
27
27
|
***
|
28
28
|
|
@@ -30,7 +30,7 @@ Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/d
|
|
30
30
|
|
31
31
|
> **expiresAt**: `number`
|
32
32
|
|
33
|
-
Defined in: [actioncode.ts:31](https://github.com/otaprotocol/actioncodes/blob/
|
33
|
+
Defined in: [actioncode.ts:31](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L31)
|
34
34
|
|
35
35
|
***
|
36
36
|
|
@@ -38,7 +38,7 @@ Defined in: [actioncode.ts:31](https://github.com/otaprotocol/actioncodes/blob/d
|
|
38
38
|
|
39
39
|
> `optional` **metadata**: [`ActionCodeMetadata`](ActionCodeMetadata.md)
|
40
40
|
|
41
|
-
Defined in: [actioncode.ts:30](https://github.com/otaprotocol/actioncodes/blob/
|
41
|
+
Defined in: [actioncode.ts:30](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L30)
|
42
42
|
|
43
43
|
***
|
44
44
|
|
@@ -46,7 +46,7 @@ Defined in: [actioncode.ts:30](https://github.com/otaprotocol/actioncodes/blob/d
|
|
46
46
|
|
47
47
|
> **prefix**: `string`
|
48
48
|
|
49
|
-
Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/
|
49
|
+
Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L24)
|
50
50
|
|
51
51
|
***
|
52
52
|
|
@@ -54,7 +54,7 @@ Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/d
|
|
54
54
|
|
55
55
|
> **pubkey**: `string`
|
56
56
|
|
57
|
-
Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/
|
57
|
+
Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L25)
|
58
58
|
|
59
59
|
***
|
60
60
|
|
@@ -62,7 +62,7 @@ Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/d
|
|
62
62
|
|
63
63
|
> **signature**: `string`
|
64
64
|
|
65
|
-
Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/
|
65
|
+
Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L27)
|
66
66
|
|
67
67
|
***
|
68
68
|
|
@@ -70,7 +70,7 @@ Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/d
|
|
70
70
|
|
71
71
|
> **status**: [`ActionCodeStatus`](../type-aliases/ActionCodeStatus.md)
|
72
72
|
|
73
|
-
Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/
|
73
|
+
Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L32)
|
74
74
|
|
75
75
|
***
|
76
76
|
|
@@ -78,7 +78,7 @@ Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/d
|
|
78
78
|
|
79
79
|
> **timestamp**: `number`
|
80
80
|
|
81
|
-
Defined in: [actioncode.ts:26](https://github.com/otaprotocol/actioncodes/blob/
|
81
|
+
Defined in: [actioncode.ts:26](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L26)
|
82
82
|
|
83
83
|
***
|
84
84
|
|
@@ -86,4 +86,4 @@ Defined in: [actioncode.ts:26](https://github.com/otaprotocol/actioncodes/blob/d
|
|
86
86
|
|
87
87
|
> `optional` **transaction**: [`ActionCodeTransaction`](ActionCodeTransaction.md)
|
88
88
|
|
89
|
-
Defined in: [actioncode.ts:29](https://github.com/otaprotocol/actioncodes/blob/
|
89
|
+
Defined in: [actioncode.ts:29](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L29)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ActionCodeMetadata
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L8)
|
10
10
|
|
11
11
|
## Properties
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/d0
|
|
14
14
|
|
15
15
|
> `optional` **description**: `string`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L9)
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -22,4 +22,4 @@ Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/d0
|
|
22
22
|
|
23
23
|
> `optional` **params**: `Record`\<`string`, `any`\>
|
24
24
|
|
25
|
-
Defined in: [actioncode.ts:10](https://github.com/otaprotocol/actioncodes/blob/
|
25
|
+
Defined in: [actioncode.ts:10](https://github.com/otaprotocol/actioncodes/blob/7fa582d3aecdeca51131d2fc9eec0802298f9a4d/src/actioncode.ts#L10)
|